Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

UpoSRGB2RGB.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Trait_UpoSRGB2RGB_h
00002 #define Impala_Core_Array_Trait_UpoSRGB2RGB_h
00003 
00004 namespace Impala
00005 {
00006 namespace Core
00007 {
00008 namespace Array
00009 {
00010 namespace Trait
00011 {
00012 
00013 
00014 class UpoSRGB2RGBPtr
00015 {
00016 public:
00017     typedef Pattern::TagTransInVar TransVarianceCategory;
00018     typedef Pattern::TagCallPointer CallCategory;
00019 
00020     UpoSRGB2RGBPtr(Real64 gamma=2.2)
00021     {
00022         for(int i = 0; i < 256; i++)
00023         {
00024             lookupTable[i] = pow(Real64(i) / 255.0, gamma) * 255.0;
00025         }
00026     }
00027 
00028     void DoIt(Real64 *out, UInt8* rgb)
00029     {
00030         out[0] = lookupTable[rgb[0]];
00031         out[1] = lookupTable[rgb[1]];
00032         out[2] = lookupTable[rgb[2]];
00033     }
00034 private:
00035     Real64 lookupTable[256];
00036 };
00037 
00038 } // namespace Trait
00039 } // namespace Array
00040 } // namespace Core
00041 } // namespace Impala
00042 
00043 #endif //UpoSRGB2RGB_h

Generated on Fri Mar 19 09:31:03 2010 for ImpalaSrc by  doxygen 1.5.1