00001 #include <FCam/processing/Color.h>
00002 #include <FCam/F2/Platform.h>
00003
00004
00005 namespace FCam {
00006 namespace F2 {
00007
00008
00009
00010 void Platform::rawToRGBColorMatrix(int kelvin, float *matrix) const {
00011
00012
00013
00014
00015
00016 static float RawToRGBColorMatrix3200K[] = {
00017 1.6697, -0.2693, -0.4004, -42.4346,
00018 -0.3576, 1.0615, 1.5949, -37.1158,
00019 -0.2175, -1.8751, 6.9640, -26.6970
00020 };
00021
00022 static float RawToRGBColorMatrix7000K[] = {
00023 2.2997, -0.4478, 0.1706, -39.0923,
00024 -0.3826, 1.5906, -0.2080, -25.4311,
00025 -0.0888, -0.7344, 2.2832, -20.0826
00026 };
00027
00028
00029 float alpha = (1./kelvin-1./3200)/(1./7000-1./3200);
00030 colorMatrixInterpolate(RawToRGBColorMatrix3200K,
00031 RawToRGBColorMatrix7000K,
00032 alpha, matrix);
00033 }
00034
00035 const Platform &Platform::instance() {
00036 static Platform plat;
00037 return plat;
00038 }
00039
00040 }
00041 }