HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  ~IMG_FileFilterFlip() override;
31 
32  const char *className() const override { return "IMG_FileFilterFlip"; }
33 
34  void init(bool flipx, bool flipy, bool flop);
35 
36  const void *readPlaneScanline(int y, const IMG_Plane &pi) override;
37 
38  int writePlaneScanline(const void *data, int y,
39  const IMG_Plane &pi) override;
40 
41  int isTopFirst() const override;
42  void computeCommonData() override;
43 
44  int getDeepPixelSamples(int x, int y) override;
45  bool getDeepPixelPlaneData(int x, int y,
46  const IMG_Plane &plane,
47  float *data) override;
48  bool getDeepPixelData(int x, int y, float * const *data) override;
49  bool readDeepPixelData(int x, int y,
50  PXL_DeepSampleList &p) override;
51  bool writeDeepPixelData(int x, int y,
52  const PXL_DeepSampleListPtr &p) override;
53 
54 private:
55 
56  const void *extractScanline(int y, const PXL_Raster *p);
57  bool fillRasters();
58  void finishedScanline(int scan) override;
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)
bool getDeepPixelPlaneData(int x, int y, const IMG_Plane &plane, float *data) override
const char * className() const override
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
virtual int writePlaneScanline(const void *data, int y, const IMG_Plane &pi)
Describes the format and layout of a single plane in an image The plane specifies the format and name...
Definition: IMG_Plane.h:45
int getDeepPixelSamples(int x, int y) override
int isTopFirst() const override
ImageBuf OIIO_API flop(const ImageBuf &src, ROI roi={}, int nthreads=0)
#define IMG_API
Definition: IMG_API.h:10
bool getDeepPixelData(int x, int y, float *const *data) override
GLint GLint GLint GLint GLint x
Definition: glew.h:1252
GLint GLint GLint GLint GLint GLint y
Definition: glew.h:1252
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
void computeCommonData() override
Generic interface for reading and writing image files. This class handles the reading and writing of ...
Definition: IMG_File.h:55
GLfloat GLfloat p
Definition: glew.h:16321
bool writeDeepPixelData(int x, int y, const PXL_DeepSampleListPtr &p) override
bool readDeepPixelData(int x, int y, PXL_DeepSampleList &p) override
Read a deep pixel.
constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Definition: Math.h:108
virtual const void * readPlaneScanline(int y, const IMG_Plane &pi)