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 #include "IMG_API.h"
20 #include "IMG_FileFilter.h"
21 #include <UT/UT_BitArray.h>
22 #include <UT/UT_NonCopyable.h>
23 #include <UT/UT_ValArray.h>
24 
25 class PXL_Raster;
26 
28 {
29 public:
30  IMG_FileFilterFlip(IMG_File *file_to_filter);
31  ~IMG_FileFilterFlip() override;
32 
34 
35  const char *className() const override { return "IMG_FileFilterFlip"; }
36 
37  void init(bool flipx, bool flipy, bool flop);
38 
39  const void *readPlaneScanline(int y, const IMG_Plane &pi) override;
40 
41  int writePlaneScanline(const void *data, int y,
42  const IMG_Plane &pi) override;
43 
44  int isTopFirst() const override;
45  void computeCommonData() override;
46 
47  int getDeepPixelSamples(int x, int y) override;
48  bool getDeepPixelPlaneData(int x, int y,
49  const IMG_Plane &plane,
50  float *data) override;
51  bool getDeepPixelData(int x, int y, float * const *data) override;
52  bool readDeepPixelData(int x, int y,
53  PXL_DeepSampleList &p) override;
54  bool writeDeepPixelData(int x, int y,
55  const PXL_DeepSampleListPtr &p) override;
56 
57 private:
58 
59  const void *extractScanline(int y, const PXL_Raster *p);
60  bool fillRasters();
61  void finishedScanline(int scan) override;
62 
63  void flipHorizontal(void *dest, const void *source,
64  const IMG_Plane &pi);
65 
66  void computeXY(int &x, int &y);
67 
68  bool myXFlip;
69  bool myYFlip;
70  bool myFlop;
71  bool myUseRasters;
72  bool myRastersFilled;
73 
74  UT_ValArray<PXL_Raster *> myPlaneImage;
75  void *myRasterBuffer;
76 };
77 
78 #endif
bool getDeepPixelPlaneData(int x, int y, const IMG_Plane &plane, float *data) override
GLint y
Definition: glcorearb.h:103
Describes the format and layout of a single plane in an image The plane specifies the format and name...
Definition: IMG_Plane.h:48
int getDeepPixelSamples(int x, int y) override
int isTopFirst() const override
#define IMG_API
Definition: IMG_API.h:10
bool getDeepPixelData(int x, int y, float *const *data) override
ImageBuf OIIO_API flop(const ImageBuf &src, ROI roi={}, int nthreads=0)
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
void computeCommonData() override
GLint GLenum GLint x
Definition: glcorearb.h:409
bool writeDeepPixelData(int x, int y, const PXL_DeepSampleListPtr &p) override
bool readDeepPixelData(int x, int y, PXL_DeepSampleList &p) override
constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Definition: Math.h:119
#define const
Definition: zconf.h:214
Definition: format.h:895