00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __UT_FILE_LUT_H__
00023 #define __UT_FILE_LUT_H__
00024
00025 #include "UT_API.h"
00026 #ifndef WIN32
00027 #include <sys/stat.h>
00028 #endif
00029
00030 #include "UT_String.h"
00031
00032 class UT_API UT_FileLUT
00033 {
00034 public:
00035 enum {
00036 LOAD_FORWARD_LUT = 0,
00037 LOAD_INVERSE_LUT,
00038 LOAD_FULL_LUT
00039 };
00040
00041 enum {
00042 CINEON_CLIPPED = 0,
00043 CINEON_FULL_RANGE,
00044 CINEON_WHITE_GIVEN
00045 };
00046
00047
00048 UT_FileLUT();
00049 virtual ~UT_FileLUT();
00050
00051 UT_FileLUT &operator=(const UT_FileLUT &) ;
00052 int operator==(const UT_FileLUT &) const;
00053
00054
00055 int load(const char *name, int lutsize, int lutrange,
00056 int mode = LOAD_FORWARD_LUT);
00057
00058
00059 int createCineon(int white_point, fpreal gamma, int full_range,
00060 int mode = LOAD_FORWARD_LUT,int imagepnt = 4095);
00061
00062 void create(int size, float *data, int range,
00063 int mode = LOAD_FORWARD_LUT,
00064 const char *filename = 0,
00065 int whitepoint = 65535);
00066
00067
00068 int getLUTSize() const { return myLUTSize; }
00069 unsigned short * getLUT() { return myLUT; }
00070 const unsigned short * getLUT() const { return myLUT; }
00071
00072 int getInvLUTSize() const { return myInvLUTSize; }
00073 unsigned short * getInvLUT() { return myInvLUT; }
00074 const unsigned short * getInvLUT() const { return myInvLUT; }
00075
00076 int getWhitePoint() const
00077 { return myComputedWhitePoint; }
00078
00079
00080 int compareExistingLUT(const char *name, int mode);
00081 int compareExistingLUT(int white, fpreal gamma,
00082 int mode, int iwhite);
00083
00084 void debugOut(const char *file);
00085
00086 private:
00087
00088 int myLUTSize;
00089 unsigned short *myLUT;
00090 int myInvLUTSize;
00091 unsigned short *myInvLUT;
00092
00093
00094 int myCreationMode;
00095 UT_String myFilename;
00096 int myWhitePoint;
00097 int myImageWhite;
00098 float myGamma;
00099
00100 #ifndef WIN32
00101 time_t myFileCreationTime;
00102 #endif
00103
00104
00105 int myComputedWhitePoint;
00106 };
00107
00108 #endif