HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_FileLUT.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: UT library (C++)
7  *
8  * COMMENTS:
9  * Defines a LUT that is read from a file; values are assumed to be
10  * unsigned shorts.
11  *
12  */
13 
14 #ifndef __UT_FILE_LUT_H__
15 #define __UT_FILE_LUT_H__
16 
17 #include "UT_API.h"
18 #ifndef WIN32
19 #include <sys/stat.h>
20 #endif
21 
22 #include "UT_String.h"
23 
25 {
26 public:
27  enum {
28  LOAD_FORWARD_LUT = 0,
30  LOAD_FULL_LUT
31  };
32 
33  enum {
34  CINEON_CLIPPED = 0,
36  CINEON_WHITE_GIVEN
37  };
38 
39 
40  UT_FileLUT();
41  virtual ~UT_FileLUT();
42 
43  UT_FileLUT &operator=(const UT_FileLUT &) ;
44  int operator==(const UT_FileLUT &) const;
45 
46  // loads a LUT file
47  int load(const char *name, int lutsize, int lutrange,
48  int mode = LOAD_FORWARD_LUT);
49 
50  // creates a cineon LUT
51  int createCineon(int white_point, fpreal gamma, int full_range,
52  int mode = LOAD_FORWARD_LUT,int imagepnt = 4095);
53 
54  void create(int size, float *data, int range,
55  int mode = LOAD_FORWARD_LUT,
56  const char *filename = 0,
57  int whitepoint = 65535);
58 
59  // LUT accessers
60  int getLUTSize() const { return myLUTSize; }
61  unsigned short * getLUT() { return myLUT; }
62  const unsigned short * getLUT() const { return myLUT; }
63 
64  int getInvLUTSize() const { return myInvLUTSize; }
65  unsigned short * getInvLUT() { return myInvLUT; }
66  const unsigned short * getInvLUT() const { return myInvLUT; }
67 
68  int getWhitePoint() const
69  { return myComputedWhitePoint; }
70 
71  // comparison functions
72  int compareExistingLUT(const char *name, int mode);
73  int compareExistingLUT(int white, fpreal gamma,
74  int mode, int iwhite);
75 
76  void debugOut(const char *file);
77 
78 private:
79 
80  int myLUTSize;
81  unsigned short *myLUT;
82  int myInvLUTSize;
83  unsigned short *myInvLUT;
84 
85  // comparison info
86  int myCreationMode;
87  UT_String myFilename;
88  int myWhitePoint;
89  int myImageWhite;
90  float myGamma;
91 
92 #ifndef WIN32
93  time_t myFileCreationTime;
94 #endif
95 
96  // the image white point.
97  int myComputedWhitePoint;
98 };
99 
100 #endif
GLenum GLint * range
Definition: glcorearb.h:1924
unsigned short * getInvLUT()
Definition: UT_FileLUT.h:65
int getInvLUTSize() const
Definition: UT_FileLUT.h:64
int getWhitePoint() const
Definition: UT_FileLUT.h:68
#define UT_API
Definition: UT_API.h:12
int getLUTSize() const
Definition: UT_FileLUT.h:60
GLsizeiptr size
Definition: glcorearb.h:663
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
const unsigned short * getInvLUT() const
Definition: UT_FileLUT.h:66
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
const unsigned short * getLUT() const
Definition: UT_FileLUT.h:62
GLenum mode
Definition: glcorearb.h:98
double fpreal
Definition: SYS_Types.h:263
unsigned short * getLUT()
Definition: UT_FileLUT.h:61