HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IMG_FileFilterFlip.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: IMG_FileFilterFlip ( IMG Library, C++)
7  *
8  * COMMENTS:
9  *
10  * Read/Write from a memory buffer.
11  * Supports vertical and horizontal flips, as well as flopping (90' rot).
12  */
13 
14 #pragma once
15 
16 #ifndef IMG_FILE_FILTER_FLIP_H
17 #define IMG_FILE_FILTER_FLIP_H
18 
19 class PXL_Raster;
20 
21 #include <UT/UT_BitArray.h>
22 #include <UT/UT_ValArray.h>
23 
24 #include "IMG_FileFilter.h"
25 
27 {
28 public:
29  IMG_FileFilterFlip(IMG_File *file_to_filter);
30  virtual ~IMG_FileFilterFlip();
31 
32  virtual const char *className() const { return "IMG_FileFilterFlip"; }
33 
34  void init(bool flipx, bool flipy, bool flop);
35 
36  virtual const void *readPlaneScanline(int y, const IMG_Plane &pi);
37 
38  virtual int writePlaneScanline(const void *data, int y,
39  const IMG_Plane &pi);
40 
41  virtual int isTopFirst() const;
42  virtual void computeCommonData();
43 
44  virtual int getDeepPixelSamples(int x, int y);
45  virtual bool getDeepPixelPlaneData(int x, int y,
46  const IMG_Plane &plane,
47  float *data);
48  virtual bool getDeepPixelData(int x, int y, float * const *data);
49  virtual bool readDeepPixelData(int x, int y,
51  virtual bool writeDeepPixelData(int x, int y,
52  const PXL_DeepSampleListPtr &p);
53 
54 private:
55 
56  const void *extractScanline(int y, const PXL_Raster *p);
57  bool fillRasters();
58  virtual void finishedScanline(int scan);
59 
60  void flipHorizontal(void *dest, const void *source,
61  const IMG_Plane &pi);
62 
63  void computeXY(int &x, int &y);
64 
65  bool myXFlip;
66  bool myYFlip;
67  bool myFlop;
68  bool myUseRasters;
69  bool myRastersFilled;
70 
71  UT_ValArray<PXL_Raster *> myPlaneImage;
72  void *myRasterBuffer;
73 };
74 
75 #endif
virtual void finishedScanline(int scan)
virtual bool readDeepPixelData(int x, int y, PXL_DeepSampleList &p)
Read a deep pixel.
virtual int isTopFirst() const
virtual void computeCommonData()
virtual bool writeDeepPixelData(int x, int y, const PXL_DeepSampleListPtr &p)
virtual int writePlaneScanline(const void *data, int y, const IMG_Plane &pi)
GLint y
Definition: glcorearb.h:102
Describes the format and layout of a single plane in an image The plane specifies the format and name...
Definition: IMG_Plane.h:44
#define IMG_API
Definition: IMG_API.h:10
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
virtual bool getDeepPixelData(int x, int y, float *const *data)
Generic interface for reading and writing image files. This class handles the reading and writing of ...
Definition: IMG_File.h:54
GLboolean * data
Definition: glcorearb.h:130
virtual int getDeepPixelSamples(int x, int y)
virtual const char * className() const
GLint GLenum GLint x
Definition: glcorearb.h:408
virtual bool getDeepPixelPlaneData(int x, int y, const IMG_Plane &plane, float *data)
virtual const void * readPlaneScanline(int y, const IMG_Plane &pi)