diff --git a/rtengine/color.cc b/rtengine/color.cc index 3f2a75788..0ee5a479c 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -939,6 +939,17 @@ void Color::rgbxyz (float r, float g, float b, float &x, float &y, float &z, con z = ((xyz_rgb[2][0] * r + xyz_rgb[2][1] * g + xyz_rgb[2][2] * b)) ; } +void Color::rgbxyY(float r, float g, float b, float &x, float &y, float &Y, float &xx, float &yy, float &zz, const double xyz_rgb[3][3]) +{ + xx = ((xyz_rgb[0][0] * r + xyz_rgb[0][1] * g + xyz_rgb[0][2] * b)) ; + yy = ((xyz_rgb[1][0] * r + xyz_rgb[1][1] * g + xyz_rgb[1][2] * b)) ; + zz = ((xyz_rgb[2][0] * r + xyz_rgb[2][1] * g + xyz_rgb[2][2] * b)) ; + float som = xx + yy + zz; + x = xx / som; + y = yy / som; + Y = yy / 65535.f; +} + void Color::rgbxyz (float r, float g, float b, float &x, float &y, float &z, const float xyz_rgb[3][3]) { x = ((xyz_rgb[0][0] * r + xyz_rgb[0][1] * g + xyz_rgb[0][2] * b)) ; diff --git a/rtengine/color.h b/rtengine/color.h index a94302e30..0963c0ff4 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -585,6 +585,7 @@ public: * @param xyz_rgb[3][3] transformation matrix to use for the conversion */ static void rgbxyz (float r, float g, float b, float &x, float &y, float &z, const double xyz_rgb[3][3]); + static void rgbxyY(float r, float g, float b, float &x, float &y, float &Y, float &xx, float &yy, float &zz, const double xyz_rgb[3][3]); static void rgbxyz (float r, float g, float b, float &x, float &y, float &z, const float xyz_rgb[3][3]); #ifdef __SSE2__ static void rgbxyz (vfloat r, vfloat g, vfloat b, vfloat &x, vfloat &y, vfloat &z, const vfloat xyz_rgb[3][3]); diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index a7a769d93..527755a03 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -23,6 +23,12 @@ #include #include "sleef.c" #include "settings.h" +#include "iccstore.h" + +#undef CLIPD +#define CLIPD(a) ((a)>0.0?((a)<1.0?(a):1.0):0.0) +#define CLIPQQ(a) ((a)>0?((a)<250?(a):250):0) +#define MAXR(a,b) ((a) > (b) ? (a) : (b)) namespace rtengine { @@ -393,6 +399,618 @@ const double ColorTemp::ColorchechGreE2_spect[97] = { 0.4297, 0.4837, 0.5142, 0.5446, 0.5541, 0.5636, 0.5608, 0.5579, 0.5480, 0.5381, 0.5258, 0.5135, 0.4959, 0.4783, 0.4570, 0.4356, 0.4124, 0.3891, 0.3710, 0.3529, 0.3425, 0.3320, 0.3266, 0.3211, 0.3180, 0.3149, 0.3129, 0.3108, 0.3123, 0.3137, 0.3193, 0.3248, 0.3335, 0.3422, 0.3518, 0.3613, 0.3693, 0.3772, 0.3810, 0.3847, 0.3838, 0.3829, 0.3838, 0.3847, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +const double ColorTemp::ColorGreenM25_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0758, 0.0614, 0.0662, 0.0591, 0.0648, 0.0633, 0.0671, 0.0613, 0.0621, 0.0610, 0.0680, 0.0690, 0.0784, 0.0830, 0.0920, 0.1070, 0.1231, 0.1423, 0.1607, 0.1731, 0.1816, 0.1911, 0.1951, 0.1986, 0.1915, 0.1889, + 0.1758, 0.1673, 0.1606, 0.1505, 0.1384, 0.1317, 0.1230, 0.1149, 0.1081, 0.0992, 0.0882, 0.0785, 0.0709, 0.0629, 0.0550, 0.0502, 0.0486, 0.0474, 0.0445, 0.0434, 0.0429, 0.0423, 0.0411, 0.0405, 0.0397, 0.0387, 0.0399, 0.0398, 0.0398, 0.0407, 0.0408, 0.0426, 0.0445, 0.0443, 0.0468, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//0 658 45 0 0 131 98 84 123 104 131 112 121 121 139 128 148 199 296 389 476 689 945 1132 1326 1490 1674 1741 1775 1868 1914 1928 1961 1972 1992 2045 2064 2053 2048 2072 2086 2081 2069 2056 2073 2096 2114 2067 2089 2100 2061 2019 1983 1971 1961 2016 1956 1946 1922 1983 1991 +const double ColorTemp::ColorYellowkeltano_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0658, 0.0045, 0.0, 0.0, 0.0131, 0.0098, 0.0084, 0.0123, 0.0104, 0.0131, 0.0112, 0.0121, 0.0121, 0.0139, + 0.0128, 0.0148, 0.0199, 0.0296, 0.0389, 0.0476, 0.0689, 0.0945, 0.1132, 0.1326, 0.1490, 0.1674, 0.1741, 0.1775, 0.1868, + 0.1914, 0.1928, 0.1961, 0.1972, 0.1992, 0.2045, 0.2064, 0.2053, 0.2048, 0.2072, 0.2086, 0.2081, 0.2069, 0.2056, 0.2073, + 0.2096, 0.2114, 0.2067, 0.2089, 0.2100, 0.2061, 0.2019, 0.1983, 0.1971, 0.1961, 0.2016, 0.1956, 0.1946, 0.1922, 0.1983, 0.1991, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::ColorGreenalsi_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1732, 0.0292, 0.0315, 0.0533, 0.0469, 0.0359, 0.0404, 0.0356, 0.0345, 0.0374, 0.0348, 0.0336, 0.0332, 0.0333, 0.0342, + 0.0330, 0.0350, 0.0343, 0.0354, 0.0371, 0.0399, 0.0426, 0.0497, 0.0541, 0.0616, 0.0701, 0.0750, 0.0764, 0.0783, 0.0794, + 0.0784, 0.0732, 0.0708, 0.0652, 0.0612, 0.0595, 0.0570, 0.0531, 0.0507, 0.0501, 0.0488, 0.0458, 0.0437, 0.0420, 0.0436, + 0.0424, 0.0417, 0.0389, 0.0380, 0.0378, 0.0371, 0.0350, 0.0333, 0.0350, 0.0394, 0.0379, 0.0446, 0.0491, 0.0575, 0.0734, 0.0953, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//1890 1097 855 899 987 881 807 804 787 691 643 549 465 404 385 302 244 195 165 159 123 129 108 111 114 126 126 134 162 170 213 248 279 351 412 566 752 909 1069 1270 1526 +//1707 1858 1999 2112 2293 2422 2471 2611 2718 2710 2778 2807 2825 2856 2909 2901 2974 3042 3044 3075 +const double ColorTemp::ColorRedpetunia_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1890, 0.1097, 0.0855, 0.0899, 0.0987, 0.0881, 0.0807, 0.0804, 0.0787, 0.0691, 0.0643, 0.0549, 0.0465, 0.0404, 0.0385, + 0.0302, 0.0244, 0.0195, 0.0165, 0.0159, 0.0123, 0.0129, 0.0108, 0.0111, 0.0114, 0.0126, 0.0126, 0.0134, 0.0162, 0.0170, + 0.0213, 0.0248, 0.0279, 0.0351, 0.0412, 0.0566, 0.0752, 0.0909, 0.1069, 0.1270, 0.1526, 0.1707, 0.1858, 0.1999, 0.2112, + 0.2293, 0.2422, 0.2471, 0.2611, 0.2718, 0.2710, 0.2778, 0.2807, 0.2825, 0.2856, 0.2909, 0.2901, 0.2974, 0.3042, 0.3044, 0.3075, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//0.1588 0.1980 0.2789 0.4585 0.6059 0.6609 0.6674 0.6599 0.6551 0.6472 0.6423 0.6485 0.6515 0.6379 0.6193 0.6121 0.6026 0.5678 0.5310 0.5245 0.5305 0.5324 0.5262 0.5219 0.5247 0.5312 0.5436 0.5634 0.5832 0.5943 0.5953 0.5902 0.5805 0.5754 0.5901 0.6262 + +const double ColorTemp::JDC468_B14_75Redspect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1588, 0.1780, 0.1980, 0.2310, 0.2789, 0.3213, 0.4585, 0.5324, 0.6059, 0.6334, 0.6609, 0.6630, 0.6674, 0.6640, 0.6599, 0.6600, 0.6551, 0.6532, 0.6472, 0.6450, + 0.6423, 0.6467, 0.6485, 0.6500, 0.6515, 0.6456, 0.6379, 0.6285, 0.6193, 0.6150, 0.6121, 0.6056, 0.6026, 0.5812, 0.5678, 0.5490, 0.5310, 0.5307, 0.5245, 0.5300, + 0.5305, 0.5310, 0.5324, 0.5298, 0.5262, 0.5230, 0.5219, 0.5231, 0.5247, 0.5280, 0.5312, 0.5364, 0.5436, 0.5550, 0.5634, 0.5731, 0.5832, 0.5901, 0.5943, 0.5950, + 0.5953, 0.5926, 0.5902, 0.5850, 0.5805, 0.5770, 0.5754, 0.6012, 0.6262, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +const double ColorTemp::ColorRedkurttu_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0979, 0.1536, 0.0745, 0.1145, 0.0937, 0.0996, 0.0972, 0.0924, 0.0875, 0.0878, 0.0826, 0.0766, 0.0658, 0.0599, 0.0545, + 0.0509, 0.0443, 0.0381, 0.0356, 0.0327, 0.0318, 0.0304, 0.0295, 0.0288, 0.0285, 0.0271, 0.0281, 0.0282, 0.0278, 0.0280, + 0.0296, 0.0309, 0.0324, 0.0342, 0.0343, 0.0376, 0.0419, 0.0464, 0.0520, 0.0634, 0.0747, 0.0905, 0.1093, 0.1167, 0.1264, + 0.1439, 0.1650, 0.1928, 0.2183, 0.2380, 0.2537, 0.2754, 0.2893, 0.3009, 0.3115, 0.3213, 0.3173, 0.3222, 0.3237, 0.3192, 0.3210, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#light red flower (lupiini) +//1792 1553 1684 1882 1909 1847 2053 2084 2045 2052 2039 2084 2041 2044 2007 1984 1906 1876 1886 1855 1859 1875 1816 1800 1811 1780 1802 1816 1838 1915 1973 2018 2083 2114 2133 2226 2304 2385 2458 2494 2571 2689 2738 2774 2734 2759 2781 2831 2844 2857 2878 2876 2884 2920 2932 2860 2894 2934 2925 2928 2921 +const double ColorTemp::ColorRedlupiini_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1792, 0.1553, 0.1684, 0.1882, 0.1909, 0.1847, 0.2053, 0.2084, 0.2045, 0.2052, 0.2039, 0.2084, 0.2041, 0.2044, 0.2007, 0.1984, 0.1906, 0.1876, + 0.1886, 0.1855, 0.1859, 0.1875, 0.1816, 0.1800, 0.1811, 0.1780, 0.1802, 0.1816, 0.1838, 0.1915, 0.1973, 0.2018, 0.2083, 0.2114, 0.2133, 0.2226, + 0.2304, 0.2385, 0.2458, 0.2494, 0.2571, 0.2689, 0.2738, 0.2774, 0.2734, 0.2759, 0.2781, 0.2831, 0.2844, 0.2857, 0.2878, 0.2876, 0.2884, 0.2920, + 0.2932, 0.2860, 0.2894, 0.2934, 0.2925, 0.2928, 0.2921, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//#red flower (hevosminttu) +//1280 706 612 462 391 339 253 285 261 264 239 208 201 186 185 161 156 149 146 148 161 144 143 151 147 146 139 148 173 185 185 197 222 238 283 322 384 439 519 633 792 922 1061 1186 1235 1342 1538 1691 1839 1974 2024 2098 2128 2187 2204 2217 2267 2299 2339 2331 2322 +const double ColorTemp::ColorRedhevosminttu_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1280, 0.0706, 0.0612, 0.0462, 0.0391, 0.0339, 0.0253, 0.0285, 0.0261, 0.0264, 0.0239, 0.0208, 0.0201, 0.0186, 0.0185, 0.0161, 0.0156, 0.0149, + 0.0146, 0.0148, 0.0161, 0.0144, 0.0143, 0.0151, 0.0147, 0.0146, 0.0139, 0.0148, 0.0173, 0.0185, 0.0185, 0.0197, 0.0222, 0.0238, 0.0283, 0.0322, + 0.0384, 0.0439, 0.0519, 0.0633, 0.0792, 0.0922, 0.1061, 0.1186, 0.1235, 0.1342, 0.1538, 0.1691, 0.1839, 0.1974, 0.2024, 0.2098, 0.2128, 0.2187, 0.2204, + 0.2217, 0.2267, 0.2299, 0.2339, 0.2331, 0.2322, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//#red flower (neilikka) +//0 0 394 0 245 95 174 149 194 171 181 175 172 167 147 137 107 108 100 87 93 87 83 77 80 67 72 64 83 84 88 90 91 94 114 133 178 241 309 419 612 823 992 1153 1222 1366 1503 1658 1767 1841 1884 1992 2035 2007 2009 2045 2065 2229 2290 2395 2449 +const double ColorTemp::ColorRedneilikka_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0394, 0.0, 0.0245, 0.0095, 0.0174, 0.0149, 0.0194, 0.0171, 0.0181, 0.0175, 0.0172, 0.0167, 0.0147, 0.0137, 0.0107, 0.0108, 0.0100, + 0.0087, 0.0093, 0.0087, 0.0083, 0.0077, 0.0080, 0.0067, 0.0072, 0.0064, 0.0083, 0.0084, 0.0088, 0.0090, 0.0091, 0.0094, 0.0114, 0.0133, + 0.0178, 0.0241, 0.0309, 0.0419, 0.0612, 0.0823, 0.0992, 0.1153, 0.1222, 0.1366, 0.1503, 0.1658, 0.1767, 0.1841, 0.1884, 0.1992, 0.2035, 0.2007, 0.2009, + 0.2045, 0.2065, 0.2229, 0.2290, 0.2395, 0.2449, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#red petal (pelargonia) +//2529 2048 2087 2698 2452 2372 2531 2475 2296 2294 2159 2111 1986 1898 1854 1729 1586 1501 1392 1332 1343 1255 1217 1182 1183 1203 1230 1277 1381 1474 1615 1762 1876 2028 2214 2464 2657 2919 3051 3172 3293 3421 3395 3494 3438 3495 3506 3490 3454 3487 3431 3452 3484 3438 3422 3368 3325 3441 3356 3432 3320 +const double ColorTemp::ColorRedpelagornia_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2529, 0.2048, 0.2087, 0.2698, 0.2452, 0.2372, 0.2531, 0.2475, 0.2296, 0.2294, 0.2159, 0.2111, 0.1986, 0.1898, 0.1854, 0.1729, 0.1586, 0.1501, 0.1392, 0.1332, 0.1343, + 0.1255, 0.1217, 0.1182, 0.1183, 0.1203, 0.1230, 0.1277, 0.1381, 0.1474, 0.1615, 0.1762, 0.1876, 0.2028, 0.2214, 0.2464, 0.2657, 0.2919, 0.3051, 0.3172, 0.3293, 0.3421, + 0.3395, 0.3494, 0.3438, 0.3495, 0.3506, 0.3490, 0.3454, 0.3487, 0.3431, 0.3452, 0.3484, 0.3438, 0.3422, 0.3368, 0.3325, 0.3441, 0.3356, 0.3432, 0.3320, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#red flower (talvio) +//3131 2199 2559 2540 2844 2530 2694 2765 2594 2673 2617 2629 2491 2384 2308 2256 2081 1973 1857 1752 1719 1652 1527 1477 1459 1386 1341 1283 1318 1334 1354 1424 1495 1543 1634 1773 1950 2129 2272 2431 2642 2827 2941 3045 3082 3158 3216 3307 3364 3388 3387 3517 3573 3501 3499 3523 3495 3606 3493 3518 3522 +const double ColorTemp::ColorRedtalvio_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3131, 0.2199, 0.2559, 0.2540, 0.2844, 0.2530, 0.2694, 0.2765, 0.2594, 0.2673, 0.2617, 0.2629, 0.2491, 0.2384, 0.2308, 0.2256, 0.2081, 0.1973, 0.1857, 0.1752, 0.1719, + 0.1652, 0.1527, 0.1477, 0.1459, 0.1386, 0.1341, 0.1283, 0.1318, 0.1334, 0.1354, 0.1424, 0.1495, 0.1543, 0.1634, 0.1773, 0.1950, 0.2129, 0.2272, 0.2431, 0.2642, 0.2827, + 0.2941, 0.3045, 0.3082, 0.3158, 0.3216, 0.3307, 0.3364, 0.3388, 0.3387, 0.3517, 0.3573, 0.3501, 0.3499, 0.3523, 0.3495, 0.3606, 0.3493, 0.3518, 0.3522, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + +}; + +//#brown dry leaf (poimulehti) +//964 520 223 244 261 247 196 199 200 207 202 198 209 204 207 222 205 218 213 212 224 218 230 235 251 250 245 250 263 273 271 275 281 264 274 288 287 307 303 307 323 304 335 335 346 345 347 348 370 364 380 393 384 407 419 421 419 433 431 461 465 +//RIs 67 +const double ColorTemp::ColorBrownpoimulehti_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0964, 0.0520, 0.0223, 0.0244, 0.0261, 0.0247, 0.0196, 0.0199, 0.0200, 0.0207, 0.0202, 0.0198, 0.0209, 0.0204, 0.0207, 0.0222, 0.0205, 0.0218, 0.0213, + 0.0212, 0.0224, 0.0218, 0.0230, 0.0235, 0.0251, 0.0250, 0.0245, 0.0250, 0.0263, 0.0273, 0.0271, 0.0275, 0.0281, 0.0264, 0.0274, 0.0288, 0.0287, 0.0307, + 0.0303, 0.0307, 0.0323, 0.0304, 0.0335, 0.0335, 0.0346, 0.0345, 0.0347, 0.0348, 0.0370, 0.0364, 0.0380, 0.0393, 0.0384, 0.0407, + 0.0419, 0.0421, 0.0419, 0.0433, 0.0431, 0.0461, 0.0465, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#orange leaf (koristepensas, tuntematon) +//241 195 223 489 574 565 634 605 574 613 645 636 644 628 621 603 614 654 676 719 776 795 862 879 918 918 955 980 1013 1055 1132 1225 1258 1362 1427 1579 1796 1936 2079 2258 2440 2597 2728 2790 2777 2857 2923 2991 3031 3040 3037 3094 3066 3023 3093 3044 3082 3085 3147 3226 3192 +const double ColorTemp::ColorOrangetuntematon_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0241, 0.0195, 0.0223, 0.0489, 0.0574, 0.0565, 0.0634, 0.0605, 0.0574, 0.0613, 0.0645, 0.0636, 0.0644, 0.0628, 0.0621, 0.0603, 0.0614, 0.0654, 0.0676, + 0.0719, 0.0776, 0.0795, 0.0862, 0.0879, 0.0918, 0.0918, 0.0955, 0.0980, 0.1013, 0.1055, 0.1132, 0.1225, 0.1258, 0.1362, 0.1427, 0.1579, 0.1796, 0.1936, 0.2079, + 0.2258, 0.2440, 0.2597, 0.2728, 0.2790, 0.2777, 0.2857, 0.2923, 0.2991, 0.3031, 0.3040, 0.3037, 0.3094, 0.3066, 0.3023, 0.3093, 0.3044, 0.3082, 0.3085, 0.3147, 0.3226, 0.3192, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//,#orange leaf (lehmus) +//1062 866 443 544 496 485 492 458 450 425 458 477 497 461 451 481 454 500 515 538 529 593 638 670 686 711 718 729 741 760 796 833 895 958 1016 1128 1246 1344 1450 1505 1596 1636 1621 1631 1627 1628 1658 1583 1486 1415 1322 1265 1159 1062 975 974 1063 1326 1736 2141 2568 +const double ColorTemp::ColorOrangetlehmus_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1062, 0.0866, 0.0443, 0.0544, 0.0496, 0.0485, 0.0492, 0.0458, 0.0450, 0.0425, 0.0458, 0.0477, 0.0497, 0.0461, 0.0451, 0.0481, 0.0454, 0.0500, 0.0515, + 0.0538, 0.0529, 0.0593, 0.0638, 0.0670, 0.0686, 0.0711, 0.0718, 0.0729, 0.0741, 0.0760, 0.0796, 0.0833, 0.0895, 0.0958, 0.1016, 0.1128, 0.1246, 0.1344, 0.1450, + 0.1505, 0.1596, 0.1636, 0.1621, 0.1631, 0.1627, 0.1628, 0.1658, 0.1583, 0.1486, 0.1415, 0.1322, 0.1265, 0.1159, 0.1062, 0.0975, 0.0974, 0.1063, 0.1326, 0.1736, 0.2141, 0.2568, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#orange leaf (vaahtera) +//1517 551 664 659 521 585 460 385 424 389 375 374 359 380 371 373 379 387 378 394 405 416 463 496 536 542 577 579 619 642 678 710 777 829 894 1035 1174 1334 1484 1611 1798 1941 2012 2065 2135 2229 2286 2317 2332 2357 2323 2330 2292 2236 2137 2093 2180 2240 2368 2487 2528 +const double ColorTemp::ColorOrangvaahtera_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1517, 0.0551, 0.0664, 0.0659, 0.0521, 0.0585, 0.0460, 0.0385, 0.0424, 0.0389, 0.0375, 0.0374, 0.0359, 0.0380, 0.0371, 0.0373, 0.0379, 0.0387, 0.0378, + 0.0394, 0.0405, 0.0416, 0.0463, 0.0496, 0.0536, 0.0542, 0.0577, 0.0579, 0.0619, 0.0642, 0.0678, 0.0710, 0.0777, 0.0829, 0.0894, 0.1035, 0.1174, 0.1334, 0.1484, + 0.1611, 0.1798, 0.1941, 0.2012, 0.2065, 0.2135, 0.2229, 0.2286, 0.2317, 0.2332, 0.2357, 0.2323, 0.2330, 0.2292, 0.2236, 0.2137, 0.2093, 0.2180, 0.2240, 0.2368, 0.2487, 0.2528, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#brown dry leaf (lehmus) +//758 236 148 430 347 435 438 495 439 454 472 471 461 459 458 479 492 482 499 513 520 545 567 594 623 647 698 717 744 792 803 834 864 876 916 932 963 1013 1025 1060 1099 1118 1153 1175 1207 1242 1268 1266 1284 1305 1305 1304 1353 1360 1330 1332 1413 1502 1610 1682 1737 +const double ColorTemp::ColorBrownlehmus_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0758, 0.0236, 0.0148, 0.0430, 0.0347, 0.0435, 0.0438, 0.0495, 0.0439, 0.0454, 0.0472, 0.0471, 0.0461, 0.0459, 0.0458, 0.0479, 0.0492, 0.0482, 0.0499, 0.0513, + 0.0520, 0.0545, 0.0567, 0.0594, 0.0623, 0.0647, 0.0698, 0.0717, 0.0744, 0.0792, 0.0803, 0.0834, 0.0864, 0.0876, 0.0916, 0.0932, 0.0963, 0.1013, 0.1025, 0.1060, + 0.1099, 0.1118, 0.1153, 0.1175, 0.1207, 0.1242, 0.1268, 0.1266, 0.1284, 0.1305, 0.1305, 0.1304, 0.1353, 0.1360, 0.1330, 0.1332, 0.1413, 0.1502, 0.1610, 0.1682, 0.1737, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#brown moss (nuotiosammal) +//482 260 178 92 104 88 92 40 43 52 58 64 70 63 67 67 62 76 82 82 91 96 104 116 135 141 142 155 168 179 198 199 193 201 212 218 226 240 242 238 255 265 277 266 265 283 289 275 289 277 291 288 277 252 262 260 264 299 375 411 446 +const double ColorTemp::ColorBrownuotiosammal_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0482, 0.0260, 0.0178, 0.0092, 0.0104, 0.0088, 0.0092, 0.0040, 0.0043, 0.0052, 0.0058, 0.0064, 0.0070, 0.0063, 0.0067, 0.0067, 0.0062, 0.0076, 0.0082, 0.0082, 0.0091, 0.0096, + 0.0104, 0.0116, 0.0135, 0.0141, 0.0142, 0.0155, 0.0168, 0.0179, 0.0198, 0.0199, 0.0193, 0.0201, 0.0212, 0.0218, 0.0226, 0.0240, 0.0242, 0.0238, 0.0255, 0.0265, + 0.0277, 0.0266, 0.0265, 0.0283, 0.0289, 0.0275, 0.0289, 0.0277, 0.0291, 0.0288, 0.0277, 0.0252, 0.0262, 0.0260, 0.0264, 0.0299, 0.0375, 0.0411, 0.0446, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#black soil +//0 0 89 122 52 53 104 127 130 134 137 137 134 136 138 139 134 140 142 148 154 153 152 150 151 156 153 166 154 171 163 163 166 166 169 169 166 174 174 170 170 168 176 177 176 174 179 180 180 183 177 193 178 187 194 193 182 196 184 195 195 +const double ColorTemp::ColorBlacksoil_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0089, 0.0122, 0.0052, 0.0053, 0.0104, 0.0127, 0.0130, 0.0134, 0.0137, 0.0137, 0.0134, 0.0136, 0.0138, 0.0139, 0.0134, 0.0140, 0.0142, 0.0148, 0.0154, 0.0153, + 0.0152, 0.0150, 0.0151, 0.0156, 0.0153, 0.0166, 0.0154, 0.0171, 0.0163, 0.0163, 0.0166, 0.0166, 0.0169, 0.0169, 0.0166, 0.0174, 0.0174, 0.0170, 0.0170, 0.0168, 0.0176, 0.0177, + 0.0176, 0.0174, 0.0179, 0.0180, 0.0180, 0.0183, 0.0177, 0.0193, 0.0178, 0.0187, 0.0194, 0.0193, 0.0182, 0.0196, 0.0184, 0.0195, 0.0195, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#black, dry leaf (pihlaja) +//0 79 111 172 174 201 214 211 207 207 191 200 196 206 196 194 203 207 204 208 210 212 211 208 209 219 222 224 231 241 232 244 249 250 267 264 262 269 282 277 289 284 279 302 289 308 313 315 310 325 313 319 356 340 331 347 356 352 364 373 352 +const double ColorTemp::ColorBlackpihlaja[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0079, 0.0111, 0.0172, 0.0174, 0.0201, 0.0214, 0.0211, 0.0207, 0.0207, 0.0191, 0.0200, 0.0196, 0.0206, 0.0196, 0.0194, 0.0203, 0.0207, 0.0204, 0.0208, 0.0210, 0.0212, + 0.0211, 0.0208, 0.0209, 0.0219, 0.0222, 0.0224, 0.0231, 0.0241, 0.0232, 0.0244, 0.0249, 0.0250, 0.0267, 0.0264, 0.0262, 0.0269, 0.0282, 0.0277, 0.0289, 0.0284, 0.0279, 0.0302, + 0.0289, 0.0308, 0.0313, 0.0315, 0.0310, 0.0325, 0.0313, 0.0319, 0.0356, 0.0340, 0.0331, 0.0347, 0.0356, 0.0352, 0.0364, 0.0373, 0.0352, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + +//#gray lichen (nahkajaekaelae) +//1204 585 1113 733 600 653 715 685 726 682 713 691 719 691 683 693 711 715 701 700 720 697 706 696 723 714 726 738 729 735 737 739 742 746 746 761 743 735 722 717 728 749 721 712 705 737 733 758 780 785 775 771 755 744 743 742 755 779 849 940 1042 +//RIS 74 +const double ColorTemp::ColorGraynahjajaekaelae_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1204, 0.0585, 0.1113, 0.0733, 0.0600, 0.0653, 0.0715, 0.0685, 0.0726, 0.0682, 0.0713, 0.0691, 0.0719, 0.0691, 0.0683, 0.0693, 0.0711, 0.0715, 0.0701, 0.0700, + 0.0720, 0.0697, 0.0706, 0.0696, 0.0723, 0.0714, 0.0726, 0.0738, 0.0729, 0.0735, 0.0737, 0.0739, 0.0742, 0.0746, 0.0746, 0.0761, 0.0743, 0.0735, 0.0722, 0.0717, + 0.0728, 0.0749, 0.0721, 0.0712, 0.0705, 0.0737, 0.0733, 0.0758, 0.0780, 0.0785, 0.0775, 0.0771, 0.0755, 0.0744, 0.0743, 0.0742, 0.0755, 0.0779, 0.0849, 0.0940, 0.1042, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#green moss (nuotiosammal) +//120 65 134 31 209 124 104 96 97 95 76 79 83 93 83 95 95 104 117 127 140 161 214 252 290 310 328 343 347 373 365 351 347 343 311 301 285 283 263 256 255 251 257 235 227 224 233 208 194 186 165 160 151 149 157 161 185 243 309 425 543 +const double ColorTemp::ColorGreennuotisammal_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0120, 0.0065, 0.0134, 0.0031, 0.0209, 0.0124, 0.0104, 0.0096, 0.0097, 0.0095, 0.0076, 0.0079, 0.0083, 0.0093, 0.0083, 0.0095, 0.0095, 0.0104, 0.0117, 0.0127, 0.0140, 0.0161, + 0.0214, 0.0252, 0.0290, 0.0310, 0.0328, 0.0343, 0.0347, 0.0373, 0.0365, 0.0351, 0.0347, 0.0343, 0.0311, 0.0301, 0.0285, 0.0283, 0.0263, 0.0256, 0.0255, 0.0251, + 0.0257, 0.0235, 0.0227, 0.0224, 0.0233, 0.0208, 0.0194, 0.0186, 0.0165, 0.0160, 0.0151, 0.0149, 0.0157, 0.0161, 0.0185, 0.0243, 0.0309, 0.0425, 0.0543, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#green leaf (leskenlehti) +//525 273 0 378 318 164 224 276 316 266 303 290 305 286 290 303 323 323 352 383 405 482 614 743 920 1015 1139 1192 1175 1216 1195 1145 1116 1009 947 867 802 754 741 709 675 625 574 579 561 565 557 511 471 419 399 372 365 395 375 382 458 555 716 1002 1407 +const double ColorTemp::ColorGreenleskenlehti_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0525, 0.0273, 0.0, 0.0378, 0.0318, 0.0164, 0.0224, 0.0276, 0.0316, 0.0266, 0.0303, 0.0290, 0.0305, 0.0286, 0.0290, 0.0303, 0.0323, 0.0323, 0.0352, 0.0383, 0.0405, 0.0482, + 0.0614, 0.0743, 0.0920, 0.1015, 0.1139, 0.1192, 0.1175, 0.1216, 0.1195, 0.1145, 0.1116, 0.1009, 0.0947, 0.0867, 0.0802, 0.0754, 0.0741, 0.0709, 0.0675, 0.0625, + 0.0574, 0.0579, 0.0561, 0.0565, 0.0557, 0.0511, 0.0471, 0.0419, 0.0399, 0.0372, 0.0365, 0.0395, 0.0375, 0.0382, 0.0458, 0.0555, 0.0716, 0.1002, 0.1407, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#green leaf (linnunkaali) +//602 0 267 306 339 335 300 247 292 289 295 298 292 318 312 289 299 307 310 320 350 375 446 499 574 634 698 725 736 754 736 702 668 633 590 551 514 499 467 460 445 424 415 409 399 412 393 380 370 362 366 343 342 350 333 350 364 418 494 670 914 +//RIS 77 +const double ColorTemp::ColorGreenlinnunkaali_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0602, 0.0, 0.0267, 0.0306, 0.0339, 0.0335, 0.0300, 0.0247, 0.0292, 0.0289, 0.0295, 0.0298, 0.0292, 0.0318, 0.0312, 0.0289, 0.0299, 0.0307, 0.0310, 0.0320, + 0.0350, 0.0375, 0.0446, 0.0499, 0.0574, 0.0634, 0.0698, 0.0725, 0.0736, 0.0754, 0.0736, 0.0702, 0.0668, 0.0633, 0.0590, 0.0551, 0.0514, 0.0499, 0.0467, 0.0460, + 0.0445, 0.0424, 0.0415, 0.0409, 0.0399, 0.0412, 0.0393, 0.0380, 0.0370, 0.0362, 0.0366, 0.0343, 0.0342, 0.0350, 0.0333, 0.0350, 0.0364, 0.0418, 0.0494, 0.0670, 0.0914, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//#green leaf (pelto-ohake) +//0 366 360 233 173 179 157 175 206 205 180 179 173 178 187 189 184 171 195 204 193 219 253 297 365 431 467 489 493 516 500 466 426 406 380 343 316 295 276 282 265 253 239 228 226 229 238 237 216 221 219 217 212 219 229 258 284 309 375 487 732 +const double ColorTemp::ColorGreenpelto_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0366, 0.0360, 0.0233, 0.0173, 0.0179, 0.0157, 0.0175, 0.0206, 0.0205, 0.0180, 0.0179, 0.0173, 0.0178, 0.0187, 0.0189, 0.0184, 0.0171, 0.0195, 0.0204, 0.0193, 0.0219, + 0.0253, 0.0297, 0.0365, 0.0431, 0.0467, 0.0489, 0.0493, 0.0516, 0.0500, 0.0466, 0.0426, 0.0406, 0.0380, 0.0343, 0.0316, 0.0295, 0.0276, 0.0282, 0.0265, 0.0253, 0.0239, + 0.0228, 0.0226, 0.0229, 0.0238, 0.0237, 0.0216, 0.0221, 0.0219, 0.0217, 0.0212, 0.0219, 0.0229, 0.0258, 0.0284, 0.0309, 0.0375, 0.0487, 0.0732, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#green rod (voikukka), +//2205 1755 1710 1365 1159 1207 1024 1118 1127 1141 1134 1125 1149 1140 1120 1128 1139 1156 1212 1273 1262 1359 1461 1519 1568 1599 1660 1668 1680 1718 1697 1690 1672 1675 1663 1644 1642 1652 1626 1623 1653 1621 1614 1590 1625 1609 1615 1576 1509 1483 1418 1391 1324 1294 1267 1220 1315 1417 1650 1861 2006 +const double ColorTemp::ColorGreenrodvoikukka[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2205, 0.1755, 0.1710, 0.1365, 0.1159, 0.1207, 0.1024, 0.1118, 0.1127, 0.1141, 0.1134, 0.1125, 0.1149, 0.1140, 0.1120, 0.1128, 0.1139, 0.1156, 0.1212, 0.1273, 0.1262, 0.1359, + 0.1461, 0.1519, 0.1568, 0.1599, 0.1660, 0.1668, 0.1680, 0.1718, 0.1697, 0.1690, 0.1672, 0.1675, 0.1663, 0.1644, 0.1642, 0.1652, 0.1626, 0.1623, 0.1653, 0.1621, 0.1614, 0.1590, + 0.1625, 0.1609, 0.1615, 0.1576, 0.1509, 0.1483, 0.1418, 0.1391, 0.1324, 0.1294, 0.1267, 0.1220, 0.1315, 0.1417, 0.1650, 0.1861, 0.2006, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#green leaf (lehmus) +//2362 1024 945 666 617 604 591 580 648 631 656 607 616 653 643 626 643 656 710 753 801 929 1105 1277 1437 1601 1742 1774 1798 1848 1832 1820 1787 1730 1663 1593 1541 1461 1446 1419 1335 1298 1247 1192 1197 1199 1156 1072 1007 942 899 832 824 793 755 801 860 1031 1305 1809 2260 +const double ColorTemp::ColorGreenlehmus[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2362, 0.1024, 0.0945, 0.0666, 0.0617, 0.0604, 0.0591, 0.0580, 0.0648, 0.0631, 0.0656, 0.0607, 0.0616, 0.0653, 0.0643, 0.0626, 0.0643, 0.0656, 0.0710, 0.0753, + 0.0801, 0.0929, 0.1105, 0.1277, 0.1437, 0.1601, 0.1742, 0.1774, 0.1798, 0.1848, 0.1832, 0.1820, 0.1787, 0.1730, 0.1663, 0.1593, 0.1541, 0.1461, 0.1446, 0.1419, 0.1335, 0.1298, + 0.1247, 0.1192, 0.1197, 0.1199, 0.1156, 0.1072, 0.1007, 0.0942, 0.0899, 0.0832, 0.0824, 0.0793, 0.0755, 0.0801, 0.0860, 0.1031, 0.1305, 0.1809, 0.2260, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#green leaf (koristeherukka) +//945 292 315 433 321 294 295 321 278 261 282 272 270 278 285 274 277 268 269 283 275 309 325 389 450 493 551 557 587 585 567 554 515 487 460 424 409 387 353 349 353 333 309 309 312 315 321 298 304 304 281 273 293 311 314 333 355 392 439 595 811 +const double ColorTemp::ColorGreenkoriste[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0945, 0.0292, 0.0315, 0.0433, 0.0321, 0.0294, 0.0295, 0.0321, 0.0278, 0.0261, 0.0282, 0.0272, 0.0270, 0.0278, 0.0285, 0.0274, 0.0277, 0.0268, 0.0269, 0.0283, + 0.0275, 0.0309, 0.0325, 0.0389, 0.0450, 0.0493, 0.0551, 0.0557, 0.0587, 0.0585, 0.0567, 0.0554, 0.0515, 0.0487, 0.0460, 0.0424, 0.0409, 0.0387, 0.0353, 0.0349, + 0.0353, 0.0333, 0.0309, 0.0309, 0.0312, 0.0315, 0.0321, 0.0298, 0.0304, 0.0304, 0.0281, 0.0273, 0.0293, 0.0311, 0.0314, 0.0333, 0.0355, 0.0392, 0.0439, 0.0595, 0.0811, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#green leaf (poimulehti) +//1102 146 630 266 247 261 285 238 273 281 272 260 262 254 274 263 273 278 296 309 322 388 493 607 712 840 953 986 1006 1034 999 981 918 855 794 711 649 627 604 563 531 515 467 450 448 466 445 421 402 385 369 345 346 319 330 359 378 439 578 835 1177 +const double ColorTemp::ColorGreenpoimulehti[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1102, 0.0146, 0.0630, 0.0266, 0.0247, 0.0261, 0.0285, 0.0238, 0.0273, 0.0281, 0.0272, 0.0260, 0.0262, 0.0254, 0.0274, 0.0263, 0.0273, 0.0278, 0.0296, 0.0309, 0.0322, + 0.0388, 0.0493, 0.0607, 0.0712, 0.0840, 0.0953, 0.0986, 0.1006, 0.1034, 0.0999, 0.0981, 0.0918, 0.0855, 0.0794, 0.0711, 0.0649, 0.0627, 0.0604, 0.0563, 0.0531, 0.0515, + 0.0467, 0.0450, 0.0448, 0.0466, 0.0445, 0.0421, 0.0402, 0.0385, 0.0369, 0.0345, 0.0346, 0.0319, 0.0330, 0.0359, 0.0378, 0.0439, 0.0578, 0.0835, 0.1177, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#green leaf (hopeapaju) +//787 512 1260 1032 765 881 994 908 983 985 941 985 971 967 964 937 928 959 973 992 1004 1017 1053 1102 1180 1227 1281 1309 1317 1328 1318 1271 1238 1222 1179 1152 1131 1092 1086 1078 1083 1020 1015 1000 1027 1037 1028 970 962 977 952 963 955 935 980 979 963 1028 1059 1228 1401 +const double ColorTemp::ColorGreenhopeapaju[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0787, 0.0512, 0.1260, 0.1032, 0.0765, 0.0881, 0.0994, 0.0908, 0.0983, 0.0985, 0.0941, 0.0985, 0.0971, 0.0967, 0.0964, 0.0937, 0.0928, 0.0959, 0.0973, 0.0992, 0.1004, + 0.1017, 0.1053, 0.1102, 0.1180, 0.1227, 0.1281, 0.1309, 0.1317, 0.1328, 0.1318, 0.1271, 0.1238, 0.1222, 0.1179, 0.1152, 0.1131, 0.1092, 0.1086, 0.1078, 0.1083, 0.1020, + 0.1015, 0.1000, 0.1027, 0.1037, 0.1028, 0.0970, 0.0962, 0.0977, 0.0952, 0.0963, 0.0955, 0.0935, 0.0980, 0.0979, 0.0963, 0.1028, 0.1059, 0.1228, 0.1401, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#red flower (uuden guinean liisa) +//2288 1861 2364 2229 2783 2842 2842 2923 2902 2990 2828 2871 2772 2723 2639 2558 2424 2315 2169 2094 2064 1964 1865 1739 1680 1624 1548 1457 1424 1408 1434 1451 1492 1528 1597 1755 1951 2147 2367 2648 2986 3236 3393 3596 3665 3786 3879 3915 3926 3994 3987 4017 4026 4112 4067 4125 4139 4121 4050 4040 4095 +const double ColorTemp::ColorReduuden[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2288, 0.1861, 0.2364, 0.2229, 0.2783, 0.2842, 0.2842, 0.2923, 0.2902, 0.2990, 0.2828, 0.2871, 0.2772, 0.2723, 0.2639, 0.2558, 0.2424, 0.2315, 0.2169, 0.2094, 0.2064, + 0.1964, 0.1865, 0.1739, 0.1680, 0.1624, 0.1548, 0.1457, 0.1424, 0.1408, 0.1434, 0.1451, 0.1492, 0.1528, 0.1597, 0.1755, 0.1951, 0.2147, 0.2367, 0.2648, 0.2986, 0.3236, + 0.3393, 0.3596, 0.3665, 0.3786, 0.3879, 0.3915, 0.3926, 0.3994, 0.3987, 0.4017, 0.4026, 0.4112, 0.4067, 0.4125, 0.4139, 0.4121, 0.4050, 0.4040, 0.4095, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#red flower (pajuangervo) +//445 1024 605 833 937 959 1052 1028 1049 1029 1017 975 948 882 865 812 757 718 658 638 628 597 554 523 509 509 485 475 469 492 479 477 490 525 555 597 641 704 756 846 948 1055 1164 1221 1266 1339 1393 1491 1553 1604 1608 1650 1643 1652 1655 1658 1651 1739 1813 1818 1938 +const double ColorTemp::ColorRedpajuan[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0445, 0.1024, 0.0605, 0.0833, 0.0937, 0.0959, 0.1052, 0.1028, 0.1049, 0.1029, 0.1017, 0.0975, 0.0948, 0.0882, 0.0865, 0.0812, 0.0757, 0.0718, 0.0658, 0.0638, 0.0628, 0.0597, + 0.0554, 0.0523, 0.0509, 0.0509, 0.0485, 0.0475, 0.0469, 0.0492, 0.0479, 0.0477, 0.0490, 0.0525, 0.0555, 0.0597, 0.0641, 0.0704, 0.0756, 0.0846, 0.0948, 0.1055, 0.1164, 0.1221, + 0.1266, 0.1339, 0.1393, 0.1491, 0.1553, 0.1604, 0.1608, 0.1650, 0.1643, 0.1652, 0.1655, 0.1658, 0.1651, 0.1739, 0.1813, 0.1818, 0.1938, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#red flower (jaloangervo) +//120 152 512 635 662 538 749 713 743 792 777 785 733 726 728 749 709 674 661 657 645 635 598 570 553 544 545 538 546 514 540 567 585 577 602 651 690 765 836 907 980 1089 1147 1188 1212 1253 1318 1371 1412 1473 1459 1478 1548 1582 1564 1590 1595 1714 1728 1814 1837 +const double ColorTemp::ColorRedjaloan[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0120, 0.0152, 0.0512, 0.0635, 0.0662, 0.0538, 0.0749, 0.0713, 0.0743, 0.0792, 0.0777, 0.0785, 0.0733, 0.0726, 0.0728, 0.0749, 0.0709, 0.0674, 0.0661, 0.0657, 0.0645, 0.0635, + 0.0598, 0.0570, 0.0553, 0.0544, 0.0545, 0.0538, 0.0546, 0.0514, 0.0540, 0.0567, 0.0585, 0.0577, 0.0602, 0.0651, 0.0690, 0.0765, 0.0836, 0.0907, 0.0980, 0.1089, 0.1147, 0.1188, + 0.1212, 0.1253, 0.1318, 0.1371, 0.1412, 0.1473, 0.1459, 0.1478, 0.1548, 0.1582, 0.1564, 0.1590, 0.1595, 0.1714, 0.1728, 0.1814, 0.1837, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#blue flower (ukonhattu) +//801 682 1070 1319 1311 1420 1453 1394 1318 1292 1268 1179 1132 1054 1015 948 846 780 731 709 705 667 621 598 555 522 505 493 498 500 494 471 479 463 450 461 487 515 546 574 555 562 539 558 546 552 567 626 715 807 862 978 1086 1199 1313 1323 1350 1366 1358 1320 1365 +const double ColorTemp::ColorBlueukon[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0801, 0.0682, 0.1070, 0.1319, 0.1311, 0.1420, 0.1453, 0.1394, 0.1318, 0.1292, 0.1268, 0.1179, 0.1132, 0.1054, 0.1015, 0.0948, 0.0846, 0.0780, 0.0731, 0.0709, 0.0705, 0.0667, + 0.0621, 0.0598, 0.0555, 0.0522, 0.0505, 0.0493, 0.0498, 0.0500, 0.0494, 0.0471, 0.0479, 0.0463, 0.0450, 0.0461, 0.0487, 0.0515, 0.0546, 0.0574, 0.0555, 0.0562, 0.0539, 0.0558, + 0.0546, 0.0552, 0.0567, 0.0626, 0.0715, 0.0807, 0.0862, 0.0978, 0.1086, 0.1199, 0.1313, 0.1323, 0.1350, 0.1366, 0.1358, 0.1320, 0.1365, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#blue flower (orvokki) +//292 528 645 1000 932 1439 1752 1947 2077 2158 2169 2153 2164 2132 2091 1993 1916 1876 1803 1702 1659 1554 1503 1425 1330 1229 1186 1134 1065 1031 1014 993 989 980 939 936 945 995 1055 1104 1180 1247 1284 1343 1349 1403 1458 1538 1634 1790 1880 2006 2218 2396 2556 2612 2735 2811 2765 2840 2877 +const double ColorTemp::ColorBlueorvokki[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0292, 0.0528, 0.0645, 0.1000, 0.0932, 0.1439, 0.1752, 0.1947, 0.2077, 0.2158, 0.2169, 0.2153, 0.2164, 0.2132, 0.2091, 0.1993, 0.1916, 0.1876, 0.1803, 0.1702, 0.1659, 0.1554, + 0.1503, 0.1425, 0.1330, 0.1229, 0.1186, 0.1134, 0.1065, 0.1031, 0.1014, 0.0993, 0.0989, 0.0980, 0.0939, 0.0936, 0.0945, 0.0995, 0.1055, 0.1104, 0.1180, 0.1247, 0.1284, 0.1343, + 0.1349, 0.1403, 0.1458, 0.1538, 0.1634, 0.1790, 0.1880, 0.2006, 0.2218, 0.2396, 0.2556, 0.2612, 0.2735, 0.2811, 0.2765, 0.2840, 0.2877, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#blue flower (malvikki) +//1062 528 749 571 512 538 455 445 431 384 353 299 249 212 190 162 123 105 90 81 83 75 78 72 59 56 61 54 71 69 70 62 63 65 70 74 78 73 76 87 90 104 119 119 131 145 156 184 225 255 314 414 538 669 849 1068 1247 1467 1701 1885 2032 +const double ColorTemp::ColorBluemalvikki[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1062, 0.0528, 0.0749, 0.0571, 0.0512, 0.0538, 0.0455, 0.0445, 0.0431, 0.0384, 0.0353, 0.0299, 0.0249, 0.0212, 0.0190, 0.0162, 0.0123, 0.0105, 0.0090, 0.0081, 0.0083, 0.0075, + 0.0078, 0.0072, 0.0059, 0.0056, 0.0061, 0.0054, 0.0071, 0.0069, 0.0070, 0.0062, 0.0063, 0.0065, 0.0070, 0.0074, 0.0078, 0.0073, 0.0076, 0.0087, 0.0090, 0.0104, 0.0119, 0.0119, + 0.0131, 0.0145, 0.0156, 0.0184, 0.0225, 0.0255, 0.0314, 0.0414, 0.0538, 0.0669, 0.0849, 0.1068, 0.1247, 0.1467, 0.1701, 0.1885, 0.2032, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#black dry leaf (maitohorsma) +//256 0 172 356 213 270 203 203 195 208 202 201 210 210 203 204 209 203 209 201 205 201 194 210 206 197 203 198 207 201 204 202 198 200 198 197 186 203 202 198 200 208 206 231 235 223 244 254 278 289 297 309 338 335 338 368 412 524 686 926 1185 +const double ColorTemp::ColorBlackmaito[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0256, 0.0, 0.0172, 0.0356, 0.0213, 0.0270, 0.0203, 0.0203, 0.0195, 0.0208, 0.0202, 0.0201, 0.0210, 0.0210, 0.0203, 0.0204, 0.0209, 0.0203, 0.0209, 0.0201, 0.0205, 0.0201, + 0.0194, 0.0210, 0.0206, 0.0197, 0.0203, 0.0198, 0.0207, 0.0201, 0.0204, 0.0202, 0.0198, 0.0200, 0.0198, 0.0197, 0.0186, 0.0203, 0.0202, 0.0198, 0.0200, 0.0208, 0.0206, 0.0231, + 0.0235, 0.0223, 0.0244, 0.0254, 0.0278, 0.0289, 0.0297, 0.0309, 0.0338, 0.0335, 0.0338, 0.0368, 0.0412, 0.0524, 0.0686, 0.0926, 0.1185, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#orange berry (pihlaja) +//945 731 585 433 247 408 266 314 293 305 289 288 280 297 262 298 277 274 291 293 285 303 300 310 324 336 364 377 426 465 499 561 602 667 741 890 1028 1164 1275 1465 1602 1640 1695 1744 1812 1837 1859 1805 1791 1822 1796 1751 1715 1655 1575 1600 1560 1618 1666 1740 1838 +const double ColorTemp::ColorOrangpihlaja[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0945, 0.0731, 0.0585, 0.0433, 0.0247, 0.0408, 0.0266, 0.0314, 0.0293, 0.0305, 0.0289, 0.0288, 0.0280, 0.0297, 0.0262, 0.0298, 0.0277, 0.0274, 0.0291, 0.0293, 0.0285, 0.0303, + 0.0300, 0.0310, 0.0324, 0.0336, 0.0364, 0.0377, 0.0426, 0.0465, 0.0499, 0.0561, 0.0602, 0.0667, 0.0741, 0.0890, 0.1028, 0.1164, 0.1275, 0.1465, 0.1602, 0.1640, 0.1695, 0.1744, + 0.1812, 0.1837, 0.1859, 0.1805, 0.1791, 0.1822, 0.1796, 0.1751, 0.1715, 0.1655, 0.1575, 0.1600, 0.1560, 0.1618, 0.1666, 0.1740, 0.1838, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#green flower (lehmus=linden) +//2677 1682 1170 1032 1085 816 728 755 833 832 813 845 857 884 855 882 914 997 1084 1179 1231 1437 1661 1873 2048 2209 2378 2408 2442 2509 2503 2452 2457 2418 2383 2348 2277 2213 2221 2169 2146 2048 1977 1960 2000 1993 1961 1899 1784 1748 1625 1517 1389 1260 1165 1143 1244 1522 1870 2324 2586 +//RIS 81 +const double ColorTemp::ColorGreenlinden[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2677, 0.1682, 0.1170, 0.1032, 0.1085, 0.0816, 0.0728, 0.0755, 0.0833, 0.0832, 0.0813, 0.0845, 0.0857, 0.0884, 0.0855, 0.0882, 0.0914, 0.0997, 0.1084, 0.1179, 0.1231, 0.1437, + 0.1661, 0.1873, 0.2048, 0.2209, 0.2378, 0.2408, 0.2442, 0.2509, 0.2503, 0.2452, 0.2457, 0.2418, 0.2383, 0.2348, 0.2277, 0.2213, 0.2221, 0.2169, 0.2146, 0.2048, 0.1977, 0.1960, + 0.2000, 0.1993, 0.1961, 0.1899, 0.1784, 0.1748, 0.1625, 0.1517, 0.1389, 0.1260, 0.1165, 0.1143, 0.1244, 0.1522, 0.1870, 0.2324, 0.2586, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#yellow petal (lehmus) +//1890 1097 900 832 814 799 758 853 803 808 833 862 916 943 960 969 1039 1162 1283 1370 1427 1529 1689 1781 1894 1950 2105 2118 2140 2185 2191 2199 2234 2266 2263 2297 2328 2312 2298 2332 2344 2312 2288 2347 2384 2390 2358 2280 2306 2315 2310 2253 2274 2271 2242 2292 2254 2208 2319 2314 2264 +const double ColorTemp::ColorYellowlehmus[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1890, 0.1097, 0.0900, 0.0832, 0.0814, 0.0799, 0.0758, 0.0853, 0.0803, 0.0808, 0.0833, 0.0862, 0.0916, 0.0943, 0.0960, 0.0969, 0.1039, 0.1162, 0.1283, 0.1370, 0.1427, + 0.1529, 0.1689, 0.1781, 0.1894, 0.1950, 0.2105, 0.2118, 0.2140, 0.2185, 0.2191, 0.2199, 0.2234, 0.2266, 0.2263, 0.2297, 0.2328, 0.2312, 0.2298, 0.2332, 0.2344, 0.2312, 0.2288, + 0.2347, 0.2384, 0.2390, 0.2358, 0.2280, 0.2306, 0.2315, 0.2310, 0.2253, 0.2274, 0.2271, 0.2242, 0.2292, 0.2254, 0.2208, 0.2319, 0.2314, 0.2264, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#yellow flower (suikeroalpi) +//2048 1666 1140 1210 699 680 615 566 567 561 609 585 614 572 599 575 636 730 982 1194 1360 1766 2222 2558 2849 3048 3201 3395 3395 3484 3576 3623 3606 3672 3651 3634 3647 3669 3715 3660 3720 3692 3704 3784 3683 3731 3681 3697 3635 3694 3617 3610 3632 3663 3616 3595 3599 3584 3588 3613 3527 +const double ColorTemp::ColorYellowsuikeroalpi[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2048, 0.1666, 0.1140, 0.1210, 0.0699, 0.0680, 0.0615, 0.0566, 0.0567, 0.0561, 0.0609, 0.0585, 0.0614, 0.0572, 0.0599, 0.0575, 0.0636, 0.0730, 0.0982, 0.1194, 0.1360, 0.1766, + 0.2222, 0.2558, 0.2849, 0.3048, 0.3201, 0.3395, 0.3395, 0.3484, 0.3576, 0.3623, 0.3606, 0.3672, 0.3651, 0.3634, 0.3647, 0.3669, 0.3715, 0.3660, 0.3720, 0.3692, 0.3704, 0.3784, + 0.3683, 0.3731, 0.3681, 0.3697, 0.3635, 0.3694, 0.3617, 0.3610, 0.3632, 0.3663, 0.3616, 0.3595, 0.3599, 0.3584, 0.3588, 0.3613, 0.3527, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#yellow flower (pensashanhikki) +//356 1365 1024 902 535 387 355 247 365 307 321 330 319 332 317 336 408 487 709 963 1235 1631 2111 2436 2718 2950 3151 3262 3313 3420 3448 3475 3491 3534 3520 3565 3622 3631 3626 3657 3640 3607 3641 3627 3601 3591 3588 3667 3618 3601 3630 3613 3592 3609 3569 3590 3568 3563 3588 3480 3471 +const double ColorTemp::ColorYellowpensashanhikki1[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0356, 0.1365, 0.1024, 0.0902, 0.0535, 0.0387, 0.0355, 0.0247, 0.0365, 0.0307, 0.0321, 0.0330, 0.0319, 0.0332, 0.0317, 0.0336, 0.0408, 0.0487, 0.0709, 0.0963, 0.1235, + 0.1631, 0.2111, 0.2436, 0.2718, 0.2950, 0.3151, 0.3262, 0.3313, 0.3420, 0.3448, 0.3475, 0.3491, 0.3534, 0.3520, 0.3565, 0.3622, 0.3631, 0.3626, 0.3657, 0.3640, 0.3607, + 0.3641, 0.3627, 0.3601, 0.3591, 0.3588, 0.3667, 0.3618, 0.3601, 0.3630, 0.3613, 0.3592, 0.3609, 0.3569, 0.3590, 0.3568, 0.3563, 0.3588, 0.3480, 0.3471, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#yellow sepal (pensashanhikki) +//1068 427 326 416 428 590 503 470 539 526 546 540 539 526 497 546 555 603 753 903 1010 1268 1563 1868 2068 2226 2429 2495 2560 2625 2636 2610 2655 2667 2635 2630 2612 2560 2597 2588 2543 2478 2499 2472 2438 2431 2379 2406 2361 2319 2264 2174 2128 2010 1942 1912 1930 2148 2334 2585 2764 +const double ColorTemp::ColorYellowpensashanhikki2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1068, 0.0427, 0.0326, 0.0416, 0.0428, 0.0590, 0.0503, 0.0470, 0.0539, 0.0526, 0.0546, 0.0540, 0.0539, 0.0526, 0.0497, 0.0546, 0.0555, 0.0603, 0.0753, 0.0903, 0.1010, 0.1268, + 0.1563, 0.1868, 0.2068, 0.2226, 0.2429, 0.2495, 0.2560, 0.2625, 0.2636, 0.2610, 0.2655, 0.2667, 0.2635, 0.2630, 0.2612, 0.2560, 0.2597, 0.2588, 0.2543, 0.2478, 0.2499, 0.2472, + 0.2438, 0.2431, 0.2379, 0.2406, 0.2361, 0.2319, 0.2264, 0.2174, 0.2128, 0.2010, 0.1942, 0.1912, 0.1930, 0.2148, 0.2334, 0.2585, 0.2764, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#blue flower (hiidenvirna) +//315 512 675 832 765 865 807 867 911 904 852 826 780 753 711 661 595 528 513 476 431 391 361 331 305 276 240 229 237 223 212 208 215 205 203 195 209 212 222 266 296 322 356 352 388 391 411 425 473 532 550 630 669 748 823 879 904 917 930 950 942 +const double ColorTemp::ColorBluehiidenvirna[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0315, 0.0512, 0.0675, 0.0832, 0.0765, 0.0865, 0.0807, 0.0867, 0.0911, 0.0904, 0.0852, 0.0826, 0.0780, 0.0753, 0.0711, 0.0661, 0.0595, 0.0528, 0.0513, 0.0476, 0.0431, 0.0391, + 0.0361, 0.0331, 0.0305, 0.0276, 0.0240, 0.0229, 0.0237, 0.0223, 0.0212, 0.0208, 0.0215, 0.0205, 0.0203, 0.0195, 0.0209, 0.0212, 0.0222, 0.0266, 0.0296, 0.0322, 0.0356, 0.0352, + 0.0388, 0.0391, 0.0411, 0.0425, 0.0473, 0.0532, 0.0550, 0.0630, 0.0669, 0.0748, 0.0823, 0.0879, 0.0904, 0.0917, 0.0930, 0.0950, 0.0942, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#blue flower (kurkkuyrtti) +//2687 1553 2181 2246 2209 2263 2442 2347 2261 2353 2292 2230 2095 2008 1896 1782 1569 1443 1333 1223 1177 1074 992 902 813 755 701 626 577 548 525 498 469 445 456 448 428 441 448 447 455 467 496 534 527 586 668 798 966 1126 1289 1469 1679 1870 2013 2040 2060 2077 2104 2155 2119 +//RIS 87 +const double ColorTemp::ColorBluekurkkuyrtti[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2687, 0.1553, 0.2181, 0.2246, 0.2209, 0.2263, 0.2442, 0.2347, 0.2261, 0.2353, 0.2292, 0.2230, 0.2095, 0.2008, 0.1896, 0.1782, 0.1569, 0.1443, 0.1333, 0.1223, 0.1177, 0.1074, + 0.0992, 0.0902, 0.0813, 0.0755, 0.0701, 0.0626, 0.0577, 0.0548, 0.0525, 0.0498, 0.0469, 0.0445, 0.0456, 0.0448, 0.0428, 0.0441, 0.0448, 0.0447, 0.0455, 0.0467, 0.0496, 0.0534, + 0.0527, 0.0586, 0.0668, 0.0798, 0.0966, 0.1126, 0.1289, 0.1469, 0.1679, 0.1870, 0.2013, 0.2040, 0.2060, 0.2077, 0.2104, 0.2155, 0.2119, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#pink (siankaersaemoe) +//585 859 758 1094 780 1012 987 1067 1059 1034 1098 1110 1097 1040 1058 1048 1028 1014 1068 1024 1023 1025 1032 1029 1011 1007 986 973 946 906 949 923 943 949 956 998 1051 1107 1166 1242 1284 1355 1394 1438 1451 1543 1589 1588 1612 1616 1562 1534 1562 1541 1494 1492 1518 1650 1749 1907 1991 +const double ColorTemp::ColorPinksiankaersaemoe[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0585, 0.0859, 0.0758, 0.1094, 0.0780, 0.1012, 0.0987, 0.1067, 0.1059, 0.1034, 0.1098, 0.1110, 0.1097, 0.1040, 0.1058, 0.1048, 0.1028, 0.1014, 0.1068, 0.1024, 0.1023, 0.1025, + 0.1032, 0.1029, 0.1011, 0.1007, 0.0986, 0.0973, 0.0946, 0.0906, 0.0949, 0.0923, 0.0943, 0.0949, 0.0956, 0.0998, 0.1051, 0.1107, 0.1166, 0.1242, 0.1284, 0.1355, 0.1394, 0.1438, + 0.1451, 0.1543, 0.1589, 0.1588, 0.1612, 0.1616, 0.1562, 0.1534, 0.1562, 0.1541, 0.1494, 0.1492, 0.1518, 0.1650, 0.1749, 0.1907, 0.1991, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#violet flower (harakankello) +//2520 1462 1890 1898 1751 1713 1555 1516 1471 1403 1282 1209 1144 1135 1069 976 895 823 782 762 713 685 661 635 603 559 551 550 541 567 562 574 580 589 586 620 670 690 718 801 786 769 773 739 800 806 837 845 971 1043 1102 1241 1359 1502 1611 1726 1793 1859 1909 1969 2014 +//RIS 89 +const double ColorTemp::ColorVioletharakankello[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2520, 0.1462, 0.1890, 0.1898, 0.1751, 0.1713, 0.1555, 0.1516, 0.1471, 0.1403, 0.1282, 0.1209, 0.1144, 0.1135, 0.1069, 0.0976, 0.0895, 0.0823, 0.0782, 0.0762, 0.0713, + 0.0685, 0.0661, 0.0635, 0.0603, 0.0559, 0.0551, 0.0550, 0.0541, 0.0567, 0.0562, 0.0574, 0.0580, 0.0589, 0.0586, 0.0620, 0.0670, 0.0690, 0.0718, 0.0801, 0.0786, 0.0769, + 0.0773, 0.0739, 0.0800, 0.0806, 0.0837, 0.0845, 0.0971, 0.1043, 0.1102, 0.1241, 0.1359, 0.1502, 0.1611, 0.1726, 0.1793, 0.1859, 0.1909, 0.1969, 0.2014, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#violet flower (alsikeapila) +//1260 585 765 1065 937 881 847 943 1075 1053 1020 994 1008 1026 1015 980 962 949 925 908 880 864 843 814 802 749 698 691 677 660 653 660 631 633 644 692 743 809 889 1005 1160 1325 1396 1450 1526 1583 1655 1674 1689 1707 1675 1674 1624 1576 1564 1591 1613 1717 1851 1962 2033 +const double ColorTemp::ColorVioletalsikeapila[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1260, 0.0585, 0.0765, 0.1065, 0.0937, 0.0881, 0.0847, 0.0943, 0.1075, 0.1053, 0.1020, 0.0994, 0.1008, 0.1026, 0.1015, 0.0980, 0.0962, 0.0949, 0.0925, 0.0908, 0.0880, 0.0864, + 0.0843, 0.0814, 0.0802, 0.0749, 0.0698, 0.0691, 0.0677, 0.0660, 0.0653, 0.0660, 0.0631, 0.0633, 0.0644, 0.0692, 0.0743, 0.0809, 0.0889, 0.1005, 0.1160, 0.1325, 0.1396, 0.1450, + 0.1526, 0.1583, 0.1655, 0.1674, 0.1689, 0.1707, 0.1675, 0.1674, 0.1624, 0.1576, 0.1564, 0.1591, 0.1613, 0.1717, 0.1851, 0.1962, 0.2033, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#violet flower (akilleija) +//843 1340 1393 1254 1290 1452 1508 1519 1454 1384 1301 1256 1178 1113 1056 985 884 827 743 720 691 664 605 578 540 507 499 475 485 494 492 479 487 493 471 495 559 595 645 689 720 732 716 723 734 750 804 849 948 1041 1169 1362 1525 1693 1761 1935 2071 2235 2376 2493 2604 +const double ColorTemp::ColorVioletakilleija[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0843, 0.1340, 0.1393, 0.1254, 0.1290, 0.1452, 0.1508, 0.1519, 0.1454, 0.1384, 0.1301, 0.1256, 0.1178, 0.1113, 0.1056, 0.0985, 0.0884, 0.0827, 0.0743, 0.0720, 0.0691, 0.0664, + 0.0605, 0.0578, 0.0540, 0.0507, 0.0499, 0.0475, 0.0485, 0.0494, 0.0492, 0.0479, 0.0487, 0.0493, 0.0471, 0.0495, 0.0559, 0.0595, 0.0645, 0.0689, 0.0720, 0.0732, 0.0716, 0.0723, + 0.0734, 0.0750, 0.0804, 0.0849, 0.0948, 0.1041, 0.1169, 0.1362, 0.1525, 0.1693, 0.1761, 0.1935, 0.2071, 0.2235, 0.2376, 0.2493, 0.2604, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#orange flower (kehaekukka) +//0 0 0 0 0 0 102 58 128 125 137 122 122 134 123 136 159 138 163 151 167 178 192 177 206 226 315 451 707 1045 1446 1707 1944 2131 2276 2524 2719 2841 2968 3052 3199 3264 3282 3429 3451 3454 3477 3556 3478 3565 3595 3569 3582 3582 3559 3610 3626 3668 3733 3692 3722 +const double ColorTemp::ColorOrangekehaekukka[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0102, 0.0058, 0.0128, 0.0125, 0.0137, 0.0122, 0.0122, 0.0134, 0.0123, 0.0136, 0.0159, 0.0138, 0.0163, 0.0151, 0.0167, 0.0178, 0.0192, + 0.0177, 0.0206, 0.0226, 0.0315, 0.0451, 0.0707, 0.1045, 0.1446, 0.1707, 0.1944, 0.2131, 0.2276, 0.2524, 0.2719, 0.2841, 0.2968, 0.3052, 0.3199, 0.3264, 0.3282, 0.3429, + 0.3451, 0.3454, 0.3477, 0.3556, 0.3478, 0.3565, 0.3595, 0.3569, 0.3582, 0.3582, 0.3559, 0.3610, 0.3626, 0.3668, 0.3733, 0.3692, 0.3722, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#red berry (pihlaja) +//0 0 0 0 25 84 128 87 165 130 167 147 155 146 148 165 158 159 164 160 158 158 157 157 173 173 179 195 210 234 264 302 349 386 461 572 735 886 1038 1216 1376 1521 1607 1691 1728 1769 1842 1843 1865 1910 1881 1920 1909 1909 1891 1879 1915 1879 1878 1843 1832 +const double ColorTemp::ColorRedpihlaja[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0025, 0.0084, 0.0128, 0.0087, 0.0165, 0.0130, 0.0167, 0.0147, 0.0155, 0.0146, 0.0148, 0.0165, 0.0158, 0.0159, 0.0164, 0.0160, 0.0158, 0.0158, + 0.0157, 0.0157, 0.0173, 0.0173, 0.0179, 0.0195, 0.0210, 0.0234, 0.0264, 0.0302, 0.0349, 0.0386, 0.0461, 0.0572, 0.0735, 0.0886, 0.1038, 0.1216, 0.1376, 0.1521, 0.1607, 0.1691, + 0.1728, 0.1769, 0.1842, 0.1843, 0.1865, 0.1910, 0.1881, 0.1920, 0.1909, 0.1909, 0.1891, 0.1879, 0.1915, 0.1879, 0.1878, 0.1843, 0.1832, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//#violet flower (petunia) +//292 66 227 313 325 332 310 319 300 268 229 193 164 137 127 104 67 50 49 37 34 34 44 32 33 31 38 41 33 34 45 44 37 42 44 49 49 67 80 89 110 130 137 145 153 171 194 223 275 321 391 464 580 720 907 1055 1230 1436 1548 1777 1933 +//RIS 94 +const double ColorTemp::ColorVioletpetunia[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0292, 0.0066, 0.0227, 0.0313, 0.0325, 0.0332, 0.0310, 0.0319, 0.0300, 0.0268, 0.0229, 0.0193, 0.0164, 0.0137, 0.0127, 0.0104, 0.0067, 0.0050, 0.0049, 0.0037, 0.0034, 0.0034, + 0.0044, 0.0032, 0.0033, 0.0031, 0.0038, 0.0041, 0.0033, 0.0034, 0.0045, 0.0044, 0.0037, 0.0042, 0.0044, 0.0049, 0.0049, 0.0067, 0.0080, 0.0089, 0.0110, 0.0130, 0.0137, 0.0145, + 0.0153, 0.0171, 0.0194, 0.0223, 0.0275, 0.0321, 0.0391, 0.0464, 0.0580, 0.0720, 0.0907, 0.1055, 0.1230, 0.1436, 0.1548, 0.1777, 0.1933, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#violet flower (orvokki) +//195 0 152 31 22 32 77 69 45 20 27 26 13 12 14 11 15 23 16 18 16 12 16 10 16 15 13 15 15 16 14 20 14 17 15 17 15 17 17 17 23 24 29 38 36 38 37 43 58 65 70 86 113 155 222 285 405 506 645 817 1035 +const double ColorTemp::ColorVioletorvokki[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0195, 0.0, 0.0152, 0.0031, 0.0022, 0.0032, 0.0077, 0.0069, 0.0045, 0.0020, 0.0027, 0.0026, 0.0013, 0.0012, 0.0014, 0.0011, 0.0015, 0.0023, 0.0016, 0.0018, 0.0016, 0.0012, 0.0016, + 0.0010, 0.0016, 0.0015, 0.0013, 0.0015, 0.0015, 0.0016, 0.0014, 0.0020, 0.0014, 0.0017, 0.0015, 0.0017, 0.0015, 0.0017, 0.0017, 0.0017, 0.0023, 0.0024, 0.0029, 0.0038, 0.0036, + 0.0038, 0.0037, 0.0043, 0.0058, 0.0065, 0.0070, 0.0086, 0.0113, 0.0155, 0.0222, 0.0285, 0.0405, 0.0506, 0.0645, 0.0817, 0.1035, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#blue flower (sinisievikki) +//801 1109 1861 2325 2329 2380 2562 2565 2558 2611 2517 2567 2475 2397 2337 2294 2195 2001 1881 1892 1854 1746 1668 1580 1491 1362 1229 1178 1110 1094 1072 1019 994 960 928 879 836 859 863 951 1046 1102 1154 1193 1174 1166 1153 1199 1275 1316 1376 1550 1739 1918 2104 2228 2364 2377 2423 2394 2334 +const double ColorTemp::ColorBluesinisievikki[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0801, 0.1109, 0.1861, 0.2325, 0.2329, 0.2380, 0.2562, 0.2565, 0.2558, 0.2611, 0.2517, 0.2567, 0.2475, 0.2397, 0.2337, 0.2294, 0.2195, 0.2001, 0.1881, 0.1892, 0.1854, 0.1746, + 0.1668, 0.1580, 0.1491, 0.1362, 0.1229, 0.1178, 0.1110, 0.1094, 0.1072, 0.1019, 0.0994, 0.0960, 0.0928, 0.0879, 0.0836, 0.0859, 0.0863, 0.0951, 0.1046, 0.1102, 0.1154, 0.1193, + 0.1174, 0.1166, 0.1153, 0.1199, 0.1275, 0.1316, 0.1376, 0.1550, 0.1739, 0.1918, 0.2104, 0.2228, 0.2364, 0.2377, 0.2423, 0.2394, 0.2334, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#blue flower (iisoppi) +//623 85 605 833 776 756 755 781 774 775 697 724 697 654 617 575 536 494 460 469 442 436 400 393 380 358 369 352 342 368 357 360 342 342 341 335 355 353 365 376 382 392 412 412 407 414 420 449 487 504 517 571 651 734 806 885 968 1088 1210 1296 1411 +const double ColorTemp::ColorBlueiisoppi[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0623, 0.0085, 0.0605, 0.0833, 0.0776, 0.0756, 0.0755, 0.0781, 0.0774, 0.0775, 0.0697, 0.0724, 0.0697, 0.0654, 0.0617, 0.0575, 0.0536, 0.0494, 0.0460, 0.0469, 0.0442, 0.0436, + 0.0400, 0.0393, 0.0380, 0.0358, 0.0369, 0.0352, 0.0342, 0.0368, 0.0357, 0.0360, 0.0342, 0.0342, 0.0341, 0.0335, 0.0355, 0.0353, 0.0365, 0.0376, 0.0382, 0.0392, 0.0412, 0.0412, + 0.0407, 0.0414, 0.0420, 0.0449, 0.0487, 0.0504, 0.0517, 0.0571, 0.0651, 0.0734, 0.0806, 0.0885, 0.0968, 0.1088, 0.1210, 0.1296, 0.1411, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//#white petal (ojakaersaemoe) +//1732 951 1800 1365 1801 1697 1762 2103 2243 2218 2200 2206 2255 2254 2269 2261 2272 2251 2254 2260 2256 2266 2247 2269 2310 2273 2345 2312 2301 2323 2302 2314 2362 2355 2348 2362 2396 2374 2362 2381 2396 2440 2383 2347 2422 2419 2472 2423 2406 2425 2377 2381 2380 2398 2390 2404 2370 2375 2364 2411 2417 +const double ColorTemp::ColorWhiteojaka[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1732, 0.0951, 0.1800, 0.1365, 0.1801, 0.1697, 0.1762, 0.2103, 0.2243, 0.2218, 0.2200, 0.2206, 0.2255, 0.2254, 0.2269, 0.2261, 0.2272, 0.2251, 0.2254, 0.2260, 0.2256, 0.2266, + 0.2247, 0.2269, 0.2310, 0.2273, 0.2345, 0.2312, 0.2301, 0.2323, 0.2302, 0.2314, 0.2362, 0.2355, 0.2348, 0.2362, 0.2396, 0.2374, 0.2362, 0.2381, 0.2396, 0.2440, 0.2383, 0.2347, + 0.2422, 0.2419, 0.2472, 0.2423, 0.2406, 0.2425, 0.2377, 0.2381, 0.2380, 0.2398, 0.2390, 0.2404, 0.2370, 0.2375, 0.2364, 0.2411, 0.2417, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//#white flower (petunia) +//4095 4022 4410 4095 4095 4095 4193 4207 4388 4328 4223 4168 4221 4304 4245 4210 4212 4192 4181 4233 4207 4224 4197 4262 4243 4241 4274 4257 4204 4285 4265 4241 4267 4275 4245 4276 4260 4217 4217 4244 4240 4186 4160 4156 4227 4286 4237 4137 4202 4187 4100 4112 4103 4090 4125 4115 4098 4036 4047 4105 4050 +const double ColorTemp::ColorWhitepetunia[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.4095, 0.4022, 0.4410, 0.4095, 0.4095, 0.4095, 0.4193, 0.4207, 0.4388, 0.4328, 0.4223, 0.4168, 0.4221, 0.4304, 0.4245, 0.4210, 0.4212, 0.4192, 0.4181, 0.4233, 0.4207, 0.4224, + 0.4197, 0.4262, 0.4243, 0.4241, 0.4274, 0.4257, 0.4204, 0.4285, 0.4265, 0.4241, 0.4267, 0.4275, 0.4245, 0.4276, 0.4260, 0.4217, 0.4217, 0.4244, 0.4240, 0.4186, 0.4160, 0.4156, + 0.4227, 0.4286, 0.4237, 0.4137, 0.4202, 0.4187, 0.4100, 0.4112, 0.4103, 0.4090, 0.4125, 0.4115, 0.4098, 0.4036, 0.4047, 0.4105, 0.4050, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + +//#blue flower (lobelia dortmanna) +//0 660 1277 1544 1612 1961 1909 1950 1901 1907 1809 1785 1685 1622 1522 1377 1178 1054 931 898 850 732 610 508 434 370 343 329 303 265 232 199 183 169 172 177 200 233 214 214 199 186 199 228 249 321 435 684 1006 1345 1703 2082 2432 2661 2843 2936 3079 3015 3003 3045 3038 +//RIS 98 +const double ColorTemp::ColorBluelobelia[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0660, 0.1277, 0.1544, 0.1612, 0.1961, 0.1909, 0.1950, 0.1901, 0.1907, 0.1809, 0.1785, 0.1685, 0.1622, 0.1522, 0.1377, 0.1178, 0.1054, 0.0931, 0.0898, 0.0850, 0.0732, + 0.0610, 0.0508, 0.0434, 0.0370, 0.0343, 0.0329, 0.0303, 0.0265, 0.0232, 0.0199, 0.0183, 0.0169, 0.0172, 0.0177, 0.0200, 0.0233, 0.0214, 0.0214, 0.0199, 0.0186, 0.0199, + 0.0228, 0.0249, 0.0321, 0.0435, 0.0684, 0.1006, 0.1345, 0.1703, 0.2082, 0.2432, 0.2661, 0.2843, 0.2936, 0.3079, 0.3015, 0.3003, 0.3045, 0.3038, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//#white petal (pelargonia) +//3493 2882 2284 2730 2869 2609 2781 2869 2861 2869 2795 2810 2740 2716 2650 2631 2539 2554 2450 2453 2447 2451 2343 2408 2404 2367 2343 2401 2474 2549 2668 2759 2843 2883 2989 3106 3209 3344 3383 3404 3453 3521 3495 3571 3521 3548 3582 3557 3581 3539 3563 3589 3597 3579 3502 3546 3507 3554 3490 3561 3518 +const double ColorTemp::ColorWhitepelargonia[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3493, 0.2882, 0.2284, 0.2730, 0.2869, 0.2609, 0.2781, 0.2869, 0.2861, 0.2869, 0.2795, 0.2810, 0.2740, 0.2716, 0.2650, 0.2631, 0.2539, 0.2554, 0.2450, 0.2453, 0.2447, + 0.2451, 0.2343, 0.2408, 0.2404, 0.2367, 0.2343, 0.2401, 0.2474, 0.2549, 0.2668, 0.2759, 0.2843, 0.2883, 0.2989, 0.3106, 0.3209, 0.3344, 0.3383, 0.3404, 0.3453, 0.3521, + 0.3495, 0.3571, 0.3521, 0.3548, 0.3582, 0.3557, 0.3581, 0.3539, 0.3563, 0.3589, 0.3597, 0.3579, 0.3502, 0.3546, 0.3507, 0.3554, 0.3490, 0.3561, 0.3518, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +/* +#white petal (paeivaenkakkara) +2168 1365 1969 2095 2231 2530 2944 3092 3107 3148 3188 3207 3195 3216 3225 3261 3211 3228 3260 3237 3258 3276 3265 3316 3327 3291 3315 3324 3355 3255 3264 3308 3324 3328 3282 3253 3220 3257 3289 3265 3245 3297 3284 3292 3228 3312 3290 3277 3278 3284 3182 3244 3273 3291 3212 3256 3154 3243 3306 3234 3155 +*/ +const double ColorTemp::ColorWhitepaeivaen[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2168, 0.1365, 0.1969, 0.2095, 0.2231, 0.2530, 0.2944, 0.3092, 0.3107, 0.3148, 0.3188, 0.3207, 0.3195, 0.3216, 0.3225, 0.3261, 0.3211, 0.3228, 0.3260, 0.3237, 0.3258, + 0.3276, 0.3265, 0.3316, 0.3327, 0.3291, 0.3315, 0.3324, 0.3355, 0.3255, 0.3264, 0.3308, 0.3324, 0.3328, 0.3282, 0.3253, 0.3220, 0.3257, 0.3289, 0.3265, 0.3245, 0.3297, + 0.3284, 0.3292, 0.3228, 0.3312, 0.3290, 0.3277, 0.3278, 0.3284, 0.3182, 0.3244, 0.3273, 0.3291, 0.3212, 0.3256, 0.3154, 0.3243, 0.3306, 0.3234, 0.3155, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + //spectral data Colorchecker24 : Green B3 const double ColorTemp::ColorchechGreB3_spect[97] = { @@ -444,6 +1062,21 @@ const double ColorTemp::ColorchechGraC4_67_spect[97] = { 0.369, 0.3689, 0.368, 0.3673, 0.3678, 0.3684, 0.37, 0.3711, 0.3712, 0.3714, 0.3714, 0.3714, 0.371, 0.3707, 0.37, 0.3694, 0.3697, 0.3703, 0.3697, 0.3692, 0.3688, 0.3685, 0.3675, 0.3669, 0.3657, 0.3647, 0.3635, 0.3625, 0.361, 0.3596, 0.3585, 0.3579, 0.357, 0.3560, 0.3555, 0.3548, 0.3535, 0.3526, 0.3513, 0.3500, 0.349, 0.3475, 0.3467, 0.3460, 0.3452, 0.3444, 0.3431, 0.3421, 0.3411, 0.3403, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +const double ColorTemp::Fictif_61greyspect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, + 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, + 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::JDC468_K15_87greyspect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1984, 0.2223, 0.2448, 0.2934, 0.3415, 0.4425, 0.5707, 0.6609, 0.7619, 0.7956, 0.8275, 0.8280, 0.8292, 0.8223, 0.8156, 0.8112, 0.8076, 0.8040, 0.7982, 0.7970, 0.7954, 0.8013, 0.8083, 0.8141, 0.8184, 0.8167, + 0.8137, 0.8080, 0.8026, 0.8013, 0.7988, 0.7963, 0.7942, 0.7855, 0.7765, 0.7680, 0.7603, 0.7640, 0.7681, 0.7750, 0.7827, 0.7876, 0.7923, 0.7935, 0.7945, 0.7955, 0.7964, 0.7975, 0.7982, 0.8000, 0.8017, 0.8051, + 0.8090, 0.8145, 0.8191, 0.8234, 0.8269, 0.8300, 0.8327, 0.8342, 0.8359, 0.8375, 0.8390, 0.8405, 0.8421, 0.8436, 0.8452, 0.8480, 0.8504, 0.8564, 0.8611, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + +}; +//K15 275 275 0.1984 0.2448 0.3415 0.5707 0.7619 0.8275 0.8292 0.8156 0.8076 0.7982 0.7954 0.8083 0.8184 0.8137 0.8026 0.7988 0.7942 0.7765 0.7603 0.7681 0.7827 0.7923 0.7945 0.7964 0.7982 0.8017 0.8090 0.8191 0.8269 0.8327 0.8359 0.8390 0.8421 0.8452 0.8504 0.8611 //spectral data Colorchecker24 : Skin B1 //use also for palette WB @@ -476,7 +1109,7 @@ const double ColorTemp::ColorchechDCBluN881_m7_m14_spect[97] = { //spectral data ColorcheckerSG : Skin F7 //use also for palette WB const double ColorTemp::ColorchechSGSkiF763_14_26_spect[97] = { - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0508, 0.64, 0.0776, 0.903, 0.1099, 0.1128, 0.1256, 0.128, 0.1307, 0.133, 0.1357, 0.139, 0.1425, 0.148, 0.1523, 0.159, 0.1669, 0.177, 0.1871, 0.20, 0.2118, 0.2235, 0.2355, 0.2445, 0.2537, 0.259, 0.2655, 0.268, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0508, 0.064, 0.0776, 0.903, 0.1099, 0.1128, 0.1256, 0.128, 0.1307, 0.133, 0.1357, 0.139, 0.1425, 0.148, 0.1523, 0.159, 0.1669, 0.177, 0.1871, 0.20, 0.2118, 0.2235, 0.2355, 0.2445, 0.2537, 0.259, 0.2655, 0.268, 0.2700, 0.2708, 0.2716, 0.2743, 0.2770, 0.2803, 0.2827, 0.283, 0.2832, 0.283, 0.2828, 0.295, 0.3079, 0.344, 0.3803, 0.4105, 0.4409, 0.455, 0.4694, 0.477, 0.4851, 0.4896, 0.4962, 0.501, 0.5066, 0.511, 0.5160, 0.521, 0.5256, 0.529, 0.5318, 0.535, 0.5383, 0.541, 0.5451, 0.549, 0.5524, 0.556, 0.5597, 0.562, 0.5650, 0.568, 0.5709, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; @@ -529,15 +1162,156 @@ const double ColorTemp::JDC468_GraK14_44_spect[97] = { 0.1408, 0.14330, 0.1475, 0.15170, 0.1583, 0.16500, 0.172, 0.17940, 0.1836, 0.18780, 0.188, 0.18820, 0.186, 0.18430, 0.1801, 0.17620, 0.1741, 0.17210, 0.179, 0.18420, 0.1991, 0.21430, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +const double ColorTemp::JDC468_BluM5_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1510, 0.1802, 0.2069, 0.2550, 0.3047, 0.4055, 0.5069, 0.590, 0.6747, 0.701, 0.7351, 0.7345, 0.7338, 0.7195, 0.7063, 0.693, 0.6732, 0.6490, 0.6261, 0.5993, 0.5723, 0.5560, + 0.5401, 0.526, 0.5106, 0.4805, 0.4504, 0.42, 0.3907, 0.385, 0.3799, 0.3750, 0.3695, 0.3340, 0.3005, 0.2692, 0.2382, 0.2387, 0.2389, 0.2501, 0.2610, 0.2635, 0.2662, 0.2601, 0.2541, + 0.2450, 0.2426, 0.2430, 0.2434, 0.2490, 0.2523, 0.2612, 0.2692, 0.2694, 0.2996, 0.3145, 0.3329, 0.3413, 0.3498, 0.3467, 0.3442, 0.3355, 0.3266, 0.3131, 0.2996, 0.2911, 0.2831, 0.2950, 0.3070, 0.3430, 0.3799, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//m5 317 //0.1510 0.2069 0.3047 0.5069 0.6747 0.7351 0.7338 0.7063 0.6732 0.6261 0.5723 0.5401 +// 0.5106 0.4504 0.3907 0.3799 0.3695 0.3005 0.2382 0.2389 0.2610 0.2662 0.2541 +// 0.2426 0.2434 0.2523 0.2692 0.2996 0.3329 0.3498 0.3442 0.3266 0.2996 0.2831 0.3070 0.3799 + +const double ColorTemp::JDC468_RedG21va_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1207, 0.141, 0.1585, 0.1810, 0.2073, 0.2529, 0.2959, 0.3210, 0.3476, 0.3350, 0.3232, 0.2845, 0.2564, 0.2140, 0.1823, 0.1523, 0.1266, 0.1001, 0.0792, 0.061, 0.0439, 0.0349, 0.0295, 0.0260, 0.0222, + 0.0180, 0.0135, 0.0111, 0.0087, 0.0090, 0.0094, 0.0101, 0.0109, 0.0093, 0.0086, 0.0090, 0.0091, 0.0061, 0.0321, 0.0086, 0.1368, 0.2312, 0.3256, 0.4112, 0.4958, 0.5444, 0.5884, 0.6002, 0.6264, 0.6323, 0.6473, + 0.6546, 0.6659, 0.6775, 0.6881, 0.6982, 0.7081, 0.7150, 0.7201, 0.7217, 0.7232, 0.7222, 0.7215, 0.7187, 0.7157, 0.7144, 0.7131, 0.7196, 0.7269, 0.7303, 0.7599, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//g21 177 0.1207 0.1585 0.2073 0.2959 0.3476 0.3232 0.2564 0.1823 0.1266 0.0792 0.0439 0.0295 0.0222 0.0135 0.0087 0.0094 0.0109 0.0086 0.0091 0.0321 +// 0.1368 0.3256 0.4958 0.5884 0.6264 0.6473 0.6659 0.6881 0.7081 0.7201 0.7232 0.7215 0.7157 0.7131 0.7269 0.7599 +const double ColorTemp::JDC468_RedI9_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0258, 0.023, 0.0220, 0.0205, 0.0189, 0.0183, 0.0174, 0.0168, 0.0162, 0.0152, 0.0148, 0.0145, 0.0139, 0.0136, 0.0133, 0.0130, 0.0127, 0.0130, 0.0133, 0.0151, 0.0168, 0.0218, 0.0268, 0.0317, 0.0367, 0.0330, + 0.0313, 0.0270, 0.0227, 0.0240, 0.0255, 0.0280, 0.0302, 0.0280, 0.0225, 0.0215, 0.0209, 0.0424, 0.0639, 0.1401, 0.2131, 0.3250, 0.4369, 0.5210, 0.6265, 0.6795, 0.7336, 0.7551, 0.7784, 0.7890, 0.7994, 0.8070, + 0.8146, 0.8210, 0.8277, 0.8321, 0.8362, 0.8398, 0.8439, 0.8470, 0.8504, 0.8530, 0.8572, 0.8612, 0.8653, 0.8689, 0.8715, 0.8730, 0.8747, 0.8766, 0.8788, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//I9 RED 217 0.0258 0.0220 0.0189 0.0174 0.0162 0.0148 0.0139 0.0133 0.0127 0.0133 0.0168 0.0268 0.0367 0.0313 0.0227 0.0255 0.0302 0.0225 0.0209 0.0639 0.2131 0.4369 0.6265 0.7336 0.7784 0.7994 0.8146 0.8277 0.8362 0.8439 0.8504 0.8572 0.8653 0.8715 0.8747 0.8788 + +const double ColorTemp::JDC468_YelN10_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0531, 0.0520, 0.0504, 0.0510, 0.0518, 0.0608, 0.0628, 0.0669, 0.0699, 0.0705, 0.0716, 0.0720, 0.0735, 0.0755, 0.0775, 0.0800, 0.0825, 0.0896, 0.0969, 0.1260, 0.1563, 0.2312, 0.3096, 0.4132, 0.5177, 0.5905, 0.6637, + 0.7251, 0.7350, 0.7458, 0.7480, 0.7507, 0.7460, 0.7414, 0.7356, 0.7301, 0.7320, 0.7347, 0.7390, 0.7438, 0.7472, 0.7500, 0.7508, 0.7515, 0.7528, 0.7538, 0.7550, 0.7563, 0.7581, 0.7607, 0.7642, 0.7686, 0.7710, + 0.7791, 0.7840, 0.7872, 0.7902, 0.7935, 0.7955, 0.7979, 0.7995, 0.8021, 0.8035, 0.8058, 0.8072, 0.8090, 0.8110, 0.8143, 0.8198, 0.8259, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//n10 348 0.0531 0.0504 0.0518 0.0628 0.0699 0.0716 0.0735 0.0775 0.0825 0.0969 0.1563 0.3096 0.5177 0.6637 0.7251 0.7458 0.7507 0.7414 0.7301 0.7347 0.7438 0.7500 0.7515 0.7538 0.7563 0.7607 0.7686 0.7791 0.7872 0.7935 0.7979 0.8021 0.8058 0.8090 0.8143 0.8259 +const double ColorTemp::JDC468_GreN7_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0112, 0.0102, 0.0094, 0.0096, 0.0099, 0.0100, 0.0100, 0.0100, 0.0100, 0.0099, 0.0099, 0.0099, 0.0099, 0.0099, 0.0099, 0.0100, 0.0100, 0.0103, 0.0107, 0.0129, 0.0151, 0.0312, 0.0462, 0.1015, 0.1571, 0.2270, 0.2977, + 0.3558, 0.3441, 0.3321, 0.3020, 0.2710, 0.2312, 0.1954, 0.1602, 0.1251, 0.1003, 0.0794, 0.0672, 0.0563, 0.0513, 0.0452, 0.0418, 0.0378, 0.0356, 0.0337, 0.0336, 0.0335, 0.0345, 0.0358, 0.0383, 0.0405, 0.0445, 0.0497, + 0.0612, 0.0647, 0.0670, 0.0660, 0.0644, 0.0620, 0.0574, 0.0525, 0.0483, 0.0460, 0.0436, 0.0484, 0.0532, 0.0690, 0.0870, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//n7 345 0.0112 0.0094 0.0099 0.0100 0.0100 0.0099 0.0099 0.0099 0.0100 0.0107 0.0151 0.0462 0.1571 0.2977 0.3558 0.3321 0.2710 0.1954 0.1251 0.0794 0.0563 0.0452 0.0378 0.0337 0.0335 0.0358 0.0405 0.0497 0.0612 0.0670 0.0644 0.0574 0.0483 0.0436 0.0532 0.0870 + +const double ColorTemp::JDC468_GreA10_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0958, 0.1010, 0.1090, 0.1172, 0.1352, 0.1954, 0.1957, 0.2178, 0.2402, 0.2477, 0.2553, 0.2594, 0.2622, 0.2667, 0.2707, 0.2760, 0.2805, 0.2913, 0.3023, 0.3376, 0.3715, 0.4345, 0.5030, 0.5702, 0.6376, 0.6724, 0.7072, + 0.7216, 0.7160, 0.7110, 0.6990, 0.6865, 0.6667, 0.6446, 0.6174, 0.5921, 0.5727, 0.5511, 0.5386, 0.5238, 0.5134, 0.5070, 0.4980, 0.4918, 0.4867, 0.4830, 0.4834, 0.4838, 0.4889, 0.4906, 0.4976, 0.5046, 0.5162, 0.5279, + 0.5519, 0.5589, 0.5649, 0.5645, 0.5639, 0.5576, 0.5552, 0.5480, 0.5407, 0.5377, 0.5326, 0.5387, 0.5498, 0.5732, 0.5966, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::JDC468_GreQ7_spect[97] = { //468 Q7 + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0149, 0.0139, 0.0133, 0.0128, 0.0123, 0.01185, 0.0114, 0.011, 0.0106, 0.01045, 0.0103, 0.0104, 0.0105, 0.01065, 0.0108, 0.0109, 0.0110, 0.0117, 0.0124, 0.0205, 0.0283, 0.071, 0.1122, 0.2051, + 0.3017, 0.385, 0.4690, 0.4880, 0.5069, 0.4811, 0.4561, 0.411, 0.3687, 0.3185, 0.2673, 0.2190, 0.1703, 0.1371, 0.1042, 0.086, 0.0695, 0.598, 0.0527, 0.0475, 0.04210, 0.039, 0.03600, 0.0357, 0.0355, 0.037, + 0.0381, 0.0405, 0.0438, 0.0499, 0.0555, 0.0635, 0.0708, 0.074, 0.0789, 0.077, 0.0751, 0.071, 0.0658, 0.059, 0.0530, 0.049, 0.0458, 0.052, 0.0570, 0.077, 0.0982, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//a10 Green 10 0.0958 0.1090 0.1352 0.1957 0.2402 0.2553 0.2622 0.2707 0.2805 0.3023 0.3715 0.5030 0.6376 0.7072 0.7216 0.7110 0.6865 0.6446 0.5921 0.5511 0.5238 0.5070 0.4918 0.4830 0.4838 0.4906 0.5046 0.5279 0.5519 0.5649 0.5639 0.5552 0.5407 0.5326 0.5498 0.5966 +const double ColorTemp::JDC468_GreK7_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0114, 0.0111, 0.0109, 0.0107, 0.0105, 0.0106, 0.0108, 0.0107, 0.0106, 0.0105, 0.0104, 0.0103, 0.0103, 0.0106, 0.0109, 0.0112, 0.0118, 0.0135, 0.0153, 0.0244, 0.0334, 0.0666, 0.0984, 0.1534, 0.2082, 0.2412, 0.2835, + 0.2959, 0.2843, 0.2735, 0.2516, 0.2305, 0.2012, 0.1728, 0.1435, 0.1156, 0.0964, 0.0772, 0.0671, 0.0570, 0.0518, 0.0468, 0.0436, 0.0397, 0.0380, 0.0354, 0.0354, 0.0355, 0.0367, 0.0380, 0.0402, 0.0426, 0.0481, 0.0523, + 0.0643, 0.0678, 0.0704, 0.0693, 0.0676, 0.0639, 0.0609, 0.0567, 0.0514, 0.0487, 0.0468, 0.0518, 0.0567, 0.0730, 0.0902, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//k7 Green 267 0.0114 0.0109 0.0105 0.0108 0.0106 0.0104 0.0103 0.0109 0.0118 0.0153 0.0334 0.0984 0.2082 0.2835 0.2959 0.2735 0.2305 0.1728 0.1156 0.0772 0.0570 0.0468 0.0397 0.0354 0.0355 0.0380 0.0426 0.0523 0.0643 0.0704 0.0676 0.0609 0.0514 0.0468 0.0567 0.0902 + +const double ColorTemp::JDC468_PurE24_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0677, 0.901, 0.1043, 0.1298, 0.1534, 0.1913, 0.2297, 0.2553, 0.2756, 0.2789, 0.2620, 0.2380, 0.2135, 0.1837, 0.1536, 0.1312, 0.1068, 0.0867, 0.0663, 0.0517, 0.0368, 0.0309, 0.0247, 0.0214, 0.0186, 0.0151, 0.0116, + 0.0077, 0.0079, 0.0079, 0.0083, 0.0086, 0.0077, 0.0071, 0.0071, 0.0072, 0.0107, 0.0147, 0.0298, 0.0440, 0.0661, 0.0880, 0.1010, 0.1152, 0.1193, 0.1236, 0.1260, 0.1287, 0.1326, 0.1366, 0.1428, 0.1489, 0.1596, 0.1697, + 0.1936, 0.1996, 0.2057, 0.2036, 0.2015, 0.1954, 0.1890, 0.1798, 0.1706, 0.1651, 0.1603, 0.1692, 0.1788, 0.2075, 0.2363, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//E24 Pur 128 0.0677 0.1043 0.1534 0.2297 0.2756 0.2620 0.2135 0.1536 0.1068 0.0663 0.0368 0.0247 0.0186 0.0116 0.0077 0.0079 0.0086 0.0071 0.0072 0.0147 0.0440 0.0880 0.1152 0.1236 0.1287 0.1366 0.1489 0.1697 0.1936 0.2057 0.2015 0.1890 0.1706 0.1603 0.1788 0.2363 + //spectral data 468 color : Blue H10 - Gamut > WidegamutRGB const double ColorTemp::JDC468_BluH10_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.01590, 0.028, 0.03970, 0.0697, 0.09970, 0.1526, 0.20550, 0.253, 0.30110, 0.3412, 0.38180, 0.423, 0.46610, 0.4683, 0.51030, 0.4999, 0.49950, 0.4785, 0.45810, 0.429, 0.39950, 0.374, 0.35010, 0.3135, 0.29630, + 0.01590, 0.028, 0.03970, 0.0697, 0.09970, 0.1526, 0.20550, 0.253, 0.30110, 0.3412, 0.38180, 0.423, 0.46610, 0.4683, 0.51030, 0.5005, 0.49950, 0.4785, 0.45810, 0.429, 0.39950, 0.374, 0.35010, 0.3135, 0.29630, 0.2587, 0.22070, 0.182, 0.14450, 0.1125, 0.09060, 0.072, 0.04810, 0.033, 0.01740, 0.0113, 0.00520, 0.004, 0.00290, 0.0028, 0.00270, 0.0027, 0.00270, 0.0027, 0.00280, 0.0027, 0.00270, 0.0028, 0.00280, - 0.0029, 0.00300, 0.0029, 0.00290, 0.0029, 0.0029, 0.00290, 0.0029, 0.00290, 0.0029, 0.00290, 0.0029, 0.00290, 0.0029, 0.00290, 0.0029, 0.0031, 0.00320, 0.0035, 0.00380, 0.047, 0.00560, + 0.0029, 0.00300, 0.0029, 0.00290, 0.0029, 0.0029, 0.00290, 0.0029, 0.00290, 0.0029, 0.00290, 0.0029, 0.00290, 0.0029, 0.00290, 0.0029, 0.0031, 0.00320, 0.0035, 0.00380, 0.0047, 0.00560, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +//0.0159, 0.028, 0.0397, 0.0697, 0.0997, 0.1526, 0.2055, 0.253, 0.3011, 0.3412, 0.3818, 0.423, 0.4661, 0.5103 0.4995 0.4581 0.3995 0.3501 0.2963 +//0.2207 0.1445 0.0906 0.0481 0.0174 0.0052 0.0029 0.0027 0.0027 0.0028 0.0027 0.0028 0.0030 0.0029 0.0029 0.0029 0.0029 0.0029 0.0029 +//0.0029 0.0032 0.0038 0.0056 + +const double ColorTemp::JDC468_BluD6_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1127, 0.143, 0.1773, 0.223, 0.2813, 0.3987, 0.4782, 0.5665, 0.6470, 0.6870, 0.7270, 0.7403, 0.7593, 0.7592, 0.7591, 0.7480, 0.7402, 0.7234, 0.7054, 0.6876, 0.6617, 0.6512, 0.6302, 0.6124, 0.5962, 0.5660, + 0.5352, 0.5009, 0.4655, 0.4356, 0.4191, 0.3923, 0.3619, 0.3145, 0.2653, 0.2245, 0.1744, 0.1499, 0.1255, 0.1124, 0.1014, 0.0972, 0.0855, 0.0786, 0.0715, 0.0659, 0.0626, 0.0625, 0.0624, 0.0645, 0.0670, 0.0714, + 0.0769, 0.0865, 0.0964, 0.1086, 0.1200, 0.123, 0.1327, 0.1309, 0.1281, 0.1214, 0.1146, 0.1023, 0.0950, 0.0901, 0.0839, 0.0918, 0.1009, 0.1260, 0.1597, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + + +}; +//d6 blue 84 0.1127 0.1773 0.2813 0.4782 0.6470 0.7270 0.7593 0.7591 0.7402 0.7054 0.6617 0.6302 0.5962 0.5352 0.4655 0.4191 0.3619 0.2653 0.1744 0.1255 0.1014 0.0855 0.0715 0.0626 0.0624 0.0670 0.0769 0.0964 0.1200 0.1327 0.1281 0.1146 0.0950 0.0839 0.1009 0.1597 +const double ColorTemp::JDC468_BluF4_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0180, 0.0270, 0.0324, 0.0453, 0.0611, 0.0845, 0.1066, 0.1234, 0.1446, 0.1567, 0.1718, 0.1867, 0.1954, 0.2024, 0.2083, 0.2090, 0.2096, 0.2060, 0.2036, 0.1990, 0.1947, 0.1920, 0.1901, 0.1856, 0.1794, 0.1667, 0.1516, 0.1321, + 0.1167, 0.1032, 0.0876, 0.0730, 0.0584, 0.0445, 0.0296, 0.0212, 0.0125, 0.0099, 0.0069, 0.0060, 0.0053, 0.0050, 0.0049, 0.0047, 0.0046, 0.0045, 0.0044, 0.0043, 0.0043, 0.0043, 0.0043, 0.0046, 0.0049, 0.0050, 0.0052, 0.0057, + 0.0063, 0.0066, 0.0069, 0.0067, 0.0066, 0.0063, 0.0059, 0.0056, 0.0053, 0.0054, 0.0055, 0.0062, 0.0069, 0.0099, 0.0122, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + +}; + +// f4 blue 134 0.0180 0.0324 0.0611 0.1066 0.1446 0.1718 0.1954 0.2083 0.2096 0.2036 0.1947 0.1901 0.1794 0.1516 0.1167 0.0876 0.0584 0.0296 0.0125 0.0069 0.0053 0.0049 0.0046 0.0044 0.0043 0.0043 0.0049 0.0052 0.0063 0.0069 0.0066 0.0059 0.0053 0.0055 0.0069 0.0122 +const double ColorTemp::JDC468_GreI8_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0230, 0.0232, 0.0234, 0.0254, 0.0263, 0.0298, 0.0329, 0.0367, 0.0377, 0.0388, 0.0399, 0.0410, 0.0421, 0.0440, 0.0460, 0.0481, 0.0496, 0.0523, 0.0559, 0.0645, 0.0727, 0.0878, 0.1020, 0.1156, 0.1288, 0.1334, 0.1394, 0.1398, + 0.1402, 0.1407, 0.1413, 0.1409, 0.1396, 0.1334, 0.1276, 0.1200, 0.1129, 0.1095, 0.1064, 0.1053, 0.1043, 0.1031, 0.1021, 0.1001, 0.0980, 0.0970, 0.0952, 0.0963, 0.0967, 0.0990, 0.1009, 0.1042, 0.1078, 0.1130, 0.1188, 0.1251, + 0.1307, 0.1335, 0.1374, 0.1376, 0.1378, 0.1362, 0.1345, 0.1312, 0.1278, 0.1257, 0.1240, 0.1290, 0.1345, 0.1476, 0.1615, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + +}; + +// i8 green215 215 0.0230 0.0234 0.0263 0.0329 0.0377 0.0399 0.0421 0.0460 0.0496 0.0559 0.0727 0.1020 0.1288 0.1394 0.1402 0.1413 0.1396 0.1276 0.1129 0.1064 0.1043 0.1021 0.0980 0.0952 0.0967 0.1009 0.1078 0.1188 0.1307 0.1374 0.1378 0.1345 0.1278 0.1240 0.1345 0.1615 + +const double ColorTemp::JDC468_OraO18_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0826, 0.0830, 0.0832, 0.0861, 0.0892, 0.0993, 0.1108, 0.1180, 0.1248, 0.1253, 0.1263, 0.1261, 0.1259, 0.1267, 0.1289, 0.1304, 0.1319, 0.1370, 0.1419, 0.1631, 0.1851, 0.2311, 0.2743, 0.3131, 0.3536, 0.3551, 0.3585, 0.3488, 0.3322, + 0.3470, 0.3575, 0.3680, 0.3498, 0.3316, 0.3224, 0.3129, 0.3578, 0.4013, 0.4734, 0.5454, 0.5978, 0.6502, 0.6745, 0.6982, 0.7080, 0.7182, 0.7273, 0.7269, 0.7308, 0.7342, 0.7393, 0.7436, 0.7498, 0.7550, 0.7597, 0.7640, 0.7680, 0.7713, + 0.7766, 0.7786, 0.7816, 0.7841, 0.7863, 0.7889, 0.7902, 0.7931, 0.7957, 0.7997, 0.8068, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + +}; +// o18 ora 382 382 0.0826 0.0832 0.0892 0.1108 0.1248 0.1263 0.1259 0.1289 0.1319 0.1419 0.1851 0.2743 0.3536 0.3585 0.3322 0.3470 0.3680 0.3316 0.3129 0.4013 0.5454 0.6502 0.6982 0.7182 0.7269 0.7342 0.7436 0.7550 0.7640 0.7713 0.7766 0.7816 0.7863 0.7902 0.7957 0.8068 +const double ColorTemp::JDC468_OraD17_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0462, 0.0442, 0.0422, 0.0401, 0.0383, 0.0390, 0.0396, 0.0396, 0.0395, 0.0388, 0.0380, 0.0378, 0.0376, 0.0381, 0.0384, 0.0391, 0.0399, 0.0421, 0.0451, 0.0561, 0.0676, 0.0934, 0.1189, 0.1432, 0.1671, 0.1650, 0.1632, 0.1512, 0.1402, 0.1456, + 0.1521, 0.1613, 0.1696, 0.1552, 0.1409, 0.1342, 0.1283, 0.1689, 0.2084, 0.2845, 0.3575, 0.4183, 0.4797, 0.5090, 0.5389, 0.5498, 0.5617, 0.5667, 0.5728, 0.5788, 0.5822, 0.5889, 0.5938, 0.6011, 0.6081, 0.6145, 0.6212, 0.6267, 0.6304, 0.6331, + 0.6352, 0.6361, 0.6373, 0.6372, 0.6370, 0.6376, 0.6384, 0.6413, 0.6483, 0.6523, 0.6668, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + +}; + +// d17 ora 95 95 0.0462 0.0422 0.0383 0.0396 0.0395 0.0380 0.0376 0.0384 0.0399 0.0451 0.0676 0.1189 0.1671 0.1632 0.1402 0.1521 0.1696 0.1409 0.1283 0.2084 0.3575 0.4797 0.5389 0.5617 0.5728 0.5822 0.5938 0.6081 0.6212 0.6304 0.6352 0.6373 0.6370 0.6384 0.6483 0.6668 //spectral data ColorLab : Skin 35 15 17 const double ColorTemp::ColabSkin35_15_17_spect[97] = { @@ -825,6 +1599,817 @@ const double ColorTemp::ColabSky42_0_m24_spect[97] = { 0.0979, 0.112, 0.1269, 0.134, 0.1430, 0.147, 0.1497, 0.151, 0.1529, 0.1545, 0.1561, 0.158, 0.1603, 0.1616, 0.1627, 0.1625, 0.1623, 0.1614, 0.1605, 0.159, 0.1575, 0.1567, 0.1557, 0.1563, 0.1569, 0.159, 0.1627, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +//spectral data ColorLab : blue 77 -44 -50 + +const double ColorTemp::Colorblue_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0316, 0.0480, 0.0658, 0.0925, 0.1199, 0.1812, 0.2424, 0.2770, 0.3145, 0.3430, 0.3702, 0.4022, 0.4346, 0.4560, 0.4778, 0.4843, 0.4902, 0.4940, 0.4960, 0.4920, 0.4889, 0.4820, + 0.4764, 0.4685, 0.4606, 0.4486, 0.4379, 0.4160, 0.3955, 0.3640, 0.3330, 0.2990, 0.2660, 0.2291, 0.1991, 0.1705, 0.1403, 0.1220, 0.1067, 0.0967, 0.0907, 0.0846, 0.0785, 0.0698, + 0.0601, 0.0525, 0.0455, 0.0423, 0.0386, 0.0370, 0.0358, 0.0354, 0.0351, 0.0368, 0.0382, 0.0413, 0.0449, 0.0474, 0.0492, 0.0484, 0.0477, 0.0460, 0.0437, 0.0402, 0.0371, 0.0349, + 0.0329, 0.0341, 0.0356, 0.0410, 0.0462, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + +}; +//0.1571 0.2150 0.3040 0.3684 0.3952 0.3965 0.3782 0.3418 0.2995 0.2543 0.2043 0.1686 0.1420 0.1070 0.0785 0.0725 0.0755 0.0695 0.0680 0.0914 0.1379 0.1833 0.2038 0.2065 0.2079 0.2110 0.2176 0.2319 0.2518 0.2632 0.2616 0.2522 0.2380 0.2290 0.2432 0.2901 + +const double ColorTemp::ColorViolA1_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1571, 0.185, 0.2150, 0.255, 0.3040, 0.332, 0.3684, 0.381, 0.3952, 0.3956, 0.3965, 0.387, 0.3782, 0.362, 0.3418, 0.322, 0.2995, 0.275, 0.2543, 0.229, 0.2043, 0.185, 0.1686, + 0.155, 0.1420, 0.131, 0.1070, 0.093, 0.0785, 0.075, 0.0725, 0.074, 0.0755, 0.072, 0.0695, 0.069, 0.0680, 0.083, 0.0914, 0.115, 0.1379, 0.162, 0.1833, 0.193, 0.2038, 0.205, + 0.2065, 0.207, 0.2079, 0.209, 0.2110, 0.214, 0.2176, 0.226, 0.2319, 0.242, 0.2518, 0.258, 0.2632, 0.263, 0.2616, 0.256, 0.2522, 0.246, 0.2380, 0.233, 0.2290, 0.235, 0.2432, 0.265, 0.2901, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//0.2270 0.2413 0.3287 0.4079 0.4469 0.4594 0.4535 0.4268 0.3886 0.3427 0.2866 0.2433 0.2087 0.1604 0.1181 0.1069 0.1098 0.0985 0.0916 0.1130 0.1496 0.1746 0.1783 0.1742 0.1738 0.1763 0.1831 0.1975 0.2169 0.2274 0.2247 0.2140 0.1990 0.1897 0.2039 0.2508 + +const double ColorTemp::ColorViolA4_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2270, 0231, 0.2413, 0.286, 0.3287, 0.367, 0.4079, 0.427, 0.4469, 0.452, 0.4594, 0.456, 0.4535, 0.432, 0.4268, 0.403, 0.3886, 0.368, 0.3427, 0.314, 0.2866, 0.265, 0.2433, 0.222, + 0.2087, 0.183, 0.1604, 0.130, 0.1181, 0.112, 0.1069, 0.108, 0.1098, 0.103, 0.0985, 0.094, 0.0916, 0.104, 0.1130, 0.131, 0.1496, 0.152, 0.1746, 0.176, 0.1783, 0.176, 0.1742, 0.174, + 0.1738, 0.175, 0.1763, 0.181, 0.1831, 0.192, 0.1975, 0.206, 0.2169, 0.222, 0.2274, 0.226, 0.2247, 0.219, 0.2140, 0.206, 0.1990, 0.195, 0.1897, 0.196, 0.2039, 0.221, 0.2508, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//0.1426 0.2660 0.3556 0.4259 0.4459 0.4317 0.3942 0.3425 0.2917 0.2413 0.1885 0.1524 0.1267 0.0948 0.0700 0.0661 0.0708 0.0671 0.0699 0.1092 0.2099 0.3582 0.4857 0.5583 0.5950 0.6146 0.6307 0.6495 0.6720 0.6825 0.6809 0.6718 0.6593 0.6517 0.6649 0.7066 +const double ColorTemp::ColorViolA6_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1426, 0.203, 0.2660, 0.315, 0.3556, 0.392, 0.4259, 0.435, 0.4459, 0.437, 0.4317, 0.417, 0.3942, 0.365, 0.3425, 0.317, 0.2917, 0.266, 0.2413, 0.218, 0.1885, 0.172, 0.1524, 0.141, + 0.1267, 0.112, 0.0948, 0.083, 0.0700, 0.068, 0.0661, 0.068, 0.0708, 0.069, 0.0671, 0.068, 0.0699, 0.900, 0.1092, 0.159, 0.2099, 0.284, 0.3582, 0.441, 0.4857, 0.525, 0.5583, 0.567, + 0.5950, 0.605, 0.6146, 0.623, 0.6307, 0.638, 0.6495, 0.661, 0.6720, 0.679, 0.6825, 0.681, 0.6809, 0.675, 0.6718, 0.667, 0.6593, 0.655, 0.6517, 0.658, 0.6649, 0.681, 0.7066, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//0.4939 0.3859 0.4198 0.4780 0.5328 0.5672 0.5880 0.5994 0.6029 0.5981 0.5808 0.5618 0.5369 0.4819 0.4190 0.3921 0.3815 0.3400 0.2991 0.2977 0.3090 0.3088 0.2930 0.2753 0.2660 0.2636 0.2678 0.2811 0.2995 0.3125 0.3153 0.3111 0.3006 0.2952 0.3116 0.3584 +const double ColorTemp::ColorBlueSkyK3_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.4939, 0.435, 0.3859, 0.403, 0.4198, 0.446, 0.4780, 0.505, 0.5328, 0.552, 0.5672, 0.578, 0.5880, 0.595, 0.5994, 0.602, 0.6029, 0.600, 0.5981, 0.588, 0.5808, 0.571, 0.5618, 0.551, + 0.5369, 0.503, 0.4819, 0.452, 0.4190, 0.404, 0.3921, 0.386, 0.3815, 0.364, 0.3400, 0.321, 0.2991, 0.298, 0.2977, 0.304, 0.3090, 0.309, 0.3088, 0.302, 0.2930, 0.284, 0.2753, 0.271, + 0.2660, 0.265, 0.2636, 0.266, 0.2678, 0.275, 0.2811, 0.290, 0.2995, 0.306, 0.3125, 0.314, 0.3153, 0.313, 0.3111, 0.307, 0.3006, 0.298, .2952, 0.306, 0.3116, 0.325, 0.3584, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//0.4058 0.4734 0.5372 0.6051 0.6698 0.6992 0.7118 0.7135 0.7071 0.6938 0.6702 0.6511 0.6282 0.5732 0.5103 0.4913 0.4926 0.4604 0.4341 0.4648 0.5111 0.5335 0.5283 0.5154 0.5098 0.5093 0.5151 0.5309 0.5520 0.5642 0.5657 0.5598 0.5489 0.5430 0.5601 0.6067 + +const double ColorTemp::ColorBlueSkyK9_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.4058, 0.441, 0.4734, 0.502, 0.5372, 0.585, 0.6051, 0.643, 0.6698, 0.685, 0.6992, 0.705, 0.7118, 0.712, 0.7135, 0.711, 0.7071, 0.702, 0.6938, 0.681, 0.6702, 0.663, 0.6511, 0.642, + 0.6282, 0.604, 0.5732, 0.542, 0.5103, 0.499, 0.4913, 0.492, 0.4926, 0.475, 0.4604, 0.452, 0.4341, 0.453, 0.4648, 0.496, 0.5111, 0.525, 0.5335, 0.531, 0.5283, 0.522, 0.5154, 0.512, + 0.5098, 0.509, 0.5093, 0.513, 0.5151, 0.523, 0.5309, 0.544, 0.5520, 0.562, 0.5642, 0.565, 0.5657, 0.562, 0.5598, 0.554, 0.5489, 0.546, 0.5430, 0.553, 0.5601, 0.576, 0.6067, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//42 C4 0.3280 0.2611 0.3781 0.4646 0.5292 0.5732 0.6112 0.6307 0.6310 0.6181 0.5847 0.5488 0.5066 0.4358 0.3585 0.3151 0.2855 0.2309 0.1786 0.1546 0.1443 0.1359 0.1245 0.1151 0.1120 0.1127 0.1169 0.1275 0.1421 0.1504 0.1488 0.1416 0.1303 0.1241 0.1355 0.1739 +const double ColorTemp::ColorBlueSkyC4_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3280, 0.2950, 0.2611, 0.304, 0.3781, 0.423, 0.4646, 0.498, 0.5292, 0.555, 0.5732, 0.591, 0.6112, 0.6221, 0.6307, 0.631, 0.6310, 0.625, 0.6181, 0.607, 0.5847, 0.563, 0.5488, 0.524, + 0.5066, 0.465, 0.4358, 0.398, 0.3585, 0.336, 0.3151, 0.302, 0.2855, 0.254, 0.2309, 0.203, 0.1786, 0.166, 0.1546, 0.149, 0.1443, 0.143, 0.1359, 0.131, 0.1245, 0.123, 0.115, 0.114, + 0.1120, 0.112, 0.1127, 0.114, 0.1169, 0.122, 0.1275, 0.133, 0.1421, 0.147, 0.1504, 0.149, 0.1488, 0.145, 0.1416, 0.136, 0.1303, 0.127, 0.1241, 0.132, 0.1355, 0.155, 0.1739, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//52 C14 0.5697 0.4660 0.5000 0.5560 0.6072 0.6402 0.6632 0.6850 0.7069 0.7292 0.7488 0.7678 0.7786 0.7721 0.7544 0.7394 0.7232 0.6889 0.6446 0.6171 0.5966 0.5743 0.5425 0.5093 0.4884 0.4784 0.4774 0.4822 0.4944 0.5076 0.5186 0.5268 0.5303 0.5332 0.5454 0.5760 +const double ColorTemp::ColorBlueSkyC14_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.5697, 0.511, 0.4660, 0.481, 0.5000, 0.528, 0.5560, 0.583, 0.6072, 0.622, 0.6402, 0.653, 0.6632, 0.674, 0.6850, 0.699, 0.7069, 0.717, 0.7292, 0.735, 0.7488, 0.757, 0.7678, 0.773, + 0.7786, 0.776, 0.7721, 0.765, 0.7544, 0.746, 0.7394, 0.731, 0.7232, 0.704, 0.6889, 0.674, 0.6446, 0.631, 0.6171, 0.606, 0.5966, 0.585, 0.5743, 0.5570, 0.5425, 0.529, 0.5093, 0.498, + 0.4884, 0.482, 0.4784, 0.478, 0.4774, 0.481, 0.4822, 0.487, 0.4944, 0.503, 0.5076, 0.512, 0.5186, 0.522, 0.5268, 0.529, 0.5303, 0.532, 0.5332, 0.539, 0.5454, 0.565, 0.5760, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//80 E4 0.1483 0.1756 0.2536 0.3084 0.3665 0.4189 0.4746 0.5127 0.5239 0.5193 0.4917 0.4569 0.4123 0.3422 0.2672 0.2179 0.1820 0.1356 0.0972 0.0784 0.0698 0.0646 0.0592 0.0556 0.0546 0.0551 0.0571 0.0611 0.0670 0.0701 0.0692 0.0661 0.0620 0.0606 0.0663 0.0834 +const double ColorTemp::ColorBlueSkyE4_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1483, 0.161, 0.1756, 0.213, 0.2536, 0.283, 0.3084, 0.331, 0.3665, 0.387, 0.4189, 0.445, 0.4746, 0.496, 0.5127, 0.519, 0.5239, 0.522, 0.5193, 0.508, 0.4917, 0.476, 0.4569, 0.431, + 0.4123, 0.375, 0.3422, 0.309, 0.2672, 0.242, 0.2179, 0.208, 0.1820, 0.162, 0.1356, 0.113, 0.0972, 0.091, 0.0784, 0.073, 0.0698, 0.066, 0.0646, 0.062, 0.0592, 0.057, 0.0556, 0.055, + 0.0546, 0.055, 0.0551, 0.056, 0.0571, 0.059, 0.0611, 0.064, 0.0670, 0.069, 0.0701, 0.070, 0.0692, 0.067, 0.0661, 0.065, 0.0620, 0.061, 0.0606, 0.063, 0.0663, 0.072, 0.0834, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//229 M1 0.3100 0.2922 0.3514 0.4042 0.4443 0.4769 0.5002 0.5133 0.5187 0.5179 0.5057 0.4928 0.4729 0.4235 0.3643 0.3371 0.3234 0.2827 0.2418 0.2338 0.2370 0.2329 0.2184 0.2028 0.1958 0.1937 0.1973 0.2084 0.2244 0.2351 0.2372 0.2331 0.2239 0.2178 0.2319 0.2731 +const double ColorTemp::ColorBlueSkyM1_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3100, 0.303, 0.2922, 0.322, 0.3514, 0.376, 0.4042, 0.424, 0.4443, 0.457, 0.4769, 0.497, 0.5002, 0.507, 0.5133, 0.516, 0.5187, 0.518, 0.5179, 0.511, 0.5057, 0.497, 0.4928, 0.483, + 0.4729, 0.454, 0.4235, 0.398, 0.3643, 0.346, 0.3371, 0.329, 0.3234, 0.301, 0.2827, 0.263, 0.2418, 0.235, 0.2338, 0.235, 0.2370, 0.236, 0.2329, 0.226, 0.2184, 0.213, 0.2028, 0.198, + 0.1958, 0.194, 0.1937, 0.196, 0.1973, 0.203, 0.2084, 0.212, 0.2244, 0.233, 0.2351, 0.236, 0.2372, 0.234, 0.2331, 0.229, 0.2239, 0.222, 0.2178, 0.224, 0.2319, 0.251, 0.2731, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//514 2B1 0.5277 0.4431 0.4972 0.5820 0.6387 0.6750 0.7001 0.7140 0.7202 0.7193 0.7053 0.6891 0.6657 0.6181 0.5614 0.5312 0.5101 0.4589 0.4045 0.3857 0.3826 0.3751 0.3574 0.3393 0.3314 0.3304 0.3368 0.3523 0.3742 0.3874 0.3883 0.3818 0.3693 0.3616 0.3800 0.4324 +const double ColorTemp::ColorBlueSky2B1_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.5277, 0.485, 0.4431, 0.476, 0.4972, 0.539, 0.5820, 0.607, 0.6387, 0.653, 0.6750, 0.691, 0.7001, 0.707, 0.7140, 0.718, 0.7202, 0.720, 0.7193, 0.713, 0.7053, 0.695, 0.6891, 0.674, + 0.6657, 0.632, 0.6181, 0.587, 0.5614, 0.543, 0.5312, 0.521, 0.5101, 0.483, 0.4589, 0.431, 0.4045, 0.398, 0.3857, 0.385, 0.3826, 0.376, 0.3751, 0.364, 0.3574, 0.346, 0.3393, 0.335, + 0.3314, 0.331, 0.3304, 0.333, 0.3368, 0.346, 0.3523, 0.363, 0.3742, 0.382, 0.3874, 0.385, 0.3883, 0.384, 0.3818, 0.375, 0.3693, 0.364, 0.3616, 0.374, 0.3800, 0.396, 0.4324, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//368 T7 0.1943 0.3199 0.4536 0.5443 0.6043 0.6499 0.6839 0.7125 0.7329 0.7482 0.7527 0.7514 0.7383 0.7028 0.6526 0.6034 0.5500 0.4708 0.3848 0.3268 0.2929 0.2712 0.2493 0.2316 0.2243 0.2234 0.2288 0.2436 0.2640 0.2762 0.2767 0.2693 0.2566 0.2489 0.2665 0.3165 +const double ColorTemp::ColorBlueSkyT7_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1943, 0.256, 0.3199, 0.376, 0.4536, 0.494, 0.5443, 0.572, 0.6043, 0.631, 0.6499, 0.664, 0.6839, 0.698, 0.7125, 0.726, 0.7329, 0.741, 0.7482, 0.751, 0.7527, 0.752, 0.7514, 0.745, + 0.7383, 0.721, 0.7028, 0.675, 0.6526, 0.631, 0.6034, 0.589, 0.5500, 0.512, 0.4708, 0.432, 0.3848, 0.342, 0.3268, 0.311, 0.2929, 0.282, 0.2712, 0.261, 0.2493, 0.236, 0.2316, 0.227, + 0.2243, 0.223, 0.2234, 0.229, 0.2288, 0.235, 0.2436, 0.255, 0.2640, 0.268, 0.2762, 0.277, 0.2767, 0.272, 0.2693, 0.263, 0.2566, 0.254, 0.2489, 0.255, 0.2665, 0.275, 0.3165, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + +//399 U19 0.5829 0.4865 0.4927 0.5690 0.6221 0.6532 0.6728 0.6832 0.6889 0.6884 0.6771 0.6648 0.6465 0.6038 0.5524 0.5297 0.5194 0.4797 0.4387 0.4356 0.4455 0.4444 0.4282 0.4094 0.4009 0.3992 0.4046 0.4185 0.4385 0.4515 0.4545 0.4505 0.4411 0.4368 0.4539 0.5013 +const double ColorTemp::ColorBlueSkyU19_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.5829, 0.534, 0.4865, 0.489, 0.4927, 0.532, 0.5690, 0.593, 0.6221, 0.641, 0.6532, 0.662, 0.6728, 0.674, 0.6832, 0.687, 0.6889, 0.688, 0.6884, 0.683, 0.6771, 0.671, 0.6648, 0.665, + 0.6465, 0.622, 0.6038, 0.583, 0.5524, 0.542, 0.5297, 0.523, 0.5194, 0.492, 0.4797, 0.451, 0.4387, 0.436, 0.4356, 0.442, 0.4455, 0.445, 0.4444, 0.432, 0.4282, 0.413, 0.4094, 0.404, + 0.4009, 0.400, 0.3992, 0.402, 0.4046, 0.411, 0.4185, 0.426, 0.4385, 0.446, 0.4515, 0.452, 0.4545, 0.452, 0.4505, 0.446, 0.4411, 0.438, 0.4368, 0.443, 0.4539, 0.467, 0.5013, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//382 U2 0.3594 0.3425 0.3214 0.3654 0.4097 0.4360 0.4590 0.4793 0.5002 0.5234 0.5476 0.5745 0.5940 0.5901 0.5703 0.5545 0.5384 0.5029 0.4592 0.4334 0.4149 0.3947 0.3657 0.3363 0.3177 0.3087 0.3077 0.3123 0.3231 0.3351 0.3454 0.3520 0.3545 0.3562 0.3674 0.3976 +const double ColorTemp::ColorBlueSkyU2_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3594, 0.345, 0.3425, 0.333, 0.3214, 0.346, 0.3654, 0.387, 0.4097, 0.424, 0.4360, 0.446, 0.4590, 0.467, 0.4793, 0.494, 0.5002, 0.517, 0.5234, 0.538, 0.5476, 0.564, 0.5745, 0.583, + 0.5940, 0.593, 0.5901, 0.580, 0.5703, 0.563, 0.5545, 0.546, 0.5384, 0.521, 0.5029, 0.478, 0.4592, 0.444, 0.4334, 0.421, 0.4149, 0.408, 0.3947, 0.378, 0.3657, 0.352, 0.3363, 0.324, + 0.3177, 0.313, 0.3087, 0.308, 0.3077, 0.310, 0.3123, 0.317, 0.3231, 0.329, 0.3351, 0.339, 0.3454, 0.348, 0.3520, 0.353, 0.3545, 0.355, 0.3562, 0.359, 0.3674, 0.375, 0.3976, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + +//378 T17 0.4213 0.3332 0.4205 0.5078 0.5650 0.6025 0.6223 0.6279 0.6195 0.5981 0.5578 0.5197 0.4785 0.4074 0.3325 0.3030 0.2918 0.2511 0.2125 0.2105 0.2198 0.2199 0.2083 0.1945 0.1895 0.1898 0.1954 0.2094 0.2288 0.2406 0.2399 0.2317 0.2189 0.2108 0.2261 0.2755 +const double ColorTemp::ColorBlueSkyT17_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.4213, 0.376, 0.3332, 0.387, 0.4205, 0.467, 0.5078, 0.532, 0.5650, 0.587, 0.6025, 0.611, 0.6223, 0.624, 0.6279, 0.623, 0.6195, 0.607, 0.5981, 0.576, 0.5578, 0.534, 0.5197, 0.499, + 0.4785, 0.435, 0.4074, 0.376, 0.3325, 0.317, 0.3030, 0.295, 0.2918, 0.272, 0.2511, 0.235, 0.2125, 0.212, 0.2105, 0.214, 0.2198, 0.219, 0.2199, 0.215, 0.2083, 0.202, 0.1945, 0.191, + 0.1895, 0.189, 0.1898, 0.193, 0.1954, 0.202, 0.2094, 0.215, 0.2288, 0.236, 0.2406, 0.240, 0.2399, 0.236, 0.2317, 0.225, 0.2189, 0.214, 0.2108, 0.218, 0.2261, 0.245, 0.2755, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//236 M8 -0.0593 0.0128 0.0031 0.0149 0.0197 0.0221 0.0223 0.0230 0.0232 0.0237 0.0243 0.0247 0.0249 0.0249 0.0248 0.0247 0.0244 0.0240 0.0240 0.0242 0.0244 0.0247 0.0252 0.0254 0.0262 0.0269 0.0271 0.0273 0.0278 0.0280 0.0276 0.0275 0.0282 0.0288 0.0295 0.0303 +const double ColorTemp::ColorBlackM8_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0593, 0.040, 0.0128, 0.023, 0.0031, 0.024, 0.0149, 0.017, 0.0197, 0.021, 0.0221, 0.022, 0.0223, 0.023, 0.0230, 0.023, 0.0232, 0.023, 0.0237, 0.024, 0.0243, 0.024, 0.0247, 0.024, + 0.0249, 0.025, 0.0249, 0.025, 0.0248, 0.025, 0.0247, 0.024, 0.0244, 0.024, 0.0240, 0.024, 0.0240, 0.024, 0.0242, 0.024, 0.0244, 0.024, 0.0247, 0.025, 0.0252, 0.025, 0.0254, 0.026, + 0.0262, 0.027, 0.0269, 0.027, 0.0271, 0.027, 0.0273, 0.027, 0.0278, 0.028, 0.0280, 0.028, 0.0276, 0.028, 0.0275, 0.028, 0.0282, 0.028, 0.0288, 0.029, 0.0295, 0.030, 0.0303, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//240 M12 -0.0377 0.0146 0.0167 0.0222 0.0257 0.0261 0.0270 0.0271 0.0274 0.0281 0.0287 0.0299 0.0306 0.0304 0.0297 0.0285 0.0277 0.0267 0.0257 0.0257 0.0258 0.0259 0.0263 0.0276 0.0279 0.0288 0.0297 0.0302 0.0304 0.0303 0.0302 0.0303 0.0310 0.0321 0.0337 0.0356 +const double ColorTemp::ColorBlackM12_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0377, 0.022, 0.0146, 0.015, 0.0167, 0.020, 0.0222, 0.023, 0.0257, 0.026, 0.0261, 0.027, 0.0270, 0.027, 0.0271, 0.027, 0.0274, 0.028, 0.0281, 0.028, 0.0287, 0.029, 0.0299, 0.030, + 0.0306, 0.030, 0.0304, 0.030, 0.0297, 0.029, 0.0285, 0.028, 0.0277, 0.027, 0.0267, 0.026, 0.0257, 0.026, 0.0257, 0.026, 0.0258, 0.026, 0.0259, 0.026, 0.0263, 0.027, 0.0276, 0.028, + 0.0279, 0.028, 0.0288, 0.029, 0.0297, 0.030, 0.0302, 0.030, 0.0304, 0.030, 0.0303, 0.030, 0.0302, 0.030, 0.0303, 0.031, 0.0310, 0.031, 0.0321, 0.033, 0.0337, 0.035, 0.0356, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//241 M13 0.2961 0.0487 0.0261 0.0330 0.0296 0.0305 0.0305 0.0314 0.0320 0.0322 0.0335 0.0348 0.0352 0.0347 0.0336 0.0325 0.0314 0.0299 0.0284 0.0284 0.0286 0.0288 0.0290 0.0299 0.0306 0.0314 0.0320 0.0328 0.0332 0.0331 0.0330 0.0328 0.0337 0.0350 0.0366 0.0385 +const double ColorTemp::ColorBlackM13_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2961, 0.100, 0.0487, 0.035, 0.0261, 0.030, 0.0330, 0.031, 0.0296, 0.030, 0.0305, 0.030, 0.0305, 0.031, 0.0314, 0.032, 0.0320, 0.032, 0.0322, 0.033, 0.0335, 0.034, 0.0348, 0.035, + 0.0352, 0.035, 0.0347, 0.034, 0.0336, 0.033, 0.0325, 0.032, 0.0314, 0.030, 0.0299, 0.029, 0.0284, 0.028, 0.0284, 0.029, 0.0286, 0.029, 0.0288, 0.029, 0.0290, 0.030, 0.0299, 0.030, + 0.0306, 0.031, 0.0314, 0.032, 0.0320, 0.032, 0.0328, 0.033, 0.0332, 0.033, 0.0331, 0.033, 0.0330, 0.033, 0.0328, 0.033, 0.0337, 0.034, 0.0350, 0.036, 0.0366, 0.037, 0.0385, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//525 2B12 0.3848 0.4127 0.4780 0.5375 0.5917 0.6194 0.6353 0.6485 0.6625 0.6784 0.7010 0.7367 0.7706 0.7847 0.7843 0.7826 0.7799 0.7689 0.7521 0.7463 0.7401 0.7314 0.7168 0.7008 0.6904 0.6860 0.6861 0.6896 0.6986 0.7064 0.7138 0.7185 0.7233 0.7281 0.7338 0.7498 +const double ColorTemp::ColorWhite2B12_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3848, 0.405, 0.4127, 0.435, 0.4780, 0.501, 0.5375, 0.572, 0.5917, 0.606, 0.6194, 0.627, 0.6353, 0.642, 0.6485, 0.653, 0.6625, 0.669, 0.6784, 0.692, 0.7010, 0.072, 0.7367, 0.0760, + 0.7706, 0.775, 0.7847, 0.784, 0.7843, 0.784, 0.7826, 0.781, 0.7799, 0.775, 0.7689, 0.762, 0.7521, 0.748, 0.7463, 0.743, 0.7401, 0.731, 0.7314, 0.723, 0.7168, 0.705, 0.7008, 0.701, + 0.6904, 0.689, 0.6860, 0.686, 0.6861, 0.687, 0.6896, 0.691, 0.6986, 0.701, 0.7064, 0.711, 0.7138, 0.715, 0.7185, 0.721, 0.7233, 0.725, 0.7281, 0.731, 0.7338, 0.741, 0.7498, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//527 2B14 0.6608 0.5900 0.6114 0.6747 0.7329 0.7599 0.7706 0.7776 0.7831 0.7890 0.7952 0.8074 0.8185 0.8214 0.8201 0.8218 0.8244 0.8229 0.8192 0.8281 0.8344 0.8388 0.8415 0.8445 0.8495 0.8521 0.8556 0.8604 0.8666 0.8687 0.8687 0.8672 0.8682 0.8703 0.8720 0.8803 +const double ColorTemp::ColorWhite2B14_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.6608, 0.631, 0.5900, 0.605, 0.6114, 0.634, 0.6747, 0.698, 0.7329, 0.745, 0.7599, 0.765, 0.7706, 0.775, 0.7776, 0.781, 0.7831, 0.786, 0.7890, 0.792, 0.7952, 0.797, 0.8074, 0.810, + 0.8185, 0.821, 0.8214, 0.821, 0.8201, 0.821, 0.8218, 0.822, 0.8244, 0.823, 0.8229, 0.822, 0.8192, 0.824, 0.8281, 0.831, 0.8344, 0.836, 0.8388, 0.840, 0.8415, 0.843, 0.8445, 0.847, + 0.8495, 0.851, 0.8521, 0.853, 0.8556, 0.858, 0.8604, 0.863, 0.8666, 0.867, 0.8687, 0.869, 0.8687, 0.867, 0.8672, 0.868, 0.8682, 0.870, 0.8703, 0.871, 0.8720, 0.874, 0.8803, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//97 97 0.0031 0.0047 0.0056 0.0064 0.0070 0.0070 0.0071 0.0066 0.0065 0.0065 0.0064 0.0063 0.0063 0.0058 0.0052 0.0052 0.0053 0.0047 0.0044 0.0052 0.0066 0.0077 0.0081 0.0082 0.0084 0.0089 0.0096 0.0106 0.0121 0.0127 0.0128 0.0124 0.0115 0.0117 0.0133 0.0169 +const double ColorTemp::JDC468_Blackred97_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0031, 0.0035, 0.0047, 0.0050, 0.0056, 0.0060, 0.0064, 0.0065, 0.0070, 0.007, 0.0070, 0.007, 0.0071, 0.007, 0.0066, 0.007, 0.0065, 0.006, 0.0065, 0.006, 0.0064, 0.006, 0.0063, + 0.006, 0.0063, 0.006, 0.0058, 0.005, 0.0052, 0.005, 0.0052, 0.005, 0.0053, 0.005, 0.0047, 0.005, 0.0044, 0.005, 0.0052, 0.006, 0.0066, 0.007, 0.0077, 0.008, 0.0081, 0.008, 0.008, + 0.008, 0.0084, 0.009, 0.0089, 0.009, 0.0096, 0.01, 0.0106, 0.011, 0.0121, 0.012, 0.0127, 0.012, 0.0128, 0.012, 0.0124, 0.012, 0.0115, 0.012, 0.0117, 0.013, 0.0133, 0.015, 0.0169, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//443 443 0.0067 0.0068 0.0067 0.0074 0.0083 0.0088 0.0092 0.0093 0.0098 0.0099 0.0101 0.0106 0.0109 0.0104 0.0094 0.0086 0.0075 0.0058 0.0044 0.0039 0.0037 0.0038 0.0036 0.0035 0.0036 0.0033 0.0033 0.0036 0.0038 0.0042 0.0041 0.0036 0.0033 0.0035 0.0042 0.0062 +const double ColorTemp::JDC468_Blackredbl443_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0067, 0.0067, 0.0068, 0.0068, 0.0067, 0.0070, 0.0074, 0.008, 0.0083, 0.0085, 0.0088, 0.009, 0.0092, 0.0092, 0.0093, 0.0096, 0.0098, 0.0098, 0.0099, 0.01, 0.0101, 0.0104, 0.0106, + 0.0106, 0.0109, 0.0105, 0.0104, 0.01, 0.0094, 0.09, 0.0086, 0.08, 0.0075, 0.06, 0.0058, 0.05, 0.0044, 0.04, 0.0039, 0.0038, 0.0037, 0.0037, 0.0038, 0.0037, 0.0036, 0.0036, + 0.0035, 0.0036, 0.0036, 0.0034, 0.0033, 0.0033, 0.0033, 0.0035, 0.0036, 0.0037, 0.0038, 0.004, 0.0042, 0.004, 0.0041, 0.004, 0.0036, 0.0034, 0.0033, 0.0034, 0.0035, 0.004, 0.0042, 0.005, 0.0062, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//27 27 0.0060 0.0064 0.0070 0.0076 0.0086 0.0086 0.0088 0.0089 0.0089 0.0083 0.0079 0.0078 0.0077 0.0067 0.0059 0.0057 0.0056 0.0046 0.0041 0.0045 0.0050 0.0056 0.0054 0.0053 0.0054 0.0055 0.0057 0.0065 0.0073 0.0079 0.0080 0.0075 0.0067 0.0068 0.0081 0.0114 +const double ColorTemp::JDC468_Blackbl27_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0060, 0.0062, 0.0064, 0.0066, 0.0070, 0.0073, 0.0076, 0.008, 0.0086, 0.0086, 0.0086, 0.0087, 0.0088, 0.0088, 0.0089, 0.0089, 0.0089, 0.0085, 0.0083, 0.008, 0.0079, 0.0078, 0.0078, + 0.0078, 0.0077, 0.007, 0.0067, 0.006, 0.0059, 0.0057, 0.0057, 0.0057, 0.0056, 0.005, 0.0046, 0.0045, 0.0041, 0.0043, 0.0045, 0.0047, 0.0050, 0.0053, 0.0056, 0.0055, 0.0054, 0.0055, + 0.0053, 0.0053, 0.0054, 0.0054, 0.0055, 0.0056, 0.0057, 0.006, 0.0065, 0.007, 0.0073, 0.0075, 0.0079, 0.008, 0.0080, 0.008, 0.0075, 0.007, 0.0067, 0.0067, 0.0068, 0.007, 0.0081, 0.01, 0.0114, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//28 28 0.0092 0.0118 0.0155 0.0218 0.0267 0.0296 0.0312 0.0306 0.0282 0.0244 0.0205 0.0186 0.0167 0.0126 0.0091 0.0080 0.0071 0.0050 0.0042 0.0042 0.0044 0.0045 0.0045 0.0042 0.0041 0.0039 0.0040 0.0043 0.0048 0.0050 0.0047 0.0042 0.0041 0.0042 0.0049 0.0074 +const double ColorTemp::JDC468_Blackbl28_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0092, 0.01, 0.0118, 0.012, 0.0155, 0.016, 0.0218, 0.025, 0.0267, 0.028, 0.0296, 0.03, 0.0312, 0.031, 0.0306, 0.03, 0.0282, 0.026, 0.0244, 0.022, 0.0205, 0.02, 0.0186, 0.017, 0.0167, + 0.015, 0.0126, 0.01, 0.0091, 0.0085, 0.0080, 0.0075, 0.0071, 0.006, 0.0050, 0.05, 0.0042, 0.0042, 0.0042, 0.0043, 0.0044, 0.0044, 0.0045, 0.0045, 0.0045, 0.0043, 0.0042, 0.0042, + 0.0041, 0.004, 0.0039, 0.004, 0.0040, 0.004, 0.0043, 0.0044, 0.0048, 0.005, 0.0050, 0.0048, 0.0047, 0.0045, 0.0042, 0.0041, 0.0041, 0.0041, 0.0042, 0.0045, 0.0049, 0.006, 0.0074, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//214 214 0.0072 0.0062 0.0061 0.0064 0.0069 0.0071 0.0075 0.0081 0.0082 0.0088 0.0103 0.0126 0.0145 0.0146 0.0140 0.0133 0.0118 0.0094 0.0070 0.0059 0.0051 0.0046 0.0045 0.0043 0.0045 0.0045 0.0048 0.0056 0.0065 0.0072 0.0067 0.0065 0.0057 0.0058 0.0068 0.0103 +const double ColorTemp::JDC468_Blackgr214_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0072, 0.007, 0.0062, 0.0062, 0.0061, 0.0063, 0.0064, 0.0067, 0.0069, 0.007, 0.0071, 0.0072, 0.0075, 0.008, 0.0081, 0.008, 0.0082, 0.0085, 0.0088, 0.009, 0.0103, 0.011, 0.0126, + 0.012, 0.0145, 0.0145, 0.0146, 0.014, 0.0140, 0.014, 0.0133, 0.012, 0.0118, 0.01, 0.0094, 0.008, 0.0070, 0.006, 0.0059, 0.0055, 0.0051, 0.005, 0.0046, 0.0045, 0.0045, 0.0044, + 0.0043, 0.0044, 0.0045, 0.0045, 0.0045, 0.0046, 0.0048, 0.005, 0.0056, 0.006, 0.0065, 0.007, 0.0072, 0.007, 0.0067, 0.0066, 0.0065, 0.006, 0.0057, 0.0056, 0.0058, 0.006, 0.0068, 0.008, 0.0103, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + +//436 436 0.0095 0.0123 0.0173 0.0242 0.0293 0.0317 0.0310 0.0283 0.0246 0.0197 0.0152 0.0129 0.0112 0.0083 0.0063 0.0059 0.0056 0.0045 0.0043 0.0050 0.0059 0.0064 0.0062 0.0060 0.0060 0.0062 0.0066 0.0075 0.0086 0.0093 0.0089 0.0082 0.0073 0.0072 0.0088 0.0139 +const double ColorTemp::JDC468_Blackbl436_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0095, 0.01, 0.0123, 0.013, 0.0173, 0.02, 0.0242, 0.026, 0.0293, 0.03, 0.0317, 0.031, 0.0310, 0.03, 0.0283, 0.025, 0.0246, 0.02, 0.0197, 0.018, 0.0152, 0.014, 0.0129, 0.012, + 0.0112, 0.01, 0.0083, 0.007, 0.0063, 0.006, 0.0059, 0.0058, 0.0056, 0.005, 0.0045, 0.0045, 0.0043, 0.005, 0.0050, 0.0055, 0.0059, 0.006, 0.0064, 0.0063, 0.0062, 0.006, 0.0060, + 0.006, 0.0060, 0.006, 0.0062, 0.0064, 0.0066, 0.007, 0.0075, 0.008, 0.0086, 0.009, 0.0093, 0.009, 0.0089, 0.0086, 0.0082, 0.008, 0.0073, 0.0072, 0.0072, 0.008, 0.0088, 0.01, 0.0139, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + +//455 455 0.1560 0.1943 0.2724 0.4469 0.5896 0.6393 0.6390 0.6239 0.6096 0.5895 0.5698 0.5662 0.5603 0.5304 0.4977 0.4975 0.4998 0.4601 0.4261 0.4520 0.4986 0.5237 0.5270 0.5260 0.5297 0.5375 0.5504 0.5711 0.5910 0.6023 0.6029 0.5977 0.5880 0.5830 0.5978 0.6345 +const double ColorTemp::JDC468_Whitebl455_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1560, 0.18, 0.1943, 0.25, 0.2724, 0.40, 0.4469, 0.50, 0.5896, 0.60, 0.6393, 0.639, 0.6390, 0.625, 0.6239, 0.61, 0.6096, 0.60, 0.5895, 0.57, 0.5698, 0.567, 0.5662, 0.56, + 0.5603, 0.55, 0.5304, 0.51, 0.4977, 0.498, 0.4975, 0.498, 0.4998, 0.47, 0.4601, 0.44, 0.4261, 0.43, 0.4520, 0.47, 0.4986, 0.51, 0.5237, 0.525, 0.5270, 0.526, 0.5260, 0.528, + 0.5297, 0.53, 0.5375, 0.54, 0.5504, 0.56, 0.5711, 0.58, 0.5910, 0.595, 0.6023, 0.602, 0.6029, 0.600, 0.5977, 0.59, 0.5880, 0.585, 0.5830, 0.59, 0.5978, 0.61, 0.6345, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//101 101 0.0076 0.0094 0.0116 0.0139 0.0158 0.0158 0.0152 0.0142 0.0130 0.0111 0.0094 0.0090 0.0085 0.0069 0.0058 0.0057 0.0058 0.0048 0.0044 0.0060 0.0094 0.0126 0.0141 0.0141 0.0148 0.0157 0.0172 0.0197 0.0227 0.0245 0.0242 0.0233 0.0215 0.0205 0.0240 0.0321 +const double ColorTemp::JDC468_Blackvio101_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0076, 0.008, 0.0094, 0.01, 0.0116, 0.012, 0.0139, 0.015, 0.0158, 0.0158, 0.0158, 0.0156, 0.0152, 0.015, 0.0142, 0.014, 0.0130, 0.012, 0.0111, 0.01, 0.0094, 0.009, 0.0090, 0.009, + 0.0085, 0.008, 0.0069, 0.006, 0.0058, 0.0057, 0.0057, 0.0058, 0.0058, 0.005, 0.0048, 0.0045, 0.0044, 0.005, 0.0060, 0.008, 0.0094, 0.011, 0.0126, 0.013, 0.0141, 0.014, 0.0141, 0.0145, 0.0148, 0.015, 0.0157, 0.016, 0.0172, 0.018, 0.0197, 0.021, 0.0227, 0.023, 0.0245, 0.0241, + 0.0242, 0.0235, 0.0233, 0.022, 0.0215, 0.021, 0.0205, 0.022, 0.0240, 0.026, 0.0321, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//92 92 0.1652 0.2036 0.2848 0.4708 0.6230 0.6758 0.6761 0.6619 0.6502 0.6343 0.6195 0.6194 0.6169 0.5939 0.5677 0.5678 0.5695 0.5373 0.5105 0.5356 0.5778 0.6020 0.6073 0.6090 0.6124 0.6187 0.6295 0.6456 0.6603 0.6693 0.6716 0.6704 0.6660 0.6640 0.6749 0.7003 +const double ColorTemp::JDC468_Whitebl92_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1652, 0.19, 0.2036, 0.24, 0.2848, 0.35, 0.4708, 0.55, 0.6230, 0.65, 0.6758, 0.6759, 0.6761, 0.665, 0.6619, 0.655, 0.6502, 0.64, 0.6343, 0.62, 0.6195, 0.6194, 0.6194, 0.618, + 0.6169, 0.605, 0.5939, 0.58, 0.5677, 0.5677, 0.5678, 0.568, 0.5695, 0.555, 0.5373, 0.52, 0.5105, 0.52, 0.5356, 0.55, 0.5778, 0.60, 0.6020, 0.605, 0.6073, 0.608, 0.6090, 0.61, + 0.6124, 0.615, 0.6187, 0.62, 0.6295, 0.64, 0.6456, 0.65, 0.6603, 0.665, 0.6693, 0.67, 0.6716, 0.671, 0.6704, 0.669, 0.6660, 0.665, 0.6640, 0.67, 0.6749, 0.69, 0.7003, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//94 94 0.0506 0.0569 0.0678 0.0906 0.1088 0.1160 0.1184 0.1195 0.1203 0.1215 0.1293 0.1474 0.1609 0.1538 0.1415 0.1466 0.1535 0.1364 0.1248 0.1494 0.1871 0.2098 0.2163 0.2179 0.2217 0.2282 0.2372 0.2500 0.2631 0.2713 0.2739 0.2725 0.2678 0.2660 0.2770 0.3025 +const double ColorTemp::JDC468_Greyredbl94_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0506, 0.053, 0.0569, 0.06, 0.0678, 0.08, 0.0906, 0.1, 0.1088, 0.11, 0.1160, 0.117, 0.1184, 0.119, 0.1195, 0.12, 0.1203, 0.1205, 0.1215, 0.125, 0.1293, 0.133, 0.1474, 0.15, + 0.1609, 0.155, 0.1538, 0.145, 0.1415, 0.143, 0.1466, 0.15, 0.1535, 0.14, 0.1364, 0.13, 0.1248, 0.14, 0.1494, 0.17, 0.1871, 0.200, 0.2098, 0.21, 0.2163, 0.217, 0.2179, 0.22, + 0.2217, 0.222, 0.2282, 0.23, 0.2372, 0.24, 0.2500, 0.256, 0.2631, 0.27, 0.2713, 0.272, 0.2739, 0.273, 0.2725, 0.27, 0.2678, 0.267, 0.2660, 0.272, 0.2770, 0.28, 0.3025, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + + +//32 32 0.0933 0.1333 0.1967 0.3132 0.4096 0.4556 0.4763 0.4845 0.4870 0.4852 0.4868 0.4959 0.4971 0.4755 0.4407 0.4085 0.3643 0.2922 0.2161 0.1658 0.1370 0.1190 0.1040 0.0947 0.0949 0.1001 0.1106 0.1306 0.1536 0.1652 0.1609 0.1480 0.1291 0.1188 0.1370 0.1933 +const double ColorTemp::JDC468_Blue32_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0933, 0.11, 0.1333, 0.17, 0.1967, 0.265, 0.3132, 0.35, 0.4096, 0.43, 0.4556, 0.465, 0.4763, 0.48, 0.4845, 0.486, .4870, 0.486, 0.4852, 0.486, 0.4868, 0.49, 0.4959, 0.496, + 0.4971, 0.48, 0.4755, 0.46, 0.4407, 0.42, 0.4085, 0.38, 0.3643, 0.32, 0.2922, 0.25, 0.2161, 0.19, 0.1658, 0.15, 0.1370, 0.12, 0.1190, 0.11, 0.1040, 0.10, 0.0947, 0.0948, + 0.0949, 0.097, 0.1001, 0.105, 0.1106, 0.12, 0.1306, 0.14, 0.1536, 0.16, 0.1652, 0.162, 0.1609, 0.154, 0.1480, 0.135, 0.1291, 0.12, 0.1188, 0.125, 0.1370, 0.16, 0.1933, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + +//236 236 0.0165 0.0259 0.0432 0.0684 0.0858 0.0895 0.0828 0.0683 0.0527 0.0365 0.0235 0.0177 0.0143 0.0096 0.0067 0.0063 0.0060 0.0052 0.0053 0.0061 0.0074 0.0083 0.0085 0.0080 0.0078 0.0076 0.0081 0.0095 0.0112 0.0121 0.0114 0.0100 0.0086 0.0083 0.0102 0.0180 +const double ColorTemp::JDC468_Blue236_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0165, 0.021, 0.0259, 0.035, 0.0432, 0.05, 0.0684, 0.075, 0.0858, 0.087, 0.0895, 0.085, 0.0828, 0.075, 0.0683, 0.058, 0.0527, 0.045, 0.0365, 0.031, 0.0235, 0.021, 0.0177, 0.016, + 0.0143, 0.012, 0.0096, 0.0085, 0.0067, 0.0065, 0.0063, 0.0062, 0.0060, 0.006, 0.0052, 0.0052, 0.0053, 0.006, 0.0061, 0.007, 0.0074, 0.008, 0.0083, 0.0084, 0.0085, 0.0083, + 0.0080, 0.008, 0.0078, 0.0077, 0.0076, 0.008, 0.0081, 0.009, 0.0095, 0.01, 0.0112, 0.012, 0.0121, 0.012, 0.0114, 0.011, 0.0100, 0.009, 0.0086, 0.0085, 0.0083, 0.009, 0.0102, 0.0015, 0.0180, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//300 300 0.0079 0.0085 0.0087 0.0092 0.0094 0.0093 0.0093 0.0095 0.0097 0.0110 0.0158 0.0544 0.1907 0.3753 0.4883 0.5181 0.5044 0.4631 0.4070 0.3594 0.3262 0.3054 0.2873 0.2772 0.2790 0.2875 0.3029 0.3292 0.3571 0.3719 0.3693 0.3573 0.3371 0.3253 0.3471 0.4087 +const double ColorTemp::JDC468_Gre300_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0079, 0.008, 0.0085, 0.0086, 0.0087, 0.009, 0.0092, 0.0093, 0.0094, 0.0094, 0.0093, 0.0093, 0.0093, 0.0094, 0.0095, 0.0096, 0.0097, 0.01, 0.0110, 0.012, 0.0158, 0.045, + 0.0544, 0.134, 0.1907, 0.25, 0.3753, 0.435, 0.4883, 0.505, 0.5181, 0.512, 0.5044, 0.485, 0.4631, 0.433, 0.4070, 0.387, 0.3594, 0.334, 0.3262, 0.31, 0.3054, 0.295, 0.2873, 0.292, + 0.2772, 0.278, 0.2790, 0.281, 0.2875, 0.291, 0.3029, 0.3121, 0.3292, 0.333, 0.3571, 0.365, 0.3719, 0.365, 0.3693, 0.362, 0.3573, 0.342, 0.3371, 0.325, 0.3253, 0.336, 0.3471, 0.367, 0.4087, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//340 340 0.0175 0.0320 0.0587 0.0989 0.1267 0.1322 0.1210 0.0978 0.0732 0.0487 0.0297 0.0212 0.0167 0.0106 0.0069 0.0064 0.0062 0.0051 0.0052 0.0061 0.0073 0.0081 0.0080 0.0076 0.0075 0.0072 0.0077 0.0088 0.0105 0.0112 0.0104 0.0092 0.0079 0.0075 0.0092 0.0167 +const double ColorTemp::JDC468_Blue340_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0175, 0.02, 0.0320, 0.04, 0.0587, 0.08, 0.0989, 0.11, 0.1267, 0.13, 0.1322, 0.125, 0.1210, 0.111, 0.0978, 0.08, 0.0732, 0.06, 0.0487, 0.04, 0.0297, 0.025, 0.0212, 0.02, + 0.0167, 0.012, 0.0106, 0.008, 0.0069, 0.0065, 0.0064, 0.0063, 0.0062, 0.0055, 0.0051, 0.0051, 0.0052, 0.006, 0.0061, 0.007, 0.0073, 0.008, 0.0081, 0.008, 0.0080, 0.0078, + 0.0076, 0.0076, 0.0075, 0.0074, 0.0072, 0.0075, 0.0077, 0.008, 0.0088, 0.0092, 0.0105, 0.011, 0.0112, 0.0108, 0.0104, 0.01, 0.0092, 0.008, 0.0079, 0.0075, 0.0075, 0.008, + 0.0092, 0.01, 0.0167, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//110 110 0.0954 0.1234 0.1702 0.2631 0.3363 0.3664 0.3799 0.3905 0.4002 0.4160 0.4582 0.5262 0.5798 0.5915 0.5742 0.5465 0.5035 0.4364 0.3581 0.2977 0.2589 0.2349 0.2152 0.2030 0.2032 0.2106 0.2249 0.2511 0.2799 0.2951 0.2915 0.2776 0.2552 0.2419 0.2638 0.3287 +const double ColorTemp::JDC468_Gree110_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0954, 0.11, 0.1234, 0.15, 0.1702, 0.22, 0.2631, 0.312, 0.3363, 0.352, 0.3664, 0.372, 0.3799, 0.385, 0.3905, 0.395, 0.4002, 0.41, 0.4160, 0.43, 0.4582, 0.511, 0.5262, 0.544, + 0.5798, 0.585, 0.5915, 0.585, 0.5742, 0.563, 0.5465, 0.523, 0.5035, 0.465, 0.4364, 0.389, 0.3581, 0.3334, 0.2977, 0.275, 0.2589, 0.245, 0.2349, 0.223, 0.2152, 0.211, 0.2030, 0.204, + 0.2032, 0.206, 0.2106, 0.221, 0.2249, 0.243, 0.2511, 0.271, 0.2799, 0.286, 0.2951, 0.294, 0.2915, 0.2876, 0.2776, 0.2657, 0.2552, 0.2456, 0.2419, 0.253, 0.2638, 0.275, 0.3287, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//457 457 0.0127 0.0126 0.0112 0.0110 0.0109 0.0106 0.0105 0.0104 0.0110 0.0136 0.0318 0.1246 0.3262 0.5051 0.5566 0.5181 0.4406 0.3429 0.2411 0.1647 0.1202 0.0968 0.0804 0.0709 0.0703 0.0747 0.0840 0.1023 0.1243 0.1355 0.1311 0.1179 0.0993 0.0884 0.1043 0.1590 +const double ColorTemp::JDC468_Gree457_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0127, 0.0126, 0.0126, 0.012, 0.0112, 0.011, 0.0110, 0.011, 0.0109, 0.0107, 0.0106, 0.0105, 0.0105, 0.0105, 0.0104, 0.0107, 0.0110, 0.0124, 0.0136, 0.0234, 0.0318, 0.09, + 0.1246, 0.22, 0.3262, 0.43, 0.5051, 0.52, 0.5566, 0.54, 0.5181, 0.476, 0.4406, 0.398, 0.3429, 0.296, 0.2411, 0.203, 0.1647, 0.142, 0.1202, 0.1, 0.0968, 0.09, 0.0804, 0.08, + 0.0709, 0.0708, 0.0703, 0.0723, 0.0747, 0.08, 0.0840, 0.09, 0.1023, 0.11, 0.1243, 0.13, 0.1355, 0.132, 0.1311, 0.12, 0.1179, 0.10, 0.0993, 0.09, 0.0884, 0.09, 0.1043, 0.12, 0.1590, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//241 241 0.0134 0.0106 0.0110 0.0108 0.0111 0.0114 0.0114 0.0115 0.0114 0.0122 0.0192 0.0731 0.2455 0.4689 0.6183 0.6852 0.7107 0.7112 0.7059 0.7177 0.7335 0.7445 0.7487 0.7523 0.7555 0.7606 0.7683 0.7779 0.7855 0.7915 0.7964 0.8011 0.8056 0.8097 0.8144 0.8239 +const double ColorTemp::JDC468_Yel241_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0134, 0.012, 0.0106, 0.011, 0.0110, 0.011, 0.0108, 0.011, 0.0111, 0.0112, 0.0114, 0.0114, 0.0114, 0.0114, 0.0115, 0.0114, 0.0114, 0.012, 0.0122, 0.017, 0.0192, 0.05, 0.0731, 0.12, + 0.2455, 0.355, 0.4689, 0.556, 0.6183, 0.645, 0.6852, 0.698, 0.7107, 0.711, 0.7112, 0.708, 0.7059, 0.712, 0.7177, 0.724, 0.7335, 0.742, 0.7445, 0.746, 0.7487, 0.751, 0.7523, 0.753, + 0.7555, 0.758, 0.760, 0.7626, 0.7683, 0.771, 0.7779, 0.782, 0.7855, 0.791, 0.7915, 0.794, 0.7964, 0.799, 0.8011, 0.804, 0.8056, 0.807, 0.8097, 0.811, 0.8144, 0.820, 0.8239, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//321 321 0.0247 0.0203 0.0182 0.0183 0.0182 0.0179 0.0182 0.0188 0.0199 0.0249 0.0529 0.1519 0.3116 0.4138 0.4410 0.4679 0.4906 0.4655 0.4517 0.5203 0.6238 0.6952 0.7270 0.7406 0.7469 0.7527 0.7607 0.7708 0.7786 0.7849 0.7897 0.7940 0.7984 0.8025 0.8069 0.8160 +const double ColorTemp::JDC468_Ora321_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0247, 0.022, 0.0203, 0.019, 0.0182, 0.0182, 0.0183, 0.0182, 0.0182, 0.018, 0.0179, 0.018, 0.0182, 0.0185, 0.0188, 0.019, 0.0199, 0.022, 0.0249, 0.035, 0.0529, 0.112, + 0.1519, 0.231, 0.3116, 0.365, 0.4138, 0.421, 0.4410, 0.451, 0.4679, 0.485, 0.4906, 0.473, 0.4655, 0.455, 0.4517, 0.487, 0.5203, 0.578, 0.6238, 0.667, 0.6952, 0.711, 0.7270, 0.735, + 0.7406, 0.743, 0.7469, .751, 0.7527, 0.756, 0.7607, 0.765, 0.7708, 0.774, 0.7786, 0.782, 0.7849, 0.786, 0.7897, 0.79, 0.7940, 0.794, 0.7984, 0.799, 0.8025, 0.805, 0.8069, 0.811, 0.8160, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//353 353 0.0260 0.0294 0.0331 0.0420 0.0490 0.0517 0.0541 0.0572 0.0608 0.0664 0.0813 0.1070 0.1291 0.1344 0.1317 0.1356 0.1390 0.1289 0.1195 0.1278 0.1420 0.1493 0.1500 0.1500 0.1527 0.1576 0.1651 0.1759 0.1870 0.1942 0.1963 0.1952 0.1910 0.1898 0.1995 0.2209 +const double ColorTemp::JDC468_Yellow353_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0260, 0.027, 0.0294, 0.031, 0.0331, 0.037, 0.0420, 0.045, 0.0490, 0.051, 0.0517, 0.053, 0.0541, 0.056, 0.0572, 0.059, 0.0608, 0.063, 0.0664, 0.072, 0.0813, 0.096, 0.1070, 0.112, + 0.1291, 0.132, 0.1344, 0.133, 0.1317, 0.134, 0.1356, 0.137, 0.1390, 0.134, 0.1289, 0.123, 0.1195, 0.122, 0.1278, 0.134, 0.1420, 0.145, 0.1493, 0.15, 0.1500, 0.15, 0.1500, 0.153, + 0.1527, 0.154, 0.1576, 0.162, 0.1651, 0.172, 0.1759, 0.182, 0.1870, 0.191, 0.1942, 0.195, 0.1963, 0.196, 0.1952, 0.193, 0.1910, 0.19, 0.1898, 0.195, 0.1995, 0.21, 0.2209, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//465 465 0.0388 0.0654 0.1020 0.1557 0.1880 0.1783 0.1434 0.1013 0.0684 0.0410 0.0219 0.0149 0.0117 0.0080 0.0062 0.0062 0.0062 0.0056 0.0063 0.0098 0.0230 0.0440 0.0577 0.0617 0.0645 0.0690 0.0766 0.0903 0.1064 0.1144 0.1113 0.1022 0.0898 0.0833 0.0962 0.1377 +const double ColorTemp::JDC468_Mag465_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0388, 0.05, 0.0654, 0.09, 0.1020, 0.12, 0.1557, 0.17, 0.1880, 0.182, 0.1783, 0.162, 0.1434, 0.12, 0.1013, 0.09, 0.0684, 0.05, 0.0410, 0.03, 0.0219, 0.02, 0.0149, 0.012, + 0.0117, 0.009, 0.0080, 0.007, 0.0062, 0.0062, 0.0062, 0.0062, 0.0062, 0.006, 0.0056, 0.006, 0.0063, 0.008, 0.0098, 0.018, 0.0230, 0.03, 0.0440, 0.05, 0.0577, 0.06, 0.0617, 0.062, + 0.0645, 0.065, 0.0690, 0.07, 0.0766, 0.08, 0.0903, 0.1, 0.1064, 0.111, 0.1144, 0.112, 0.1113, 0.104, 0.1022, 0.09, 0.0898, 0.088, 0.0833, 0.09, 0.0962, 0.111, 0.1377, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//333 333 0.1030 0.1508 0.2133 0.3191 0.3910 0.3895 0.3424 0.2770 0.2184 0.1593 0.1074 0.0825 0.0669 0.0430 0.0265 0.0278 0.0315 0.0212 0.0163 0.0355 0.0861 0.1365 0.1565 0.1589 0.1629 0.1713 0.1852 0.2099 0.2378 0.2517 0.2469 0.2322 0.2102 0.1973 0.2191 0.2855 +const double ColorTemp::JDC468_Mag333_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1030, 0.12, 0.1508, 0.18, 0.2133, 0.26, 0.3191, 0.364, 0.3910, 0.39, 0.3895, 0.375, 0.3424, 0.312, 0.2770, 0.251, 0.2184, 0.183, 0.1593, 0.122, 0.1074, 0.1, 0.0825, 0.07, + 0.0669, 0.05, 0.0430, 0.03, 0.0265, 0.027, 0.0278, 0.03, 0.0315, 0.025, 0.0212, 0.02, 0.0163, 0.03, 0.0355, 0.05, 0.0861, 0.112, 0.1365, 0.143, 0.1565, 0.157, 0.1589, 0.16, + 0.1629, 0.165, 0.1713, 0.175, 0.1852, 0.19, 0.2099, 0.221, 0.2378, 0.245, 0.2517, 0.25, 0.2469, 0.238, 0.2322, 0.224, 0.2102, 0.206, 0.1973, 0.209, 0.2191, 0.231, 0.2855, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + +//203 203 0.0833 0.1329 0.2005 0.3099 0.3855 0.3916 0.3530 0.2926 0.2346 0.1741 0.1201 0.0934 0.0759 0.0495 0.0306 0.0308 0.0330 0.0214 0.0150 0.0256 0.0510 0.0723 0.0769 0.0748 0.0761 0.0813 0.0911 0.1087 0.1295 0.1399 0.1353 0.1232 0.1064 0.0971 0.1137 0.1677 +const double ColorTemp::JDC468_Mag203_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0833, 0.11, 0.1329, 0.16, 0.2005, 0.25, 0.3099, 0.342, 0.3855, 0.39, 0.3916, 0.374, 0.3530, 0.321, 0.2926, 0.267, 0.2346, 0.21, 0.1741, 0.153, 0.1201, 0.1, 0.0934, 0.08, + 0.0759, 0.06, 0.0495, 0.04, 0.0306, 0.0307, 0.0308, 0.032, 0.0330, 0.025, 0.0214, 0.018, 0.0150, 0.02, 0.0256, 0.04, 0.0510, 0.06, 0.0723, 0.074, 0.0769, 0.075, 0.0748, 0.076, + 0.0761, 0.08, 0.0813, 0.09, 0.0911, 0.1, 0.1087, 0.115, 0.1295, 0.134, 0.1399, 0.136, 0.1353, 0.131, 0.1232, 0.114, 0.1064, 0.1, 0.0971, 0.105, 0.1137, 0.123, 0.1677, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +//blue cyan +const double ColorTemp::J570_BlueB6_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1611, 0.18, 0.1947, 0.23, 0.2639, 0.31, 0.3488, 0.37, 0.4022, 0.43, 0.4517, 0.49, 0.501, 0.52, 0.5317, 0.534, 0.5367, 0.53, 0.5246, 0.51, 0.4905, 0.47, 0.4510, 0.43, 0.4059, + 0.37, 0.3351, 0.31, 0.2612, 0.24, 0.2177, 0.205, 0.1883, 0.16, 0.1444, 0.123, 0.1065, 0.1, 0.0889, 0.085, 0.0811, 0.08, 0.0757, 0.071, 0.0695, 0.067, 0.0648, 0.064, 0.0634, + 0.063, 0.0637, 0.065, 0.0662, 0.068, 0.0714, 0.075, 0.0787, 0.08, 0.0828, 0.082, 0.0822, 0.08, 0.0781, 0.075, 0.0726, 0.071, 0.0698, 0.075, 0.0770, 0.08, 0.0973, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueB15_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2207, 0.2, 0.1897, 0.21, 0.2274, 0.25, 0.2805, 0.30, 0.3216, 0.34, 0.3596, 0.38, 0.4003, 0.42, 0.4438, 0.47, 0.4909, 0.52, 0.5469, 0.57, 0.6009, 0.62, 0.6414, 0.65, 0.6557, + 0.64, 0.6275, 0.59, 0.5675, 0.53, 0.5022, 0.48, 0.4348, 0.39, 0.3473, 0.31, 0.2613, 0.24, 0.2039, 0.18, 0.1696, 0.15, 0.1465, 0.13, 0.1243, 0.11, 0.1055, 0.10, 0.0952, 0.094, + 0.0911, 0.091, 0.0906, 0.092, 0.0940, 0.1, 0.1006, 0.104, 0.1075, 0.11, 0.1125, 0.113, 0.1146, 0.113, 0.1129, 0.112, 0.1120, 0.115, 0.1198, 0.13, 0.1431, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueC2_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2534, 0.25, 0.2454, 0.28, 0.3101, 0.33, 0.3567, 0.37, 0.3981, 0.41, 0.4258, 0.43, 0.4472, 0.45, 0.4574, 0.455, 0.4571, 0.45, 0.4468, 0.43, 0.4205, 0.41, 0.3947, 0.38, + 0.3647, 0.33, 0.3074, 0.27, 0.2471, 0.23, 0.2221, 0.22, 0.2128, 0.20, 0.1810, 0.17, 0.1510, 0.15, 0.1486, 0.15, 0.1546, 0.154, 0.1532, 0.15, 0.1426, 0.135, 0.1310, 0.125, + 0.1257, 0.125, 0.1246, 0.126, 0.1276, 0.13, 0.1360, 0.14, 0.1483, 0.15, 0.1566, 0.157, 0.1575, 0.155, 0.1535, 0.15, 0.1453, 0.143, 0.1403, 0.146, 0.1510, 0.16, 0.1855, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueC14_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.5697, 0.51, 0.4660, 0.49, 0.5000, 0.53, 0.5560, 0.58, 0.6072, 0.62, 0.6402, 0.65, 0.6632, 0.67, 0.6850, 0.69, 0.7069, 0.71, 0.7292, 0.74, 0.7488, 0.75, 0.7678, 0.77, 0.7786, + 0.775, 0.7721, 0.76, 0.7544, 0.75, 0.7394, 0.73, 0.7232, 0.70, 0.6889, 0.66, 0.6446, 0.63, 0.6171, 0.61, 0.5966, 0.58, 0.5743, 0.56, 0.5425, 0.53, 0.5093, 0.50, 0.4884, 0.48, + 0.4784, 0.475, 0.4774, 0.48, 0.4822, 0.49, 0.4944, 0.50, 0.5076, 0.51, 0.5186, 0.52, 0.5268, 0.53, 0.5303, 0.532, 0.5332, 0.54, 0.5454, 0.56, 0.5760, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueC16_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1909, 0.10, 0.0635, 0.06, 0.0554, 0.056, 0.0571, 0.057, 0.0580, 0.06, 0.0608, 0.063, 0.0662, 0.07, 0.0712, 0.072, 0.0742, 0.08, 0.0811, 0.09, 0.0985, 0.11, 0.1363, 0.15, + 0.1743, 0.173, 0.1720, 0.15, 0.1372, 0.12, 0.1005, 0.09, 0.0731, 0.06, 0.0509, 0.04, 0.0374, 0.036, 0.0322, 0.032, 0.0308, 0.031, 0.0309, 0.031, 0.0319, 0.033, + 0.0333, 0.034, 0.0349, 0.035, 0.0364, 0.037, 0.0377, 0.038, 0.0386, 0.0386, 0.0386, 0.0384, 0.0383, 0.038, 0.0377, 0.0377, 0.0378, 0.038, 0.0386, 0.04, 0.0417, 0.043, + 0.0461, 0.049, 0.0514, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueF1_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0060, 0.04, 0.0975, 0.11, 0.1297, 0.13, 0.1426, 0.15, 0.1538, 0.16, 0.1624, 0.165, 0.1684, 0.17, 0.1727, 0.175, 0.1761, 0.178, 0.1798, 0.18, 0.1863, 0.19, 0.1993, 0.20, + 0.2091, 0.205, 0.2041, 0.20, 0.1902, 0.19, 0.1836, 0.182, 0.1809, 0.17, 0.1675, 0.16, 0.1527, 0.151, 0.1511, 0.153, 0.1541, 0.154, 0.1545, 0.153, 0.1516, 0.15, + 0.1484, 0.149, 0.1489, 0.15, 0.1516, 0.153, 0.1563, 0.16, 0.1654, 0.17, 0.1766, 0.18, 0.1827, 0.182, 0.1817, 0.18, 0.1766, 0.17, 0.1693, 0.166, 0.1643, 0.17, 0.1726, 0.18, 0.1978, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueF2_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1613, 0.20, 0.2384, 0.30, 0.3288, 0.35, 0.4026, 0.43, 0.4630, 0.48, 0.4992, 0.51, 0.5294, 0.53, 0.5377, 0.53, 0.5261, 0.51, 0.4995, 0.48, 0.4513, 0.43, 0.4064, 0.38, + 0.3620, 0.31, 0.2935, 0.25, 0.2263, 0.21, 0.1977, 0.19, 0.1851, 0.17, 0.1519, 0.14, 0.1213, 0.12, 0.1149, 0.113, 0.1162, 0.114, 0.1133, 0.11, 0.1053, 0.10, 0.0976, 0.095, + 0.0947, 0.095, 0.0953, 0.097, 0.0985, 0.1, 0.1070, 0.11, 0.1188, 0.12, 0.1256, 0.124, 0.1246, 0.12, 0.1187, 0.11, 0.1099, 0.105, 0.1048, 0.11, 0.1145, 0.12, 0.145, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueF10_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3003, 0.20, 0.1512, 0.20, 0.2149, 0.25, 0.2709, 0.30, 0.3127, 0.32, 0.3534, 0.37, 0.4001, 0.42, 0.4456, 0.46, 0.4882, 0.51, 0.5343, 0.55, 0.5728, 0.58, 0.5968, 0.595, + 0.5932, 0.56, 0.5490, 0.51, 0.4756, 0.43, 0.3989, 0.37, 0.3256, 0.28, 0.2424, 0.21, 0.1691, 0.15, 0.1239, 0.10, 0.0998, 0.09, 0.0866, 0.08, 0.0752, 0.07, 0.0664, 0.065, + 0.0623, 0.062, 0.0616, 0.062, 0.0626, 0.064, 0.0662, 0.07, 0.0720, 0.075, 0.0767, 0.077, 0.0784, 0.078, 0.0770, 0.075, 0.0734, 0.073, 0.0716, 0.075, 0.0779, 0.08, 0.0968, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueF13_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3075, 0.22, 0.1514, 0.13, 0.1216, 0.125, 0.1264, 0.13, 0.1312, 0.14, 0.1448, 0.15, 0.1665, 0.17, 0.1850, 0.19, 0.1922, 0.195, 0.1970, 0.20, 0.2036, 0.21, + 0.2136, 0.213, 0.2122, 0.19, 0.1832, 0.16, 0.1412, 0.12, 0.1066, 0.09, 0.0810, 0.07, 0.0579, 0.05, 0.0422, 0.04, 0.0358, 0.035, 0.0336, 0.033, 0.0335, 0.0335, + 0.0339, 0.034, 0.0348, 0.035, 0.0358, 0.036, 0.0371, 0.038, 0.0384, 0.039, 0.0394, 0.04, 0.0405, 0.0404, 0.0405, 0.04, 0.0399, 0.039, 0.0387, 0.039, + 0.0396, 0.04, 0.0422, 0.045, 0.0467, 0.05, 0.0527, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueG9_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0937, 0.09, 0.0891, 0.07, 0.0621, 0.07, 0.0735, 0.08, 0.0842, 0.09, 0.0918, 0.1, 0.1009, 0.105, 0.1091, 0.11, 0.1158, 0.12, 0.1254, 0.13, 0.1452, 0.16, + 0.1805, 0.20, 0.2126, 0.213, 0.2128, 0.20, 0.1863, 0.17, 0.1550, 0.14, 0.1270, 0.1, 0.0973, 0.08, 0.0725, 0.06, 0.0585, 0.055, 0.0521, 0.05, 0.0486, 0.047, + 0.0458, 0.045, 0.0441, 0.044, 0.0439, 0.044, 0.0443, 0.045, 0.0455, 0.046, 0.0478, 0.049, 0.0500, 0.051, 0.0512, 0.051, 0.0511, 0.05, 0.0498, 0.049, + 0.0487, 0.049, 0.0495, 0.05, 0.0531, 0.055, 0.0620, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueG19_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1198, 0.12, 0.1376, 0.15, 0.1735, 0.18, 0.1903, 0.20, 0.2116, 0.22, 0.2322, 0.24, 0.2555, 0.27, 0.2802, 0.29, 0.3077, 0.32, 0.3420, 0.36, 0.3822, 0.41, + 0.4261, 0.43, 0.4565, 0.45, 0.4481, 0.43, 0.4109, 0.39, 0.3736, 0.35, 0.3368, 0.30, 0.2811, 0.25, 0.2228, 0.19, 0.1839, 0.17, 0.1592, 0.15, 0.1394, 0.12, + 0.1183, 0.1, 0.0998, 0.09, 0.0897, 0.085, 0.0851, 0.085, 0.0844, 0.085, 0.0863, 0.09, 0.0912, 0.095, 0.0977, 0.1, 0.1027, 0.105, 0.1064, 0.106, 0.1064, 0.106, + 0.1067, 0.11, 0.1135, 0.12, 0.1319, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueI5_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1096, 012, 0.1546, 0.16, 0.1855, 0.2, 0.2350, 0.25, 0.2720, 0.29, 0.3065, 0.32, 0.3404, 0.36, 0.3782, 0.4, 0.4229, 0.45, 0.4801, 0.51, 0.5416, 0.57, + 0.5962, 0.61, 0.6281, 0.62, 0.6144, 0.58, 0.5680, 0.55, 0.5211, 0.5, 0.4726, 0.43, 0.3991, 0.37, 0.3209, 0.29, 0.2674, 0.25, 0.2311, 0.22, 0.2000, 0.18, + 0.1656, 0.15, 0.1349, 0.12, 0.1161, 0.11, 0.1078, 0.105, 0.1046, 0.105, 0.1049, 0.107, 0.1097, 0.11, 0.1179, 0.12, 0.1264, 0.13, 0.1337, 0.135, 0.1378, 0.14, 0.1402, 0.145, 0.1474, 0.15, 0.1662, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueH15_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1047, 0.105, 0.1078, 0.12, 0.1550, 0.20, 0.2110, 0.23, 0.2487, 0.27, 0.2893, 0.31, 0.3386, 0.35, 0.3723, 0.375, 0.3773, 0.37, 0.3665, 0.35, 0.3373, 0.32, + 0.3037, 0.28, 0.2663, 0.24, 0.2106, 0.17, 0.1540, 0.13, 0.1200, 0.11, 0.0980, 0.08, 0.0721, 0.06, 0.0527, 0.05, 0.0448, 0.043, 0.0418, 0.041, 0.0403, 0.04, + 0.0390, 0.039, 0.0386, 0.039, 0.0392, 0.04, 0.0401, 0.041, 0.0413, 0.042, 0.0435, 0.044, 0.0456, 0.046, 0.0465, 0.046, 0.0457, 0.045, 0.0447, 0.044, 0.0435, 0.044, + 0.0442, 0.046, 0.0485, 0.05, 0.0576, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueI3_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1759, 0.21, 0.2647, 0.31, 0.3209, 0.36, 0.4249, 0.45, 0.4957, 0.52, 0.5536, 0.57, 0.6073, 0.62, 0.6431, 0.65, 0.6538, 0.653, 0.6506, 0.64, 0.6282, 0.61, + 0.5973, 0.57, 0.5559, 0.52, 0.4856, 0.43, 0.4033, 0.37, 0.3417, 0.32, 0.2901, 0.26, 0.2211, 0.19, 0.1585, 0.14, 0.1236, 0.11, 0.1062, 0.1, 0.0959, 0.09, + 0.0865, 0.085, 0.0801, 0.08, 0.0780, 0.079, 0.0788, 0.08, 0.0819, 0.09, 0.0903, 0.1, 0.1009, 0.105, 0.1073, 0.106, 0.1055, 0.1, 0.0998, 0.095, 0.0914, 0.09, 0.0863, 0.09, 0.0961, 0.11, 0.1250, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueI19_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3031, 0.28, 0.2588, 0.25, 0.2472, 0.26, 0.2738, 0.29, 0.3035, 0.31, 0.3271, 0.33, 0.3496, 0.36, 0.3724, 0.38, 0.3968, 0.41, 0.4252, 0.44, 0.4562, 0.47, + 0.4899, 0.5, 0.5147, 0.512, 0.5100, 0.49, 0.4841, 0.47, 0.4608, 0.45, 0.4373, 0.42, 0.3934, 0.37, 0.3420, 0.32, 0.3086, 0.30, 0.2850, 0.27, 0.2622, 0.25, + 0.2334, 0.22, 0.2054, 0.19, 0.1887, 0.185, 0.1806, 0.18, 0.1791, 0.18, 0.1825, 0.185, 0.1909, 0.2, 0.2018, 0.21, 0.2108, 0.213, 0.2164, 0.217, 0.2180, 0.219, + 0.2198, 0.22, 0.2295, 0.24, 0.2562, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueJ4_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0290, 0.02, 0.0598, 0.1, 0.1278, 0.15, 0.1764, 0.19, 0.2052, 0.21, 0.2331, 0.25, 0.2642, 0.28, 0.2906, 0.3, 0.3093, 0.31, 0.3263, 0.33, 0.3413, 0.35, + 0.3550, 0.354, 0.3532, 0.33, 0.3206, 0.3, 0.2685, 0.24, 0.2212, 0.2, 0.1802, 0.16, 0.1346, 0.1, 0.0965, 0.08, 0.0751, 0.07, 0.0646, 0.06, 0.0586, 0.055, + 0.0535, 0.052, 0.0504, 0.05, 0.0491, 0.0495, 0.0493, 0.05, 0.0504, 0.051, 0.0529, 0.053, 0.0565, 0.057, 0.0591, 0.059, 0.0593, 0.058, 0.0576, 0.056, 0.0556, 0.055, + 0.0553, 0.06, 0.0602, 0.065, 0.0727, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueJ6_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3039, 0.3, 0.2571, 0.27, 0.2960, 0.31, 0.3446, 0.37, 0.3937, 0.41, 0.4405, 0.47, 0.4884, 0.51, 0.5337, 0.56, 0.5771, 0.59, 0.6221, 0.64, 0.6589, 0.67, + 0.6808, 0.68, 0.6770, 0.65, 0.6375, 0.59, 0.5693, 0.53, 0.4933, 0.45, 0.4160, 0.39, 0.3223, 0.26, 0.2338, 0.21, 0.1761, 0.16, 0.1447, 0.13, 0.1258, 0.12, + 0.1090, 0.1, 0.0961, 0.09, 0.0899, 0.089, 0.0877, 0.088, 0.0892, 0.09, 0.0949, 0.1, 0.1045, 0.11, 0.1115, 0.112, 0.1131, 0.112, 0.1115, 0.11, 0.1065, 0.105, + 0.1033, 0.11, 0.1122, 0.12, 0.1400, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_BlueJ11_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1274, 0.1, 0.091, 0.08, 0.0656, 0.064, 0.0604, 0.06, 0.0570, 0.06, 0.0604, 0.061, 0.0644, 0.065, 0.0668, 0.07, 0.0700, 0.072, 0.0754, 0.08, 0.0874, 0.1, + 0.1111, 0.12, 0.1327, 0.132, 0.1313, 0.12, 0.1127, 0.1, 0.0931, 0.08, 0.0758, 0.06, 0.0580, 0.05, 0.0449, 0.04, 0.0385, 0.036, 0.0360, 0.035, 0.0351, 0.035, + 0.0351, 0.035, 0.0355, 0.036, 0.0371, 0.0375, 0.0379, 0.038, 0.0388, 0.04, 0.0406, 0.041, 0.0414, 0.0415, 0.0416, 0.041, 0.0409, 0.04, + 0.0398, 0.04, 0.0397, 0.04, 0.0424, 0.043, 0.0458, 0.05, 0.0522, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_BlueJ13_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2802, 0.28, 0.2820, 0.3, 0.3461, 0.4, 0.4357, 0.45, 0.5027, 0.53, 0.5528, 0.58, 0.6001, 0.62, 0.6402, 0.66, 0.6730, 0.69, 0.7019, 0.71, 0.7216, 0.725, + 0.7288, 0.72, 0.7172, 0.7, 0.6779, 0.65, 0.6160, 0.58, 0.5478, 0.52, 0.4751, 0.43, 0.3816, 0.35, 0.2882, 0.25, 0.2260, 0.2, 0.1905, 0.18, 0.1699, 0.16, + 0.1514, 0.14, 0.1361, 0.13, 0.1295, 0.129, 0.1281, 0.13, 0.1309, 0.135, 0.1408, 0.145, 0.1546, 0.16, 0.1644, 0.165, 0.1656, 0.162, + 0.1606, 0.155, 0.1516, 0.15, 0.1461, 0.15, 0.1585, 0.16, 0.1975, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_BlueK5_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1727, 0.18, 0.1814, 0.19, 0.1931, 0.21, 0.2379, 0.25, 0.2728, 0.29, 0.3054, 0.31, 0.3396, 0.36, 0.3780, 0.4, 0.4243, 0.45, 0.4829, 0.51, 0.5464, 0.57, + 0.6024, 0.62, 0.6348, 0.63, 0.6209, 0.59, 0.5741, 0.55, 0.5258, 0.49, 0.4755, 0.43, 0.4003, 0.37, 0.3204, 0.3, 0.2656, 0.25, 0.2282, 0.21, 0.1966, 0.17, + 0.1624, 0.15, 0.1322, 0.12, 0.1137, 0.11, 0.1052, 0.105, 0.1025, 0.102, 0.1028, 0.105, 0.1075, 0.11, 0.1155, 0.12, 0.1237, 0.13, 0.1310, 0.133, + 0.1352, 0.136, 0.1370, 0.14, 0.1444, 0.15, 0.1632, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_BlueN1_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1936, 0.194, 0.1942, 0.22, 0.2692, 0.29, 0.3102, 0.33, 0.3535, 0.37, 0.3885, 0.4, 0.4230, 0.44, 0.4594, 0.48, 0.5011, 0.52, 0.5510, 0.58, 0.6022, 0.62, 0.6479, 0.66, + 0.6748, 0.67, 0.6640, 0.65, 0.6268, 0.61, 0.5919, 0.58, 0.5549, 0.53, 0.4921, 0.46, 0.4209, 0.39, 0.3723, 0.35, 0.3364, 0.32, 0.3005, 0.28, 0.2569, 0.23, 0.2154, 0.19, + 0.1897, 0.18, 0.1768, 0.175, 0.1723, 0.173, 0.1722, 0.175, 0.1785, 0.18, 0.1892, 0.19, 0.2017, 0.21, 0.2134, 0.22, 0.2202, 0.222, 0.2247, 0.23, 0.2333, 0.24, 0.2566, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_BlueN4_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3138, 0.25, 0.2038, 0.19, 0.1787, 0.18, 0.1840, 0.2, 0.2109, 0.23, 0.2400, 0.26, 0.2715, 0.29, 0.3075, 0.33, 0.3534, 0.39, 0.4149, 0.45, 0.4863, 0.52, + 0.5520, 0.57, 0.5904, 0.58, 0.5750, 0.55, 0.5198, 0.48, 0.4602, 0.43, 0.3997, 0.36, 0.3199, 0.27, 0.2411, 0.2, 0.1883, 0.17, 0.1553, 0.14, 0.1307, 0.12, + 0.1062, 0.1, 0.0859, 0.08, 0.0746, 0.07, 0.0697, 0.069, 0.0678, 0.068, 0.0683, 0.07, 0.0715, 0.075, 0.0765, 0.08, 0.0818, 0.085, 0.0862, 0.087, 0.0885, 0.089, + 0.0899, 0.09, 0.0951, 0.1, 0.1090, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_BlueO19_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1231, 0.13, 0.1348, 0.12, 0.1152, 0.12, 0.1368, 0.15, 0.1627, 0.17, 0.1860, 0.2, 0.2130, 0.23, 0.2462, 0.26, 0.2859, 0.31, 0.3425, 0.38, 0.4152, 0.45, 0.4902, 0.51, + 0.5386, 0.53, 0.5259, 0.49, 0.4652, 0.43, 0.3950, 0.35, 0.3266, 0.28, 0.2469, 0.21, 0.1750, 0.15, 0.1293, 0.12, 0.1033, 0.09, 0.0859, 0.08, 0.0703, 0.06, 0.0578, 0.055, + 0.0521, 0.05, 0.0494, 0.049, 0.0492, 0.049, 0.0498, 0.05, 0.0522, 0.053, 0.0558, 0.058, 0.0590, 0.06, 0.0615, 0.062, 0.0625, 0.063, 0.0634, 0.065, 0.0670, 0.07, 0.0776, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_BlueU8_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0776, 0.1, 0.1703, 0.23, 0.2942, 0.35, 0.4022, 0.45, 0.4795, 0.51, 0.5389, 0.56, 0.5968, 0.6, 0.6362, 0.64, 0.6512, 0.652, 0.6523, 0.64, 0.6340, 0.62, 0.6052, 0.58, + 0.5645, 0.53, 0.4952, 0.45, 0.4124, 0.38, 0.3457, 0.32, 0.2883, 0.25, 0.2164, 0.19, 0.1529, 0.14, 0.1168, 0.1, 0.0983, 0.09, 0.0883, 0.08, 0.0798, 0.075, 0.0735, 0.073, + 0.0720, 0.072, 0.0726, 0.074, 0.0757, 0.08, 0.0830, 0.09, 0.0930, 0.095, 0.0989, 0.097, 0.0971, 0.095, 0.0911, 0.085, 0.0832, 0.08, 0.0795, 0.082, 0.0877, 0.09, 0.1140, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +//N8 +const double ColorTemp::J570_NeuN8_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0632, -0.04, -0.0244, 0.01, 0.0125, 0.02, 0.0294, 0.03, 0.0326, 0.033, 0.0352, 0.036, 0.0361, 0.037, 0.0374, 0.0374, 0.0373, 0.038, 0.0378, 0.039, 0.0397, 0.04, + 0.0421, 0.043, 0.0431, 0.042, 0.0417, 0.04, 0.0391, 0.038, 0.0378, 0.037, 0.0368, 0.035, 0.0347, 0.034, 0.0335, 0.034, 0.0341, 0.035, 0.0350, 0.035, 0.0355, 0.036, + 0.0357, 0.0357, 0.0358, 0.036, 0.0369, 0.037, 0.0372, 0.0376, 0.0378, 0.038, 0.0388, 0.039, 0.0397, 0.04, 0.0400, 0.0395, 0.0394, 0.039, 0.0386, 0.0385, 0.0384, 0.039, + 0.0395, 0.04, 0.0415, 0.043, 0.0448, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuN9_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0573, 0.054, 0.0516, 0.053, 0.0548, 0.05, 0.0401, 0.041, 0.0424, 0.043, 0.0449, 0.046, 0.0467, 0.047, 0.0473, 0.0473, 0.0474, 0.048, 0.0483, 0.05, 0.0508, 0.053, + 0.0558, 0.057, 0.0584, 0.058, 0.0550, 0.05, 0.0495, 0.048, 0.0468, 0.0465, 0.0460, 0.044, 0.0430, 0.042, 0.0411, 0.042, 0.0425, 0.044, 0.0457, 0.046, 0.0473, 0.0474, + 0.0475, 0.0475, 0.0474, 0.0475, 0.0476, 0.048, 0.0487, 0.049, 0.0499, 0.05, 0.0515, 0.052, 0.0533, 0.054, 0.0544, 0.054, 0.0539, 0.053, 0.0526, 0.052, 0.0512, 0.0515, + 0.0515, 0.053, 0.0538, 0.056, 0.0597, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuO8_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0014, 0.02, 0.0806, 0.07, 0.0673, 0.07, 0.0854, 0.09, 0.0901, 0.095, 0.0960, 0.098, 0.0992, 0.1, 0.1017, 0.102, 0.1030, 0.104, 0.1052, 0.107, 0.1098, 0.11, + 0.1176, 0.12, 0.1230, 0.12, 0.1176, 0.11, 0.1071, 0.105, 0.1032, 0.103, 0.1032, 0.1, 0.0963, 0.09, 0.0899, 0.09, 0.0939, 0.095, 0.1007, 0.102, 0.1037, 0.104, + 0.1029, 0.102, 0.1014, 0.102, 0.1020, 0.103, 0.1039, 0.105, 0.1072, 0.11, 0.1134, 0.12, 0.1207, 0.122, 0.1245, 0.123, 0.1236, 0.121, 0.1205, 0.12, 0.1158, 0.115, + 0.1132, 0.115, 0.1185, 0.12, 0.1345, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuO11_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2926, 0.2, 0.1863, 0.16, 0.1428, 0.14, 0.1322, 0.134, 0.1396, 0.14, 0.1450, 0.146, 0.1498, 0.15, 0.1527, 0.155, 0.1554, 0.157, 0.1583, 0.16, 0.1631, 0.17, + 0.1754, 0.18, 0.1841, 0.18, 0.1761, 0.17, 0.1600, 0.155, 0.1549, 0.155, 0.1555, 0.15, 0.1449, 0.14, 0.1352, 0.14, 0.1414, 0.15, 0.1519, 0.153, 0.1568, 0.156, + 0.1556, 0.154, 0.1534, 0.154, 0.1547, 0.156, 0.1573, 0.16, 0.1622, 0.17, 0.1713, 0.18, 0.1823, 0.185, 0.1886, 0.188, 0.1873, 0.183, 0.1829, 0.18, 0.1753, 0.174, + 0.1716, 0.175, 0.1800, 0.2, 0.2039, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuD5_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0840, 0.1, 0.1627, 0.18, 0.1934, 0.2, 0.2234, 0.23, 0.2430, 0.25, 0.2547, 0.26, 0.2618, 0.264, 0.2651, 0.265, 0.2655, 0.2655, 0.2659, 0.266, 0.2674, 0.27, + 0.2776, 0.28, 0.2841, 0.27, 0.2654, 0.25, 0.2351, 0.23, 0.2246, 0.225, 0.2247, 0.22, 0.2074, 0.20, 0.1913, 0.20, 0.2029, 0.21, 0.2231, 0.23, 0.2337, 0.233, + 0.2327, 0.23, 0.2291, 0.23, 0.2305, 0.232, 0.2344, 0.24, 0.2417, 0.25, 0.2553, 0.26, 0.2724, 0.28, 0.2816, 0.28, 0.2797, 0.276, 0.2720, 0.27, + 0.2603, 0.26, 0.2536, 0.26, 0.2660, 0.28, 0.3027, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_NeuE11_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1699, 0.18, 0.1971, 0.21, 0.2276, 0.23, 0.2483, 0.25, 0.2690, 0.28, 0.2820, 0.29, 0.2916, 0.295, 0.2992, 0.3, 0.3064, 0.31, 0.3151, 0.32, 0.3301, 0.34, 0.3593, 0.37, + 0.3873, 0.39, 0.3913, 0.38, 0.3793, 0.375, 0.3723, 0.37, 0.3678, 0.35, 0.3482, 0.33, 0.3249, 0.32, 0.3188, 0.319, 0.3188, 0.318, 0.3179, 0.315, 0.3128, 0.31, + 0.3086, 0.31, 0.3105, 0.312, 0.3148, 0.313, 0.3222, 0.33, 0.3364, 0.34, 0.3535, 0.36, 0.3629, 0.362, 0.3621, 0.36, 0.3549, 0.35, 0.3444, 0.34, 0.3394, 0.35, 0.3511, 0.36, 0.3862, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_NeuK16_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.5837, 0.45, 0.4117, 0.43, 0.4427, 0.47, 0.5098, 0.52, 0.5451, 0.55, 0.5698, 0.57, 0.5828, 0.59, 0.5939, 0.6, 0.6045, 0.607, 0.6140, 0.62, 0.6219, 0.63, 0.6330, 0.64, + 0.6419, 0.643, 0.6440, 0.642, 0.6417, 0.64, 0.6379, 0.631, 0.6309, 0.62, 0.6154, 0.6, 0.5911, 0.58, 0.5736, 0.57, 0.5612, 0.56, 0.5539, 0.55, 0.5462, 0.543, + 0.5406, 0.542, 0.5418, 0.543, 0.5452, 0.55, 0.5529, 0.56, 0.5654, 0.57, 0.5806, 0.584, 0.5888, 0.589, 0.5898, 0.586, 0.5858, 0.58, 0.5796, 0.577, 0.5770, 0.58, 0.5883, 0.59, 0.6190, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuM3_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2659, 0.255, 0.2526, 0.26, 0.2616, 0.27, 0.2854, 0.29, 0.3088, 0.31, 0.3231, 0.33, 0.3336, 0.34, 0.3421, 0.345, 0.347, 0.35, 0.3542, 0.36, 0.3647, 0.37, + 0.3854, 0.4, 0.4041, 0.402, 0.4012, 0.39, 0.3856, 0.38, 0.3769, 0.375, 0.3725, 0.36, 0.3525, 0.34, 0.3286, 0.325, 0.3247, 0.326, 0.3279, 0.328, 0.3285, 0.325, + 0.3240, 0.322, 0.3202, 0.321, 0.3220, 0.323, 0.3267, 0.33, 0.3342, 0.34, 0.3487, 0.35, 0.3667, 0.37, 0.3761, 0.375, 0.3746, 0.37, 0.3670, 0.36, 0.3559, 0.35, 0.3498, 0.35, 0.3630, 0.37, 0.3998, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuN18_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1284, 0.11, 0.1090, 0.13, 0.1573, 0.17, 0.1837, 0.19, 0.1971, 0.2, 0.2059, 0.21, 0.2143, 0.22, 0.2213, 0.225, 0.2271, 0.23, 0.2341, 0.24, 0.2487, 0.26, 0.2764, 0.29, + 0.3025, 0.303, 0.3052, 0.3, 0.2919, 0.29, 0.2843, 0.283, 0.2800, 0.27, 0.2612, 0.24, 0.2394, 0.235, 0.2339, 0.234, 0.2340, 0.233, 0.2326, 0.23, 0.2277, 0.225, + 0.2235, 0.224, 0.2246, 0.226, 0.2282, 0.23, 0.2349, 0.24, 0.2477, 0.25, 0.2632, 0.27, 0.2714, 0.271, 0.2702, 0.27, 0.2637, 0.26, 0.2538, 0.25, 0.2479, 0.25, 0.2589, 0.26, 0.2918, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuQ1_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0610, 0.06, 0.0592, 0.04, 0.0339, 0.04, 0.0338, 0.034, 0.0350, 0.036, 0.0363, 0.037, 0.0380, 0.038, 0.0383, 0.0383, 0.0385, 0.04, 0.0408, 0.042, 0.0451, 0.05, + 0.0524, 0.055, 0.0589, 0.058, 0.0585, 0.055, 0.0529, 0.05, 0.0456, 0.04, 0.0390, 0.035, 0.0330, 0.03, 0.0286, 0.028, 0.0275, 0.0276, 0.0275, 0.0278, 0.0279, 0.028, + 0.0289, 0.03, 0.0304, 0.031, 0.0320, 0.032, 0.0328, 0.033, 0.0341, 0.0345, 0.0346, 0.0346, 0.0347, 0.034, 0.0341, 0.034, 0.0336, 0.034, 0.0340, 0.035, + 0.0351, 0.036, 0.0373, 0.038, 0.0411, 0.042, 0.0446, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuS7_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1447, 0.06, 0.0448, 0.042, 0.0411, 0.03, 0.0282, 0.028, 0.0270, 0.029, 0.0298, 0.03, 0.0319, 0.032, 0.0331, 0.0333, 0.0335, 0.036, 0.0361, 0.038, 0.0403, 0.045, + 0.0493, 0.05, 0.0599, 0.06, 0.0636, 0.062, 0.0606, 0.06, 0.0547, 0.05, 0.0488, 0.045, 0.0421, 0.04, 0.0366, 0.035, 0.0335, 0.033, 0.0323, 0.032, 0.0320, 0.032, + 0.0321, 0.0322, 0.0324, 0.033, 0.0333, 0.034, 0.0345, 0.035, 0.0356, 0.036, 0.0364, 0.037, 0.0372, 0.037, 0.0367, 0.0365, 0.0363, 0.0364, + 0.0361, 0.0362, 0.0363, 0.037, 0.0376, 0.04, 0.0412, 0.042, 0.0450, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuV10_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1439, 0.07, 0.0583, 0.04, 0.0372, 0.037, 0.0362, 0.035, 0.0344, 0.034, 0.0340, 0.035, 0.0351, 0.036, 0.0361, 0.0361, 0.0361, 0.037, 0.0377, 0.039, 0.0404, 0.042, + 0.0450, 0.047, 0.0483, 0.048, 0.0475, 0.045, 0.0436, 0.04, 0.0387, 0.036, 0.0343, 0.03, 0.0299, 0.028, 0.0271, 0.027, 0.0262, 0.0262, 0.0262, 0.0267, 0.0269, 0.027, + 0.0283, 0.029, 0.0299, 0.03, 0.0308, 0.031, 0.0319, 0.032, 0.0331, 0.0333, 0.0337, 0.0337, 0.0337, 0.0333, 0.0332, 0.0332, 0.0331, 0.0331, 0.0331, 0.034, + 0.0341, 0.035, 0.0371, 0.038, 0.0399, 0.041, 0.0432, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuW18_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.4685, 0.45, 0.4262, 0.5, 0.5061, 0.55, 0.5898, 0.6, 0.6487, 0.66, 0.6781, 0.68, 0.6947, 0.7, 0.7070, 0.71, 0.7185, 0.72, 0.7294, 0.73, 0.7383, 0.74, 0.7499, 0.75, + 0.7582, 0.758, 0.7582, 0.755, 0.7531, 0.75, 0.7484, 0.745, 0.7422, 0.73, 0.7263, 0.72, 0.7033, 0.7, 0.6913, 0.69, 0.6820, 0.68, 0.6738, 0.67, 0.6628, 0.66, + 0.6512, 0.65, 0.6462, 0.645, 0.6448, 0.645, 0.6485, 0.65, 0.6569, 0.66, 0.6698, 0.67, 0.6781, 0.68, 0.6822, 0.682, 0.6820, 0.682, 0.6815, 0.682, 0.6820, 0.69, 0.6907, 0.7, 0.7152, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuZ14_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2765, 0.2, 0.1352, 0.13, 0.1222, 0.121, 0.1206, 0.13, 0.1300, 0.134, 0.1357, 0.14, 0.1407, 0.142, 0.1455, 0.147, 0.1485, 0.15, 0.1539, 0.16, 0.1648, 0.17, + 0.1844, 0.2, 0.2015, 0.202, 0.2024, 0.2, 0.1922, 0.19, 0.1868, 0.185, 0.1841, 0.18, 0.1715, 0.16, 0.1566, 0.155, 0.1536, 0.154, 0.1545, 0.154, 0.1536, 0.151, + 0.1500, 0.148, 0.1471, 0.1472, 0.1478, 0.15, 0.1505, 0.153, 0.1552, 0.16, 0.1641, 0.17, 0.1751, 0.18, 0.1813, 0.181, 0.1801, 0.18, + 0.1757, 0.17, 0.1683, 0.165, 0.1642, 0.17, 0.1728, 0.18, 0.1970, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::J570_NeuC18_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0555, 0.055, 0.0545, 0.055, 0.0585, 0.058, 0.0577, 0.056, 0.0554, 0.056, 0.0564, 0.058, 0.0590, 0.06, 0.0611, 0.062, 0.0638, 0.065, 0.0685, 0.07, 0.0797, 0.09, + 0.1009, 0.11, 0.1222, 0.124, 0.1298, 0.127, 0.1257, 0.123, 0.1208, 0.12, 0.1164, 0.11, 0.1067, 0.1, 0.0954, 0.09, 0.0895, 0.088, 0.0862, 0.085, 0.0834, 0.082, + 0.0806, 0.08, 0.0782, 0.078, 0.0780, 0.078, 0.0789, 0.08, 0.0813, 0.084, 0.0858, 0.09, 0.0911, 0.092, 0.0944, 0.093, 0.0938, 0.092, 0.0914, 0.09, 0.0878, 0.086, + 0.0858, 0.09, 0.0903, 0.1, 0.1037, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuD17_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1980, 0.1, 0.0793, 0.06, 0.0578, 0.05, 0.0476, 0.046, 0.0454, 0.046, 0.0471, 0.048, 0.0499, 0.05, 0.0518, 0.052, 0.0533, 0.055, 0.0574, 0.06, 0.0676, 0.07, + 0.0897, 0.1, 0.1129, 0.113, 0.1140, 0.1, 0.0958, 0.08, 0.0743, 0.06, 0.0566, 0.05, 0.0422, 0.04, 0.0332, 0.03, 0.0297, 0.0295, 0.0292, 0.0293, 0.0294, 0.03, + 0.0306, 0.031, 0.0319, 0.032, 0.0339, 0.034, 0.0353, 0.036, 0.0363, 0.037, 0.0370, 0.037, 0.0372, 0.037, 0.0368, 0.0365, 0.0363, 0.036, + 0.0360, 0.037, 0.0376, 0.039, 0.0406, 0.042, 0.0448, 0.046, 0.0499, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuJ11_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1274, 0.1, 0.0916, 0.08, 0.0656, 0.061, 0.0604, 0.06, 0.0570, 0.06, 0.0604, 0.062, 0.0644, 0.065, 0.0668, 0.069, 0.0700, 0.072, 0.0754, 0.08, 0.0874, 0.1, + 0.1111, 0.12, 0.1327, 0.132, 0.1313, 0.12, 0.1127, 0.1, 0.0931, 0.08, 0.0758, 0.06, 0.0580, 0.05, 0.0449, 0.04, 0.0385, 0.037, 0.0360, 0.036, 0.0351, 0.035, + 0.0351, 0.0354, 0.0355, 0.036, 0.0371, 0.0375, 0.0379, 0.038, 0.0388, 0.04, 0.0406, 0.041, 0.0414, 0.0415, 0.0416, 0.041, 0.0409, 0.04, 0.0398, 0.0397, 0.0397, 0.04, + 0.0424, 0.043, 0.0458, 0.048, 0.0522, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::J570_NeuL4_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0348, 0.05, 0.0700, 0.09, 0.1043, 0.11, 0.1320, 0.14, 0.1505, 0.16, 0.1622, 0.17, 0.1721, 0.18, 0.1805, 0.185, 0.1877, 0.19, 0.1955, 0.2, 0.2068, 0.21, + 0.2226, 0.23, 0.2350, 0.235, 0.2352, 0.23, 0.2251, 0.22, 0.2128, 0.2, 0.1990, 0.18, 0.1761, 0.16, 0.1494, 0.13, 0.1296, 0.12, 0.1171, 0.11, 0.1089, 0.105, + 0.1010, 0.1, 0.0949, 0.093, 0.0926, 0.093, 0.0937, 0.095, 0.0961, 0.1, 0.1020, 0.11, 0.1104, 0.112, 0.1150, 0.115, 0.1155, 0.113, 0.1123, 0.11, + 0.1070, 0.105, 0.1040, 0.11, 0.1110, 0.12, 0.1323, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + +const double ColorTemp::Colorlab_n72_n2_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0116, 0.01, 0.0171, 0.05, 0.0625, 0.08, 0.1486, 0.16, 0.1963, 0.2, 0.2409, 0.26, 0.2974, 0.31, 0.3468, 0.36, 0.3790, 0.39, 0.4075, 0.41, 0.4216, 0.43, + 0.4399, 0.47, 0.4878, 0.50, 0.5589, 0.57, 0.5882, 0.57, 0.5566, 0.52, 0.5030, 0.46, 0.4451, 0.42, 0.3928, 0.37, 0.3625, 0.35, 0.3396, 0.29, 0.2670, 0.15, + 0.1028, 0.05, -0.0397, -0.08, -0.1151, -0.12, -0.1464, -0.15, -0.1582, -0.16, -0.1609, -0.16, -0.1581, -0.155, -0.1556, -0.156, + -0.1582, -0.16, -0.1621, -0.165, -0.1683, -0.17, -0.1719, -0.17, -0.1696, -0.165, -0.1623, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::Colorlab_10_n70_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0964, 0.1, 0.1534, 0.2, 0.2437, 0.33, 0.4663, 0.5, 0.6005, 0.65, 0.6958, 0.75, 0.8010, 0.83, 0.8598, 0.858, 0.8579, 0.85, 0.8432, 0.83, 0.8102, 0.79, + 0.7607, 0.7, 0.6760, 0.6, 0.5530, 0.5, 0.4212, 0.3, 0.2974, 0.2, 0.1839, 0.1, 0.0743, 0.03, -0.0208, -0.05, -0.0747, -0.08, -0.0913, -0.05, -0.0458, 0.03, + 0.0806, 0.1, 0.1936, 0.2, 0.2556, 0.27, 0.2816, 0.29, 0.2925, 0.3, 0.3033, 0.31, 0.3175, 0.32, 0.3257, 0.325, 0.3246, 0.32, + 0.3187, 0.31, 0.3082, 0.305, 0.3014, 0.304, 0.3059, 0.31, 0.3253, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::Colorlab_n33_n70_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0615, 0.1, 0.1219, 0.2, 0.2179, 0.3, 0.4397, 0.5, 0.5722, 0.6, 0.6714, 0.7, 0.7834, 0.8, 0.8535, 0.86, 0.8647, 0.864, 0.8642, 0.864, 0.8429, 0.82, + 0.8035, 0.75, 0.7316, 0.7, 0.6238, 0.55, 0.4996, 0.45, 0.3717, 0.3, 0.2487, 0.2, 0.1299, 0.06, 0.0272, 0.01, -0.0315, -0.04, -0.0557, -0.051, + -0.0519, -0.03, -0.0234, 0.001, 0.0041, 0.01, 0.0201, 0.021, 0.0269, 0.028, 0.0298, 0.03, 0.0371, 0.04, 0.0497, 0.05, 0.0578, 0.056, + 0.0557, 0.05, 0.0490, 0.04, 0.0374, 0.03, 0.0299, 0.03, 0.0348, 0.04, 0.0537, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::Colorlab_n8_n74_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0603, 0.08, 0.1069, 0.15, 0.1810, 0.25, 0.3573, 0.4, 0.4634, 0.5, 0.5406, 0.6, 0.6266, 0.65, 0.6772, 0.679, 0.6800, 0.68, 0.6732, 0.66, 0.6511, 0.63, + 0.6136, 0.6, 0.5444, 0.5, 0.4415, 0.4, 0.3317, 0.3, 0.2286, 0.2, 0.1336, 0.1, 0.0425, 0.01, -0.0360, -0.05, -0.0807, -0.09, -0.0967, -0.08, + -0.0761, -0.05, -0.0119, 0.02, 0.0462, 0.05, 0.0784, 0.08, 0.0919, 0.095, 0.0974, 0.1, 0.1046, 0.11, 0.1152, 0.12, 0.1217, 0.121, + 0.1205, 0.12, 0.1155, 0.11, 0.1067, 0.104, 0.1010, 0.103, 0.1047, 0.11, 0.1199, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::Colorlab_19_n69_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1281, 0.16, 0.1941, 0.24, 0.2982, 0.4, 0.5607, 0.65, 0.7192, 0.8, 0.8299, 0.9, 0.9517, 1.0, 1.0174, 1.014, 1.0115, 1.0, 0.9899, 0.96, 0.9475, 0.91, + 0.8877, 0.82, 0.7902, 0.7, 0.6508, 0.57, 0.5008, 0.45, 0.3595, 0.3, 0.2302, 0.15, 0.1049, 0.02, -0.0045, -0.03, -0.0662, -0.07, -0.0832, -0.05, -0.0161, 0.05, + 0.1648, 0.2, 0.3257, 0.37, 0.4137, 0.43, 0.4506, 0.46, 0.4661, 0.47, 0.4801, 0.49, 0.4974, 0.5, 0.5072, 0.505, 0.5062, 0.5, 0.4995, 0.49, 0.4876, 0.48, + 0.4799, 0.48, 0.4849, 0.49, 0.5081, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::Colorlab_n80_10_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0247, -0.01, -0.0057, 0.01, 0.0242, 0.05, 0.0736, 0.08, 0.0996, 0.1, 0.1281, 0.14, 0.1660, 0.19, 0.2037, 0.21, 0.2337, 0.25, 0.2618, 0.27, 0.2793, 0.29, + 0.3024, 0.32, 0.3564, 0.4, 0.4360, 0.44, 0.4788, 0.47, 0.4655, 0.45, 0.4308, 0.42, 0.3920, 0.37, 0.3564, 0.34, 0.3357, 0.32, 0.3167, 0.28, 0.2434, 0.1, + 0.0745, 0.01, -0.0725, -0.09, -0.1506, -0.18, -0.1831, -0.19, -0.1955, -0.195, -0.1995, -0.199, -0.1989, -0.198, + -0.1976, -0.198, -0.1999, -0.2, -0.2027, -0.208, -0.2070, -0.208, -0.2094, -0.208, -0.2080, -0.207, -0.2038, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; +const double ColorTemp::Colorlab_n80_26_spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0325, -0.03, -0.0203, -0.01, -0.0012, 0.01, 0.0228, 0.03, 0.0332, 0.04, 0.0506, 0.06, 0.0762, 0.09, 0.1069, 0.12, 0.1370, 0.15, 0.1666, 0.17, 0.1877, 0.2, + 0.2174, 0.25, 0.2849, 0.33, 0.3849, 0.4, 0.4477, 0.45, 0.4509, 0.44, 0.4305, 0.42, 0.4049, 0.39, 0.3806, 0.37, 0.3664, 0.35, 0.3495, 0.29, 0.2724, 0.1, + 0.0921, 0.01, -0.0651, -0.09, -0.1489, -0.15, -0.1837, -0.19, -0.1970, -0.2, -0.2020, -0.202, -0.2029, -0.203, -0.2026, -0.204, + -0.2047, -0.205, -0.2069, -0.208, -0.2099, -0.21, -0.2115, -0.21, -0.2106, -0.209, -0.2086, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; /* * Name: XYZtoCorColorTemp.c @@ -1022,6 +2607,197 @@ void ColorTemp::cieCAT02(double Xw, double Yw, double Zw, double &CAM02BB00, dou } +void ColorTemp::cieCAT02float(float Xw, float Yw, float Zw, float &CAM02BB00, float &CAM02BB01, float &CAM02BB02, float &CAM02BB10, float &CAM02BB11, float &CAM02BB12, float &CAM02BB20, float &CAM02BB21, float &CAM02BB22, float adap) +{ + +// CIECAT02 - J.Desmis January 2012 review September 2012 + const float whiteD50p[3] = {0.9646019585, 1.0, 0.8244507152}; //calculate with these tools + + float cam_dest[3] = {0., 0., 0.}; + float cam_orig[3] = {0., 0., 0.}; + const float CAT02[3][3] = {{0.7328, 0.4296, -0.1624},//CAT02 2002 + { -0.7036, 1.6975, 0.0061}, + {0.0030, 0.0136, 0.9834} + }; + const float INVCAT02[3][3] = {{1.09612382083551, -0.278869000218287, 0.182745179382773}, //Inverse CAT02 + {0.454369041975359, 0.4735331543070412, 0.0720978037172291}, + { -0.009627608738442936, -0.00569803121611342, 1.01532563995454} + }; + + float inv_white_orig[3][3] = {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.} + }; + float intermed[3][3] = {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.} + }; + + float intermed_2[3][3] = {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.} + }; + float CAM02[3][3] = {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.} + }; + float D = adap; + + //white destination Wd : RT use always D50 + cam_dest[0] = CAT02[0][0] * whiteD50p[0] + CAT02[0][1] * whiteD50p[1] + CAT02[0][2] * whiteD50p[2]; //Cone response RoD + cam_dest[1] = CAT02[1][0] * whiteD50p[0] + CAT02[1][1] * whiteD50p[1] + CAT02[1][2] * whiteD50p[2]; //GaD + cam_dest[2] = CAT02[2][0] * whiteD50p[0] + CAT02[2][1] * whiteD50p[1] + CAT02[2][2] * whiteD50p[2]; //BeD + + //origin white Ws : A, D65, custom, etc. + cam_orig[0] = CAT02[0][0] * Xw + CAT02[0][1] * Yw + CAT02[0][2] * Zw; //Cone response RoS + cam_orig[1] = CAT02[1][0] * Xw + CAT02[1][1] * Yw + CAT02[1][2] * Zw; + cam_orig[2] = CAT02[2][0] * Xw + CAT02[2][1] * Yw + CAT02[2][2] * Zw; + + //inverse white + inv_white_orig[0][0] = 1. / cam_orig[0]; // 1/RoS + inv_white_orig[1][1] = 1. / cam_orig[1]; // 1/GaS + inv_white_orig[2][2] = 1. / cam_orig[2]; // 1/BeS + + //intermediates computation + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3 ; j++) { + intermed[i][j] = inv_white_orig[i][i] * CAT02[i][j]; + } + + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3 ; j++) { + intermed_2[i][j] = cam_dest[i] * intermed[i][j]; + } + + //and CAM02 + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) { + CAM02[i][j] += INVCAT02[i][k] * intermed_2[k][j]; + } + + //adaptation jdc : slightly different from CIECAM02 : Rc=(Yw(D/Rw)+(1-D))*R , but it's work ! true at 0 and 1 + CAM02[1][1] = (CAM02[1][1] - 1.0) * D + 1.0; + CAM02[0][0] = (CAM02[0][0] - 1.0) * D + 1.0; + CAM02[2][2] = (CAM02[2][2] - 1.0) * D + 1.0; +// CAM02[1][1] *= D; +// CAM02[0][0] *= D; +// CAM02[2][2] *= D; + CAM02[0][1] *= D; + CAM02[0][2] *= D; + CAM02[1][0] *= D; + CAM02[1][2] *= D; + CAM02[2][0] *= D; + CAM02[2][1] *= D; + //CAT02 matrix with D adaptation + CAM02BB00 = CAM02[0][0]; + CAM02BB01 = CAM02[0][1]; + CAM02BB02 = CAM02[0][2]; + CAM02BB10 = CAM02[1][0]; + CAM02BB11 = CAM02[1][1]; + CAM02BB12 = CAM02[1][2]; + CAM02BB20 = CAM02[2][0]; + CAM02BB21 = CAM02[2][1]; + CAM02BB22 = CAM02[2][2]; + +} + +void ColorTemp::icieCAT02float(float Xw, float Yw, float Zw, float &iCAM02BB00, float &iCAM02BB01, float &iCAM02BB02, float &iCAM02BB10, float &iCAM02BB11, float &iCAM02BB12, float &iCAM02BB20, float &iCAM02BB21, float &iCAM02BB22, float adap) +{ + +// CIECAT02 - J.Desmis January 2012 review September 2017 + const float whiteD50p[3] = {0.9646019585, 1.0, 0.8244507152}; //calculate with these tools + + float cam_dest[3] = {0., 0., 0.}; + float cam_orig[3] = {0., 0., 0.}; + const float CAT02[3][3] = {{0.7328, 0.4296, -0.1624},//CAT02 2002 + { -0.7036, 1.6975, 0.0061}, + {0.0030, 0.0136, 0.9834} + }; + const float INVCAT02[3][3] = {{1.09612382083551, -0.278869000218287, 0.182745179382773}, //Inverse CAT02 + {0.454369041975359, 0.4735331543070412, 0.0720978037172291}, + { -0.009627608738442936, -0.00569803121611342, 1.01532563995454} + }; + + float inv_white_orig[3][3] = {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.} + }; + float intermed[3][3] = {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.} + }; + + float intermed_2[3][3] = {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.} + }; + float INVCAM02[3][3] = {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.} + }; + float D = adap / 2.; + + //white destination Wd : RT use always D50 + cam_dest[0] = INVCAT02[0][0] * whiteD50p[0] + INVCAT02[0][1] * whiteD50p[1] + INVCAT02[0][2] * whiteD50p[2]; //Cone reponse RoD + cam_dest[1] = INVCAT02[1][0] * whiteD50p[0] + INVCAT02[1][1] * whiteD50p[1] + INVCAT02[1][2] * whiteD50p[2]; //GaD + cam_dest[2] = INVCAT02[2][0] * whiteD50p[0] + INVCAT02[2][1] * whiteD50p[1] + INVCAT02[2][2] * whiteD50p[2]; //BeD + + //origin white Ws : A, D65, custom, etc. + cam_orig[0] = INVCAT02[0][0] * Xw + INVCAT02[0][1] * Yw + INVCAT02[0][2] * Zw; //Cone reponse RoS + cam_orig[1] = INVCAT02[1][0] * Xw + INVCAT02[1][1] * Yw + INVCAT02[1][2] * Zw; + cam_orig[2] = INVCAT02[2][0] * Xw + INVCAT02[2][1] * Yw + INVCAT02[2][2] * Zw; +// cam_orig[0] = CAT02[0][0] * Xw + CAT02[0][1] * Yw + CAT02[0][2] * Zw; //Cone reponse RoS +// cam_orig[1] = CAT02[1][0] * Xw + CAT02[1][1] * Yw + CAT02[1][2] * Zw; + // cam_orig[2] = CAT02[2][0] * Xw + CAT02[2][1] * Yw + CAT02[2][2] * Zw; + + //inverse white + inv_white_orig[0][0] = 1. / cam_orig[0]; // 1/RoS + inv_white_orig[1][1] = 1. / cam_orig[1]; // 1/GaS + inv_white_orig[2][2] = 1. / cam_orig[2]; // 1/BeS + + //intermediates computation + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3 ; j++) { + // intermed[i][j] = inv_white_orig[i][i] * INVCAT02[i][j]; + intermed[i][j] = inv_white_orig[i][i] * CAT02[i][j]; + } + + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3 ; j++) { + intermed_2[i][j] = cam_dest[i] * intermed[i][j]; + } + + //and CAM02 + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) { + INVCAM02[i][j] += INVCAT02[i][k] * intermed_2[k][j]; + } + + //adaptation jdc : slightly different from CIECAM02 : Rc=(Yw(D/Rw)+(1-D))*R , but it's work ! true at 0 and 1 + INVCAM02[0][0] = (INVCAM02[0][0] - 1.0) * D + 1.0; + INVCAM02[2][2] = (INVCAM02[2][2] - 1.0) * D + 1.0; + INVCAM02[0][1] *= D; + INVCAM02[0][2] *= D; + INVCAM02[1][0] *= D; + INVCAM02[1][2] *= D; + INVCAM02[2][0] *= D; + INVCAM02[2][1] *= D; + //CAT02 matrix with D adaptation + iCAM02BB00 = INVCAM02[0][0]; + iCAM02BB01 = INVCAM02[0][1]; + iCAM02BB02 = INVCAM02[0][2]; + iCAM02BB10 = INVCAM02[1][0]; + iCAM02BB11 = INVCAM02[1][1]; + iCAM02BB12 = INVCAM02[1][2]; + iCAM02BB20 = INVCAM02[2][0]; + iCAM02BB21 = INVCAM02[2][1]; + iCAM02BB22 = INVCAM02[2][2]; + +} + + void ColorTemp::temp2mulxyz (double temp, const std::string &method, double &Xxyz, double &Zxyz) { double x, y, z; @@ -1645,6 +3421,452 @@ double ColorTemp::daylight_spect(double wavelength, double m1, double m2) return (s0[wlm] + m1 * s1[wlm] + m2 * s2[wlm]); } +//tempxy : return x and y of xyY for 200 or more refreence color, and for T temperature from 2000K to 12000K +// we can change step for temperature and increase number for T > 7500K if necessary +//these values Temp, x, y are references for all calculations and very precise. +//copyright J.Desmis august 2017 and june 2018 +void ColorTemp::tempxy(bool separated, int &repref, float **Tx, float **Ty, float **Tz, float **Ta, float **Tb, float **TL, double *TX, double *TY, double *TZ, const procparams::WBParams & wbpar) +{ + const double* spec_colorforxcyc[] = {//color references + JDC468_BluH10_spect, JDC468_BluD6_spect, ColorchechCyaF3_spect, JDC468_BluM5_spect, // 0 3 + ColorGreenM25_spect, JDC468_GreK7_spect, ColabSky42_0_m24_spect, ColabSky60_0_m31_spect, ColorchechBluC150_m5_m22_spect,//8 + JDC468_GreQ7_spect, ColorchechDCBluN881_m7_m14_spect, ColorchechGreB3_spect, ColorchechPurD2_spect, //12 + ColorchechSGBlaN3_6_spect, ColorchechGraC4_67_spect, JDC468_K15_87greyspect,//15 + JDC468_GraK14_44_spect, ColorGreenalsi_spect, Fictif_61greyspect, ColorchechGreD1_spect,//19 + ColorchechWhiA496_spect, JDC468_GreA10_spect, JDC468_GreI8_spect,//22 + ColabSkin91_4_14_spect, JDC468_PurE24_spect, //24 + ColorchechSGSkiK285_11_17_spect, ColorchechGreE2_spect, ColorchechMagE3_spect, //27 + ColorchechSkiB166_18_18_spect, ColabSkin70_7_32_spect, ColorchechSGSkiF763_14_26_spect,//30 + ColorchechSkiA138_13_14_spect, ColabSkin57_22_18_spect, JDC468_YelN10_spect,//33 + ColabSkin35_15_17_spect, ColabSkin40_17_17_spect, ColorRedkurttu_spect, ColorYellowkeltano_spect, ColorchechYelD3_spect, JDC468_OraO18_spect,//39 + JDC468_GreN7_spect, JDC468_RedG21va_spect, JDC468_OraD17_spect,//42 + ColorchechredC3_spect, JDC468_RedI9_spect, ColorRedpetunia_spect, ColorchechOraA2_spect,//46 + ColabSkin87_8_8_spect, ColabSkin89_8_21_spect, ColabSkin75_8_4_spect, ColabSkin75_10_33_spect,//50 + ColabSkin65_33_11_spect, ColabSkin65_7_24_spect, ColabSkin57_19_6_spect, ColabSkin57_4_19_spect, ColabSkin57_10_28_spect, ColabSkin40_17_6_spect,//56 + ColabSkin26_18_18_spect, ColabSkin90_m1_20_spect, ColorRedlupiini_spect, ColorRedhevosminttu_spect, //60 + ColorRedneilikka_spect, ColorRedpelagornia_spect, ColorRedtalvio_spect, ColorBrownpoimulehti_spect, ColorOrangetuntematon_spect,//65 + ColorOrangetlehmus_spect, ColorOrangvaahtera_spect, ColorBrownlehmus_spect, ColorBrownuotiosammal_spect,//69 + ColorBlacksoil_spect, ColorGraynahjajaekaelae_spect, //71 + ColorGreennuotisammal_spect, ColorGreenleskenlehti_spect, ColorGreenlinnunkaali_spect, //74 + ColorGreenpelto_spect, ColorGreenrodvoikukka, ColorGreenlehmus, ColorGreenlinden, ColorYellowlehmus, ColorYellowsuikeroalpi, //80 + ColorYellowpensashanhikki1, ColorYellowpensashanhikki2, ColorBluehiidenvirna, ColorBluekurkkuyrtti, //84 + ColorPinksiankaersaemoe, ColorVioletharakankello, ColorVioletalsikeapila, ColorVioletakilleija, ColorOrangekehaekukka,//89 + ColorRedpihlaja, ColorVioletpetunia, ColorVioletorvokki, ColorBluesinisievikki, ColorBlueiisoppi, ColorBluelobelia, //95 + ColorWhiteojaka, ColorWhitepetunia, ColorWhitepelargonia, ColorWhitepaeivaen, JDC468_B14_75Redspect,//100 + ColorGreenkoriste, ColorGreenpoimulehti, ColorGreenhopeapaju, //103 + ColorReduuden, ColorRedpajuan, ColorRedjaloan, ColorBlueukon, ColorBlueorvokki, ColorBluemalvikki, //109 + ColorBlackmaito, ColorOrangpihlaja, ColorBlackpihlaja, //112 + ColorViolA1_spect, ColorViolA4_spect, ColorViolA6_spect, ColorBlueSkyK3_spect, ColorBlueSkyK9_spect, //117 + ColorBlueSkyC4_spect, ColorBlueSkyC14_spect, ColorBlueSkyE4_spect, //120 + ColorBlueSkyM1_spect, ColorBlueSky2B1_spect, ColorBlueSkyT7_spect, //123 + ColorBlueSkyU19_spect, ColorBlueSkyU2_spect, ColorBlueSkyT17_spect, //126 + ColorBlackM8_spect, ColorBlackM12_spect, ColorBlackM13_spect, ColorWhite2B12_spect, ColorWhite2B14_spect, //131 + JDC468_Blackred97_spect, JDC468_Blackredbl443_spect, JDC468_Blackbl27_spect, JDC468_Blackbl28_spect, //135 + JDC468_Blackgr214_spect, JDC468_Blackbl436_spect, JDC468_Whitebl455_spect, JDC468_Blackvio101_spect, JDC468_Whitebl92_spect, JDC468_Greyredbl94_spect, //141 + JDC468_Blue32_spect, JDC468_Blue236_spect, JDC468_Gre300_spect, //144 + JDC468_Blue340_spect, JDC468_Gree110_spect, JDC468_Gree457_spect, JDC468_Yel241_spect, JDC468_Ora321_spect, JDC468_Yellow353_spect, JDC468_Mag465_spect, //151 + JDC468_Mag333_spect, JDC468_Mag203_spect, J570_BlueB6_spect, J570_BlueB15_spect, J570_BlueC2_spect, J570_BlueC14_spect, J570_BlueC16_spect,//158 + J570_BlueF1_spect, J570_BlueF2_spect, J570_BlueF10_spect, J570_BlueF13_spect, J570_BlueG9_spect, J570_BlueG19_spect, J570_BlueI5_spect,//165 + J570_BlueI3_spect, J570_BlueI19_spect, J570_BlueJ4_spect, J570_BlueJ6_spect, J570_BlueJ11_spect, J570_BlueK5_spect, //171 + J570_BlueN1_spect, J570_BlueN4_spect, J570_BlueO19_spect, J570_BlueU8_spect, J570_NeuN8_spect,//176 + J570_NeuN9_spect, J570_NeuO8_spect, J570_NeuO11_spect, J570_NeuD5_spect,//180 + J570_NeuE11_spect, J570_NeuK16_spect, J570_NeuM3_spect, J570_NeuN18_spect, + J570_NeuQ1_spect, J570_NeuS7_spect, + J570_NeuV10_spect, J570_NeuW18_spect, J570_NeuZ14_spect, //189 + J570_NeuC18_spect, J570_NeuD17_spect, J570_NeuJ11_spect, J570_NeuL4_spect, Colorlab_n72_n2_spect, + Colorlab_10_n70_spect, Colorlab_n33_n70_spect, Colorlab_n8_n74_spect, Colorlab_19_n69_spect, Colorlab_n80_10_spect, Colorlab_n80_26_spect + }; + + + typedef struct WbTxyz { + double Tem; + double XX; + double ZZ; + } WbTxyz; + //probbaly can be "passed" with rawimagesource.cc but I don't know how to do. + WbTxyz Txyz[118] = {//temperature Xwb Zwb 118 values x wb and y wb are calculated after + {2001., 1.273842, 0.145295}, + {2101., 1.244008, 0.167533}, + {2201., 1.217338, 0.190697}, + {2301., 1.193444, 0.214632}, + {2401., 1.171996, 0.239195}, + {2501., 1.152883, 0.264539}, + {2605., 1.134667, 0.290722}, + {2655., 1.126659, 0.303556}, + {2705., 1.119049, 0.316446}, + {2755., 1.111814, 0.329381}, + {2803., 1.105381, 0.342193}, + {2856., 1.098258, 0.355599}, + {2910., 1.091550, 0.369645}, + {2960., 1.085649, 0.382655}, + {3003., 1.080982, 0.394258}, + {3050., 1.075727, 0.406057}, + {3103., 1.070277, 0.419815}, + {3153., 1.065384, 0.432769}, + {3203., 1.060906, 0.446161}, + {3250., 1.056535, 0.457806}, + {3303., 1.052034, 0.471422}, + {3353., 1.047990, 0.484218}, + {3400., 1.044547, 0.496719}, + {3450., 1.040667, 0.508891}, + {3500., 1.037145, 0.521523}, + {3550., 1.033783, 0.534090}, + {3600., 1.030574, 0.546590}, + {3650., 1.027510, 0.559020}, + {3699., 1.024834, 0.571722}, + {3801., 1.019072, 0.596102}, + {3851., 1.016527, 0.608221}, + {3902., 1.014244, 0.621136}, + {3952., 1.011729, 0.632447}, + {4002., 0.996153, 0.609518}, + {4052., 0.993720, 0.620805}, + {4102., 0.993908, 0.631520}, + {4152., 0.989179, 0.643262}, + {4202., 0.989283, 0.653999}, + {4252., 0.985039, 0.665536}, + {4302., 0.985067, 0.676288}, + {4352., 0.981271, 0.687599}, + {4402., 0.981228, 0.698349}, + {4452., 0.977843, 0.709425}, + {4502., 0.977736, 0.720159}, + {4552., 0.974728, 0.730993}, + {4602., 0.974562, 0.741698}, + {4652., 0.971899, 0.752284}, + {4702., 0.971681, 0.762949}, + {4752., 0.969335, 0.773285}, + {4802., 0.969069, 0.783899}, + {4827., 0.967570, 0.788836}, + {4852., 0.967011, 0.793982}, + {4877., 0.966465, 0.799108}, + {4902., 0.965933, 0.804214}, + {4927., 0.965414, 0.809229}, + {4952., 0.964908, 0.814366}, + {4977., 0.964415, 0.819412}, + {5002., 0.963934, 0.824438}, + {5027., 0.963465, 0.829444}, + {5052., 0.963008, 0.834429}, + {5077., 0.962563, 0.839395}, + {5102., 0.962129, 0.844339}, + {5127., 0.961706, 0.849263}, + {5152., 0.961294, 0.854166}, + {5177., 0.960893, 0.859049}, + {5202., 0.960501, 0.863911}, + {5252., 0.959749, 0.873572}, + {5302., 0.959313, 0.883815}, + {5352., 0.958361, 0.892644}, + {5402., 0.957903, 0.902793}, + {5452., 0.957116, 0.911379}, + {5502., 0.956639, 0.921431}, + {5552., 0.956002, 0.929779}, + {5602., 0.955509, 0.939728}, + {5652., 0.955008, 0.947842}, + {5702., 0.954502, 0.957685}, + {5752., 0.954124, 0.965569}, + {5802., 0.953608, 0.975303}, + {5852., 0.953342, 0.982963}, + {5902., 0.952818, 0.992584}, + {5952., 0.952652, 1.000025}, + {6002., 0.952122, 1.009532}, + {6052., 0.952047, 1.016759}, + {6102., 0.951514, 1.026149}, + {6152., 0.951520, 1.033168}, + {6202., 0.950985, 1.042439}, + {6252., 0.951064, 1.049256}, + {6302., 0.950530, 1.058406}, + {6352., 0.950674, 1.065027}, + {6402., 0.950143, 1.074055}, + {6452., 0.950345, 1.080484}, + {6502., 0.950201, 1.088097}, + {6552., 0.950070, 1.095633}, + {6602., 0.949952, 1.103094}, + {6652., 0.949846, 1.110479}, + {6702., 0.949752, 1.119138}, + {6752., 0.949668, 1.125027}, + {6802., 0.949596, 1.132190}, + {6902., 0.949033, 1.147691}, + {7002., 0.949402, 1.160129}, + {7152., 0.949348, 1.180429}, + {7301., 0.948896, 1.201432}, + {7451., 0.949434, 1.219076}, + {7601., 0.949099, 1.239061}, + {7751., 0.949729, 1.255559}, + {7901., 0.949498, 1.274460}, + {8151., 0.950361, 1.300912}, + {8301., 0.950253, 1.318464}, + {8451., 0.950966, 1.332651}, + {8601., 0.950941, 1.349261}, + {8801., 0.951772, 1.367421}, + {9001., 0.951969, 1.387639}, + {9201., 0.952784, 1.404422}, + {9401., 0.953081, 1.423213}, + {9901., 0.954537, 1.464134}, + {10501., 0.956321, 1.508623}, + {11001., 0.957747, 1.541281}, + {12001., 0.960440, 1.601019} + }; + + int N_c = sizeof(spec_colorforxcyc) / sizeof(spec_colorforxcyc[0]); //number of color + int N_t = sizeof(Txyz) / sizeof(Txyz[0]); //number of temperature White point + typedef struct XYZref { + double Xref; + double Yref; + double Zref; + } XYZref; + XYZref Refxyz[N_c + 1]; + typedef struct XYZrefcat02 { + double Xrefcat; + double Yrefcat; + double Zrefcat; + } XYZrefcat02; + XYZrefcat02 Refxyzcat02[N_c + 1]; + + for (int i = 0; i < N_c; i++) { + Refxyz[i].Xref = 0.f; + Refxyz[i].Yref = 0.f; + Refxyz[i].Zref = 0.f; + Refxyzcat02[i].Xrefcat = 0.f; + Refxyzcat02[i].Yrefcat = 0.f; + Refxyzcat02[i].Zrefcat = 0.f; + } + + + struct chrom { + float chroab; + float chroa; + float chrob; + int nn; + float L; + bool operator()(const chrom& lchro, const chrom& rchro) + { + return lchro.chroab < rchro.chroab; + } + + } ; + + // chrom wbchro[N_c + 1]; + + double tempw = 5000.; + + if (separated) { + tempw = Txyz[repref].Tem; + // tempw = 5004.; + + if (tempw <= INITIALBLACKBODY) { + // float aa = 0.f; + // float bb = 0.f; + + for (int i = 0; i < N_c; i++) { + spectrum_to_color_xyz_blackbody(spec_colorforxcyc[i], tempw, TX[i], TY[i], TZ[i]); + /* float XX = TX[i] * 65535.f; + float YY = TY[i] * 65535.f; + float ZZ = TZ[i] * 65535.f; + float L, a, b; + Color::XYZ2Lab(XX, YY, ZZ, L, a, b);//only to see Lab values in console + printf("N=%i L=%f a=%f b=%f\n", i, L / 327.68f, a / 327.68f, b / 327.68f); + aa += (a / 327.68f); + bb += (b / 327.68f); + */ + } + + /* + aa /= N_c; + bb /= N_c; + printf("aa=%f bb=%f\n", aa, bb); + */ + // } + + } else { + double m11, m22, x_DD, y_DD, interm2; + + if (tempw <= 7000) { + x_DD = -4.6070e9 / (tempw * tempw * tempw) + 2.9678e6 / (tempw * tempw) + 0.09911e3 / tempw + 0.244063; + } else { + x_DD = -2.0064e9 / (tempw * tempw * tempw) + 1.9018e6 / (tempw * tempw) + 0.24748e3 / tempw + 0.237040; + } + + y_DD = -3.0 * x_DD * x_DD + 2.87 * x_DD - 0.275; + //calculate D -daylight in function of s0, s1, s2 and temp ==> x_D y_D + //S(lamda)=So(lambda)+m1*s1(lambda)+m2*s2(lambda) + interm2 = (0.0241 + 0.2562 * x_DD - 0.734 * y_DD); + m11 = (-1.3515 - 1.7703 * x_DD + 5.9114 * y_DD) / interm2; + m22 = (0.03 - 31.4424 * x_DD + 30.0717 * y_DD) / interm2; + // float aa = 0.f; + // float bb = 0.f; + + for (int i = 0; i < N_c; i++) { + spectrum_to_color_xyz_daylight(spec_colorforxcyc[i], m11, m22, TX[i], TY[i], TZ[i]); + +/* float XX = TX[i] * 65535.f; + float YY = TY[i] * 65535.f; + float ZZ = TZ[i] * 65535.f; + float L, a, b; + Color::XYZ2Lab(XX, YY, ZZ, L, a, b);//only to see Lab values in console + // printf("N=%i L=%f a=%f b=%f\n", i, L / 327.68f, a / 327.6 8f, b / 327.68f); + aa += (a / 327.68f); + bb += (b / 327.68f); + wbchro[i].chroab = (sqrt(SQR(a) + SQR(b))) / 327.68f; + wbchro[i].chroa = a / 327.68f; + wbchro[i].chrob = b / 327.68f; + wbchro[i].nn = i; +*/ + + + } +/* + std::sort(wbchro, wbchro + N_c + 1, wbchro[0]); + float ab5 = 0.f; + int n5 = 0; + float ab15 = 0.f; + int n15 = 0; + float ab30 = 0.f; + int n30 = 0; + float ab50 = 0.f; + int n50 = 0; + float ab70 = 0.f; + int n70 = 0; + float ab120 = 0.f; + int n120 = 0; + + for (int i = 0; i < N_c; i++) { + if (wbchro[i].chroab < 5.f) { + ab5 += (wbchro[i].chroa + wbchro[i].chrob); + n5++; + } else if (wbchro[i].chroab < 15.f) { + ab15 += (wbchro[i].chroa + wbchro[i].chrob); + n15++; + } else if (wbchro[i].chroab < 30.f) { + ab30 += (wbchro[i].chroa + wbchro[i].chrob); + n30++; + } else if (wbchro[i].chroab < 50.f) { + ab50 += (wbchro[i].chroa + wbchro[i].chrob); + n50++; + } else if (wbchro[i].chroab < 70.f) { + ab70 += (wbchro[i].chroa + wbchro[i].chrob); + n70++; + } else if (wbchro[i].chroab < 120.f) { + ab120 += (wbchro[i].chroa + wbchro[i].chrob); + n120++; + } + + printf("N=%i nn=%i chr=%f cha=%f chb=%f\n", i, wbchro[i].nn, wbchro[i].chroab, wbchro[i].chroa, wbchro[i].chrob); + } + + printf("ab5=%f n5=%i\n", ab5 / n5, n5); + printf("ab15=%f n15=%i\n", ab15 / n15, n15); + printf("ab30=%f n30=%i\n", ab30 / n30, n30); + printf("ab50=%f n50=%i\n", ab50 / n50, n50); + printf("ab70=%f n70=%i\n", ab70 / n70, n70); + printf("ab120=%f n120=%i\n", ab120 / n120, n120); + aa /= N_c; + bb /= N_c; + printf("aa=%f bb=%f\n", aa, bb); + //very low 15 --, 16 -+, 17 + -, 18 +-, 20 ++, 22 -+, 73 ++, 98 ++, 99 -+, 101 -+, 129 ++, 130 -+, 131 --, + //low 8 +-, 9 --, 10 --, 12 --, 19 -+, 21 -+, 24 -+, 25 ++, 27 ++, 30 ++, 33++, 34 ++, 36 ++, 37++,38 +-, + */ + } + } + + if (!separated) { + // std::string wbcat02Method = wbpar.wbcat02Method; + std::string wbcat02Method = "none"; + + for (int tt = 0; tt < N_t; tt++) { + tempw = Txyz[tt].Tem; + + if (tempw <= INITIALBLACKBODY) { + + for (int i = 0; i < N_c; i++) { + spectrum_to_color_xyz_blackbody(spec_colorforxcyc[i], tempw, Refxyz[i].Xref, Refxyz[i].Yref, Refxyz[i].Zref); + } + + } else { + double m11, m22, x_DD, y_DD, interm2; + + if (tempw <= 7000) { + x_DD = -4.6070e9 / (tempw * tempw * tempw) + 2.9678e6 / (tempw * tempw) + 0.09911e3 / tempw + 0.244063; + } else { + x_DD = -2.0064e9 / (tempw * tempw * tempw) + 1.9018e6 / (tempw * tempw) + 0.24748e3 / tempw + 0.237040; + } + + y_DD = -3.0 * x_DD * x_DD + 2.87 * x_DD - 0.275; + //calculate D -daylight in function of s0, s1, s2 and temp ==> x_D y_D + //S(lamda)=So(lambda)+m1*s1(lambda)+m2*s2(lambda) + interm2 = (0.0241 + 0.2562 * x_DD - 0.734 * y_DD); + m11 = (-1.3515 - 1.7703 * x_DD + 5.9114 * y_DD) / interm2; + m22 = (0.03 - 31.4424 * x_DD + 30.0717 * y_DD) / interm2; + + for (int i = 0; i < N_c; i++) { + spectrum_to_color_xyz_daylight(spec_colorforxcyc[i], m11, m22, Refxyz[i].Xref, Refxyz[i].Yref, Refxyz[i].Zref); + } + } + +//CAT02 + + float CAM02BB00 = 1.0, CAM02BB01 = 1.0, CAM02BB02 = 1.0, CAM02BB10 = 1.0, CAM02BB11 = 1.0, CAM02BB12 = 1.0, CAM02BB20 = 1.0, CAM02BB21 = 1.0, CAM02BB22 = 1.0; //for CIECAT02 + float Xwb = Txyz[tt].XX; + float Ywb = 1.; + float Zwb = Txyz[tt].ZZ; + + if (wbcat02Method == "icam") {//not used + icieCAT02float(Xwb, Ywb, Zwb, CAM02BB00, CAM02BB01, CAM02BB02, CAM02BB10, CAM02BB11, CAM02BB12, CAM02BB20, CAM02BB21, CAM02BB22, 1.0); + } + + if (wbcat02Method == "cam") { + + cieCAT02float(Xwb, Ywb, Zwb, CAM02BB00, CAM02BB01, CAM02BB02, CAM02BB10, CAM02BB11, CAM02BB12, CAM02BB20, CAM02BB21, CAM02BB22, 1.0); + } + + if (wbcat02Method == "none") { + + for (int i = 0; i < N_c; i++) { + Refxyzcat02[i].Xrefcat = CAM02BB00 * Refxyz[i].Xref + CAM02BB01 * Refxyz[i].Yref + CAM02BB02 * Refxyz[i].Zref ; + Refxyzcat02[i].Yrefcat = CAM02BB10 * Refxyz[i].Xref + CAM02BB11 * Refxyz[i].Yref + CAM02BB12 * Refxyz[i].Zref ; + Refxyzcat02[i].Zrefcat = CAM02BB20 * Refxyz[i].Xref + CAM02BB21 * Refxyz[i].Yref + CAM02BB22 * Refxyz[i].Zref; + } + } + +//end CAT02 + + for (int i = 0; i < N_c; i++) { + /* float X = 65535.f * Refxyzcat02[i].Xrefcat; + float Y = 65535.f * Refxyzcat02[i].Yrefcat; + float Z = 65535.f * Refxyzcat02[i].Zrefcat; + float L, a, b; + Color::XYZ2Lab(X, Y, Z, L, a, b); + + double som = (Refxyzcat02[i].Xrefcat + Refxyzcat02[i].Yrefcat + Refxyzcat02[i].Zrefcat); + L /= 327.68f; + a /= 327.68f; + b /= 327.68f; + Ta[i][tt] = a; + Tb[i][tt] = b; + TL[i][tt] = L; + TX[i][tt] = X; + TY[i][tt] = Y; + TZ[i][tt] = Z; + */ + //som = 1.; +// Tx[i][tt] = (float) Refxyz[i].Xref; +// Ty[i][tt] = (float) Refxyz[i].Yref; +// Tz[i][tt] = (float) Refxyz[i].Zref; + +// if (wbpar.wbcat02Method == "none") { + if (wbcat02Method == "none") { + + Tx[i][tt] = (float) Refxyz[i].Xref; + Ty[i][tt] = (float) Refxyz[i].Yref; + Tz[i][tt] = (float) Refxyz[i].Zref; + } else { + Tx[i][tt] = (float) Refxyzcat02[i].Xrefcat; + Ty[i][tt] = (float) Refxyzcat02[i].Yrefcat; + Tz[i][tt] = (float) Refxyzcat02[i].Zrefcat; + } + + } + } + } +} + } diff --git a/rtengine/colortemp.h b/rtengine/colortemp.h index d529d844e..1c50f282a 100644 --- a/rtengine/colortemp.h +++ b/rtengine/colortemp.h @@ -22,6 +22,7 @@ #include #include #include +#include "procparams.h" namespace rtengine { @@ -54,6 +55,7 @@ public: explicit ColorTemp (double e) : temp(-1.), green(-1.), equal (e), method("Custom") {} ColorTemp (double t, double g, double e, const std::string &m); ColorTemp (double mulr, double mulg, double mulb, double e); + static void tempxy(bool separated, int &repref, float **Tx, float **Ty, float **Tz, float **Ta, float **Tb, float **TL, double *TX, double *TY, double *TZ, const procparams::WBParams & wbpar); void update (const double rmul, const double gmul, const double bmul, const double equal, const double tempBias=0.0) { @@ -96,6 +98,8 @@ public: static void temp2mulxyz (double tem, const std::string &method, double &Xxyz, double &Zxyz); static void cieCAT02(double Xw, double Yw, double Zw, double &CAM02BB00, double &CAM02BB01, double &CAM02BB02, double &CAM02BB10, double &CAM02BB11, double &CAM02BB12, double &CAM02BB20, double &CAM02BB21, double &CAM02BB22, double adap ); + static void cieCAT02float(float Xw, float Yw, float Zw, float &CAM02BB00, float &CAM02BB01, float &CAM02BB02, float &CAM02BB10, float &CAM02BB11, float &CAM02BB12, float &CAM02BB20, float &CAM02BB21, float &CAM02BB22, float adap); + static void icieCAT02float(float Xw, float Yw, float Zw, float &iCAM02BB00, float &iCAM02BB01, float &iCAM02BB02, float &iCAM02BB10, float &iCAM02BB11, float &iCAM02BB12, float &iCAM02BB20, float &iCAM02BB21, float &iCAM02BB22, float adap); bool operator== (const ColorTemp& other) const { @@ -163,6 +167,125 @@ public: static const double ColorchechGreD1_spect[97]; static const double ColorchechSGBlaN3_6_spect[97];//ColorChecker SG N3 static const double JDC468_GraK14_44_spect[97];//468 K14 + static const double JDC468_BluM5_spect[97]; //468 M5 + static const double JDC468_BluD6_spect[97]; //468 D6 + static const double JDC468_BluF4_spect[97]; //468 F4 + static const double JDC468_RedG21va_spect[97]; //468 G21 modifié + static const double JDC468_RedI9_spect[97]; //468 I9 + static const double JDC468_GreI8_spect[97]; //468 I8 + static const double JDC468_GreQ7_spect[97]; //468 Q7 + static const double ColorGreenM25_spect[97]; + static const double ColorYellowkeltano_spect[97]; + static const double ColorGreenalsi_spect[97]; + static const double ColorRedpetunia_spect[97]; + static const double ColorRedkurttu_spect[97]; + static const double ColorRedlupiini_spect[97]; + static const double ColorRedhevosminttu_spect[97]; + static const double ColorRedneilikka_spect[97]; + static const double ColorRedpelagornia_spect[97]; + static const double ColorRedtalvio_spect[97]; + static const double ColorBrownpoimulehti_spect[97]; + static const double ColorOrangetuntematon_spect[97]; + static const double ColorOrangetlehmus_spect[97]; + static const double ColorOrangvaahtera_spect[97]; + static const double ColorBrownlehmus_spect[97]; + static const double ColorBrownuotiosammal_spect[97]; + static const double ColorBlacksoil_spect[97]; + static const double ColorGraynahjajaekaelae_spect[97]; + static const double ColorGreennuotisammal_spect[97]; + static const double ColorGreenleskenlehti_spect[97]; + static const double ColorGreenlinnunkaali_spect[97]; + static const double ColorGreenpelto_spect[97]; + static const double ColorGreenrodvoikukka[97]; + static const double ColorGreenlehmus[97]; + static const double ColorGreenlinden[97]; + static const double ColorYellowlehmus[97]; + static const double ColorYellowsuikeroalpi[97]; + static const double ColorYellowpensashanhikki1[97]; + static const double ColorYellowpensashanhikki2[97]; + static const double ColorBluehiidenvirna[97]; + static const double ColorBluekurkkuyrtti[97]; + static const double ColorPinksiankaersaemoe[97]; + static const double ColorVioletharakankello[97]; + static const double ColorVioletalsikeapila[97]; + static const double ColorVioletakilleija[97]; + static const double ColorOrangekehaekukka[97]; + static const double ColorRedpihlaja[97]; + static const double ColorVioletpetunia[97]; + static const double ColorVioletorvokki[97]; + static const double ColorBluesinisievikki[97]; + static const double ColorBlueiisoppi[97]; + static const double ColorBluelobelia[97]; + static const double ColorWhiteojaka[97]; + static const double ColorWhitepetunia[97]; + static const double ColorWhitepelargonia[97]; + static const double ColorWhitepaeivaen[97]; + static const double JDC468_B14_75Redspect[97]; + static const double Colorblue_spect[97]; + static const double ColorGreenkoriste[97]; + static const double ColorGreenpoimulehti[97]; + static const double ColorGreenhopeapaju[97]; + static const double ColorReduuden[97]; + static const double ColorRedpajuan[97]; + static const double ColorRedjaloan[97]; + static const double ColorBlueukon[97]; + static const double ColorBlueorvokki[97]; + static const double ColorBluemalvikki[97]; + static const double ColorBlackmaito[97]; + static const double ColorOrangpihlaja[97]; + static const double ColorBlackpihlaja[97]; + static const double ColorViolA1_spect[97]; + static const double ColorViolA4_spect[97]; + static const double ColorViolA6_spect[97]; + static const double ColorBlueSkyK3_spect[97]; + static const double ColorBlueSkyK9_spect[97]; + static const double ColorBlueSkyC4_spect[97]; + static const double ColorBlueSkyC14_spect[97]; + static const double ColorBlueSkyE4_spect[97]; + static const double ColorBlueSkyM1_spect[97]; + static const double ColorBlueSky2B1_spect[97]; + static const double ColorBlueSkyT7_spect[97]; + static const double ColorBlueSkyU19_spect[97]; + static const double ColorBlueSkyU2_spect[97]; + static const double ColorBlueSkyT17_spect[97]; + static const double ColorBlackM8_spect[97]; + static const double ColorBlackM12_spect[97]; + static const double ColorBlackM13_spect[97]; + static const double ColorWhite2B12_spect[97]; + static const double ColorWhite2B14_spect[97]; + static const double JDC468_Blackred97_spect[97]; + static const double JDC468_Blackredbl443_spect[97]; + static const double JDC468_Blackbl27_spect[97]; + static const double JDC468_Blackbl28_spect[97]; + static const double JDC468_Blackgr214_spect[97]; + static const double JDC468_Blackbl436_spect[97]; + static const double JDC468_Whitebl455_spect[97]; + static const double JDC468_Blackvio101_spect[97]; + static const double JDC468_Whitebl92_spect[97]; + static const double JDC468_Greyredbl94_spect[97]; + static const double JDC468_Blue32_spect[97]; + static const double JDC468_Blue236_spect[97]; + static const double JDC468_Gre300_spect[97]; + static const double JDC468_Blue340_spect[97]; + static const double JDC468_Gree110_spect[97]; + static const double JDC468_Gree457_spect[97]; + static const double JDC468_Yel241_spect[97]; + static const double JDC468_Ora321_spect[97]; + static const double JDC468_Yellow353_spect[97]; + static const double JDC468_Mag465_spect[97]; + static const double JDC468_Mag333_spect[97]; + static const double JDC468_Mag203_spect[97]; + + + static const double JDC468_OraO18_spect[97]; //468 O18 + static const double JDC468_OraD17_spect[97]; //468 D17 + static const double Fictif_61greyspect[97];//468 K15 + static const double JDC468_K15_87greyspect[97]; + static const double JDC468_YelN10_spect[97]; //468 N10 + static const double JDC468_GreN7_spect[97]; //468 N7 + static const double JDC468_GreA10_spect[97]; //468 A10 + static const double JDC468_GreK7_spect[97]; //468 K7 + static const double JDC468_PurE24_spect[97]; //468 E24 static const double JDC468_BluH10_spect[97];//468 H10 static const double ColabSkin35_15_17_spect[97];//Skin L 35 static const double ColabSkin57_22_18_spect[97];//Skin L 57 @@ -196,6 +319,55 @@ public: static const double ColabSkin70_7_32_spect[97];//Skin L 77 static const double ColabSky60_0_m31_spect[97];//Sky L=60 static const double ColabSky42_0_m24_spect[97];//Sky L=42 + static const double J570_BlueB6_spect[97];//blue Cyan + static const double J570_BlueB15_spect[97];//blue Cyan + static const double J570_BlueC2_spect[97];//blue Cyan + static const double J570_BlueC14_spect[97];//blue Cyan + static const double J570_BlueC16_spect[97];//blue Cyan + static const double J570_BlueF1_spect[97];//blue Cyan + static const double J570_BlueF2_spect[97];//blue Cyan + static const double J570_BlueF10_spect[97];//blue Cyan + static const double J570_BlueF13_spect[97];//blue Cyan + static const double J570_BlueG9_spect[97];//blue Cyan + static const double J570_BlueG19_spect[97];//blue Cyan + static const double J570_BlueI5_spect[97];//blue Cyan + static const double J570_BlueH15_spect[97];//blue Cyan + static const double J570_BlueI3_spect[97];//blue Cyan + static const double J570_BlueI19_spect[97];//blue Cyan + static const double J570_BlueJ4_spect[97];//blue Cyan + static const double J570_BlueJ6_spect[97];//blue Cyan + static const double J570_BlueJ11_spect[97];//blue Cyan + static const double J570_BlueJ13_spect[97];//blue Cyan + static const double J570_BlueK5_spect[97];//blue Cyan + static const double J570_BlueN1_spect[97];//blue Cyan + static const double J570_BlueN4_spect[97];//blue Cyan + static const double J570_BlueO19_spect[97];//blue Cyan + static const double J570_BlueU8_spect[97];//blue Cyan + static const double J570_NeuN8_spect[97];//neutral + static const double J570_NeuN9_spect[97];//neutral + static const double J570_NeuO8_spect[97];//neutral + static const double J570_NeuO11_spect[97];//neutral + static const double J570_NeuD5_spect[97];//neutral + static const double J570_NeuE11_spect[97];//neutral + static const double J570_NeuK16_spect[97];//neutral + static const double J570_NeuM3_spect[97];//neutral + static const double J570_NeuN18_spect[97];//neutral + static const double J570_NeuQ1_spect[97];//neutral + static const double J570_NeuS7_spect[97];//neutral + static const double J570_NeuV10_spect[97];//neutral + static const double J570_NeuW18_spect[97];//neutral + static const double J570_NeuZ14_spect[97];//neutral + static const double J570_NeuC18_spect[97];//neutral + static const double J570_NeuD17_spect[97];//neutral + static const double J570_NeuJ11_spect[97];//neutral + static const double J570_NeuL4_spect[97];//neutral + static const double Colorlab_n72_n2_spect[97]; + static const double Colorlab_10_n70_spect[97]; + static const double Colorlab_n33_n70_spect[97]; + static const double Colorlab_n8_n74_spect[97]; + static const double Colorlab_19_n69_spect[97]; + static const double Colorlab_n80_10_spect[97]; + static const double Colorlab_n80_26_spect[97]; static void spectrum_to_xyz_daylight (double _m1, double _m2, double &x, double &y, double &z); static void spectrum_to_xyz_blackbody (double _temp, double &x, double &y, double &z); diff --git a/rtengine/iimage.h b/rtengine/iimage.h index ff016df1a..bda390895 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -26,6 +26,7 @@ #include "imagedimensions.h" #include "LUT.h" #include "coord2d.h" +#include "procparams.h" #include "color.h" #include "../rtgui/threadutils.h" @@ -102,6 +103,10 @@ public: { rm = gm = bm = 1.0; } + virtual void getAutoWBMultipliersloc(double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw) + { + rm = gm = bm = 1.0; + } }; diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index a18cca9d7..089cb3bae 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -105,6 +105,8 @@ public: virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) = 0; virtual ColorTemp getWB () const = 0; virtual ColorTemp getSpotWB (std::vector &red, std::vector &green, std::vector &blue, int tran, double equal) = 0; + virtual void WBauto(double &tempref, double &greenref, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams &cmp, const RAWParams &raw) = 0; + virtual void getrgbloc(bool local, bool gamma, bool cat02, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w) = 0; virtual double getDefGain () const { diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 01f9892bf..e718087ec 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -330,6 +330,21 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) // if a demosaic happened we should also call getimage later, so we need to set the M_INIT flag todo |= M_INIT; + bool autowb0 = false; + // bool autoitc = false; + autowb0 = (params->wb.method == "autold" || params->wb.method == "aut" || params->wb.method == "autosdw" || params->wb.method == "autedgsdw" || params->wb.method == "autitcgreen" || params->wb.method == "autedgrob" || params->wb.method == "autedg" || params->wb.method == "autorobust"); + // autoitc = (params.wb.method == "autitcgreen"); + // bool gamma = false; + // bool cat = false; +// if (params.wb.wbcat02Method == "cam" && autoitc) { +// cat = true; +// } + + if (autowb0) { + imgsrc->getrgbloc(false, false, false, 0, 0, fh, fw, 0, 0, fh, fw); + } + + if (highDetailNeeded) { highDetailRawComputed = true; } else { @@ -360,6 +375,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } } + bool autowb = false; + autowb = (params->wb.method == "autold" || params->wb.method == "aut" || params->wb.method == "autosdw" || params->wb.method == "autedgsdw" || params->wb.method == "autitcgreen" || params->wb.method == "autedgrob" || params->wb.method == "autedg" || params->wb.method == "autorobust"); + if (todo & (M_INIT | M_LINDENOISE | M_HDR)) { MyMutex::MyLock initLock(minit); // Also used in crop window diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 1c05fbbad..cfa35ee01 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1230,7 +1230,15 @@ const std::vector& WBParams::getWbEntries() { static const std::vector wb_entries = { {"Camera", WBEntry::Type::CAMERA, M("TP_WBALANCE_CAMERA"), 0, 1.f, 1.f, 0.f}, - {"Auto", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTO"), 0, 1.f, 1.f, 0.f}, + // {"Auto", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTO"), 0, 1.f, 1.f, 0.f}, + {"autitcgreen", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTOITCGREEN"), 0, 1.f, 1.f, 0.f}, + {"autold", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTOOLD"), 0, 1.f, 1.f, 0.f}, + {"aut", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTODEM"), 0, 1.f, 1.f, 0.f}, + {"autedg", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTOEDGE"), 0, 1.f, 1.f, 0.f}, + {"autorobust", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTOROB"), 0, 1.f, 1.f, 0.f}, + {"autosdw", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTOSDW"), 0, 1.f, 1.f, 0.f}, + {"autedgsdw", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTOEDGESW"), 0, 1.f, 1.f, 0.f}, + {"autedgrob", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTOEDGEROB"), 0, 1.f, 1.f, 0.f}, {"Daylight", WBEntry::Type::DAYLIGHT, M("TP_WBALANCE_DAYLIGHT"), 5300, 1.f, 1.f, 0.f}, {"Cloudy", WBEntry::Type::CLOUDY, M("TP_WBALANCE_CLOUDY"), 6200, 1.f, 1.f, 0.f}, {"Shade", WBEntry::Type::SHADE, M("TP_WBALANCE_SHADE"), 7600, 1.f, 1.f, 0.f}, diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 3b2738405..7d4f613f9 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -37,6 +37,9 @@ #include "pdaflinesfilter.h" #include "camconst.h" #include "procparams.h" +#define BENCHMARK +#include "StopWatch.h" + #ifdef _OPENMP #include #endif @@ -450,8 +453,11 @@ RawImageSource::RawImageSource () , ri(nullptr) , rawData(0, 0) , green(0, 0) + , greenloc(0, 0) , red(0, 0) + , redloc(0, 0) , blue(0, 0) + , blueloc(0, 0) , rawDirty(true) , histMatchingParams(new procparams::ColorManagementParams) { @@ -2285,6 +2291,19 @@ void RawImageSource::flushRGB() if (blue) { blue(0, 0); } + + if (greenloc) { + greenloc(0, 0); + } + + if (redloc) { + redloc(0, 0); + } + + if (blueloc) { + blueloc(0, 0); + } + } void RawImageSource::HLRecovery_Global(const ToneCurveParams &hrp) @@ -4350,6 +4369,3764 @@ void RawImageSource::getRowStartEnd (int x, int &start, int &end) } } + +static void histoxyY(int bfhitc, int bfwitc, array2D & xc, array2D & yc, array2D & Yc, float *xxx, float * yyy, float * YYY, int * histxy, float * area, int * inter) + +{ + int nh = 0; +// int nc = 0; + // int nc2 = 0; + + for (int y = 0; y < bfhitc ; y++) { + for (int x = 0; x < bfwitc ; x++) { + + if (xc[y][x] < 0.12f && xc[y][x] > 0.03f) { // near Prophoto + + if (yc[y][x] < 0.2f && yc[y][x] > 0.1f) { + nh = 0; + histxy[nh]++; + area[nh] = 50.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + + YYY[nh] += Yc[y][x]; + + // nc = 0; + //blue hard + } else if (yc[y][x] < 0.3f) { + nh = 1; + histxy[nh]++; + area[nh] = 60.f; + inter[nh] = 1; + YYY[nh] += Yc[y][x]; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + + // nc = 1; + + //blue + } else if (yc[y][x] < 0.4f) { + nh = 2; + histxy[nh]++; + area[nh] = 80.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + // nc = 1; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + //blue green + nh = 3; + histxy[nh]++; + area[nh] = 100.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + // nc = 1; + + } else if (yc[y][x] < 0.6f) { + nh = 4; + histxy[nh]++; + area[nh] = 120.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + // nc = 1; + + } else if (yc[y][x] < 0.82f) { + //green + nh = 5; + histxy[nh]++; + area[nh] = 240.f; + inter[nh] = 1; + // nc = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } + } else if (xc[y][x] < 0.24f) { + if (yc[y][x] < 0.2f && yc[y][x] > 0.05f) { + nh = 6; + histxy[nh]++; + area[nh] = 230.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + // nc = 2; + + } else if (yc[y][x] < 0.3f) { + nh = 7; + histxy[nh]++; + area[nh] = 240.f; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + // nc = 2; + + } else if (yc[y][x] < 0.4f) { + nh = 8; + histxy[nh]++; + area[nh] = 240.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + // nc = 2; + + } else if (yc[y][x] < 0.5f) { + nh = 9; + histxy[nh]++; + area[nh] = 240.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + // nc = 2; + // nc2 = 3; + + } else if (yc[y][x] < 0.6f) { + nh = 10; + histxy[nh]++; + area[nh] = 240.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + // nc = 3; + + } else if (yc[y][x] < 0.75f) { + nh = 11; + histxy[nh]++; + area[nh] = 400.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + // nc = 3; + + } + + } else if (xc[y][x] < 0.28f) {//blue sky and other + if (yc[y][x] < 0.2f && yc[y][x] > 0.1f) { + nh = 12; + histxy[nh]++; + area[nh] = 80.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.25f) { + nh = 13; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 14; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.33f) { + nh = 15; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 16; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 17; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 18; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.5f) { + nh = 19; + histxy[nh]++; + area[nh] = 25.f; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.6f) { + nh = 20; + histxy[nh]++; + area[nh] = 50.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.75f) { + nh = 21; + histxy[nh]++; + area[nh] = 60.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + } else if (xc[y][x] < 0.31f) {//near neutral others + if (yc[y][x] < 0.2f && yc[y][x] > 0.1f) { + nh = 22; + histxy[nh]++; + area[nh] = 50.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 23; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 24; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.32f) { + nh = 25; + histxy[nh]++; + area[nh] = 9.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.36f) { + nh = 26; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 27; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.5f) { + nh = 28; + histxy[nh]++; + area[nh] = 30.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.7f) { + nh = 29; + histxy[nh]++; + area[nh] = 45.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + } else if (xc[y][x] < 0.325f) {//neutral 34 + if (yc[y][x] < 0.2f && yc[y][x] > 0.1f) { + nh = 30; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 31; + histxy[nh]++; + area[nh] = 6.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 32; + histxy[nh]++; + area[nh] = 7.5f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 33; + histxy[nh]++; + area[nh] = 4.5f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.34f) { + nh = 34; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 35; + histxy[nh]++; + area[nh] = 4.5f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 36; + histxy[nh]++; + area[nh] = 4.5f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 37; + histxy[nh]++; + area[nh] = 7.5f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 38; + histxy[nh]++; + area[nh] = 7.5f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.55f) { + nh = 39; + histxy[nh]++; + area[nh] = 7.5f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.7f) { + nh = 40; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.335f) {//neutral + if (yc[y][x] < 0.2f && yc[y][x] > 0.1f) { + nh = 41; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 42; + histxy[nh]++; + area[nh] = 4.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 43; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 44; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.33f) { + nh = 45; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.34f) { + nh = 46; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.35f) { + nh = 47; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.36f) { + nh = 48; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 47; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.38f) { + nh = 48; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 49; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 50; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 51; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.55f) { + nh = 52; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.7f) { + nh = 53; + histxy[nh]++; + area[nh] = 10.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.345f) {//neutral 37 + if (yc[y][x] < 0.2f && yc[y][x] > 0.1f) { + nh = 54; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 55; + histxy[nh]++; + area[nh] = 4.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 56; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 57; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.33f) {//34 + nh = 58; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.34f) { + nh = 59; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.35f) {//34 + nh = 60; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.36f) {//34 + nh = 61; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 62; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.38f) { + nh = 63; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.39f) { + nh = 64; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 65; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.42f) { + nh = 66; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 67; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.48f) { + nh = 68; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 69; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.55f) { + nh = 70; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.65f) { + nh = 71; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.355f) {//neutral 37 + if (yc[y][x] < 0.2f && yc[y][x] > 0.1f) { + nh = 72; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 73; + histxy[nh]++; + area[nh] = 4.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 74; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 75; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.33f) {//34 + nh = 76; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.34f) { + nh = 77; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.35f) {//34 + nh = 78; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.36f) {//34 + nh = 79; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 80; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.38f) { + nh = 81; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.39f) { + nh = 82; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 83; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.42f) { + nh = 84; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 85; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.48f) { + nh = 68; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 86; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.55f) { + nh = 87; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.65f) { + nh = 88; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.365f) { //0.4 + if (yc[y][x] < 0.2f && yc[y][x] > 0.15f) { + nh = 89; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.24f) { + nh = 90; + histxy[nh]++; + area[nh] = 4.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 91; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 92; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.33f) { + nh = 93; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.34f) { + nh = 94; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.36f) { + nh = 95; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 5; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 96; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.38f) { + nh = 97; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.39f) { + nh = 98; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 99; + histxy[nh]++; + area[nh] = 1.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + } else if (yc[y][x] < 0.42f) { + nh = 100; + histxy[nh]++; + area[nh] = 2.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 101; + histxy[nh]++; + area[nh] = 3.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 102; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.55f) { + nh = 103; + histxy[nh]++; + area[nh] = 5.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.63f) { + nh = 104; + histxy[nh]++; + area[nh] = 10.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.405f) {//45 + if (yc[y][x] < 0.2f && yc[y][x] > 0.15f) { + nh = 105; + histxy[nh]++; + area[nh] = 40.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 106; + histxy[nh]++; + area[nh] = 16.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 107; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 108; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.34f) { + nh = 109; + histxy[nh]++; + area[nh] = 8.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 110; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 111; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 112; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 113; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.55f) { + nh = 114; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.6f) { + nh = 115; + histxy[nh]++; + area[nh] = 16.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.445f) {//45 + if (yc[y][x] < 0.2f && yc[y][x] > 0.15f) { + nh = 116; + histxy[nh]++; + area[nh] = 40.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 117; + histxy[nh]++; + area[nh] = 16.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 118; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 119; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.34f) { + nh = 120; + histxy[nh]++; + area[nh] = 8.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 121; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 122; + histxy[nh]++; + area[nh] = 12.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 123; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 124; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.55f) { + nh = 125; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.58f) { + nh = 126; + histxy[nh]++; + area[nh] = 16.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.495f) { + if (yc[y][x] < 0.2f && yc[y][x] > 0.15f) { + nh = 127; + histxy[nh]++; + area[nh] = 40.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 128; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 129; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 130; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.34f) { + nh = 131; + histxy[nh]++; + area[nh] = 10.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 132; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 133; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 3; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 134; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 135; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.55f) { + nh = 136; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + } else if (xc[y][x] < 0.545f) { + if (yc[y][x] < 0.2f && yc[y][x] > 0.15f) { + nh = 137; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.24f) { + nh = 138; + histxy[nh]++; + area[nh] = 20.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.29f) { + nh = 139; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.32f) { + nh = 140; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.34f) { + nh = 141; + histxy[nh]++; + area[nh] = 10.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.37f) { + nh = 142; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 143; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.45f) { + nh = 144; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.5f) { + nh = 145; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + + } + + } else if (xc[y][x] < 0.595f) { + if (yc[y][x] < 0.22f && yc[y][x] > 0.15f) { + nh = 146; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.25f) { + nh = 147; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.3f) { + nh = 148; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.35f) { + nh = 149; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.4f) { + nh = 160; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.45f) { + nh = 161; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.65f) { + if (yc[y][x] < 0.25f && yc[y][x] > 0.12f) { + nh = 162; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.3f) { + nh = 163; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } else if (yc[y][x] < 0.35f) { + nh = 164; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 2; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } else if (yc[y][x] < 0.45f) { + nh = 165; + histxy[nh]++; + area[nh] = 15.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + } + + } else if (xc[y][x] < 0.75f && yc[y][x] > 0.1f) { + nh = 166; + histxy[nh]++; + area[nh] = 25.f; + inter[nh] = 1; + xxx[nh] += xc[y][x]; + yyy[nh] += yc[y][x]; + YYY[nh] += Yc[y][x]; + + + } + + } + } +} + + + + +void static studentXY(array2D & YYcurr, array2D & reffYY, int sizcurr, int Nc, int tt, float & student) +{ + //calculate Student coeff YY + float somcurrY = 0.f; + float somreffY = 0.f; + float somcurr2Y = 0.f; + float somreff2Y = 0.f; + float somsqueccurrY = 0.f; + float somsquecreffY = 0.f; + int sizestucurrY = sizcurr; + int sizestureffY = Nc; + + for (int i = 0; i < sizestucurrY; i++) { + somcurrY += 100.f * YYcurr[i][tt]; + //sum observations first group + } + + for (int i = 0; i < sizestureffY; i++) { + somreffY += 100.f * reffYY[i][tt]; + //sum observations second group + + } + + + for (int i = 0; i < sizestucurrY; i++) { + somcurr2Y += SQR(100.f * YYcurr[i][tt]); + //sum sqr observations first group + + } + + for (int i = 0; i < sizestureffY; i++) { + somreff2Y += SQR(100.f * reffYY[i][tt]); + //sum sqr observations second group + + } + + somsqueccurrY = somcurr2Y - (SQR(somcurrY)) / sizestucurrY; + //sum sqr differences first + somsquecreffY = somreff2Y - (SQR(somreffY)) / sizestureffY; + //sum sqr differences second + + float diviY = sqrt(((somsqueccurrY + somsquecreffY) * (1.f / (float)sizestucurrY + 1.f / (float)sizestureffY)) / (sizestucurrY + sizestureffY - 2)); + //divisor student + float numerY = ((float)somcurrY / (float)sizestucurrY) - ((float)somreffY / (float)sizestureffY); + //numerator student +// printf("num=%f divY=%f \n", numerY, diviY); + + student = numerY / diviY ; + //student coeeficient +} + +/* +static void SdwWB(const array2D &redloc, const array2D &greenloc, const array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm) +{ + //Standard deviation weighted Gary World - from Lan rt al. + constexpr float clipHigh = 64000.f; + constexpr float clipLow = 1500.f; + + float MeanG[12] = { }; + float SigmaG[12] = { }; + + float MeanR[12] = { }; + float SigmaR[12] = { }; + + float MeanB[12] = { }; + float SigmaB[12] = { }; + + //divide in 12 areas + int partw, parth; + int yh, xw; + + if (bfw > bfh) { + partw = bfw / 4; + parth = bfh / 3; + xw = 4; + yh = 3; + } else { + partw = bfw / 3; + parth = bfh / 4; + xw = 3; + yh = 4; + } + + float SigmaGG = 0.f, SigmaRR = 0.f, SigmaBB = 0.f; + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic) collapse(2) +#endif + + for (int w = 0; w < xw ; ++w) { + for (int h = 0; h < yh ; ++h) { + float meanr = 0.f; + float meang = 0.f; + float meanb = 0.f; + int nr = 0; + int ng = 0; + int nb = 0; + + for (int y = h * parth; y < (h + 1) * parth; ++y) { + for (int x = w * partw; x < (w + 1) * partw; ++x) { + if (greenloc[y][x] > clipLow && greenloc[y][x] < clipHigh) { + meang += greenloc[y][x]; + ng++; + } + + if (redloc[y][x] > clipLow && redloc[y][x] < clipHigh) { + meanr += redloc[y][x]; + nr++; + } + + if (blueloc[y][x] > clipLow && blueloc[y][x] < clipHigh) { + meanb += blueloc[y][x]; + nb++; + } + } + } + + int i = w + h * xw; + + if (ng > 0) { + meang /= ng; + } + + if (nr > 0) { + meanr /= nr; + } + + if (nb > 0) { + meanb /= nb; + } + + MeanG[i] = meang; + MeanR[i] = meanr; + MeanB[i] = meanb; + + float sigmar = 0.f; + float sigmag = 0.f; + float sigmab = 0.f; + + for (int y = h * parth; y < (h + 1) * parth; ++y) { + for (int x = w * partw; x < (w + 1) * partw; ++x) { + if (greenloc[y][x] > clipLow && greenloc[y][x] < clipHigh) { + sigmag += SQR(meang - greenloc[y][x]) ; + } + + if (redloc[y][x] > clipLow && redloc[y][x] < clipHigh) { + sigmar += SQR(meanr - redloc[y][x]); + } + + if (blueloc[y][x] > clipLow && blueloc[y][x] < clipHigh) { + sigmab += SQR(meanb - blueloc[y][x]); + } + } + } + + SigmaG[i] = sigmag; + SigmaR[i] = sigmar; + SigmaB[i] = sigmab; + + if (ng > 0) { + SigmaG[i] = sqrt(SigmaG[i] / ng); + } + + if (nr > 0) { + SigmaR[i] = sqrt(SigmaR[i] / nr); + } + + if (nb > 0) { + SigmaB[i] = sqrt(SigmaB[i] / nb); + } + +#ifdef _OPENMP + #pragma omp critical +#endif + { + SigmaGG += SigmaG[i]; + SigmaRR += SigmaR[i]; + SigmaBB += SigmaB[i]; + } + } + } + + float StdavgG = 0.f, StdavgR = 0.f, StdavgB = 0.f; + constexpr float epsilo = 0.01f; + + for (int k = 0; k < 12 ; k++) { + StdavgG += (SigmaG[k] * MeanG[k]) / (SigmaGG + epsilo); + StdavgR += (SigmaR[k] * MeanR[k]) / (SigmaRR + epsilo); + StdavgB += (SigmaB[k] * MeanB[k]) / (SigmaBB + epsilo); + + } + + avg_gm = (StdavgG + StdavgB + StdavgR) / (3 * StdavgG); + avg_rm = (StdavgG + StdavgB + StdavgR) / (3 * StdavgR); + avg_bm = (StdavgG + StdavgB + StdavgR) / (3 * StdavgB); + + avg_gm *= 10000.f; + avg_rm *= 10000.f; + avg_bm *= 10000.f; + +} +*/ + +/* +static void RobustWB(array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm) +{ + BENCHFUN + // inspired by "Robust automatic WB algorithm using grey colour points in Images" + // Jy Huo, Yl Chang, J.Wang Xx Wei + // robust = true; +// printf("Robust WB\n"); + const int bfwr = bfw / 4 + 1 ;//5 middle value to keep good result and reduce time + const int bfhr = bfh / 4 + 1; + + array2D rl(bfwr, bfhr); + array2D gl(bfwr, bfhr); + array2D bl(bfwr, bfhr); + + // copy data to smaller arrays to reduce memory pressure in do-while loop +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int y = 0; y < bfh ; y += 4) { + int yy = y / 4; + + for (int x = 0; x < bfw ; x += 4) { + int xx = x / 4; + rl[yy][xx] = redloc[y][x]; + gl[yy][xx] = greenloc[y][x]; + bl[yy][xx] = blueloc[y][x]; + } + } + + float *Uba = new float [204]; + float *Vba = new float [204]; + + constexpr float Th = 0.1321f; //Threshold 0.1321f 0.097f 0.2753f if necessary + //wr, wb, wg multipliers for each channel RGB + float wr = 1.f; + float wg = 1.f; + float wb = 1.f; + constexpr float mu = 0.002f;//std variation + constexpr float mu2 = 0.0012f;//first reduce variation + constexpr float mu3 = 0.0007f;//second variation + int itera = 0; + int minim = 1; + int realitera = 1; + + int Kx = 0; + + do {//iterative WB + float Ubarohm = 0.f, Vbarohm = 0.f; + itera++; + int Nf = 0; +#ifdef _OPENMP + #pragma omp parallel for reduction(+:Ubarohm, Vbarohm, Nf) schedule(dynamic,16) +#endif + + for (int y = 0; y < bfhr ; ++y) { + for (int x = 0; x < bfwr ; ++x) { + + //calculate YUV from RGB and wr, wg, wb + float Y0 = 0.299f * wr * rl[y][x] + 0.587f * wg * gl[y][x] + 0.114f * wb * bl[y][x]; + float U0 = -0.14713f * wr * rl[y][x] - 0.28886f * wg * gl[y][x] + 0.436f * wb * bl[y][x]; + float V0 = 0.615f * wr * rl[y][x] - 0.51498f * wg * gl[y][x] - 0.10001f * wb * bl[y][x]; + + //FYUX function to detect grey points + if (fabs(U0) + fabs(V0) < Th * Y0) {//grey values + Nf++; + Ubarohm += U0; + Vbarohm += V0; + } + + + } + } + + Ubarohm /= Nf; + Uba[itera] = Ubarohm;//stock value Ubarohm + Vba[itera] = Vbarohm;//stock value Vbarohm + + if (itera > 5 && minim < 2) { + if ((fabs(Uba[itera] - Uba[itera - 2]) < 0.001f) && (fabs(Vba[itera] - Vba[itera - 2]) < 0.001f)) { + //printf("DUba=%f Dvba=%f\n", Uba[itera] - Uba[itera - 2], Vba[itera] - Vba[itera - 2]); + realitera = itera; + minim = 2; //accelerate convergence - not in original algorithm + } + } + + if (itera > 10 && minim == 2 && itera > realitera + 3) { + if ((fabs(Uba[itera] - Uba[itera - 2]) < 0.001f) && (fabs(Vba[itera] - Vba[itera - 2]) < 0.001f)) { + minim = 3; //accelerate second time if necessary convergence, - not in original algorithm + } + + } + + Vbarohm /= Nf; // QUESTION INGO: why is this not done before the value is saved to Vba[itera]? Bug or intentional? + // printf ("Nf=%i max=%i U=%f V=%f\n", Nf, bfh*bfw, Ubarohm, Vbarohm); + Kx = 0; + constexpr float aa = 0.8f;//superior limit if epsil > aa increase variation + constexpr float bb = 0.15f;//inferior limit if epsil < bb exit + int ind = 1; + + float phi = 0.f; + + if ((fabs(Ubarohm) > fabs(Vbarohm)) || (Ubarohm != 0.f && fabs(Ubarohm) == fabs(Vbarohm))) { + phi = Ubarohm; + ind = 1; + } else if (fabs(Ubarohm) < fabs(Vbarohm)) { + phi = Vbarohm; + ind = 2; + } else if (Ubarohm == 0.f && Vbarohm == 0.f) { + phi = 0.f; + ind = 3; + } + + int sign = SGN(-phi); + + if (fabs(phi) >= aa) { + Kx = 2 * sign; + } + + if (fabs(phi) < aa && fabs(phi) >= bb) { + Kx = sign; + } + + if (fabs(phi) < bb) { + Kx = 0; + } + + // + float mur = mu; + + if (minim == 2) { + mur = mu2; + } else if (minim == 3) { + mur = mu3; + } + + if (ind == 1) { + wb += mur * Kx; + } else if (ind == 2) { + wr += mur * Kx; + } + + //printf ("epsil=%f iter=%i wb=%f wr=%f U=%f V=%f mu=%f\n", fabs (epsil), itera, wb, wr, Ubarohm, Vbarohm, mur); + } while (Kx != 0 && itera <= 200); //stop iterations in normal case Kx =0, or if WB iteration do not converge + + delete Uba; + delete Vba; +// printf("epsil=%f iter=%i wb=%f wr=%f mu=%f\n", fabs(epsil), itera, wb, wr, mur); + + avg_rm = 10000.* wr; + avg_gm = 10000.* wg; + avg_bm = 10000.* wb; + // printf("Robust ar%f ag=%f ab=%f\n", avg_rm, avg_gm, avg_bm); + +} +*/ +/* +static void SobelWB(array2D &redsobel, array2D &greensobel, array2D &bluesobel, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh) +{ + BENCHFUN + int GX[3][3]; + int GY[3][3]; + + //Sobel Horizontal + GX[0][0] = 1; + GX[0][1] = 0; + GX[0][2] = -1; + GX[1][0] = 2; + GX[1][1] = 0; + GX[1][2] = -2; + GX[2][0] = 1; + GX[2][1] = 0; + GX[2][2] = -1; + + //Sobel Vertical + GY[0][0] = 1; + GY[0][1] = 2; + GY[0][2] = 1; + GY[1][0] = 0; + GY[1][1] = 0; + GY[1][2] = 0; + GY[2][0] = -1; + GY[2][1] = -2; + GY[2][2] = -1; + // inspired from Chen Guanghua Zhang Xiaolong + // edge detection to improve auto WB + + { +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int y = 0; y < bfh ; y++) { + for (int x = 0; x < bfw ; x++) { + if (y == 0 || y == bfh - 1 || x == 0 || x == bfw - 1) { + redsobel[y][x] = 0.f; + greensobel[y][x] = 0.f; + bluesobel[y][x] = 0.f; + } else { + float sumXr = 0.f; + float sumYr = 0.f; + float sumXg = 0.f; + float sumYg = 0.f; + float sumXb = 0.f; + float sumYb = 0.f; + + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + sumXr += GX[j + 1][i + 1] * redloc[y + i][x + j]; + sumXg += GX[j + 1][i + 1] * greenloc[y + i][x + j]; + sumXb += GX[j + 1][i + 1] * blueloc[y + i][x + j]; + sumYr += GY[j + 1][i + 1] * redloc[y + i][x + j]; + sumYg += GY[j + 1][i + 1] * greenloc[y + i][x + j]; + sumYb += GY[j + 1][i + 1] * blueloc[y + i][x + j]; + } + } + + //Edge strength + //we can add if need teta = atan2 (sumYr, sumXr) + redsobel[y][x] = CLIP(sqrt(SQR(sumXr) + SQR(sumYr))); + greensobel[y][x] = CLIP(sqrt(SQR(sumXg) + SQR(sumYg))); + bluesobel[y][x] = CLIP(sqrt(SQR(sumXb) + SQR(sumYb))); + } + } + } + } +} +*/ + +void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, const ColorManagementParams &cmp, const RAWParams &raw, const WBParams & wbpar) +{ + /* + copyright Jacques Desmis 6 - 2018 jdesmis@gmail.com + + This algorithm try to find temperature correlation between 20 to 200 color between 200 spectral color and about 20 to 55 color found in the image, I just found the idea in the web "correlate with chroma" instead of RGB grey point,but I don't use any algo found on the web. + + I have test many many algo to find the first one that work :) + Probably (sure) there are improvment to do... + + I have create a table temperature with temp and white point with 100 values between 2000K and 12000K we can obviously change these values, more...with different steps + I have create or recuparate and transformed 200 spectral colors from Colorchecker24, others color and my 468 colors target, or from web flowers, etc. with a step of 5nm, I think it is largey enough. + I think this value of 200 is now complete: I tested correlation with 60, 90, 100, 120, 155...better student increase with number of color, but now it seems stabilized + Of course we can increase this number :) + + 1) for the cuurent raw file we create a table for each temp of RGB multipliers + 2) then, I choose the "camera temp" to initialize calculation (why not) + 3) for this temp, I calculated XYZ values for the 200 spectrals datas + 4) then I create for the image an "histogram", but for xyY (Cie 1931 color space) + 5) for each pixel (in fact to accelerate only 1/10 for and 1/10 for y), I determine for each couple xy, the number of occurences + 6) I sort this result in ascending order + 7) in option we can sort in another maner to take into account chroma : chromax = x - white point x, chromay = y - white point y + 8) then I compare this result, with spectral datas found above in 3) with deltaE (limited to chroma) + 9) at this point we have xyY values that match Camera temp, and spectral datas associated + 10) then I recalculate RGB values from xyY histogram + 11) after, I vary temp, between 2000K to 12000K + 12) RGB values are recalcualted from 10) with RGB multipliers, and then xyY are calcualted for each temp + 13) spectral datas choose are recalculated with temp betwen 2000K to 12000K with matrix spectral calculation, that leeds to xyY values + 14) I calculated for each couple xy, Student correlation (without Snedecor test) + 15) the good result, is the best correlation + 16) we have found the best temperature where color image and color refences are correlate + 17) after we pass this value to improccoordinator + + 18) in a second part if camera green is out, I used an "extra" algorithm + 19) we make vary green between 2 limits (settings in option) + 20) betwen these green limits, we make slightly vary temp (settings in options) and recalculated RGB multipliers + 21) with this multipliers for the RGB color find in histogram we recalculate xyY + 22) we re-adjust references color for these xyY from 20) + 23) we add if chroma image is very low, k colors to degrad correlation + 24) then find all Student correlation for each couple green / temp + 25) sort these Student values, and choose the minimum + 26) then for the 3 better couple "temp / green" choose the one wher grren is neraest from 1. + + Some variables or function are not used, keep in case of + I have test with cat02 but result are not stable enough ! why ??, therefore cat02 neutralized + This operation is done (actually) 100 times and compare Student coefficient, and keep the absolute minimum, We can probably optimize.... + But actually the goal is to find the good algorithm ! + + I think, this algo is very good in most cases :) ...to verify of course. + You can used it in images :flowers, landscape, portrait, skin, where illuminants are "normal" (daylight, blackbody) + You must avoid when illuminant is non standard (fluorescent, LED...) and also, when the subject is lost in the image (some target to generate profiles). + + You can change 4 parameters in option.cc + Itcwb_thres : 34 by default ==> number of color used in final algorithm - between 10 and max 55 + Itcwb_sort : false by default, can improve algo if true, ==> sort value in something near chroma order, instead of histogram number + Itcwb_greenrange : 0 amplitude of green variation - between 0 to 2 + Itcwb_greendeltatemp : 1 - delta temp in green iterate loop for "extra" - between 0 to 4 + Itcwb_forceextra : false - if true force algorithm "extra" ("extra" is used when cmaera wbsettings are wrong) to all images + Itcwb_sizereference : 3 by default, can be set to 5 ==> size of reference color comapre to size of histogram real color + itcwb_delta : 1 by defaut can be set between 0 to 5 ==> delta temp to build histogram xy - if camera temp is not probably good + */ + // BENCHFUN + BENCHFUN + + + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix("sRGB"); + double wp[3][3] = { + {wprof[0][0], wprof[0][1], wprof[0][2]}, + {wprof[1][0], wprof[1][1], wprof[1][2]}, + {wprof[2][0], wprof[2][1], wprof[2][2]} + }; + + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix("sRGB"); + //inverse matrix user select + double wip[3][3] = { + {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, + {wiprof[1][0], wiprof[1][1], wiprof[1][2]}, + {wiprof[2][0], wiprof[2][1], wiprof[2][2]} + }; + + array2D xc; + array2D yc; + array2D Yc; + + + + array2D histcurr; + array2D histcurrref; + + array2D xxyycurr; + array2D xxyycurr_reduc; + array2D xx_curref; + array2D yy_curref; + array2D YY_curref; + array2D xx_curref_reduc; + array2D yy_curref_reduc; + array2D R_curref_reduc; + array2D G_curref_reduc; + array2D B_curref_reduc; + + array2D reff_spect_xxyy; + array2D reff_spect_xxyy_prov; + array2D YYcurr; + array2D YY_curref_reduc; + array2D YYcurr_reduc; + // array2D reffYY; + // array2D reffYY_prov; + + array2D reff_spect_yy_camera; + array2D reff_spect_xx_camera; + + + int bfwitc = bfw / 10 + 1 ;// 10 arbitrary value ; perhaps 4 or 5 or 20 + int bfhitc = bfh / 10 + 1; + + xc(bfwitc, bfhitc); + yc(bfwitc, bfhitc); + Yc(bfwitc, bfhitc); + + typedef struct WbGreen { + double green; + float snedecor;//1. actually but put in case of confiance interval + } WbGreen; + + WbGreen gree[118] = {//symetric coefficient between 0.717 and 1.40 + {0.400, 1.f}, + {0.500, 1.f}, + {0.550, 1.f}, + {0.600, 1.f}, + {0.625, 1.f}, + {0.650, 1.f}, + {0.675, 1.f}, + {0.700, 1.f}, + {0.714, 1.f}, + {0.727, 1.f}, + {0.741, 1.f}, + {0.755, 1.f}, + {0.769, 1.f}, + {0.784, 1.f}, + {0.800, 1.f}, + {0.806, 1.f}, + {0.813, 1.f}, + {0.820, 1.f}, + {0.826, 1.f}, + {0.833, 1.f}, + {0.840, 1.f}, + {0.847, 1.f}, + {0.855, 1.f}, + {0.862, 1.f}, + {0.870, 1.f}, + {0.877, 1.f}, + {0.885, 1.f}, + {0.893, 1.f}, + {0.901, 1.f}, + {0.909, 1.f}, + {0.917, 1.f}, + {0.926, 1.f}, + {0.935, 1.f}, + {0.943, 1.f}, + {0.952, 1.f}, + {0.962, 1.f}, + {0.971, 1.f}, + {0.980, 1.f}, + {0.990, 1.f}, + {1.000, 1.f},//39 + {1.010, 1.f}, + {1.020, 1.f}, + {1.030, 1.f}, + {1.040, 1.f}, + {1.050, 1.f}, + {1.060, 1.f}, + {1.070, 1.f}, + {1.080, 1.f}, + {1.090, 1.f}, + {1.100, 1.f}, + {1.110, 1.f}, + {1.120, 1.f}, + {1.130, 1.f}, + {1.140, 1.f}, + {1.150, 1.f}, + {1.160, 1.f}, + {1.170, 1.f}, + {1.180, 1.f}, + {1.190, 1.f}, + {1.200, 1.f}, + {1.210, 1.f}, + {1.220, 1.f}, + {1.230, 1.f}, + {1.240, 1.f}, + {1.250, 1.f}, + {1.275, 1.f}, + {1.300, 1.f}, + {1.325, 1.f}, + {1.350, 1.f}, + {1.375, 1.f}, + {1.400, 1.f}, + {1.425, 1.f}, + {1.450, 1.f}, + {1.475, 1.f}, + {1.500, 1.f}, + {1.525, 1.f}, + {1.550, 1.f}, + {1.575, 1.f}, + {1.600, 1.f}, + {1.633, 1.f}, + {1.666, 1.f}, + {1.700, 1.f}, + {1.733, 1.f}, + {1.766, 1.f}, + {1.800, 1.f}, + {1.833, 1.f}, + {1.866, 1.f}, + {1.900, 1.f}, + {1.933, 1.f}, + {1.966, 1.f}, + {2.000, 1.f}, + {2.033, 1.f}, + {2.066, 1.f}, + {2.100, 1.f}, + {2.133, 1.f}, + {2.166, 1.f}, + {2.200, 1.f}, + {2.250, 1.f}, + {2.300, 1.f}, + {2.350, 1.f}, + {2.400, 1.f}, + {2.450, 1.f}, + {2.500, 1.f}, + {2.550, 1.f}, + {2.600, 1.f}, + {2.650, 1.f}, + {2.700, 1.f}, + {2.750, 1.f}, + {2.800, 1.f}, + {2.850, 1.f}, + {2.900, 1.f}, + {2.950, 1.f}, + {3.000, 1.f}, + {3.200, 1.f}, + {3.400, 1.f}, + {3.600, 1.f}, + {3.800, 1.f}, + {4.000, 1.f} + }; + int N_g = sizeof(gree) / sizeof(gree[0]); //number of green + + typedef struct RangeGreen { + int begin; + int end; + int ng; + } RangeGreen; + + RangeGreen Rangestandard; + Rangestandard.begin = 8; + Rangestandard.end = 70; + Rangestandard.ng = 62; + + RangeGreen Rangeextand; + Rangeextand.begin = 4; + Rangeextand.end = 77; + Rangeextand.ng = 73; + + RangeGreen Rangemax; + Rangemax.begin = 0; + Rangemax.end = N_g; + Rangemax.ng = N_g; + + RangeGreen Rangegreenused; + + if (settings->itcwb_greenrange == 0) { + Rangegreenused = Rangestandard; + } + + else if (settings->itcwb_greenrange == 1) { + Rangegreenused = Rangeextand; + } else { + Rangegreenused = Rangemax; + } + + // printf("rangemin=%i rangmax=%i\n", Rangegreenused.begin, Rangegreenused.end); + + + + typedef struct WbTxyz { + double Tem; + double XX; + double ZZ; + } WbTxyz; + //we can change step to increase precision if need - also in Colortemp.cc with same changes + //I don't know how to pass this structure to Colortemp ! + WbTxyz Txyz[118] = {//temperature Xwb Zwb 118 values x wb and y wb are calculated after + {2001., 1.273842, 0.145295}, + {2101., 1.244008, 0.167533}, + {2201., 1.217338, 0.190697}, + {2301., 1.193444, 0.214632}, + {2401., 1.171996, 0.239195}, + {2501., 1.152883, 0.264539}, + {2605., 1.134667, 0.290722}, + {2655., 1.126659, 0.303556}, + {2705., 1.119049, 0.316446}, + {2755., 1.111814, 0.329381}, + {2803., 1.105381, 0.342193}, + {2856., 1.098258, 0.355599}, + {2910., 1.091550, 0.369645}, + {2960., 1.085649, 0.382655}, + {3003., 1.080982, 0.394258}, + {3050., 1.075727, 0.406057}, + {3103., 1.070277, 0.419815}, + {3153., 1.065384, 0.432769}, + {3203., 1.060906, 0.446161}, + {3250., 1.056535, 0.457806}, + {3303., 1.052034, 0.471422}, + {3353., 1.047990, 0.484218}, + {3400., 1.044547, 0.496719}, + {3450., 1.040667, 0.508891}, + {3500., 1.037145, 0.521523}, + {3550., 1.033783, 0.534090}, + {3600., 1.030574, 0.546590}, + {3650., 1.027510, 0.559020}, + {3699., 1.024834, 0.571722}, + {3801., 1.019072, 0.596102}, + {3851., 1.016527, 0.608221}, + {3902., 1.014244, 0.621136}, + {3952., 1.011729, 0.632447}, + {4002., 0.996153, 0.609518}, + {4052., 0.993720, 0.620805}, + {4102., 0.993908, 0.631520}, + {4152., 0.989179, 0.643262}, + {4202., 0.989283, 0.653999}, + {4252., 0.985039, 0.665536}, + {4302., 0.985067, 0.676288}, + {4352., 0.981271, 0.687599}, + {4402., 0.981228, 0.698349}, + {4452., 0.977843, 0.709425}, + {4502., 0.977736, 0.720159}, + {4552., 0.974728, 0.730993}, + {4602., 0.974562, 0.741698}, + {4652., 0.971899, 0.752284}, + {4702., 0.971681, 0.762949}, + {4752., 0.969335, 0.773285}, + {4802., 0.969069, 0.783899}, + {4827., 0.967570, 0.788836}, + {4852., 0.967011, 0.793982}, + {4877., 0.966465, 0.799108}, + {4902., 0.965933, 0.804214}, + {4927., 0.965414, 0.809229}, + {4952., 0.964908, 0.814366}, + {4977., 0.964415, 0.819412}, + {5002., 0.963934, 0.824438}, + {5027., 0.963465, 0.829444}, + {5052., 0.963008, 0.834429}, + {5077., 0.962563, 0.839395}, + {5102., 0.962129, 0.844339}, + {5127., 0.961706, 0.849263}, + {5152., 0.961294, 0.854166}, + {5177., 0.960893, 0.859049}, + {5202., 0.960501, 0.863911}, + {5252., 0.959749, 0.873572}, + {5302., 0.959313, 0.883815}, + {5352., 0.958361, 0.892644}, + {5402., 0.957903, 0.902793}, + {5452., 0.957116, 0.911379}, + {5502., 0.956639, 0.921431}, + {5552., 0.956002, 0.929779}, + {5602., 0.955509, 0.939728}, + {5652., 0.955008, 0.947842}, + {5702., 0.954502, 0.957685}, + {5752., 0.954124, 0.965569}, + {5802., 0.953608, 0.975303}, + {5852., 0.953342, 0.982963}, + {5902., 0.952818, 0.992584}, + {5952., 0.952652, 1.000025}, + {6002., 0.952122, 1.009532}, + {6052., 0.952047, 1.016759}, + {6102., 0.951514, 1.026149}, + {6152., 0.951520, 1.033168}, + {6202., 0.950985, 1.042439}, + {6252., 0.951064, 1.049256}, + {6302., 0.950530, 1.058406}, + {6352., 0.950674, 1.065027}, + {6402., 0.950143, 1.074055}, + {6452., 0.950345, 1.080484}, + {6502., 0.950201, 1.088097}, + {6552., 0.950070, 1.095633}, + {6602., 0.949952, 1.103094}, + {6652., 0.949846, 1.110479}, + {6702., 0.949752, 1.119138}, + {6752., 0.949668, 1.125027}, + {6802., 0.949596, 1.132190}, + {6902., 0.949033, 1.147691}, + {7002., 0.949402, 1.160129}, + {7152., 0.949348, 1.180429}, + {7301., 0.948896, 1.201432}, + {7451., 0.949434, 1.219076}, + {7601., 0.949099, 1.239061}, + {7751., 0.949729, 1.255559}, + {7901., 0.949498, 1.274460}, + {8151., 0.950361, 1.300912}, + {8301., 0.950253, 1.318464}, + {8451., 0.950966, 1.332651}, + {8601., 0.950941, 1.349261}, + {8801., 0.951772, 1.367421}, + {9001., 0.951969, 1.387639}, + {9201., 0.952784, 1.404422}, + {9401., 0.953081, 1.423213}, + {9901., 0.954537, 1.464134}, + {10501., 0.956321, 1.508623}, + {11001., 0.957747, 1.541281}, + {12001., 0.960440, 1.601019} + }; + int N_t = sizeof(Txyz) / sizeof(Txyz[0]); //number of temperature White point + + int nbt = N_t; + float **Tx = nullptr; + float **Ty = nullptr; + float **Tz = nullptr; + float **Ta = nullptr; + float **Tb = nullptr; + float **TL = nullptr; + double *TX = nullptr; + double *TY = nullptr; + double *TZ = nullptr; + int *good_spectral = nullptr; + // float studgood = 1000.f; + + int Nc = 200 + 1;//200 number of reference spectral colors, I think it is enough to retrieve good values + Tx = new float*[Nc]; + + for (int i = 0; i < Nc; i++) { + Tx[i] = new float[nbt]; + } + + Ty = new float*[Nc]; + + for (int i = 0; i < Nc; i++) { + Ty[i] = new float[nbt]; + } + + Tz = new float*[Nc]; + + for (int i = 0; i < Nc; i++) { + Tz[i] = new float[nbt]; + } + + Ta = new float*[Nc]; + + for (int i = 0; i < Nc; i++) { + Ta[i] = new float[nbt]; + } + + Tb = new float*[Nc]; + + for (int i = 0; i < Nc; i++) { + Tb[i] = new float[nbt]; + } + + TL = new float*[Nc]; + + for (int i = 0; i < Nc; i++) { + TL[i] = new float[nbt]; + } + + TX = new double [Nc]; + + + TY = new double [Nc]; + + + TZ = new double [Nc]; + + good_spectral = new int [Nc]; + + for (int i = 0; i < Nc; i++) { + good_spectral[i] = 0; + } + + float *rmm = nullptr; + rmm = new float [N_t]; + + float *gmm = nullptr; + gmm = new float [N_t]; + + float *bmm = nullptr; + bmm = new float [N_t]; + + int siza = 167;//size of histogram + int maxval = 25; + + //tempref and greenref are camera wb values. + // I used them by default to select good spectral values !! + if (tempref > 12000.f) { + tempref = 12000.f; + } + + int repref = 0; + + for (int tt = 0; tt < N_t; tt++) { + if (Txyz[tt].Tem > tempref) { + repref = tt;//show the select temp + break; + } + } + + + //calculate R G B multiplier in function illuminant and temperature + for (int tt = 0; tt < N_t; tt++) { + double r, g, b; + float rm, gm, bm; + ColorTemp WBiter = ColorTemp(Txyz[tt].Tem, greenitc, 1.f, "Custom"); + WBiter.getMultipliers(r, g, b); + rm = imatrices.cam_rgb[0][0] * r + imatrices.cam_rgb[0][1] * g + imatrices.cam_rgb[0][2] * b; + gm = imatrices.cam_rgb[1][0] * r + imatrices.cam_rgb[1][1] * g + imatrices.cam_rgb[1][2] * b; + bm = imatrices.cam_rgb[2][0] * r + imatrices.cam_rgb[2][1] * g + imatrices.cam_rgb[2][2] * b; + + const float new_pre_mul[4] = { ri->get_pre_mul(0) / rm, ri->get_pre_mul(1) / gm, ri->get_pre_mul(2) / bm, ri->get_pre_mul(3) / gm }; + float new_scale_mul[4]; + bool isMono = (ri->getSensorType() == ST_FUJI_XTRANS && raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO)) + || (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO)); + float gain = calculate_scale_mul(new_scale_mul, new_pre_mul, c_white, cblacksom, isMono, ri->get_colors()); + + rm = new_scale_mul[0] / scale_mul[0] * gain; + gm = new_scale_mul[1] / scale_mul[1] * gain; + bm = new_scale_mul[2] / scale_mul[2] * gain; + rmm[tt] = rm / gm; + gmm[tt] = gm / gm; + bmm[tt] = bm / gm; + } + + struct hiss { + int histnum; + int index; + int interest; + bool operator()(const hiss& lhis, const hiss& rhis) + { + return lhis.histnum < rhis.histnum; + } + + } ; + + //intermediate structure + struct chrom { + float chroxy_number; + float chroxy; + float chrox; + float chroy; + float Y; + int index; + int interest; + bool operator()(const chrom& lchro, const chrom& rchro) + { + return lchro.chroxy_number < rchro.chroxy_number; + } + + } ; + + int histxy[siza] = {};//number of values for each pair xy + + float area[siza] = {};//multiplier for compensation differences area ==> big areas are rare near limit prophotos or more + + int inter[siza] = {}; //interest for photographie 1 = small (limit gamut) 2 = normal 3 = major (skin, sky, neutral) + + float xxx[siza] = {};//for color references calculated ==> max in images "like histogram" + + float yyy[siza] = {}; + + float YYY[siza] = {};//not used directly, but necessary to keep good range + + for (int p = 0; p < siza; p++) { + histxy[p] = 0; + area[p] = 20.f; + inter[p] = 1; + } + + float estimchrom = 0.f; + + bool separated = true; + int w = -1; + //printf("greenrefraw=%f\n", greenref); + reff_spect_xxyy(N_t, 2 * Nc + 2); + reff_spect_xxyy_prov(N_t, 2 * Nc + 2); + reff_spect_yy_camera(N_t, 2 * Nc + 2); + reff_spect_xx_camera(N_t, 2 * Nc + 2); + + // reffYY(N_t, 2 * Nc);//in case of + //reffYY_prov(N_t, 2 * Nc); + + //here we select the good spectral color inside the 113 values + //call tempxy to calculate for 114 color references Temp and XYZ with cat02 + + if (separated) { + ColorTemp::tempxy(separated, repref, Tx, Ty, Tz, Ta, Tb, TL, TX, TY, TZ, wbpar); //calculate chroma xy (xyY) for Z known colors on under 90 illuminants + + //find the good spectral values + //calculate xy reference spectral for tempref + for (int j = 0; j < Nc ; j++) { + reff_spect_xx_camera[j][repref] = TX[j] / (TX[j] + TY[j] + TZ[j]); // x from xyY + reff_spect_yy_camera[j][repref] = TY[j] / (TX[j] + TY[j] + TZ[j]); // y from xyY + } + + int deltarepref = settings->itcwb_delta; + + for (int nn = 0; nn <= 2; nn++) { + //three loop to refine color if temp camera is probably not very good + int drep = 0; + + if (nn == 0) { + drep = -deltarepref; + } + + if (nn == 2) { + drep = +deltarepref; + } + + int rep = repref + drep; + + if (rep > N_t) { + rep = N_t; + } + + if (rep < 0) { + rep = 0; + } + + //initialize calculation of xy current for tempref + for (int y = 0; y < bfh ; y += 10) { + for (int x = 0; x < bfw ; x += 10) { + int yy = y / 10; + int xx = x / 10 ; + float x_c = 0.f, y_c = 0.f, Y_c = 0.f; + float x_x = 0.f, y_y = 0.f, z_z = 0.f; + float RR = rmm[rep] * redloc[y][x]; + float GG = gmm[rep] * greenloc[y][x]; + float BB = bmm[rep] * blueloc[y][x]; + Color::rgbxyY(RR, GG, BB, x_c, y_c, Y_c, x_x, y_y, z_z, wp); + xc[yy][xx] = x_c; + yc[yy][xx] = y_c; + Yc[yy][xx] = Y_c; + } + + } + + //histogram xy depend of temp...but in most cases D45 ..D65.. + //calculate for this image the mean values for each family of color, near histogram x y (number) + //xy vary from x 0..0.77 y 0..0.82 + //neutral values are near x=0.34 0.33 0.315 0.37 y =0.35 0.36 0.34 + //skin are about x 0.45 0.49 y 0.4 0.47 + //blue sky x=0.25 y=0.28 and x=0.29 y=0.32 + // step about 0.02 x 0.32 0.34 y= 0.34 0.36 skin -- sky x 0.24 0.30 y 0.28 0.32 + //big step about 0.2 + + histoxyY(bfhitc, bfwitc, xc, yc, Yc, xxx, yyy, YYY, histxy, area, inter); + } + + //calculate x y Y + int sizcurrref = siza;//choice of number of correlate colors in image + histcurrref(N_t, sizcurrref); + xx_curref(N_t, sizcurrref); + yy_curref(N_t, sizcurrref); + YY_curref(N_t, sizcurrref); + xx_curref_reduc(N_t, sizcurrref); + yy_curref_reduc(N_t, sizcurrref); + YY_curref_reduc(N_t, sizcurrref); + R_curref_reduc(N_t, sizcurrref); + G_curref_reduc(N_t, sizcurrref); + B_curref_reduc(N_t, sizcurrref); + + + hiss Wbhis [siza]; + int n1 = 0; + int n4 = 0; + int n15 = 0; + int n30 = 0; + int ntr = 0; + + for (int nh = 0; nh < siza; nh++) { + Wbhis[nh].histnum = histxy[nh]; + Wbhis[nh].index = nh; + Wbhis[nh].interest = inter[nh]; + } + + //sort in ascending order + std::sort(Wbhis, Wbhis + siza, Wbhis[0]); + + for (int nh = 0; nh < siza; nh++) { +// printf("nh=%i", Wbhis[nh].index); + } + + //part to improve + for (int nh = 0; nh < siza; nh++) { + if (Wbhis[nh].histnum < 1) { + n1++; //keep only existing color but avoid to small + } + + if (Wbhis[nh].histnum < 4) { + n4++; //keep only existing color but avoid to small + } + + if (Wbhis[nh].histnum < 15) { + n15++; //keep only existing color but avoid to small + } + + if (Wbhis[nh].histnum < 30) { + n30++; //keep only existing color but avoid to small + } + + + } + + + ntr = n30; + + if (ntr > (siza - 25)) { + ntr = n15; //if to less elements 25 elements mini + } + + if (ntr > (siza - 23)) { + ntr = n4; //if to less elements 25 elements mini + } + + if (ntr > (siza - 20)) { + ntr = n1; //if to less elements 20 elements mini - normally never be used ! + } + + int sizcurr2ref = sizcurrref - ntr; + int sizcu30 = sizcurrref - n30; + int sizcu4 = sizcurrref - n4; + +// printf("sizcurr2ref=%i sizcur_30=%i siecur_4=%i \n", sizcurr2ref, sizcu30, sizcu4); + sizcu4 = sizcu30;//arbitrary mini size if 30 result, ==> in full image 3000 pixels + + if (sizcu4 > 55) { + sizcu4 = 55; + } + + chrom wbchro[sizcu4]; + double swpr = (Txyz[repref].XX + Txyz[repref].ZZ + 1.); + double xwpr = Txyz[repref].XX / swpr;//white point for tt in xy coordiantes + double ywpr = 1. / swpr; + + + for (int i = 0; i < sizcu4; i++) { //take the max values + int j = i; + histcurrref[j][repref] = (float) Wbhis[siza - (j + 1)].histnum; + xx_curref[j][repref] = xxx[Wbhis[siza - (j + 1)].index] / histcurrref[j][repref]; + yy_curref[j][repref] = yyy[Wbhis[siza - (j + 1)].index] / histcurrref[j][repref]; + YY_curref[j][repref] = YYY[Wbhis[siza - (j + 1)].index] / histcurrref[j][repref]; +// printf("xx=%f yy=%f\n", xx_curref[j][repref], yy_curref[j][repref]); + } + + estimchrom = 0.f; + + for (int nh = 0; nh < sizcu4; nh++) { + float chxy = sqrt(SQR(xx_curref[nh][repref] - xwpr) + SQR(yy_curref[nh][repref] - ywpr)); + wbchro[nh].chroxy_number = chxy * sqrt(histcurrref[nh][repref]); + wbchro[nh].chroxy = sqrt(chxy); + wbchro[nh].chrox = xx_curref[nh][repref]; + wbchro[nh].chroy = yy_curref[nh][repref]; + wbchro[nh].Y = YY_curref[nh][repref]; + wbchro[nh].index = nh; + estimchrom += chxy; + } + + estimchrom /= sizcu4; + //printf("estimchrom=%f \n", estimchrom); + + if (settings->itcwb_sort) { //sort in ascending with chroma values + + std::sort(wbchro, wbchro + sizcu4, wbchro[0]); + } + + /* + for (int nh = 0; nh < sizcu4; nh++) { + printf("nh=%i chroma_xy=%f chrox=%f chroy=%f\n", nh, wbchro[nh].chroxy, wbchro[nh].chrox, wbchro[nh].chroy); + } + */ + maxval = settings->itcwb_thres;//max values of color to find correllation + + if (maxval < 10) { + maxval = 10; + } + + if (maxval > 55) { + maxval = 55; + } + + if (sizcurr2ref > maxval) { + sizcurr2ref = maxval; //keep about the biggest values, + } + + + for (int i = 0; i < sizcurr2ref; i++) { + //is condition chroxy necessary ? + if (((wbchro[sizcu4 - (i + 1)].chrox > 0.1f) && (wbchro[sizcu4 - (i + 1)].chroy > 0.1f)) && wbchro[sizcu4 - (i + 1)].chroxy > 0.0f) { //suppress value too far from reference spectral + w++; + xx_curref_reduc[w][repref] = wbchro[sizcu4 - (i + 1)].chrox; + yy_curref_reduc[w][repref] = wbchro[sizcu4 - (i + 1)].chroy; + YY_curref_reduc[w][repref] = wbchro[sizcu4 - (i + 1)].Y; + // printf("xx_cu=%f yy_cu=%f Y=%f chro=%f\n", xx_curref_reduc[w][repref], yy_curref_reduc[w][repref], YY_curref_reduc[w][repref],sqrt(wbchro[sizcu4 - (i + 1)].chroxy)); + } + } + + //calculate deltaE xx to find best values of spectrals datas + int maxnb = settings->itcwb_sizereference; + + if (maxnb > 5) { + maxnb = 5; + } + + if (maxnb < 1) { + maxnb = 1; + } + + + if (settings->itcwb_thres > 39) { + maxnb = 200 / settings->itcwb_thres; + } + + for (int nb = 1; nb <= maxnb; nb ++) { //max 5 iterations for Itcwb_thres=33, after trial 3 is good in most cases but in some cases 5 + for (int i = 0; i < w; i++) { + float mindeltaE = 100000.f; + int kN = 0; + + for (int j = 0; j < Nc ; j++) { + if (good_spectral[j] == 0) { + float deltaE = SQR(xx_curref_reduc[i][repref] - reff_spect_xx_camera[j][repref]) + SQR(yy_curref_reduc[i][repref] - reff_spect_yy_camera[j][repref]); + + if (deltaE < mindeltaE) { + mindeltaE = deltaE; + kN = j; + } + } + } + + good_spectral[kN] = 1;//good spectral are spectral color that match color histogram xy + //printf("k=%i ", kN); + } + } + +//reconvert to RGB for "reduction" + for (int i = 0; i < w; i++) { + float X = 65535.f * xx_curref_reduc[i][repref] * YY_curref_reduc[i][repref] / yy_curref_reduc[i][repref]; + float Y = 65535.f * YY_curref_reduc[i][repref]; + float Z = 65535.f * (1.f - xx_curref_reduc[i][repref] - yy_curref_reduc[i][repref]) * YY_curref_reduc[i][repref] / yy_curref_reduc[i][repref]; + float r, g, b; + Color::xyz2rgb(X, Y, Z, r, g, b, wip); + r /= rmm[repref]; + g /= gmm[repref]; + b /= bmm[repref]; + R_curref_reduc[i][repref] = r; + G_curref_reduc[i][repref] = g; + B_curref_reduc[i][repref] = b; + + } + + } + +//end first part + + + + //Now begin real calculations + separated = false; + ColorTemp::tempxy(separated, repref, Tx, Ty, Tz, Ta, Tb, TL, TX, TY, TZ, wbpar); //calculate chroma xy (xyY) for Z known colors on under 90 illuminants + + int kk = -1; + + //calculate x y Y + int sizcurr = siza;//choice of number of correlate colors in image + histcurr(N_t, sizcurr); + xxyycurr(N_t, 2 * sizcurr); + xxyycurr_reduc(N_t, 2 * sizcurr); + float minstud = 100000.f; + int goodref = 1; + + YYcurr(N_t, sizcurr); + YYcurr_reduc(N_t, sizcurr); + +//calculate x y z for each pixel with multiplier rmm gmm bmm + kk = -1; + + for (int tt = 0; tt < N_t; tt++) {//N_t + // double swp = (Txyz[tt].XX + Txyz[tt].ZZ + 1.); + // double xwp = Txyz[tt].XX / swp; + // double ywp = 1. / swp; + + + for (int i = 0; i < w; i++) { + float x_c = 0.f, y_c = 0.f, Y_c = 0.f; + float x_x = 0.f, y_y = 0.f, z_z = 0.f; + + float RR = rmm[tt] * R_curref_reduc[i][repref]; + float GG = gmm[tt] * G_curref_reduc[i][repref]; + float BB = bmm[tt] * B_curref_reduc[i][repref]; + Color::rgbxyY(RR, GG, BB, x_c, y_c, Y_c, x_x, y_y, z_z, wp); + // xxyycurr_reduc[2 * i][tt] = fabs(x_c - xwp); + // xxyycurr_reduc[2 * i + 1][tt] = fabs(y_c - ywp); + xxyycurr_reduc[2 * i][tt] = x_c; + xxyycurr_reduc[2 * i + 1][tt] = y_c; + // printf("w=%i tt=%i xx=%f yy=%f\n",i, tt, xxyycurr_reduc[2 * i][tt], xxyycurr_reduc[2 * i +1][tt]); + + } + + for (int j = 0; j < Nc ; j++) { + reff_spect_xxyy_prov[2 * j][tt] = Tx[j][tt] / (Tx[j][tt] + Ty[j][tt] + Tz[j][tt]); // x from xyY + reff_spect_xxyy_prov[2 * j + 1][tt] = Ty[j][tt] / (Tx[j][tt] + Ty[j][tt] + Tz[j][tt]); // y from xyY + //reffYY_prov[j][tt] = Ty[j][tt];//Y + // printf("w=%i tt=%i xx=%f yy=%f\n",j, tt,reffxxyy_prov[2 * kk][tt] ,reffxxyy_prov[2 * kk + 1][tt]); + + } + + kk = -1; + + for (int i = 0; i < Nc ; i++) { + if (good_spectral[i] == 1) { + kk++; + //we calculate now absolute chroma for each spectral color + // reffxxyy[2 * kk][tt] = fabs(reffxxyy_prov[2 * i][tt] - xwp); + // reffxxyy[2 * kk + 1][tt] = fabs(reffxxyy_prov[2 * i + 1][tt] - ywp); + reff_spect_xxyy[2 * kk][tt] = reff_spect_xxyy_prov[2 * i][tt]; + reff_spect_xxyy[2 * kk + 1][tt] = reff_spect_xxyy_prov[2 * i + 1][tt]; + //printf("w=%i tt=%i xx=%f yy=%f\n",i, tt,reffxxyy[2 * kk][tt] ,reffxxyy[2 * kk + 1][tt]); + // reffYY[kk][tt] = reffYY_prov[i][tt]; + } + } + + + /* + //cat02 not need and does not work well + float nnx, nny, nnz; + + if(wbpar.wbcat02Method == "cam") {//code no update... + for(int k=0;k < sizcurr3; k++) { + float nnx = xxyycurr[2 * k][tt]*YYcurr[k][tt] / xxyycurr[2 * k + 1][tt]; + float nny = YYcurr[k][tt]; + float nnz = (1.f -xxyycurr[2 * k][tt] - xxyycurr[2 * k + 1][tt] )*YYcurr[k][tt]/xxyycurr[2 * k + 1][tt]; + float CAM02BB00 = 1.0f, CAM02BB01=1.0f, CAM02BB02=1.0f, CAM02BB10=1.0f, CAM02BB11=1.0f, CAM02BB12=1.0f, CAM02BB20=1.0f, CAM02BB21=1.0f, CAM02BB22=1.0f; //for CIECAT02 + float Xwb = Txyz[20].XX; + float Ywb = 1.; + float Zwb = Txyz[20].ZZ; + float xn, yn, zn; + ColorTemp::icieCAT02float(Xwb, Ywb, Zwb, CAM02BB00, CAM02BB01, CAM02BB02, CAM02BB10, CAM02BB11, CAM02BB12, CAM02BB20, CAM02BB21, CAM02BB22, 1.0f); + + xn = CAM02BB00 * nnx + CAM02BB01 * nny + CAM02BB02 * nnz ; + yn = CAM02BB10 * nnx + CAM02BB11 * nny + CAM02BB12 * nnz ; + zn = CAM02BB20 * nnx + CAM02BB21 * nny + CAM02BB22 * nnz; + float som = xn + yn + zn; + xxyycurr[2 * k][tt] = xn / som; + xxyycurr[2 * k + 1][tt] = yn / som; + YYcurr[k][tt] = yn; + } + } + */ + + float student = 0.f; + + + studentXY(xxyycurr_reduc, reff_spect_xxyy, 2 * w, 2 * kk, tt, student); //for xy + //printf("tt=%i st=%f\n", tt, student); + float abstud = fabs(student); + + if (abstud < minstud) { // find the minimum Student + minstud = abstud; + goodref = tt; + } + + } + + if (extra) { + struct Tempgreen { + float student; + int tempref; + int greenref; + bool operator()(const Tempgreen& ltg, const Tempgreen& rtg) + { + return ltg.student < rtg.student; + } + }; + Tempgreen Tgstud[N_g]; + + for (int i = 0; i < N_g; i++) {//init variables with + Tgstud[i].student = 1000.f;//max value to initialize + Tgstud[i].tempref = 57; + Tgstud[i].greenref = 39; + + } + + int dgoodref = settings->itcwb_greendeltatemp; + + if (dgoodref > 4) { + dgoodref = 4; + } + + int scantempbeg = goodref - (dgoodref + 1); + + if (scantempbeg < 1) { + scantempbeg = 1; + } + + int scantempend = goodref + dgoodref; + + if (scantempend > N_t - 1) { + scantempend = N_t - 1; + } + + int kkg = -1; + + for (int gr = Rangegreenused.begin; gr < Rangegreenused.end; gr++) { + float minstudgr = 100000.f; + int goodrefgr = 1; + + for (int tt = scantempbeg; tt < scantempend; tt++) { + double r, g, b; + float rm, gm, bm; + ColorTemp WBiter = ColorTemp(Txyz[tt].Tem, gree[gr].green, 1.f, "Custom"); + WBiter.getMultipliers(r, g, b); + rm = imatrices.cam_rgb[0][0] * r + imatrices.cam_rgb[0][1] * g + imatrices.cam_rgb[0][2] * b; + gm = imatrices.cam_rgb[1][0] * r + imatrices.cam_rgb[1][1] * g + imatrices.cam_rgb[1][2] * b; + bm = imatrices.cam_rgb[2][0] * r + imatrices.cam_rgb[2][1] * g + imatrices.cam_rgb[2][2] * b; + + const float new_pre_mul[4] = { ri->get_pre_mul(0) / rm, ri->get_pre_mul(1) / gm, ri->get_pre_mul(2) / bm, ri->get_pre_mul(3) / gm }; + float new_scale_mul[4]; + bool isMono = (ri->getSensorType() == ST_FUJI_XTRANS && raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO)) + || (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO)); + float gain = calculate_scale_mul(new_scale_mul, new_pre_mul, c_white, cblacksom, isMono, ri->get_colors()); + + rm = new_scale_mul[0] / scale_mul[0] * gain; + gm = new_scale_mul[1] / scale_mul[1] * gain; + bm = new_scale_mul[2] / scale_mul[2] * gain; + rmm[tt] = rm / gm; + gmm[tt] = gm / gm; + bmm[tt] = bm / gm; + } + + + for (int tt = scantempbeg; tt < scantempend; tt++) {//N_t + // double swp = (Txyz[tt].XX + Txyz[tt].ZZ + 1.); + // double xwp = Txyz[tt].XX / swp; + // double ywp = 1. / swp; + + + for (int i = 0; i < w; i++) { + float x_c = 0.f, y_c = 0.f, Y_c = 0.f; + float x_x = 0.f, y_y = 0.f, z_z = 0.f; + + float RR = rmm[tt] * R_curref_reduc[i][repref]; + float GG = gmm[tt] * G_curref_reduc[i][repref]; + float BB = bmm[tt] * B_curref_reduc[i][repref]; + Color::rgbxyY(RR, GG, BB, x_c, y_c, Y_c, x_x, y_y, z_z, wp); + xxyycurr_reduc[2 * i][tt] = x_c; + xxyycurr_reduc[2 * i + 1][tt] = y_c; + // printf("w=%i tt=%i xx=%f yy=%f\n",i, tt, xxyycurr_reduc[2 * i][tt], xxyycurr_reduc[2 * i +1][tt]); + + } + + for (int j = 0; j < Nc ; j++) { + reff_spect_xxyy_prov[2 * j][tt] = Tx[j][tt] / (Tx[j][tt] + Ty[j][tt] + Tz[j][tt]); // x from xyY + reff_spect_xxyy_prov[2 * j + 1][tt] = Ty[j][tt] / (Tx[j][tt] + Ty[j][tt] + Tz[j][tt]); // y from xyY + // reffYY_prov[j][tt] = Ty[j][tt];//Y + // printf("w=%i tt=%i xx=%f yy=%f\n",j, tt,reffxxyy_prov[2 * kk][tt] ,reffxxyy_prov[2 * kk + 1][tt]); + + } + + kkg = -1; + + //degrade correllation with color high chroma, but not too much...seems not good, but keep in case of?? + if (estimchrom < 0.025f) {//very smal value of chroma for image + + good_spectral[0] = 1;//blue + //good_spectral[1] = 1;//blue + // good_spectral[97] = 1;//blue + // good_spectral[93] = 1;//purple + // good_spectral[7] = 1;//green + good_spectral[11] = 1;//green + //good_spectral[42] = 1;//green + // good_spectral[75] = 1;//green + // good_spectral[46] = 1;//red + good_spectral[62] = 1;//red + // good_spectral[63] = 1;//red + // good_spectral[91] = 1;//ora + + } + + for (int i = 0; i < Nc ; i++) { + if (good_spectral[i] == 1) { + kkg++; + reff_spect_xxyy[2 * kkg][tt] = reff_spect_xxyy_prov[2 * i][tt]; + reff_spect_xxyy[2 * kkg + 1][tt] = reff_spect_xxyy_prov[2 * i + 1][tt]; + // reffYY[kkg][tt] = reffYY_prov[i][tt]; + } + } + + float studentgr = 0.f; + + studentXY(xxyycurr_reduc, reff_spect_xxyy, 2 * w, 2 * kkg, tt, studentgr); //for xy + float abstudgr = fabs(studentgr); + + if (abstudgr < minstudgr) { // find the minimum Student + minstudgr = abstudgr; + goodrefgr = tt; + } + + Tgstud[gr].tempref = goodrefgr; + Tgstud[gr].greenref = gr; + Tgstud[gr].student = minstudgr; + + } + + } + + std::sort(Tgstud, Tgstud + N_g, Tgstud[0]); + + for (int j = 0; j < 20; j++) { + // printf("reftemp=%i refgreen=%i stud=%f \n", Tgstud[j].tempref, Tgstud[j].greenref, Tgstud[j].student); + } + + //now search the value of green the nearest of 1 with a good student value + // I take the 3 first values + //I admit a symetrie in green coefiicient for rgb multiplier...probably not excatly true + //perhaps we can used a Snedecor test ? but why...at least we have confidence interval > 90% + int greengood; + int greengoodprov; + int goodrefprov; + float studprov; + int goodref0 = Tgstud[0].tempref; + int greengood0 = Tgstud[0].greenref - 39;//39 green = 1 + float stud0 = Tgstud[0].student; + int goodref1 = Tgstud[1].tempref; + float stud1 = Tgstud[1].student; + int greengood1 = Tgstud[1].greenref - 39; + int goodref2 = Tgstud[2].tempref; + int greengood2 = Tgstud[2].greenref - 39; + float stud2 = Tgstud[2].student; + + if (fabs(greengood2) < fabs(greengood1)) { + greengoodprov = greengood2; + goodrefprov = goodref2; + studprov = stud2; + } else { + greengoodprov = greengood1; + goodrefprov = goodref1; + studprov = stud1; + + } + + if (fabs(greengoodprov) < fabs(greengood0)) { + goodref = goodrefprov; + greengood = greengoodprov + 39; + studgood = studprov; + + } else { + goodref = goodref0; + greengood = greengood0 + 39; + studgood = stud0; + } + + tempitc = Txyz[goodref].Tem; + greenitc = gree[greengood].green; + + } + + histcurr(0, 0); + histcurrref(0, 0); + xxyycurr(0, 0); + xxyycurr_reduc(0, 0); + xx_curref(0, 0); + yy_curref(0, 0); + YY_curref(0, 0); + + reff_spect_xxyy(0, 0); + YYcurr(0, 0); + YYcurr_reduc(0, 0); + reff_spect_yy_camera(0, 0); + reff_spect_xx_camera(0, 0); + xx_curref_reduc(0, 0); + yy_curref_reduc(0, 0); + YY_curref_reduc(0, 0); + + R_curref_reduc(0, 0); + G_curref_reduc(0, 0); + B_curref_reduc(0, 0); + + reff_spect_xxyy_prov(0, 0); + +// reffYY(0, 0); +// reffYY_prov(0, 0); + + avg_rm = 10000.f * rmm[goodref]; + avg_gm = 10000.* gmm[goodref]; + avg_bm = 10000.f * bmm[goodref]; + + if (!extra) { + tempitc = Txyz[goodref].Tem; + } + + + printf("ITCWB tempitc=%f gritc=%f stud=%f \n", tempitc, greenitc, studgood); + + + xc(0, 0); + yc(0, 0); + Yc(0, 0); + + + + for (int i = 0; i < Nc; i++) { + delete [] Tx[i]; + delete [] Ty[i]; + delete [] Tz[i]; + delete [] Ta[i]; + delete [] Tb[i]; + delete [] TL[i]; + + } + + delete [] Tx; + delete [] Ty; + delete [] Tz; + delete [] Ta; + delete [] Tb; + delete [] TL; + delete [] TX; + delete [] TY; + delete [] TZ; + delete [] good_spectral; + + + delete [] rmm; + delete [] gmm; + delete [] bmm; + + + + +} + +void RawImageSource::WBauto(double & tempref, double & greenref, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double & avg_rm, double & avg_gm, double & avg_bm, double & tempitc, double & greenitc, float & studgood, bool & twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams & cmp, const RAWParams & raw) +{ + BENCHFUN + //auto white balance +// printf ("AUtoWB OK\n"); +/* + array2D redsobel; + array2D greensobel; + array2D bluesobel; + + redsobel(bfw, bfh); + greensobel(bfw, bfh); + bluesobel(bfw, bfh); +*/ + double avg_r = 0.; + double avg_g = 0.; + double avg_b = 0.; + int rn = 0, gn = 0, bn = 0; +// constexpr double clipHigh = 65500.0; +// constexpr double clipLow = 0; //1500.0; + bool edg = false; + bool greyn = false; + bool robust = false; + bool itc = false; + + if (wbpar.method == "autorobust") { + // printf("autorob\n"); + // RobustWB(redloc, greenloc, blueloc, bfw, bfh, avg_rm, avg_gm, avg_bm); + + } + + if (wbpar.method == "autedg") { + // printf("autoedge\n"); + // edg = true; + } + + if (wbpar.method == "aut") { +// greyn = true; + } + + + + if (wbpar.method == "autitcgreen") { + bool extra = false; + + if (greenref > 0.77 && greenref < 1.3) { + greenitc = greenref; + extra = false; + + if (settings->itcwb_forceextra) { + extra = true; + } + } else { + greenitc = 1.; + extra = true; + } + + // greenref = wbpar.green; +// printf("gree=%f\n", greenref); + tempitc = 5000.; +// greenitc = greenref; + itc = true; + + if (itc) { + ItcWB(extra, tempref, greenref, tempitc, greenitc, studgood, redloc, greenloc, blueloc, bfw, bfh, avg_rm, avg_gm, avg_bm, cmp, raw, wbpar); + } + } + + if (wbpar.method == "autedgsdw") { + // SobelWB(redsobel, greensobel, bluesobel, redloc, greenloc, blueloc, bfw, bfh); + // SdwWB(redsobel, greensobel, bluesobel, bfw, bfh, avg_rm, avg_gm, avg_bm); + + } + + if (wbpar.method == "autedgrob") { + // SobelWB(redsobel, greensobel, bluesobel, redloc, greenloc, blueloc, bfw, bfh); + // RobustWB(redsobel, greensobel, bluesobel, bfw, bfh, avg_rm, avg_gm, avg_bm); + + } + + if (wbpar.method == "autosdw") { + // SdwWB(redloc, greenloc, blueloc, bfw, bfh, avg_rm, avg_gm, avg_bm); + + + // printf("bfw=%i bfh=%i begx=%i begy=%i xEn=%i yEn=%i cx=%i\n", bfw, bfh, begx, begy, xEn, yEn, cx); + } + +/* + if (edg) { + SobelWB(redsobel, greensobel, bluesobel, redloc, greenloc, blueloc, bfw, bfh); + +#ifdef _OPENMP + #pragma omp parallel for reduction(+:avg_r, avg_g, avg_b, rn, gn, bn) +#endif + + for (int y = 0; y < bfh ; y++) { + for (int x = 0; x < bfw ; x++) { + if (redsobel[y][x] < clipHigh && redsobel[y][x] > clipLow) { + avg_r += redsobel[y][x]; + rn++; + } + + if (greensobel[y][x] < clipHigh && greensobel[y][x] > clipLow) { + avg_g += greensobel[y][x]; + gn++; + } + + if (bluesobel[y][x] < clipHigh && bluesobel[y][x] > clipLow) { + avg_b += bluesobel[y][x]; + bn++; + } + } + } + } +*/ +/* + if (greyn) { +#ifdef _OPENMP + #pragma omp parallel for reduction(+:avg_r, avg_g, avg_b, rn, gn, bn) +#endif + + for (int y = 0; y < bfh ; y++) { + for (int x = 0; x < bfw ; x++) { + if (redloc[y][x] < clipHigh && redloc[y][x] > clipLow) { + avg_r += redloc[y][x]; + rn++; + } + + if (greenloc[y][x] < clipHigh && greenloc[y][x] > clipLow) { + avg_g += greenloc[y][x]; + gn++; + } + + if (blueloc[y][x] < clipHigh && blueloc[y][x] > clipLow) { + avg_b += blueloc[y][x]; + bn++; + } + } + } + } +*/ +// float varir = localr.equal; +// float varib = 1.f - (varir - 1.f); + + + +//CAT02 inverse + +// + if (greyn || edg) { + avg_rm = avg_r / rn; + avg_gm = avg_g / gn; + avg_bm = avg_b / bn; + } + + /* + //inverse cat02 + if (localr.wbcamMethod == "cat" || localr.wbcamMethod == "gamcat") { + //printf("Inverse CAT02\n"); + float x, y, z; + // cat02_to_xyzfloatraw ( x, y, z, avg_rm, avg_gm, avg_bm); + Color::xyz2rgbraw (x, y, z, avg_rm, avg_gm, avg_bm, wip); + } + */ + if (edg) { + // printf("Local sobel avgr = % f avgg = % f avgb = % f \n", avg_rm, avg_gm, avg_bm); + } + + if (greyn || robust) { + // printf("Local rgb avgr = % f avgg = % f avgb = % f \n", avg_rm, avg_gm, avg_bm); + } + +/* + redsobel(0, 0); + greensobel(0, 0); + bluesobel(0, 0); +*/ +} + + +void RawImageSource::getrgbloc(bool local, bool gamma, bool cat02, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w) +{ + //used by auto WB local to calculate red, green, blue in local region + // int bfh = bf_h + 3, bfw = bf_w + 3; + int bfh = H, bfw = W; + + if (local) { + bfh = bf_h + 3; + bfw = bf_w + 3; + } + + // printf ("bfh=%i bfw=%i H=%i W=%i \n", bf_h, bf_w, H, W); + ColorManagementParams cmp; + + //TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(cmp.working); + // TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.working); + /* + float toxyz[3][3] = { + { + static_cast ( wprof[0][0] / Color::D50x), + static_cast ( wprof[0][1] / Color::D50x), + static_cast ( wprof[0][2] / Color::D50x) + }, { + static_cast ( wprof[1][0]), + static_cast ( wprof[1][1]), + static_cast ( wprof[1][2]) + }, { + static_cast ( wprof[2][0] / Color::D50z), + static_cast ( wprof[2][1] / Color::D50z), + static_cast ( wprof[2][2] / Color::D50z) + } + }; + */ + /* + double wp[3][3] = { + {wprof[0][0], wprof[0][1], wprof[0][2]}, + {wprof[1][0], wprof[1][1], wprof[1][2]}, + {wprof[2][0], wprof[2][1], wprof[2][2]} + }; + */ +// printf("wp00=%f wp02=%f\n", wp[0][0], wp[0][2]); + if (! greenloc) { + greenloc(bfw, bfh); + } + + if (! redloc) { + redloc(bfw, bfh); + } + + if (! blueloc) { + blueloc(bfw, bfh); + } + + float avgL = 0.f; + float redmm = 0.f, greenmm = 0.f, bluemm = 0.f; + + //center data on normal values + int nn = 0; + + for (int i = 0; i < H; i ++) + for (int j = 0; j < W; j++) { + int lox = cx + j; + int loy = cy + i; + + if (!local) { + redmm = redloc[i][j] = red[i][j]; + greenmm = greenloc[i][j] = green[i][j]; + bluemm = blueloc[i][j] = blue[i][j]; + float LL = (0.299f * redmm + 0.587f * greenmm + 0.114f * bluemm); + avgL += LL; + nn++; + } else { + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + redmm = redloc[loy - begy][lox - begx] = red[i][j]; + greenmm = greenloc[loy - begy][lox - begx] = green[i][j]; + bluemm = blueloc[loy - begy][lox - begx] = blue[i][j]; + float LL = (0.299f * redmm + 0.587f * greenmm + 0.114f * bluemm); + avgL += LL; + nn++; + } + } + } + + avgL /= nn; + + float sig = 0.f; + float vari = 0.f; + int mm = 0; + + for (int i = 0; i < bfh; i++) + for (int j = 0; j < bfw; j++) { + float LL = (0.299f * redloc[i][j] + 0.587f * greenloc[i][j] + 0.114f * blueloc[i][j]); + vari += SQR(LL - avgL); + mm++; + } + + sig = sqrt(vari / mm); + float multip = 60000.f / (avgL + 2.f * sig); + + // printf("multip=%f \n", multip); + for (int i = 0; i < bfh; i++) + for (int j = 0; j < bfw; j++) { + redloc[i][j] *= multip; + greenloc[i][j] *= multip; + blueloc[i][j] *= multip; + } + + if (gamma) { + // printf("gamma loc\n"); + + for (int i = 0; i < bfh; i++) + for (int j = 0; j < bfw; j++) { + redloc[i][j] = Color::gammatab_srgb[redloc[i][j]]; + greenloc[i][j] = Color::gammatab_srgb[greenloc[i][j]]; + blueloc[i][j] = Color::gammatab_srgb[blueloc[i][j]]; + } + } + + if (cat02) {//CAT02 + /* + //not good threatment, I must wait merge branch cat02wb + for (int i = 0; i < bfh; i++) + for (int j = 0; j < bfw; j++) { + float X = 0.f, Y = 0.f, Z = 0.f; + Color::rgbxyz(redloc[i][j], greenloc[i][j], blueloc[i][j], X, Y, Z, wp); + double temp; + double Xr = X / 65535.; + double Yr = Y / 65535.; + double Zr = Z / 65535.; + + Ciecam02::xyz_to_cat02float ( redloc[i][j], greenloc[i][j], blueloc[i][j], Xr, Yr, Zr, 1); + redloc[i][j] *= 65535.f; + greenloc[i][j] *= 65535.f; + blueloc[i][j] *= 65535.f; + //to do ciecam adaptation + } + */ + } + +} + +//void RawImageSource::getAutoWBMultipliers (double &rm, double &gm, double &bm) +void RawImageSource::getAutoWBMultipliersloc(double & tempref, double & greenref, double & tempitc, double & greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double & rm, double & gm, double & bm, const WBParams & wbpar, const ColorManagementParams & cmp, const RAWParams & raw) +{ + BENCHFUN + constexpr double clipHigh = 64000.0; + + if (ri->get_colors() == 1) { + rm = gm = bm = 1; + return; + } +/* + if (redAWBMul != -1.) { + rm = redAWBMul; + gm = greenAWBMul; + bm = blueAWBMul; + return; + } + + if (!isWBProviderReady()) { + rm = -1.0; + gm = -1.0; + bm = -1.0; + return; + } +*/ + double avg_r = 0; + double avg_g = 0; + double avg_b = 0; + int rn = 0, gn = 0, bn = 0; + double avg_rm, avg_gm, avg_bm; + // int bfh = bf_h + 3, bfw = bf_w + 3; + int bfh = H, bfw = W; + if (wbpar.method == "autold") { + + if (fuji) { + for (int i = 32; i < H - 32; i++) { + int fw = ri->get_FujiWidth(); + int start = ABS(fw - i) + 32; + int end = min(H + W - fw - i, fw + i) - 32; + + for (int j = start; j < end; j++) { + if (ri->getSensorType() != ST_BAYER) { + double dr = CLIP(initialGain * (rawData[i][3 * j] )); + double dg = CLIP(initialGain * (rawData[i][3 * j + 1])); + double db = CLIP(initialGain * (rawData[i][3 * j + 2])); + + if (dr > clipHigh || dg > clipHigh || db > clipHigh) { + continue; + } + + avg_r += dr; + avg_g += dg; + avg_b += db; + rn = gn = ++bn; + } else { + int c = FC( i, j); + double d = CLIP(initialGain * (rawData[i][j])); + + if (d > clipHigh) { + continue; + } + + // Let's test green first, because they are more numerous + if (c == 1) { + avg_g += d; + gn++; + } else if (c == 0) { + avg_r += d; + rn++; + } else { /*if (c==2)*/ + avg_b += d; + bn++; + } + } + } + } + } else { + if (ri->getSensorType() != ST_BAYER) { + if(ri->getSensorType() == ST_FUJI_XTRANS) { + const double compval = clipHigh / initialGain; +#ifdef _OPENMP + #pragma omp parallel +#endif + { + double avg_c[3] = {0.0}; + int cn[3] = {0}; +#ifdef _OPENMP + #pragma omp for schedule(dynamic,16) nowait +#endif + + for (int i = 32; i < H - 32; i++) { + for (int j = 32; j < W - 32; j++) { + // each loop read 1 rgb triplet value + double d = rawData[i][j]; + + if (d > compval) { + continue; + } + + int c = ri->XTRANSFC(i, j); + avg_c[c] += d; + cn[c]++; + } + } + +#ifdef _OPENMP + #pragma omp critical +#endif + { + avg_r += avg_c[0]; + avg_g += avg_c[1]; + avg_b += avg_c[2]; + rn += cn[0]; + gn += cn[1]; + bn += cn[2]; + } + } + avg_r *= initialGain; + avg_g *= initialGain; + avg_b *= initialGain; + } else { + for (int i = 32; i < H - 32; i++) + for (int j = 32; j < W - 32; j++) { + // each loop read 1 rgb triplet value + + double dr = CLIP(initialGain * (rawData[i][3 * j] )); + double dg = CLIP(initialGain * (rawData[i][3 * j + 1])); + double db = CLIP(initialGain * (rawData[i][3 * j + 2])); + + if (dr > clipHigh || dg > clipHigh || db > clipHigh) { + continue; + } + + avg_r += dr; + rn++; + avg_g += dg; + avg_b += db; + } + + gn = rn; + bn = rn; + } + } else { + //determine GRBG coset; (ey,ex) is the offset of the R subarray + int ey, ex; + + if (ri->ISGREEN(0, 0)) { //first pixel is G + if (ri->ISRED(0, 1)) { + ey = 0; + ex = 1; + } else { + ey = 1; + ex = 0; + } + } else {//first pixel is R or B + if (ri->ISRED(0, 0)) { + ey = 0; + ex = 0; + } else { + ey = 1; + ex = 1; + } + } + + const double compval = clipHigh / initialGain; +#ifdef _OPENMP + #pragma omp parallel for reduction(+:avg_r,avg_g,avg_b,rn,gn,bn) schedule(dynamic,8) +#endif + + for (int i = 32; i < H - 32; i += 2) + for (int j = 32; j < W - 32; j += 2) { + //average each Bayer quartet component individually if non-clipped + double d[2][2]; + d[0][0] = rawData[i][j]; + d[0][1] = rawData[i][j + 1]; + d[1][0] = rawData[i + 1][j]; + d[1][1] = rawData[i + 1][j + 1]; + + if (d[ey][ex] <= compval) { + avg_r += d[ey][ex]; + rn++; + } + + if (d[1 - ey][ex] <= compval) { + avg_g += d[1 - ey][ex]; + gn++; + } + + if (d[ey][1 - ex] <= compval) { + avg_g += d[ey][1 - ex]; + gn++; + } + + if (d[1 - ey][1 - ex] <= compval) { + avg_b += d[1 - ey][1 - ex]; + bn++; + } + } + + avg_r *= initialGain; + avg_g *= initialGain; + avg_b *= initialGain; + + } + } + } + + if (wbpar.method == "aut" || wbpar.method == "autosdw" || wbpar.method == "autedgsdw" || wbpar.method == "autitcgreen" || wbpar.method == "autedgrob" || wbpar.method == "autedg" || wbpar.method == "autorobust") { + bool twotimes = false; + WBauto(tempref, greenref, redloc, greenloc, blueloc, bfw, bfh, avg_rm, avg_gm, avg_bm, tempitc, greenitc, studgood, twotimes, wbpar, begx, begy, yEn, xEn, cx, cy, cmp, raw); + + } + + redloc(0, 0); + greenloc(0, 0); + blueloc(0, 0); + + if( settings->verbose ) { + printf ("AVG: %g %g %g\n", avg_r / std::max(1, rn), avg_g / std::max(1, gn), avg_b / std::max(1, bn)); + } + + // return ColorTemp (pow(avg_r/rn, 1.0/6.0)*img_r, pow(avg_g/gn, 1.0/6.0)*img_g, pow(avg_b/bn, 1.0/6.0)*img_b); + double reds = 0., greens = 0., blues = 0.; + + if (wbpar.method == "aut" || wbpar.method == "autosdw" || wbpar.method == "autedgsdw" || wbpar.method == "autedgrob" || wbpar.method == "autedg" || wbpar.method == "autorobust") { + //twotimes = true; + reds = avg_rm * refwb_red; + greens = avg_gm * refwb_green; + blues = avg_bm * refwb_blue; + } + + if (wbpar.method == "autold") { + reds = avg_r / std::max(1, rn) * refwb_red; + greens = avg_g / std::max(1, gn) * refwb_green; + blues = avg_b / std::max(1, bn) * refwb_blue; + } + + if (wbpar.method == "autitcgreen") { + //not used + redAWBMul = rm = avg_rm * refwb_red; + greenAWBMul = gm = avg_gm * refwb_green; + blueAWBMul = bm = avg_bm * refwb_blue; + } else { + redAWBMul = rm = imatrices.rgb_cam[0][0] * reds + imatrices.rgb_cam[0][1] * greens + imatrices.rgb_cam[0][2] * blues; + greenAWBMul = gm = imatrices.rgb_cam[1][0] * reds + imatrices.rgb_cam[1][1] * greens + imatrices.rgb_cam[1][2] * blues; + blueAWBMul = bm = imatrices.rgb_cam[2][0] * reds + imatrices.rgb_cam[2][1] * greens + imatrices.rgb_cam[2][2] * blues; + } + +} + + + + + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void RawImageSource::getAutoWBMultipliers (double &rm, double &gm, double &bm) { diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 4c7b0ba21..477519c1f 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -85,10 +85,13 @@ protected: // the interpolated green plane: array2D green; + array2D greenloc; // the interpolated red plane: array2D red; + array2D redloc; // the interpolated blue plane: array2D blue; + array2D blueloc; bool rawDirty; float psRedBrightness[4]; float psGreenBrightness[4]; @@ -101,6 +104,7 @@ protected: void hlRecovery (const std::string &method, float* red, float* green, float* blue, int width, float* hlmax); void transformRect (const PreviewProps &pp, int tran, int &sx1, int &sy1, int &width, int &height, int &fw); void transformPosition (int x, int y, int tran, int& tx, int& ty); + void ItcWB(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, const ColorManagementParams &cmp, const RAWParams &raw, const WBParams & wbpar); unsigned FC(int row, int col) const { @@ -136,6 +140,9 @@ public: void copyOriginalPixels(const RAWParams &raw, RawImage *ri, RawImage *riDark, RawImage *riFlatFile, array2D &rawData ); void cfaboxblur (RawImage *riFlatFile, float* cfablur, int boxH, int boxW); void scaleColors (int winx, int winy, int winw, int winh, const RAWParams &raw, array2D &rawData); // raw for cblack + void WBauto(double &tempref, double &greenref, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams &cmp, const RAWParams &raw); + void getAutoWBMultipliersloc(double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const WBParams & wbpar, const ColorManagementParams &cmp, const RAWParams &raw); + void getrgbloc(bool local, bool gamma, bool cat02, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w); void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hrp, const procparams::RAWParams &raw) override; eSensorType getSensorType () const override diff --git a/rtengine/settings.h b/rtengine/settings.h index 1fc3b222c..1986ee69f 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -80,6 +80,14 @@ public: // bool bw_complementary; double level0_cbdl; double level123_cbdl; + int itcwb_thres; + bool itcwb_sort; + int itcwb_greenrange; + int itcwb_greendeltatemp; + bool itcwb_forceextra; + int itcwb_sizereference; + int itcwb_delta; + Glib::ustring lensfunDbDirectory; ///< The directory containing the lensfun database. If empty, the system defaults will be used (as described in http://lensfun.sourceforge.net/manual/dbsearch.html) enum class ThumbnailInspectorMode { diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 6ca3091a3..ce101bd7a 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -29,6 +29,8 @@ namespace rtengine { +using namespace procparams; +ProcParams* params; extern const Settings* settings; @@ -309,6 +311,30 @@ void StdImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) } } +void StdImageSource::WBauto(double &tempref, double &greenref, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams &cmp, const RAWParams &raw) +{ +} + +void StdImageSource::getrgbloc(bool local, bool gamma, bool cat02, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w) +{} + +void StdImageSource::getAutoWBMultipliersloc(double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const WBParams & wbpar, const ColorManagementParams &cmp, const RAWParams &raw) +{ + if (redAWBMul != -1.) { + rm = redAWBMul; + gm = greenAWBMul; + bm = blueAWBMul; + return; + } + + img->getAutoWBMultipliersloc(tempref, greenref, tempitc, greenitc,studgood, begx, begy, yEn, xEn, cx, cy, bf_h, bf_w, rm, gm, bm, params->wb, params->icm, params->raw); + + redAWBMul = rm; + greenAWBMul = gm; + blueAWBMul = bm; +} + + void StdImageSource::getAutoWBMultipliers (double &rm, double &gm, double &bm) { if (redAWBMul != -1.) { diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index 8f16880dc..ba75efbb9 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -44,12 +44,15 @@ public: int load (const Glib::ustring &fname) override; void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw) override; + void getrgbloc(bool local, bool gamma, bool cat02, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w); ColorTemp getWB () const override { return wb; } void getAutoWBMultipliers (double &rm, double &gm, double &bm) override; ColorTemp getSpotWB (std::vector &red, std::vector &green, std::vector &blue, int tran, double equal) override; + void WBauto(double &tempref, double &greenref, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams &cmp, const RAWParams &raw); + void getAutoWBMultipliersloc(double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const WBParams & wbpar, const ColorManagementParams &cmp, const RAWParams &raw); eSensorType getSensorType() const override {return ST_NONE;} bool isMono() const override {return false;} diff --git a/rtgui/options.cc b/rtgui/options.cc index 2437f5313..89a490a68 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -583,6 +583,13 @@ void Options::setDefaults() rtSettings.amchroma = 40;//between 20 and 140 low values increase effect..and also artifacts, high values reduces rtSettings.level0_cbdl = 0; rtSettings.level123_cbdl = 30; + rtSettings.itcwb_thres = 34;//between 10 to 55 + rtSettings.itcwb_sort = false; + rtSettings.itcwb_greenrange = 0;//between 0 to 2 + rtSettings.itcwb_greendeltatemp = 2;//between 0 and 4 + rtSettings.itcwb_forceextra = true; + rtSettings.itcwb_sizereference = 3;//between 1 and 5 + rtSettings.itcwb_delta = 1;//between 0 and 5 rtSettings.protectred = 60; rtSettings.protectredh = 0.3; @@ -1485,6 +1492,35 @@ void Options::readFromFile(Glib::ustring fname) rtSettings.level123_cbdl = keyFile.get_double("Color Management", "CBDLlevel123"); } + if (keyFile.has_key("Color Management", "Itcwb_thres")) { + rtSettings.itcwb_thres = keyFile.get_integer("Color Management", "Itcwb_thres"); + } + + if (keyFile.has_key("Color Management", "Itcwb_sort")) { + rtSettings.itcwb_sort = keyFile.get_boolean("Color Management", "Itcwb_sort"); + } + + if (keyFile.has_key("Color Management", "Itcwb_forceextra")) { + rtSettings.itcwb_forceextra = keyFile.get_boolean("Color Management", "Itcwb_forceextra"); + } + + if (keyFile.has_key("Color Management", "Itcwb_greenrange")) { + rtSettings.itcwb_greenrange = keyFile.get_integer("Color Management", "Itcwb_greenrange"); + } + + if (keyFile.has_key("Color Management", "Itcwb_greendeltatemp")) { + rtSettings.itcwb_greendeltatemp = keyFile.get_integer("Color Management", "Itcwb_greendeltatemp"); + } + + if (keyFile.has_key("Color Management", "Itcwb_sizereference")) { + rtSettings.itcwb_sizereference = keyFile.get_integer("Color Management", "Itcwb_sizereference"); + } + + if (keyFile.has_key("Color Management", "Itcwb_delta")) { + rtSettings.itcwb_delta = keyFile.get_integer("Color Management", "Itcwb_delta"); + } + + //if (keyFile.has_key ("Color Management", "Colortoningab")) rtSettings.colortoningab = keyFile.get_double("Color Management", "Colortoningab"); //if (keyFile.has_key ("Color Management", "Decaction")) rtSettings.decaction = keyFile.get_double("Color Management", "Decaction"); @@ -2148,6 +2184,14 @@ void Options::saveToFile(Glib::ustring fname) //keyFile.set_boolean ("Color Management", "Ciebadpixgauss", rtSettings.ciebadpixgauss); keyFile.set_double("Color Management", "CBDLlevel0", rtSettings.level0_cbdl); keyFile.set_double("Color Management", "CBDLlevel123", rtSettings.level123_cbdl); + keyFile.set_integer("Color Management", "Itcwb_thres", rtSettings.itcwb_thres); + keyFile.set_boolean("Color Management", "Itcwb_sort", rtSettings.itcwb_sort); + keyFile.set_integer("Color Management", "Itcwb_greenrange", rtSettings.itcwb_greenrange); + keyFile.set_integer("Color Management", "Itcwb_greendeltatemp", rtSettings.itcwb_greendeltatemp); + keyFile.set_boolean("Color Management", "Itcwb_forceextra", rtSettings.itcwb_forceextra); + keyFile.set_integer("Color Management", "Itcwb_sizereference", rtSettings.itcwb_sizereference); + keyFile.set_integer("Color Management", "Itcwb_delta", rtSettings.itcwb_delta); + //keyFile.set_double ("Color Management", "Colortoningab", rtSettings.colortoningab); //keyFile.set_double ("Color Management", "Decaction", rtSettings.decaction); keyFile.set_string("Color Management", "ClutsDirectory", clutsDir); diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 3c3382bc3..226edab0b 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -175,6 +175,14 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB row[methodColumns.colId] = i + 100; } + if (currType == WBEntry::Type::AUTO) { + // Creating the auto category + row = *(refTreeModel->append()); + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; + row[methodColumns.colLabel] = M("TP_WBALANCE_AUTO_HEADER"); + row[methodColumns.colId] = i + 100; + } + if (currType == WBEntry::Type::WATER) { // Creating the under water subcategory header row = *(refTreeModel->append()); @@ -213,6 +221,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB || currType == WBEntry::Type::WATER || currType == WBEntry::Type::FLASH || currType == WBEntry::Type::LED + || currType == WBEntry::Type::AUTO ) { childrow = *(refTreeModel->append(row.children())); childrow[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)];