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
00011
00012
00013
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
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 }}