• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/N900/Platform.cpp

00001 
00002 #include <FCam/processing/Color.h>
00003 #include <FCam/N900/Platform.h>
00004 
00005 
00006 namespace FCam { namespace N900 {
00007     
00008     void Platform::rawToRGBColorMatrix(int kelvin, float *matrix) const {      
00009 
00010         // These are quick and dirty numbers computed using a random
00011         // outdoor overcast day, and interior office lighting.  The 3x3
00012         // linear portion of the matrices are scaled so that the minimum
00013         // row sum is one (i.e. saturated in all channels maps to white).
00014         static float RawToRGBColorMatrix3200K[] = {                
00015             1.6697,   -0.2693,   -0.4004,  -42.4346,
00016             -0.3576,    1.0615,    1.5949,  -37.1158,
00017             -0.2175,  -1.8751,    6.9640,  -26.6970
00018         };
00019         
00020         static float RawToRGBColorMatrix7000K[] = {
00021             2.2997,   -0.4478,    0.1706,  -39.0923,
00022             -0.3826,    1.5906,   -0.2080,  -25.4311,
00023             -0.0888,   -0.7344,    2.2832,  -20.0826
00024         };
00025 
00026         // Linear interpolation with inverse color temperature
00027         float alpha = (1./kelvin-1./3200)/(1./7000-1./3200);
00028         colorMatrixInterpolate(RawToRGBColorMatrix3200K,
00029                                RawToRGBColorMatrix7000K,
00030                                alpha, matrix);
00031     }
00032 
00033     const Platform &Platform::instance() {
00034         static Platform plat;
00035         return plat;
00036     }
00037 
00038 }}

Generated on Fri Sep 24 2010 15:53:00 for FCam by  doxygen 1.7.1