HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMG_FileFilterLUT.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_FileFilterLUT ( IMG Library, C++)
7  *
8  * COMMENTS:
9  *
10  * Applies a LUT and/or gamma to the scanlines.
11  */
12 #ifndef IMG_FILE_FILTER_LUT_H
13 #define IMG_FILE_FILTER_LUT_H
14 
15 #include <SYS/SYS_Types.h>
16 #include <UT/UT_BitArray.h>
17 #include <UT/UT_StringHolder.h>
18 #include <UT/UT_ValArray.h>
19 #include <PXL/PXL_Fill.h>
20 
21 #include "IMG_FileFilter.h"
22 
23 class PXL_Raster;
24 class PXL_Lookup;
25 
27 {
28 public:
29  IMG_FileFilterLUT(IMG_File *file_to_filter);
30  ~IMG_FileFilterLUT() override;
31 
32  const char *className() const override { return "IMG_FileFilterLUT"; }
33 
34  void init(const char *lutname, const char *lut_scope,
35  fpreal gamma, const char *gamma_scope,
36  bool is_ocio, const char *ocio_colorspace,
37  const char *ocio_looks);
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  void computeCommonData() override;
45 
46 private:
47  void applyGammaLUT(void *dest, const void *sdata,
48  const IMG_Plane &pi, bool dogamma, bool dolut);
49  void applyOCIO(int y, void *dest, const void *sdata,
50  const IMG_Plane &pi,
51  const UT_StringHolder &src_colorspace,
52  const UT_StringHolder &dest_colorspace,
53  const UT_StringHolder &looks);
54  bool myIsOCIO;
55  bool myOCIONoOp;
56  PXL_Lookup *myLookup;
57  UT_StringHolder myLUTScopeString;
58  UT_StringHolder myOCIOColorspaceA;
59  UT_StringHolder myOCIOColorspaceB;
60  UT_StringHolder myOCIOLooks;
61  UT_BitArray myLUTScope;
62 
63  fpreal myGamma;
64  UT_StringHolder myGammaScopeString;
65  UT_BitArray myGammaScope;
66 
67  UT_ValArray<PXL_Raster *> myScanRaster;
68 
69  // We cache this so we can share the gamma table between
70  // invocations.
71  PXL_FillParms myFill;
72 };
73 
74 
75 #endif
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
#define IMG_API
Definition: IMG_API.h:10
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
fpreal64 fpreal
Definition: SYS_Types.h:277
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)
const char * className() const override