HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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_ValArray.h>
18 #include <PXL/PXL_Fill.h>
19 
20 #include "IMG_FileFilter.h"
21 
22 class PXL_Raster;
23 class PXL_Lookup;
24 
26 {
27 public:
28  IMG_FileFilterLUT(IMG_File *file_to_filter);
29  virtual ~IMG_FileFilterLUT();
30 
31  virtual const char *className() const { return "IMG_FileFilterLUT"; }
32 
33  void init(const char *lutname, const char *lut_scope,
34  fpreal gamma, const char *gamma_scope);
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 void computeCommonData();
42 
43 private:
44  void applyGammaLUT(void *dest, const void *sdata,
45  const IMG_Plane &pi, bool dogamma, bool dolut);
46  PXL_Lookup *myLookup;
47  UT_String myLUTScopeString;
48  UT_BitArray myLUTScope;
49 
50  fpreal myGamma;
51  UT_String myGammaScopeString;
52  UT_BitArray myGammaScope;
53 
54  UT_ValArray<PXL_Raster *> myScanRaster;
55 
56  // We cache this so we can share the gamma table between
57  // invocations.
58  PXL_FillParms myFill;
59 };
60 
61 
62 #endif
virtual void computeCommonData()
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
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
double fpreal
Definition: SYS_Types.h:263
virtual const char * className() const
virtual const void * readPlaneScanline(int y, const IMG_Plane &pi)