HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 
44  : UT_FileLUT()
45  {
46  *this = copy;
47  }
48  UT_FileLUT &operator=(const UT_FileLUT &) ;
49 
50  // loads a LUT file
51  int load(const char *name, int lutsize, int lutrange,
52  int mode = LOAD_FORWARD_LUT);
53 
54  // creates a cineon LUT
55  int createCineon(int white_point, fpreal gamma, int full_range,
56  int mode = LOAD_FORWARD_LUT,int imagepnt = 4095);
57 
58  void create(int size, float *data, int range,
59  int mode = LOAD_FORWARD_LUT,
60  const char *filename = 0,
61  int whitepoint = 65535);
62 
63  // LUT accessers
64  int getLUTSize() const { return myLUTSize; }
65  unsigned short * getLUT() { return myLUT; }
66  const unsigned short * getLUT() const { return myLUT; }
67 
68  int getInvLUTSize() const { return myInvLUTSize; }
69  unsigned short * getInvLUT() { return myInvLUT; }
70  const unsigned short * getInvLUT() const { return myInvLUT; }
71 
72  int getWhitePoint() const
73  { return myComputedWhitePoint; }
74 
75  // comparison functions
76  int compareExistingLUT(const char *name, int mode);
77  int compareExistingLUT(int white, fpreal gamma,
78  int mode, int iwhite);
79 
80  void debugOut(const char *file);
81 
82 private:
83 
84  int myLUTSize;
85  unsigned short *myLUT;
86  int myInvLUTSize;
87  unsigned short *myInvLUT;
88 
89  // comparison info
90  int myCreationMode;
91  UT_String myFilename;
92  int myWhitePoint;
93  int myImageWhite;
94  float myGamma;
95 
96 #ifndef WIN32
97  time_t myFileCreationTime;
98 #endif
99 
100  // the image white point.
101  int myComputedWhitePoint;
102 };
103 
104 #endif
GT_API const UT_StringHolder filename
GLenum GLint * range
Definition: glcorearb.h:1925
unsigned short * getInvLUT()
Definition: UT_FileLUT.h:69
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
UT_FileLUT(const UT_FileLUT &copy)
Definition: UT_FileLUT.h:43
int getInvLUTSize() const
Definition: UT_FileLUT.h:68
int getWhitePoint() const
Definition: UT_FileLUT.h:72
#define UT_API
Definition: UT_API.h:14
int getLUTSize() const
Definition: UT_FileLUT.h:64
const unsigned short * getInvLUT() const
Definition: UT_FileLUT.h:70
GLuint const GLchar * name
Definition: glcorearb.h:786
const unsigned short * getLUT() const
Definition: UT_FileLUT.h:66
GLenum mode
Definition: glcorearb.h:99
GLsizeiptr size
Definition: glcorearb.h:664
fpreal64 fpreal
Definition: SYS_Types.h:277
Definition: format.h:895
unsigned short * getLUT()
Definition: UT_FileLUT.h:65