diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 81450a61a..efe2295cc 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -99,6 +99,10 @@ jobs: run: | echo "Listing shared library dependencies." ldd "./build/${{matrix.build_type}}/rawtherapee.exe" + echo "Finding DLLs to include." + DLLS=($(ldd "./build/${{matrix.build_type}}/rawtherapee.exe" | grep '/mingw64/bin/' | awk '{print($1)'})) + echo "Required DLLs are: ${DLLS[*]}" + echo "Getting workspace path." export BUILD_DIR="$(pwd)/build/${{matrix.build_type}}" echo "Build directory is '$BUILD_DIR'." @@ -111,77 +115,7 @@ jobs: "gdbus.exe" \ "gspawn-win64-helper.exe" \ "gspawn-win64-helper-console.exe" \ - "libatk-1.0-0.dll" \ - "libatkmm-1.6-1.dll" \ - "libbrotlicommon.dll" \ - "libbrotlidec.dll" \ - "libbz2-1.dll" \ - "libcairo-2.dll" \ - "libcairo-gobject-2.dll" \ - "libcairomm-1.0-1.dll" \ - "libcrypto-3-x64.dll" \ - "libcurl-4.dll" \ - "libdatrie-1.dll" \ - "libdeflate.dll" \ - "libepoxy-0.dll" \ - "libexiv2.dll" \ - "libexpat-1.dll" \ - libffi-*.dll \ - "libfftw3f-3.dll" \ - "libfftw3f_omp-3.dll" \ - "libfontconfig-1.dll" \ - "libfreetype-6.dll" \ - "libfribidi-0.dll" \ - "libgcc_s_seh-1.dll" \ - "libgdk_pixbuf-2.0-0.dll" \ - "libgdk-3-0.dll" \ - "libgdkmm-3.0-1.dll" \ - "libgio-2.0-0.dll" \ - "libgiomm-2.4-1.dll" \ - "libglib-2.0-0.dll" \ - "libglibmm-2.4-1.dll" \ - "libgmodule-2.0-0.dll" \ - "libgobject-2.0-0.dll" \ - "libgomp-1.dll" \ - "libgraphite2.dll" \ - "libgtk-3-0.dll" \ - "libgtkmm-3.0-1.dll" \ - "libharfbuzz-0.dll" \ - "libiconv-2.dll" \ - "libidn2-0.dll" \ - "libintl-8.dll" \ - "libjbig-0.dll" \ - "libjpeg-8.dll" \ - "liblcms2-2.dll" \ - "liblensfun.dll" \ - "libLerc.dll" \ - "liblzma-5.dll" \ - "libnghttp2-14.dll" \ - "libpango-1.0-0.dll" \ - "libpangocairo-1.0-0.dll" \ - "libpangoft2-1.0-0.dll" \ - "libpangomm-1.4-1.dll" \ - "libpangowin32-1.0-0.dll" \ - "libpcre2-8-0.dll" \ - "libpixman-1-0.dll" \ - "libpng16-16.dll" \ - "libpsl-5.dll" \ - "librsvg-2-2.dll" \ - "libsharpyuv-0.dll" \ - "libsigc-2.0-0.dll" \ - "libssh2-1.dll" \ - "libssl-3-x64.dll" \ - "libstdc++-6.dll" \ - "libsystre-0.dll" \ - "libthai-0.dll" \ - "libtiff-6.dll" \ - "libtre-5.dll" \ - "libunistring-5.dll" \ - "libwebp-7.dll" \ - "libwinpthread-1.dll" \ - "libxml2-2.dll" \ - "libzstd.dll" \ - "zlib1.dll" \ + ${DLLS[*]} \ "$BUILD_DIR" cd - diff --git a/.gitignore b/.gitignore index 7774f1f3a..e67dc3511 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ .settings .directory .vscode +.DS_Store +.idea CMakeCache.txt CMakeFiles @@ -42,4 +44,3 @@ clean *.tar *.xz *.zip - diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index b7b2c7ec7..f4ef5a0db 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -2732,8 +2732,8 @@ TP_RGBCURVES_BLUE;B TP_RGBCURVES_CHANNEL;Canal TP_RGBCURVES_GREEN;V TP_RGBCURVES_LABEL;Courbes RVB -TP_RGBCURVES_LUMAMODE;Mode Lominosité -TP_RGBCURVES_LUMAMODE_TOOLTIP;Mode Lominosité permet de faire varier la contribution des canaux R, V et B à la luminosité de l'image, sans altérer les couleurs de l'image. +TP_RGBCURVES_LUMAMODE;Mode Luminosité +TP_RGBCURVES_LUMAMODE_TOOLTIP;Mode Luminosité permet de faire varier la contribution des canaux R, V et B à la luminosité de l'image, sans altérer les couleurs de l'image. TP_RGBCURVES_RED;R TP_ROTATE_DEGREE;Degré TP_ROTATE_LABEL;Rotation diff --git a/rtdata/languages/default b/rtdata/languages/default index 3ddfaa5e9..98b6b3870 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1447,6 +1447,7 @@ HISTORY_MSG_LOCALCONTRAST_ENABLED;Local Contrast HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Local Contrast - Lightness HISTORY_MSG_LOCALCONTRAST_RADIUS;Local Contrast - Radius HISTORY_MSG_LOCAL_GAMUTMUNSEL;Local - Gamut-Munsell +HISTORY_MSG_LOCALLAB_TE_PIVOT;Local - Equalizer pivot HISTORY_MSG_METADATA_MODE;Metadata copy mode HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Auto threshold @@ -1492,6 +1493,11 @@ HISTORY_MSG_SPOT_ENTRY;Spot removal - Point modif. HISTORY_MSG_TEMPOUT;CAM02 automatic temperature HISTORY_MSG_THRESWAV;Balance threshold HISTORY_MSG_TM_FATTAL_ANCHOR;DRC - Anchor +HISTORY_MSG_TONE_EQUALIZER_BANDS;Tone equalizer - Bands +HISTORY_MSG_TONE_EQUALIZER_ENABLED;Tone equalizer +HISTORY_MSG_TONE_EQUALIZER_PIVOT;Tone equalizer - Pivot +HISTORY_MSG_TONE_EQUALIZER_REGULARIZATION;Tone equalizer - Regularization +HISTORY_MSG_TONE_EQUALIZER_SHOW_COLOR_MAP;Tone equalizer - Tonal map HISTORY_MSG_TRANS_METHOD;Geometry - Method HISTORY_MSG_WAVBALCHROM;Equalizer chrominance HISTORY_MSG_WAVBALLUM;Equalizer luminance @@ -1532,6 +1538,22 @@ HISTORY_MSG_WAVTHRDEN;Threshold local contrast HISTORY_MSG_WAVTHREND;Threshold local contrast HISTORY_MSG_WAVUSHAMET;Clarity method HISTORY_MSG_WBALANCE_OBSERVER10;Observer 10° +HISTORY_MSG_WBITC_OBS;Remove algo 2 passes +HISTORY_MSG_WBITC_CUSTOM;Itcwb Custom +HISTORY_MSG_WBITC_SAMPLING;Low sampling +HISTORY_MSG_WBITC_THRES;Itcwb Theshold +HISTORY_MSG_WBITC_NOPURPLE;Itcwb Nopurple +HISTORY_MSG_WBITC_PRIM;Primaries +HISTORY_MSG_WBITC_SORTED;Itcwb ponderated +HISTORY_MSG_WBITC_FORCE;Itcwb Force +HISTORY_MSG_WBITC_SIZE;Itcwb Size +HISTORY_MSG_WBITC_PRECIS;Itcwb Precision +HISTORY_MSG_WBITC_DELTA;Itcwb Delta green +HISTORY_MSG_WBITC_FGREEN;Itcwb Green - student +HISTORY_MSG_WBITC_RGREEN;Itcwb Green range +HISTORY_MSG_WBITC_MINSIZE;Patch min size +HISTORY_MSG_WBITC_PONDER;Itcwb ponderated +HISTORY_MSG_WBITC_GREEN;Grren refinement HISTORY_NEWSNAPSHOT;Add HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s HISTORY_SNAPSHOT;Snapshot @@ -1799,6 +1821,7 @@ PARTIALPASTE_SHARPENMICRO;Microcontrast PARTIALPASTE_SOFTLIGHT;Soft light PARTIALPASTE_SPOT;Spot removal PARTIALPASTE_TM_FATTAL;Dynamic range compression +PARTIALPASTE_TONE_EQUALIZER;Tone equalizer PARTIALPASTE_VIBRANCE;Vibrance PARTIALPASTE_VIGNETTING;Vignetting correction PARTIALPASTE_WHITEBALANCE;White balance @@ -1837,6 +1860,17 @@ PREFERENCES_CHUNKSIZE_RGB;RGB processing PREFERENCES_CIE;Ciecam PREFERENCES_CIEARTIF;Avoid artifacts PREFERENCES_WBA;White Balance +PREFERENCES_WBACORR;White Balance - Automatic temperature correlation +PREFERENCES_WBACORR_TOOLTIP;These settings allow, depending on the images (type of raw file, colorimetry, etc.), an adaptation of the " Temperature correlation " algorithm in order to obtain the best overall results. There is no absolute rule, linking these parameters to the results obtained.\n\nThe settings are of 3 types: \n* those accessible to the user from the GUI.\n* those accessible only in reading from each pp3 file : Itcwb_minsize=20, Itcwb_delta=4 Itcwb_rgreen=1 Itcwb_nopurple=false (See Rawpedia)\n* those accessible to the user in 'options' (see Rawpedia)\n You can use "Awb temperature bias" and "Green refinement" to adjust the results. Each movement of these commands brings a new calculation of temperature, tint and correlation.\n\nPlease note that the 3 indicators 'Correlation factor', 'Patch chroma' and ΔE are given for information only. It is not because one of these indicators is better that the result will necessarily be better. +PREFERENCES_WBAENA;Show White Balance auto Temperature correlation Settings +PREFERENCES_WBAENACUSTOM;Use Custom temperature & tint +PREFERENCES_WBAPATCH;Number maximum of colors used in picture +PREFERENCES_WBAFORC;Forces Extra algoritm +PREFERENCES_WBAGREENDELTA;Delta temperature in green iterate loop (if Force Extra enabled) +PREFERENCES_WBANOPURP;No purple color used +PREFERENCES_WBAPRECIS;Precision algorithm - scale used +PREFERENCES_WBASIZEREF;Size of reference color compare to size of histogram color +PREFERENCES_WBASORT;Sort in chroma order instead of histogram PREFERENCES_CLIPPINGIND;Clipping Indication PREFERENCES_CLUTSCACHE;HaldCLUT Cache PREFERENCES_CLUTSCACHE_LABEL;Maximum number of cached CLUTs @@ -2620,6 +2654,7 @@ TP_ICM_WORKING_PRIM_BRU;BruceRGB TP_ICM_WORKING_PRIM_BST;BestRGB TP_ICM_WORKING_PRIM_CUS;Custom (sliders) TP_ICM_WORKING_PRIM_CUSGR;Custom (CIE xy Diagram) +TP_ICM_WORKING_PRIM_JDCMAX;JDC Max TP_ICM_WORKING_PRIM_NONE;Default TP_ICM_WORKING_PRIM_PROP;ProPhoto TP_ICM_WORKING_PRIM_REC;Rec2020 @@ -2850,13 +2885,15 @@ TP_LOCALLAB_DENOIMASK;Denoise chroma mask TP_LOCALLAB_DENOIMASK_TOOLTIP;For all tools, allows you to control the chromatic noise level of the mask.\nUseful for better control of chrominance and to avoid artifacts when using the LC(h) curve. TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservative mode preserves low frequency detail. Aggressive mode removes low frequency detail.\nConservative and Aggressive modes use wavelets and DCT and can be used in conjunction with 'Non-local Means – Luminance'. TP_LOCALLAB_DENOITHR_TOOLTIP;Adjusts edge detection to help reduce noise in uniform, low-contrast areas. +TP_LOCALLAB_DENOIWAVCH;Wavelets: Chrominance +TP_LOCALLAB_DENOIWAVLUM;Wavelets: Luminance TP_LOCALLAB_DENOI_EXP;Denoise TP_LOCALLAB_DENOI_TOOLTIP;This module can be used for noise reduction either on its own (at the end of the processing pipeline) or in addition to the Noise Reduction module in the Detail tab (which works at the beginning of the pipeline).\n Scope allows you to differentiate the action based on color (ΔE).\nMinimum RT-spot size: 128x128. TP_LOCALLAB_DEPTH;Depth TP_LOCALLAB_DETAIL;Local contrast TP_LOCALLAB_DETAILFRA;Edge detection - DCT TP_LOCALLAB_DETAILSH;Details -TP_LOCALLAB_DETAILTHR;Luma-chro detail threshold +TP_LOCALLAB_DETAILTHR;Lum/chrom detail threshold TP_LOCALLAB_DIVGR;Gamma TP_LOCALLAB_DUPLSPOTNAME;Copy TP_LOCALLAB_EDGFRA;Edge sharpness @@ -3121,7 +3158,7 @@ TP_LOCALLAB_MASKLCTHRLOW;Dark area luminance threshold TP_LOCALLAB_MASKLCTHRLOW2;Dark area luma threshold TP_LOCALLAB_MASKLCTHRMID;Gray area luma denoise TP_LOCALLAB_MASKLCTHRMIDCH;Gray area chroma denoise -TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n 'Dark area luminance threshold'. If 'Reinforce denoise in dark and light areas' > 1 the denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by mask).\n 'Light area luminance threshold'. The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by mask).\n In the area between the two thresholds, the denoise settings are not affected by the mask. +TP_LOCALLAB_MASKLC_TOOLTIP;Used by wavelet luminance.\nThis allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n 'Dark area luminance threshold'. If 'Reinforce denoise in dark and light areas' > 1 the denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by mask).\n 'Light area luminance threshold'. The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by mask).\n In the area between the two thresholds, the denoise settings are not affected by the mask. TP_LOCALLAB_MASKLNOISELOW;Reinforce dark/light areas TP_LOCALLAB_MASKLOWTHRESCB_TOOLTIP;Dark-tone limit below which the CBDL parameters (Luminance only) will be restored progressively to their original values prior to being modified by the CBDL settings.\n You can use certain tools in 'Mask and modifications' to change the gray levels: 'Smooth radius', Gamma and Slope, 'Contrast curve'.\n Use a 'lockable color picker' on the mask to see which areas will be affected. Make sure you set 'Background color mask' = 0 in Settings. TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which the parameters will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in 'Mask and modifications' to change the gray levels: 'Structure mask', 'blur mask', 'Smooth radius', Gamma and Slope, 'Contrast curve', 'Local contrast' (wavelets).\n Use a 'lockable color picker' on the mask to see which areas will be affected. Make sure you set 'Background color mask' = 0 in Settings. @@ -3180,6 +3217,12 @@ TP_LOCALLAB_MERTHR;Difference TP_LOCALLAB_MERTWE;Exclusion TP_LOCALLAB_MERTWO;Subtract TP_LOCALLAB_METHOD_TOOLTIP;'Enhanced + chroma denoise' significantly increases processing times.\nBut reduce artifacts. +TP_LOCALLAB_LCLABELS;Residual noise levels +TP_LOCALLAB_LCLABELS_TOOLTIP;Displays the mean and high-end noise values for the area shown in the Preview Panel (at 100% zoom). The noise values are grouped by wavelet levels 0,1,2,3 and 4,5,6.\nThe displayed values are indicative only and are designed to assist with denoise adjustments. They should not be interpreted as absolute noise levels.\n\n 300: Very noisy\n 100-300: Noisy\n 50-100: Moderatly noisy\n < 50: Low noise\n\nThey allow you to see:\n*The impact of Noise Reduction in the main-menu Detail tab.\n*The influence of Non-local Means, Wavelets and DCT on the luminance noise.\n*The influence of Wavelets and DCT on the chroma noise.\n*The influence of Capture Sharpening and Demosaicing. +TP_LOCALLAB_LUMLABEL;Luma levels 0123: Mean=%1 High=%2 +TP_LOCALLAB_LUM46LABEL;Luma levels 456: Mean=%1 High=%2 +TP_LOCALLAB_CHROLABEL;Chroma levels 0123: Mean=%1 High=%2 +TP_LOCALLAB_CHRO46LABEL;Chroma levels 456: Mean=%1 High=%2 TP_LOCALLAB_MLABEL;Restored data Min=%1 Max=%2 TP_LOCALLAB_MLABEL_TOOLTIP;The values should be close to Min=0 Max=32768 (log mode) but other values are possible.You can adjust 'Clip restored data (gain)' and 'Offset' to normalize.\nRecovers image data without blending. TP_LOCALLAB_MODE_EXPERT;Advanced @@ -3196,7 +3239,7 @@ TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP;Use this slider to adapt the amount of denois TP_LOCALLAB_NLDENOISENLRAD_TOOLTIP;Higher values increase denoise at the expense of processing time. TP_LOCALLAB_NLDENOISE_TOOLTIP;'Detail recovery' acts on a Laplacian transform to target uniform areas rather than areas with detail. TP_LOCALLAB_NLDET;Detail recovery -TP_LOCALLAB_NLFRA;Non-local Means - Luminance +TP_LOCALLAB_NLFRA;Non-local Means: Luminance TP_LOCALLAB_NLFRAME_TOOLTIP;Non-local means denoising takes a mean of all pixels in the image, weighted by how similar they are to the target pixel.\nReduces loss of detail compared with local mean algorithms.\nOnly luminance noise is taken into account. Chrominance noise is best processed using wavelets and Fourier transforms (DCT).\nCan be used in conjunction with 'Luminance denoise by level' or on its own. TP_LOCALLAB_NLGAM;Gamma TP_LOCALLAB_NLLUM;Strength @@ -3390,6 +3433,7 @@ TP_LOCALLAB_STYPE_TOOLTIP;You can choose between:\nSymmetrical - left handle lin TP_LOCALLAB_SYM;Symmetrical (mouse) TP_LOCALLAB_SYMSL;Symmetrical (mouse + sliders) TP_LOCALLAB_TARGET_GRAY;Mean luminance (Yb%) +TP_LOCALLAB_TE_PIVOT;Pivot (Ev) TP_LOCALLAB_THRES;Threshold structure TP_LOCALLAB_THRESDELTAE;ΔE scope threshold TP_LOCALLAB_THRESRETI;Threshold @@ -3786,6 +3830,16 @@ TP_TM_FATTAL_AMOUNT;Amount TP_TM_FATTAL_ANCHOR;Anchor TP_TM_FATTAL_LABEL;Dynamic Range Compression TP_TM_FATTAL_THRESHOLD;Detail +TP_TONE_EQUALIZER_BAND_0;Blacks +TP_TONE_EQUALIZER_BAND_1;Shadows +TP_TONE_EQUALIZER_BAND_2;Midtones +TP_TONE_EQUALIZER_BAND_3;Highlights +TP_TONE_EQUALIZER_BAND_4;Whites +TP_TONE_EQUALIZER_BANDS;Bands +TP_TONE_EQUALIZER_DETAIL;Regularization +TP_TONE_EQUALIZER_LABEL;Tone Equalizer +TP_TONE_EQUALIZER_PIVOT;Pivot (Ev) +TP_TONE_EQUALIZER_SHOW_COLOR_MAP;Show tonal map TP_VIBRANCE_AVOIDCOLORSHIFT;Avoid color shift TP_VIBRANCE_CURVEEDITOR_SKINTONES;HH TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL;Skin-tones @@ -4062,7 +4116,7 @@ TP_WAVELET_WAVOFFSET;Offset TP_WBALANCE_AUTO;Auto TP_WBALANCE_AUTOITCGREEN;Temperature correlation TP_WBALANCE_AUTOOLD;RGB grey -TP_WBALANCE_AUTO_HEADER;Automatic +TP_WBALANCE_AUTO_HEADER;Automatic & Refinement TP_WBALANCE_CAMERA;Camera TP_WBALANCE_CLOUDY;Cloudy TP_WBALANCE_CUSTOM;Custom @@ -4089,6 +4143,47 @@ TP_WBALANCE_FLUO_HEADER;Fluorescent TP_WBALANCE_GREEN;Tint TP_WBALANCE_GTI;GTI TP_WBALANCE_HMI;HMI +TP_WBALANCE_ITCWB_DELTA;Delta temperature in green loop +TP_WBALANCE_ITCWBDELTA_TOOLTIP;Fixed for each "green" iteration tried, the temperature difference to be taken into account. +//TP_WBALANCE_ITCWB_FORCED;Forces use of the entire CIE diagram +TP_WBALANCE_ITCWB_FORCED;Close to full CIE diagram +TP_WBALANCE_ITCWFORCED_TOOLTIP;By default (box not checked) the data scanned during sampling is brought back to the sRGB profile, which is the most widespread, both for calibrating DCP or ICC profiles with the Colorchecker24, or used on the web.\n If you have very high gamut images (some flowers, artificial colors), then it may be necessary to use the entire CIExy diagram, the profile used will be ACESP0. In this second case, the number of colors that can be used in internal to the algorithm will be more important. +TP_WBALANCE_ITCWB_FGREEN;Find green student +TP_WBALANCE_ITCWGREEN;Green refinement +TP_WBALANCE_ITCWGREEN_TOOLTIP;Allows you to change the "tint" (green) which will serve as a reference when starting the algorithm. It has substantially the same role for greens as "AWB temperature bias" for temperature.\nThe whole algorithm is recalculated. +TP_WBALANCE_ITCWBFGREEN_TOOLTIP;Find the best compromise between Student and green. +TP_WBALANCE_ITCWB_FRA;Auto Temperature correlation Settings +TP_WBALANCE_ITCWB_FRA_TOOLTIP;These settings allow, depending on the images (type of raw, colorimetry, etc.), an adaptation of the 'Temperature correlation' algorithm. There is no absolute rule linking these parameters to the results obtained. +TP_WBALANCE_ITCWB_MINSIZEPATCH;Patch minimum size +TP_WBALANCE_ITCWBMINSIZEPATCH_TOOLTIP;Allows you to set the minimum patch value. values that are too low can lead to a lack of correlation. +TP_WBALANCE_ITCWB_NOPURPLE;Filter on purple color +//TP_WBALANCE_ITCWBNOPURPLE_TOOLTIP;By default when "Inpaint opposed" is activated, purple colors are not taken into account. However, if the image does not need highlight reconstruction, or if this image naturally contains purple tints (flowers, etc.), it may be necessary to deactivate, to take into account all the colors. +TP_WBALANCE_ITCWBNOPURPLE_TOOLTIP;Allows you to filter magenta/purple data from the image. If the box is checked a filter limiting the value of Y is applied. By default this value is 0.4. You can change it in 'options' Itcwb_Ypurple (Maximum 1) +TP_WBALANCE_ITCWB_ALG;Remove 2 pass algorithm +TP_WBALANCE_ITCWB_CUSTOM;Use Custom temperature & tint +TP_WBALANCE_ITCWCUSTOM_TOOLTIP;Allows you to use Custom settings Temperature and Green (tint).\n\nUsage tips:\n1) start Itcwb , enable 'Use Custom temperature and tint'.\n2) Set 'Temperature and tint' to your liking :free, Pick,...(Custom)\n3) go back to 'Temperature correlation'.\n\nYou cannot use : 2 passes, AWB temperature bias, Green refinement. +TP_WBALANCE_ITCWALG_TOOLTIP;Allows you to switch to the other Alternative temperature (Alt_temp), when possible.\nInactive in the "single choice" case. +TP_WBALANCE_ITCWB_PRECIS;Precision algorithm - scale used +TP_WBALANCE_ITCWBPRECIS_TOOLTIP;The lower the value, the more relevant the data, but increases the processing time. Since the processing time is low, this parameter should generally be able to remain at the default value +TP_WBALANCE_ITCWB_PRIM_SRGB;Low sampling & No use Camera settings +TP_WBALANCE_ITCWB_PRIM_ADOB;Medium sampling +TP_WBALANCE_ITCWB_PRIM_BETA;Medium sampling - near Pointer's gamut +TP_WBALANCE_ITCWB_PRIM_REC;High sampling +TP_WBALANCE_ITCWB_PRIM_ACE;Forces use of the entire CIE diagram +TP_WBALANCE_ITCWB_PRIM_JDCMAX;Close to full CIE diagram +TP_WBALANCE_ITCWB_PRIM_XYZCAM;Camera XYZ matrix +TP_WBALANCE_ITCWB_PRIM_XYZCAM2;JDCmax after Camera XYZ matrix +TP_WBALANCE_ITCWPRIM_TOOLTIP;Allows you to select the image sampling.\n'Close to full CIE diagram' almost uses the data present on the sensor, possibly including the imaginary colors.\n'Camera XYZ matrix' - uses the matrix directly derived from Color Matrix.\n'Medium sampling' (default) - near Pointer's gamut: corresponds substantially to the most common cases of human vision.\nThe other choice 'Low sampling and No use camera settings' allow you to isolate high gamut parts of the image and forces the algorithm in some cases (tint > 0.8,...) not to use camera settings. This will obviously have an impact on the result.\n\nThis sampling only has an influence on the channel multipliers, it has nothing to do with the "working profile" and does not modify the gamut of the image. +TP_WBALANCE_ITCWB_RGREEN;Green range +TP_WBALANCE_ITCWBRGREEN_TOOLTIP;Sets the green value review amplitude in iterations, from low amplitude 0.82 to 1.25 to maximum amplitude 0.4 to 4. +TP_WBALANCE_ITCWB_SAMPLING;Low sampling 5.9 +TP_WBALANCE_ITCWSAMPLING_TOOLTIP;Allows you to use the old sampling algorithm to ensure better compatibility with 5.9. You must enable Observer 10° (default). +TP_WBALANCE_ITCWB_SIZE;Size of ref. color compare to histogram +TP_WBALANCE_ITCWB_SIZEPATCH;Size of color patch +TP_WBALANCE_ITCWBSIZEPATCH_TOOLTIP;This setting sets the size of color datas used by algorithm. +TP_WBALANCE_ITCWBSIZE_TOOLTIP;This setting sets the number of iterations to find the best correspondence between the reference spectral colors and those in xyY value of the image. A value of 3 seams a good compromise. +TP_WBALANCE_ITCWB_THRES;Colors used in picture (preset) +TP_WBALANCE_ITCWBTHRES_TOOLTIP;Limits comparison sampling between spectral data and image data. TP_WBALANCE_JUDGEIII;JudgeIII TP_WBALANCE_LABEL;White Balance TP_WBALANCE_LAMP_HEADER;Lamp @@ -4100,6 +4195,10 @@ TP_WBALANCE_MULLABEL;Multipliers: r=%1 g=%2 b=%3 TP_WBALANCE_MULLABEL_TOOLTIP;Values given for information purposes. You cannot change them. TP_WBALANCE_OBSERVER10;Observer 10° instead of Observer 2° TP_WBALANCE_OBSERVER10_TOOLTIP;The color management in Rawtherapee (White balance, channel multipliers, highlight recovery,...) uses the spectral data of the illuminants and colors. Observer is an important parameter of this management which takes into account the angle of perception of the eye. In 1931 it was fixed at 2° (privileges the use of the cones). In 1964 it was fixed at 10° (privileges the use of the cones, but partially takes into account the rods).\nTo avoid a (rare) drift of the colors due to the choice Observer 10° - probably due to the conversion matrix - Observer 2° must be selected.\nIn a majority of cases Observer 10° (default) will be a more relevant choice. +TP_WBALANCE_PATCHLABEL;Read colors:%1 Patch: Chroma:%2 Size=%3 +TP_WBALANCE_PATCHLABEL_TOOLTIP;Display number of read colors (max=237).\nDisplay calculated Patch Chroma.\nAWB temperature bias, lets try to reduce this value, a minimum may seem to optimize the algorithm.\n\nPatch size matching chroma optimization. +TP_WBALANCE_PATCHLEVELLABEL;Patch: ΔE=%1 - datas x 9 Min:%2 Max=%3 +TP_WBALANCE_PATCHLEVELLABEL_TOOLTIP;Display ΔE patch (this assumes there is enough spectral data), between image and spectral datas.\n Display read datas found. The 2 values correspond to the minimum and maximum data values taken into account. The coefficient x9 must be taken into account to obtain the number of pixels concerned in the image. TP_WBALANCE_PICKER;Pick TP_WBALANCE_SHADE;Shade TP_WBALANCE_SIZE;Size: @@ -4108,10 +4207,12 @@ TP_WBALANCE_SOLUX41;Solux 4100K TP_WBALANCE_SOLUX47;Solux 4700K (vendor) TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. -TP_WBALANCE_STUDLABEL;Correlation factor: %1 -TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation.\nLower values are better, where <0.005 is excellent,\n<0.01 is good, and >0.5 is poor.\nLow values do not mean that the white balance is good:\nif the illuminant is non-standard the results can be erratic.\nA value of 1000 means previous calculations are used and\nthe resultsare probably good. +TP_WBALANCE_STUDLABEL;Correlation factor: %1 Passes:%2 Worst_alt=%3 +TP_WBALANCE_STUDLABEL1;Correlation factor: %1 Passes:%2 Best_alt=%3 +TP_WBALANCE_STUDLABEL0;Correlation factor: %1 Passes:%2 Alt=%3 +TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation.\nLower values are better, where <0.005 is excellent,\n<0.01 is good, and >0.5 is poor.\nLow values do not mean that the white balance is good:\nif the illuminant is non-standard the results can be erratic.\nA value of 1000 means previous calculations are used and\nthe resultsare probably good.\n\nPasses : number of passes made.\nAlt_temp : Alternative temperature. TP_WBALANCE_TEMPBIAS;AWB temperature bias -TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the 'auto white balance'\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by 'computedTemp + computedTemp * bias'. +TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the 'auto white balance'\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by 'computedTemp + computedTemp * bias'.\n\nYou can use "Awb temperature bias" to adjust the "Temperature correlation" results. Each movement of this command brings a new calculation of temperature, tint and correlation. TP_WBALANCE_TEMPERATURE;Temperature TP_WBALANCE_TUNGSTEN;Tungsten TP_WBALANCE_WATER1;UnderWater 1 diff --git a/rtdata/themes/TooWaBlue-GTK3-20_.css b/rtdata/themes/TooWaBlue-GTK3-20_.css index ba25e70b7..4d7504dc5 100644 --- a/rtdata/themes/TooWaBlue-GTK3-20_.css +++ b/rtdata/themes/TooWaBlue-GTK3-20_.css @@ -946,7 +946,7 @@ dialog notebook stack { } -/* Adds a line on top of the notebook as a separtor for the titlebar (only on CSD) */ +/* Adds a line on top of the notebook as a separator for the titlebar (only on CSD) */ dialog.csd #PrefNotebook > header, dialog.csd #AboutNotebook > header, window.csd:not(.fullscreen) #MainNotebook > header.top { diff --git a/rtdata/themes/size - Legacy.css b/rtdata/themes/size - Legacy.css index 089a909ee..290b95d8c 100644 --- a/rtdata/themes/size - Legacy.css +++ b/rtdata/themes/size - Legacy.css @@ -102,7 +102,7 @@ notebook > header.left > tabs > arrow { } -/* Adds a line on top of the notebook as a separtor for the titlebar (only on CSD) */ +/* Adds a line on top of the notebook as a separator for the titlebar (only on CSD) */ dialog.csd #PrefNotebook > header, dialog.csd #AboutNotebook > header, window.csd:not(.fullscreen) #MainNotebook > header.top { diff --git a/rtdata/themes/size.css b/rtdata/themes/size.css index 675ed51c2..5f5e64120 100644 --- a/rtdata/themes/size.css +++ b/rtdata/themes/size.css @@ -102,7 +102,7 @@ notebook > header.left > tabs > arrow { } -/* Adds a line on top of the notebook as a separtor for the titlebar (only on CSD) */ +/* Adds a line on top of the notebook as a separator for the titlebar (only on CSD) */ dialog.csd #PrefNotebook > header, dialog.csd #AboutNotebook > header, window.csd:not(.fullscreen) #MainNotebook > header.top { diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 19a93c1c4..5a9b2d953 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -136,6 +136,7 @@ set(RTENGINESOURCEFILES ipsharpen.cc ipsharpenedges.cc ipsoftlight.cc + iptoneequalizer.cc iptransform.cc ipvibrance.cc ipwavelet.cc diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 400dea05b..7477c5d08 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -1203,7 +1203,7 @@ BENCHFUN if (!memoryAllocationFailed) { if (kall == 0) { - Noise_residualAB(*adecomp, chresid, chmaxresid, denoiseMethodRgb); + Noise_residualAB(*adecomp, chresid, chmaxresid, denoiseMethodRgb, 0, levwav); chresidtemp = chresid; chmaxresidtemp = chmaxresid; } @@ -1240,12 +1240,13 @@ BENCHFUN if (!memoryAllocationFailed) { if (kall == 0) { - Noise_residualAB(*bdecomp, chresid, chmaxresid, denoiseMethodRgb); + Noise_residualAB(*bdecomp, chresid, chmaxresid, denoiseMethodRgb, 0, levwav); chresid += chresidtemp; chmaxresid += chmaxresidtemp; chresid = sqrt(chresid / (6 * (levwav))); highresi = chresid + 0.66f * (sqrt(chmaxresid) - chresid); //evaluate sigma nresi = chresid; + printf("Nresi=%f Highresi=%f lev=%i\n", (double) nresi, (double) highresi, levwav); } bdecomp->reconstruct(labdn->b[0]); @@ -2158,16 +2159,18 @@ float ImProcFunctions::MadRgb(const float * DataList, const int datalen) -void ImProcFunctions::Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb) +void ImProcFunctions::Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb, int beg, int end) { float resid = 0.f; float maxresid = 0.f; - +// int maxlev = WaveletCoeffs_ab.maxlevel(); + // end = maxlev; #ifdef _OPENMP #pragma omp parallel for schedule(dynamic) collapse(2) reduction(+:resid) reduction(max:maxresid) num_threads(denoiseNestedLevels) if (denoiseNestedLevels>1) #endif - for (int lvl = 0; lvl < WaveletCoeffs_ab.maxlevel(); ++lvl) { + // for (int lvl = 0; lvl < WaveletCoeffs_ab.maxlevel(); ++lvl) { + for (int lvl = beg; lvl < end; ++lvl) { // compute median absolute deviation (MAD) of detail coefficients as robust noise estimator for (int dir = 1; dir < 4; ++dir) { const int Wlvl_ab = WaveletCoeffs_ab.level_W(lvl); diff --git a/rtengine/alpha.h b/rtengine/alpha.h index 1fe2a7a7c..314dac642 100644 --- a/rtengine/alpha.h +++ b/rtengine/alpha.h @@ -19,7 +19,7 @@ #ifndef _ALPHA_H_ #define _ALPHA_H_ -#include +#include #include #define CHECK_BOUNDS 0 diff --git a/rtengine/cJSON.c b/rtengine/cJSON.c index 130c8e2a5..5af587eeb 100644 --- a/rtengine/cJSON.c +++ b/rtengine/cJSON.c @@ -126,7 +126,7 @@ typedef struct internal_hooks } internal_hooks; #if defined(_MSC_VER) -/* work around MSVC error C2322: '...' address of dillimport '...' is not static */ +/* work around MSVC error C2322: '...' address of dllimport '...' is not static */ static void *internal_malloc(size_t size) { return malloc(size); diff --git a/rtengine/calc_distort.cc b/rtengine/calc_distort.cc index 3a7a4a1c4..8f241d0c5 100644 --- a/rtengine/calc_distort.cc +++ b/rtengine/calc_distort.cc @@ -84,7 +84,7 @@ int calcDistortion(unsigned char* img1, unsigned char* img2, int ncols, int nrow r0[n] = sqrt((x0 - wc) * (x0 - wc) + (y0 - hc) * (y0 - hc)) / radius; - // dots too close to the center tends to have big diviation and create noise, extract them + // dots too close to the center tends to have big deviation and create noise, extract them if (r0[n] < CENTER_R) { continue; } diff --git a/rtengine/camconst.json b/rtengine/camconst.json index ac3980bbe..217015e5f 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1230,7 +1230,7 @@ Camera constants: "raw_crop": [ 160, 120, 6024, 4024 ] }, - { // Quality C + { // Quality A "make_model": "Canon EOS R5", "dcraw_matrix" : [9766, -2953, -1254, -4276, 12116, 2433, -437, 1336, 5131], "raw_crop" : [ @@ -1241,7 +1241,7 @@ Camera constants: { "frame" : [ 8352, 5586 ], "areas": [ 94, 20, 5578, 122 ] }, { "frame" : [ 5248, 3510 ], "areas": [ 94, 20, 3510, 122 ] } ], - "ranges" : { "white" : 16382 } + "ranges" : { "white" : 16300 } // 16382 without LENR, add margin for LENR. Dual-pixel frame 2 is lower for low ISOs. }, { // Quality C @@ -1258,6 +1258,19 @@ Camera constants: "ranges" : { "white" : 16382 } }, + { // Quality C + "make_model": ["Canon EOS R6m2", "Canon EOS R8"], + "dcraw_matrix": [9539, -2795, -1224, -4175, 11998, 2458, -465, 1755, 6048], + "raw_crop": [ + {"frame": [6188, 4120], "crop": [154, 96, 6024, 4024]}, + {"frame": [3936, 2612], "crop": [156, 96, 3780, 2516]} + ], + "masked_areas": [ + {"frame": [6188, 4120], "areas": [4, 4, 4116, 150, 4, 150, 92, 6184]}, + {"frame": [3936, 2612], "areas": [4, 4, 2608, 150, 4, 150, 92, 3932]} + ] + }, + { // Quality C "make_model": "Canon EOS R7", "dcraw_matrix" : [10424, -3138, -1300, -4221, 11938, 2584, -547, 1658, 6183], @@ -1565,7 +1578,10 @@ Camera constants: { // Quality B "make_model": [ "FUJIFILM X-T30", "FUJIFILM X-T30 II", "FUJIFILM X100V", "FUJIFILM X-T4", "FUJIFILM X-S10" ], "dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v11, standard_v2 d65 - "raw_crop": [ 0, 5, 6252, 4176] + "raw_crop": [ + {"frame": [6384, 3348], "crop": [624, 0, 5004, 3347]}, // Sports finder mode. + {"frame": [0, 0], "crop": [0, 5, 6252, 4176]} + ] }, { // Quality B @@ -1739,7 +1755,7 @@ Camera constants: { // Quality B, lacks aperture and ISO scaling, known to exist, but little to gain as the levels are so close to white_max "make_model": "Nikon D7000", "dcraw_matrix": [ 7530,-1942,-255,-4318,11390,3362,-926,1694,7649 ], // matrix provided by Tanveer(tsk1979) - //"dcraw_matrix": [ 8198, -2239, -725, -4871, 12388, 2798, -1043, 2050, 7181 ], // DNG v13.2 + // "dcraw_matrix": [ 8198, -2239, -725, -4871, 12388, 2798, -1043, 2050, 7181 ], // DNG v13.2 "ranges": { // measured at ISO 100. ISO differences not measured, but known to exist "white": [ 16300, 15700, 16300 ], // typical R 16383, G 15778, B 16383 @@ -2187,8 +2203,8 @@ Camera constants: { // Quality B "make_model": [ "Panasonic DC-LX100M2" ], - "dcraw_matrix": [ 11577, -4230, -1106, -3967, 12211, 1957, -759, 1762, 5610 ], // DNG v13.2 - //"dcraw_matrix": [ 8585, -3127, -833, -4005, 12250, 1953, -650, 1494, 4862 ], // DNG v13.2 alternate + //"dcraw_matrix": [ 11577, -4230, -1106, -3967, 12211, 1957, -759, 1762, 5610 ], // DNG v13.2 + "dcraw_matrix": [ 8585, -3127, -833, -4005, 12250, 1953, -650, 1494, 4862 ], // DNG v13.2 alternate "raw_crop": [ 0, 0, 0, 0 ], "ranges": { "black": 15 } }, @@ -3123,6 +3139,15 @@ Camera constants: "dcraw_matrix": [ 6344, -1612, -462, -4863, 12477, 2681, -865, 1786, 6899 ] // DNG }, + { // Quality A + "make_model": "Sony ZV-1", + "dcraw_matrix": [ 8280, -2987, -703, -3531, 11645, 2133, -550, 1542, 5312 ], // DNG v15.2 + "ranges": { "black": 800 }, // White level from EXIF. + "raw_crop": [ 0, 0, 5496, 3672 ], + "pdaf_pattern": [0, 24, 48, 72, 88, 120], + "pdaf_offset": 17 + }, + { // Quality C, No proper color data, beta samples, frame set to official jpeg, "make_model": [ "XIAOYI M1", "YI TECHNOLOGY M1" ], "dcraw_matrix": [ 7158,-1911,-606,-3603,10669,2530,-659,1236,5530 ], // XIAO YI DNG D65 diff --git a/rtengine/color.cc b/rtengine/color.cc index 085fd41ce..4e139a868 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -2895,7 +2895,7 @@ void Color::SkinSat (float lum, float hue, float chrom, float &satreduc) * * data (Munsell ==> Lab) obtained with WallKillcolor and http://www.cis.rit.edu/research/mcsl2/online/munsell.php * each LUT give Hue in function of C, for each color Munsell and Luminance - * eg: _6PB20 : color Munsell 6PB for L=20 c=5 c=45 c=85 c=125..139 when possible: interpolation betwwen values + * eg: _6PB20 : color Munsell 6PB for L=20 c=5 c=45 c=85 c=125..139 when possible: interpolation between values * no value for C<5 (gray) * low memory footprint -- maximum: 195 LUTf * 140 values * errors due to small number of samples in LUT and linearization are very low (1 to 2%) diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index 756fdf906..1c98b3e8b 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -71,127 +71,127 @@ static const color_match_type cie_colour_match_jd2 = {//350nm to 830nm 5 nm J. static const color_match_type cie_colour_match_jd = {//350nm to 830nm 5 nm J.Desmis 10° Standard Observer. -{0.000000000000, 0.000000000000, 0.000000000000}, -{0.000000000000, 0.000000000000, 0.000000000000}, -{0.000000122200, 0.000000013398, 0.000000535027}, -{0.000000919270, 0.000000100650, 0.000004028300}, -{0.000005958600, 0.000000651100, 0.000026143700}, -{0.000033266000, 0.000003625000, 0.000146220000}, -{0.000159952000, 0.000017364000, 0.000704776000}, -{0.000662440000, 0.000071560000, 0.002927800000}, -{0.002361600000, 0.000253400000, 0.010482200000}, -{0.007242300000, 0.000768500000, 0.032344000000}, -{0.019109700000, 0.002004400000, 0.086010900000}, -{0.043400000000, 0.004509000000, 0.197120000000}, -{0.084736000000, 0.008756000000, 0.389366000000}, -{0.140638000000, 0.014456000000, 0.656760000000}, -{0.204492000000, 0.021391000000, 0.972542000000}, -{0.264737000000, 0.029497000000, 1.282500000000}, -{0.314679000000, 0.038676000000, 1.553480000000}, -{0.357719000000, 0.049602000000, 1.798500000000}, -{0.383734000000, 0.062077000000, 1.967280000000}, -{0.386726000000, 0.074704000000, 2.027300000000}, -{0.370702000000, 0.089456000000, 1.994800000000}, -{0.342957000000, 0.106256000000, 1.900700000000}, -{0.302273000000, 0.128201000000, 1.745370000000}, -{0.254085000000, 0.152761000000, 1.554900000000}, -{0.195618000000, 0.185190000000, 1.317560000000}, -{0.132349000000, 0.219940000000, 1.030200000000}, -{0.080507000000, 0.253589000000, 0.772125000000}, -{0.041072000000, 0.297665000000, 0.570060000000}, -{0.016172000000, 0.339133000000, 0.415254000000}, -{0.005132000000, 0.395379000000, 0.302356000000}, -{0.003816000000, 0.460777000000, 0.218502000000}, -{0.015444000000, 0.531360000000, 0.159249000000}, -{0.037465000000, 0.606741000000, 0.112044000000}, -{0.071358000000, 0.685660000000, 0.082248000000}, -{0.117749000000, 0.761757000000, 0.060709000000}, -{0.172953000000, 0.823330000000, 0.043050000000}, -{0.236491000000, 0.875211000000, 0.030451000000}, -{0.304213000000, 0.923810000000, 0.020584000000}, -{0.376772000000, 0.961988000000, 0.013676000000}, -{0.451584000000, 0.982200000000, 0.007918000000}, -{0.529826000000, 0.991761000000, 0.003988000000}, -{0.616053000000, 0.999110000000, 0.001091000000}, -{0.793832000000, 0.982380000000, 0.000000000000}, -{0.878655000000, 0.955552000000, 0.000000000000}, -{0.951162000000, 0.915175000000, 0.000000000000}, -{1.014160000000, 0.868934000000, 0.000000000000}, -{1.074300000000, 0.825623000000, 0.000000000000}, -{1.118520000000, 0.777405000000, 0.000000000000}, -{1.134300000000, 0.720353000000, 0.000000000000}, -{1.123990000000, 0.658341000000, 0.000000000000}, -{1.089100000000, 0.593878000000, 0.000000000000}, -{1.030480000000, 0.527963000000, 0.000000000000}, -{0.950740000000, 0.461834000000, 0.000000000000}, -{0.856297000000, 0.398057000000, 0.000000000000}, -{0.754930000000, 0.339554000000, 0.000000000000}, -{0.647467000000, 0.283493000000, 0.000000000000}, -{0.535110000000, 0.228254000000, 0.000000000000}, -{0.431567000000, 0.179828000000, 0.000000000000}, -{0.343690000000, 0.140211000000, 0.000000000000}, -{0.268329000000, 0.107633000000, 0.000000000000}, -{0.204300000000, 0.081187000000, 0.000000000000}, -{0.152568000000, 0.060281000000, 0.000000000000}, -{0.112210000000, 0.044096000000, 0.000000000000}, -{0.081260600000, 0.031800400000, 0.000000000000}, -{0.057930000000, 0.022601700000, 0.000000000000}, -{0.040850800000, 0.015905100000, 0.000000000000}, -{0.028623000000, 0.011130300000, 0.000000000000}, -{0.019941300000, 0.007748800000, 0.000000000000}, -{0.013842000000, 0.005375100000, 0.000000000000}, -{0.009576880000, 0.003717740000, 0.000000000000}, -{0.006605200000, 0.002564560000, 0.000000000000}, -{0.004552630000, 0.001768470000, 0.000000000000}, -{0.003144700000, 0.001222390000, 0.000000000000}, -{0.002174960000, 0.000846190000, 0.000000000000}, -{0.001505700000, 0.000586440000, 0.000000000000}, -{0.001044760000, 0.000407410000, 0.000000000000}, -{0.000727450000, 0.000284041000, 0.000000000000}, -{0.000508258000, 0.000198730000, 0.000000000000}, -{0.000356380000, 0.000139550000, 0.000000000000}, -{0.000250969000, 0.000098428000, 0.000000000000}, -{0.000177730000, 0.000069819000, 0.000000000000}, -{0.000126390000, 0.000049737000, 0.000000000000}, -{0.000090151000, 0.000035540500, 0.000000000000}, -{0.000064525800, 0.000025486000, 0.000000000000}, -{0.000046339000, 0.000018338400, 0.000000000000}, -{0.000033411700, 0.000013249000, 0.000000000000}, -{0.000024209000, 0.000009619600, 0.000000000000}, -{0.000017611500, 0.000007012800, 0.000000000000}, -{0.000012855000, 0.000005129800, 0.000000000000}, -{0.000009413630, 0.000003764730, 0.000000000000}, -{0.000006913000, 0.000002770810, 0.000000000000}, -{0.000005093470, 0.000002046130, 0.000000000000}, -{0.000003767100, 0.000001516770, 0.000000000000}, -{0.000002795310, 0.000001128090, 0.000000000000}, -{0.000002082000, 0.000000842160, 0.000000000000}, -{0.000001553140, 0.000000629700, 0.000000000000} + {0.000000000000, 0.000000000000, 0.000000000000}, + {0.000000000000, 0.000000000000, 0.000000000000}, + {0.000000122200, 0.000000013398, 0.000000535027}, + {0.000000919270, 0.000000100650, 0.000004028300}, + {0.000005958600, 0.000000651100, 0.000026143700}, + {0.000033266000, 0.000003625000, 0.000146220000}, + {0.000159952000, 0.000017364000, 0.000704776000}, + {0.000662440000, 0.000071560000, 0.002927800000}, + {0.002361600000, 0.000253400000, 0.010482200000}, + {0.007242300000, 0.000768500000, 0.032344000000}, + {0.019109700000, 0.002004400000, 0.086010900000}, + {0.043400000000, 0.004509000000, 0.197120000000}, + {0.084736000000, 0.008756000000, 0.389366000000}, + {0.140638000000, 0.014456000000, 0.656760000000}, + {0.204492000000, 0.021391000000, 0.972542000000}, + {0.264737000000, 0.029497000000, 1.282500000000}, + {0.314679000000, 0.038676000000, 1.553480000000}, + {0.357719000000, 0.049602000000, 1.798500000000}, + {0.383734000000, 0.062077000000, 1.967280000000}, + {0.386726000000, 0.074704000000, 2.027300000000}, + {0.370702000000, 0.089456000000, 1.994800000000}, + {0.342957000000, 0.106256000000, 1.900700000000}, + {0.302273000000, 0.128201000000, 1.745370000000}, + {0.254085000000, 0.152761000000, 1.554900000000}, + {0.195618000000, 0.185190000000, 1.317560000000}, + {0.132349000000, 0.219940000000, 1.030200000000}, + {0.080507000000, 0.253589000000, 0.772125000000}, + {0.041072000000, 0.297665000000, 0.570060000000}, + {0.016172000000, 0.339133000000, 0.415254000000}, + {0.005132000000, 0.395379000000, 0.302356000000}, + {0.003816000000, 0.460777000000, 0.218502000000}, + {0.015444000000, 0.531360000000, 0.159249000000}, + {0.037465000000, 0.606741000000, 0.112044000000}, + {0.071358000000, 0.685660000000, 0.082248000000}, + {0.117749000000, 0.761757000000, 0.060709000000}, + {0.172953000000, 0.823330000000, 0.043050000000}, + {0.236491000000, 0.875211000000, 0.030451000000}, + {0.304213000000, 0.923810000000, 0.020584000000}, + {0.376772000000, 0.961988000000, 0.013676000000}, + {0.451584000000, 0.982200000000, 0.007918000000}, + {0.529826000000, 0.991761000000, 0.003988000000}, + {0.616053000000, 0.999110000000, 0.001091000000}, + {0.793832000000, 0.982380000000, 0.000000000000}, + {0.878655000000, 0.955552000000, 0.000000000000}, + {0.951162000000, 0.915175000000, 0.000000000000}, + {1.014160000000, 0.868934000000, 0.000000000000}, + {1.074300000000, 0.825623000000, 0.000000000000}, + {1.118520000000, 0.777405000000, 0.000000000000}, + {1.134300000000, 0.720353000000, 0.000000000000}, + {1.123990000000, 0.658341000000, 0.000000000000}, + {1.089100000000, 0.593878000000, 0.000000000000}, + {1.030480000000, 0.527963000000, 0.000000000000}, + {0.950740000000, 0.461834000000, 0.000000000000}, + {0.856297000000, 0.398057000000, 0.000000000000}, + {0.754930000000, 0.339554000000, 0.000000000000}, + {0.647467000000, 0.283493000000, 0.000000000000}, + {0.535110000000, 0.228254000000, 0.000000000000}, + {0.431567000000, 0.179828000000, 0.000000000000}, + {0.343690000000, 0.140211000000, 0.000000000000}, + {0.268329000000, 0.107633000000, 0.000000000000}, + {0.204300000000, 0.081187000000, 0.000000000000}, + {0.152568000000, 0.060281000000, 0.000000000000}, + {0.112210000000, 0.044096000000, 0.000000000000}, + {0.081260600000, 0.031800400000, 0.000000000000}, + {0.057930000000, 0.022601700000, 0.000000000000}, + {0.040850800000, 0.015905100000, 0.000000000000}, + {0.028623000000, 0.011130300000, 0.000000000000}, + {0.019941300000, 0.007748800000, 0.000000000000}, + {0.013842000000, 0.005375100000, 0.000000000000}, + {0.009576880000, 0.003717740000, 0.000000000000}, + {0.006605200000, 0.002564560000, 0.000000000000}, + {0.004552630000, 0.001768470000, 0.000000000000}, + {0.003144700000, 0.001222390000, 0.000000000000}, + {0.002174960000, 0.000846190000, 0.000000000000}, + {0.001505700000, 0.000586440000, 0.000000000000}, + {0.001044760000, 0.000407410000, 0.000000000000}, + {0.000727450000, 0.000284041000, 0.000000000000}, + {0.000508258000, 0.000198730000, 0.000000000000}, + {0.000356380000, 0.000139550000, 0.000000000000}, + {0.000250969000, 0.000098428000, 0.000000000000}, + {0.000177730000, 0.000069819000, 0.000000000000}, + {0.000126390000, 0.000049737000, 0.000000000000}, + {0.000090151000, 0.000035540500, 0.000000000000}, + {0.000064525800, 0.000025486000, 0.000000000000}, + {0.000046339000, 0.000018338400, 0.000000000000}, + {0.000033411700, 0.000013249000, 0.000000000000}, + {0.000024209000, 0.000009619600, 0.000000000000}, + {0.000017611500, 0.000007012800, 0.000000000000}, + {0.000012855000, 0.000005129800, 0.000000000000}, + {0.000009413630, 0.000003764730, 0.000000000000}, + {0.000006913000, 0.000002770810, 0.000000000000}, + {0.000005093470, 0.000002046130, 0.000000000000}, + {0.000003767100, 0.000001516770, 0.000000000000}, + {0.000002795310, 0.000001128090, 0.000000000000}, + {0.000002082000, 0.000000842160, 0.000000000000}, + {0.000001553140, 0.000000629700, 0.000000000000} }; -ColorTemp::ColorTemp (double t, double g, double e, const std::string &m, StandardObserver o) : temp(t), green(g), equal(e), method(m), observer(o) +ColorTemp::ColorTemp(double t, double g, double e, const std::string &m, StandardObserver o) : temp(t), green(g), equal(e), method(m), observer(o) { - clip (temp, green, equal); + clip(temp, green, equal); } -void ColorTemp::clip (double &temp, double &green) +void ColorTemp::clip(double &temp, double &green) { temp = rtengine::LIM(temp, MINTEMP, MAXTEMP); green = rtengine::LIM(green, MINGREEN, MAXGREEN); } -void ColorTemp::clip (double &temp, double &green, double &equal) +void ColorTemp::clip(double &temp, double &green, double &equal) { temp = rtengine::LIM(temp, MINTEMP, MAXTEMP); green = rtengine::LIM(green, MINGREEN, MAXGREEN); equal = rtengine::LIM(equal, MINEQUAL, MAXEQUAL); } -ColorTemp::ColorTemp (double mulr, double mulg, double mulb, double e, StandardObserver observer) : equal(e), method("Custom"), observer(observer) +ColorTemp::ColorTemp(double mulr, double mulg, double mulb, double e, StandardObserver observer) : equal(e), method("Custom"), observer(observer) { - mul2temp (mulr, mulg, mulb, equal, observer, temp, green); + mul2temp(mulr, mulg, mulb, equal, observer, temp, green); } ColorTemp ColorTemp::convertObserver(StandardObserver observer) const @@ -199,6 +199,7 @@ ColorTemp ColorTemp::convertObserver(StandardObserver observer) const if (observer == this->observer) { return *this; } + double r; double g; double b; @@ -206,7 +207,7 @@ ColorTemp ColorTemp::convertObserver(StandardObserver observer) const return ColorTemp(r, g, b, equal, observer); } -void ColorTemp::mul2temp (const double rmul, const double gmul, const double bmul, const double equal, StandardObserver observer, double& temp, double& green) const +void ColorTemp::mul2temp(const double rmul, const double gmul, const double bmul, const double equal, StandardObserver observer, double& temp, double& green) const { double maxtemp = MAXTEMP, mintemp = MINTEMP; @@ -214,7 +215,7 @@ void ColorTemp::mul2temp (const double rmul, const double gmul, const double bmu temp = (maxtemp + mintemp) / 2; while (maxtemp - mintemp > 1) { - temp2mul (temp, 1.0, equal, observer, tmpr, tmpg, tmpb); + temp2mul(temp, 1.0, equal, observer, tmpr, tmpg, tmpb); if (tmpb / tmpr > bmul / rmul) { maxtemp = temp; @@ -226,7 +227,7 @@ void ColorTemp::mul2temp (const double rmul, const double gmul, const double bmu } green = (tmpg / tmpr) / (gmul / rmul); - clip (temp, green); + clip(temp, green); } @@ -441,41 +442,40 @@ const double ColorTemp::Flash6500_spect[97] = { 55.72, 51.97, 54.72, 57.46, 58.89, 60.33 }; -const std::map ColorTemp::spectMap = { - {"Daylight", Daylight5300_spect}, - {"Cloudy", Cloudy6200_spect}, - {"Shade", Shade7600_spect}, - {"Tungsten", A2856_spect}, - {"Fluo F1", FluoF1_spect}, - {"Fluo F2", FluoF2_spect}, - {"Fluo F3", FluoF3_spect}, - {"Fluo F4", FluoF4_spect}, - {"Fluo F5", FluoF5_spect}, - {"Fluo F6", FluoF6_spect}, - {"Fluo F7", FluoF7_spect}, - {"Fluo F8", FluoF8_spect}, - {"Fluo F9", FluoF9_spect}, - {"Fluo F10", FluoF10_spect}, - {"Fluo F11", FluoF11_spect}, - {"Fluo F12", FluoF12_spect}, - {"HMI Lamp", HMI_spect}, - {"GTI Lamp", GTI_spect}, - {"JudgeIII Lamp", JudgeIII_spect}, - {"Solux Lamp 3500K", Solux3500_spect}, - {"Solux Lamp 4100K", Solux4100_spect}, - {"Solux Lamp 4700K", Solux4700_spect}, - {"NG Solux Lamp 4700K", NG_Solux4700_spect}, - {"LED LSI Lumelex 2040", NG_LEDLSI2040_spect}, - {"LED CRS SP12 WWMR16", NG_CRSSP12WWMR16_spect}, - {"Flash 5500K", Flash5500_spect}, - {"Flash 6000K", Flash6000_spect}, - {"Flash 6500K", Flash6500_spect} - }; +const std::map ColorTemp::spectMap = { + {"Daylight", Daylight5300_spect}, + {"Cloudy", Cloudy6200_spect}, + {"Shade", Shade7600_spect}, + {"Tungsten", A2856_spect}, + {"Fluo F1", FluoF1_spect}, + {"Fluo F2", FluoF2_spect}, + {"Fluo F3", FluoF3_spect}, + {"Fluo F4", FluoF4_spect}, + {"Fluo F5", FluoF5_spect}, + {"Fluo F6", FluoF6_spect}, + {"Fluo F7", FluoF7_spect}, + {"Fluo F8", FluoF8_spect}, + {"Fluo F9", FluoF9_spect}, + {"Fluo F10", FluoF10_spect}, + {"Fluo F11", FluoF11_spect}, + {"Fluo F12", FluoF12_spect}, + {"HMI Lamp", HMI_spect}, + {"GTI Lamp", GTI_spect}, + {"JudgeIII Lamp", JudgeIII_spect}, + {"Solux Lamp 3500K", Solux3500_spect}, + {"Solux Lamp 4100K", Solux4100_spect}, + {"Solux Lamp 4700K", Solux4700_spect}, + {"NG Solux Lamp 4700K", NG_Solux4700_spect}, + {"LED LSI Lumelex 2040", NG_LEDLSI2040_spect}, + {"LED CRS SP12 WWMR16", NG_CRSSP12WWMR16_spect}, + {"Flash 5500K", Flash5500_spect}, + {"Flash 6000K", Flash6000_spect}, + {"Flash 6500K", Flash6500_spect} +}; // Data for Color ==> CRI (Color Rendering Index and Palette // actually 20 color that must be good enough for CRI -// I think 40 color for palette (Skin, Sky, gray) //spectral data Colorchecker24 : Red C3 const double ColorTemp::ColorchechredC3_spect[97] = { @@ -517,7 +517,7 @@ const double ColorTemp::ColorGreenM25_spect[97] = { 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, @@ -535,8 +535,7 @@ const double ColorTemp::ColorGreenalsi_spect[97] = { 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, @@ -546,7 +545,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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, @@ -567,8 +565,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -577,8 +573,6 @@ const double ColorTemp::ColorRedlupiini_spect[97] = { 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, @@ -587,8 +581,6 @@ const double ColorTemp::ColorRedhevosminttu_spect[97] = { 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, @@ -598,8 +590,6 @@ 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.0, 0.0, 0.0, 0.0, 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, @@ -608,8 +598,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -619,9 +607,6 @@ const double ColorTemp::ColorRedtalvio_spect[97] = { }; -//#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, @@ -631,8 +616,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -640,8 +623,7 @@ const double ColorTemp::ColorOrangetuntematon_spect[97] = { 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, @@ -650,8 +632,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -660,8 +640,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -670,9 +648,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -681,8 +656,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -691,8 +664,6 @@ 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.0, 0.0, 0.0, 0.0, 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, @@ -701,11 +672,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -714,8 +680,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -724,9 +688,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -735,9 +696,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -745,8 +703,7 @@ const double ColorTemp::ColorGreenlinnunkaali_spect[97] = { 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, @@ -755,8 +712,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -765,8 +720,6 @@ const double ColorTemp::ColorGreenrodvoikukka[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.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, @@ -775,8 +728,6 @@ const double ColorTemp::ColorGreenlehmus[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.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, @@ -785,9 +736,6 @@ const double ColorTemp::ColorGreenkoriste[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.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, @@ -796,9 +744,6 @@ const double ColorTemp::ColorGreenpoimulehti[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.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, @@ -807,8 +752,6 @@ const double ColorTemp::ColorGreenhopeapaju[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.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, @@ -817,9 +760,6 @@ const double ColorTemp::ColorReduuden[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.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, @@ -828,9 +768,6 @@ const double ColorTemp::ColorRedpajuan[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.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, @@ -839,9 +776,6 @@ const double ColorTemp::ColorRedjaloan[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.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, @@ -850,9 +784,6 @@ const double ColorTemp::ColorBlueukon[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.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, @@ -861,9 +792,6 @@ const double ColorTemp::ColorBlueorvokki[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.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, @@ -872,8 +800,6 @@ const double ColorTemp::ColorBluemalvikki[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.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, @@ -882,9 +808,6 @@ const double ColorTemp::ColorBlackmaito[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.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, @@ -893,9 +816,6 @@ const double ColorTemp::ColorOrangpihlaja[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.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, @@ -904,8 +824,6 @@ const double ColorTemp::ColorGreenlinden[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.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, @@ -914,8 +832,6 @@ const double ColorTemp::ColorYellowlehmus[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.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, @@ -924,8 +840,6 @@ const double ColorTemp::ColorYellowsuikeroalpi[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.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, @@ -934,8 +848,6 @@ const double ColorTemp::ColorYellowpensashanhikki1[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.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, @@ -944,8 +856,6 @@ const double ColorTemp::ColorYellowpensashanhikki2[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.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, @@ -954,9 +864,6 @@ const double ColorTemp::ColorBluehiidenvirna[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.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, @@ -965,8 +872,6 @@ const double ColorTemp::ColorBluekurkkuyrtti[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.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, @@ -975,10 +880,6 @@ const double ColorTemp::ColorPinksiankaersaemoe[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.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, @@ -987,8 +888,6 @@ const double ColorTemp::ColorVioletharakankello[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.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, @@ -997,8 +896,6 @@ const double ColorTemp::ColorVioletalsikeapila[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.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, @@ -1007,8 +904,6 @@ const double ColorTemp::ColorVioletakilleija[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.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, @@ -1017,8 +912,6 @@ 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.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, @@ -1026,9 +919,7 @@ const double ColorTemp::ColorRedpihlaja[97] = { 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, @@ -1037,8 +928,6 @@ const double ColorTemp::ColorVioletpetunia[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.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, @@ -1047,9 +936,6 @@ const double ColorTemp::ColorVioletorvokki[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.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, @@ -1058,8 +944,6 @@ const double ColorTemp::ColorBluesinisievikki[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.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, @@ -1067,8 +951,7 @@ const double ColorTemp::ColorBlueiisoppi[97] = { 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, @@ -1077,9 +960,6 @@ const double ColorTemp::ColorWhiteojaka[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.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, @@ -1089,10 +969,6 @@ const double ColorTemp::ColorWhitepetunia[97] = { }; - -//#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, @@ -1101,8 +977,6 @@ 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.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -1111,10 +985,6 @@ const double ColorTemp::ColorWhitepelargonia[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.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, @@ -1123,8 +993,6 @@ const double ColorTemp::ColorWhitepaeivaen[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.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] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0531, 0.0545, 0.0559, 0.0563, 0.0566, 0.0571, 0.0576, 0.0576, 0.0575, 0.0581, 0.0586, 0.0596, 0.0606, 0.0629, 0.0652, 0.0699, 0.0745, 0.0839, 0.0932, 0.1101, 0.1270, 0.1521, 0.1771, 0.2098, 0.2424, @@ -1133,7 +1001,6 @@ const double ColorTemp::ColorchechGreB3_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data Colorchecker24 : Cyan F3 const double ColorTemp::ColorchechCyaF3_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0813, 0.1048, 0.1282, 0.1611, 0.1940, 0.2198, 0.2456, 0.2575, 0.2693, 0.2807, 0.2921, 0.3079, 0.3237, 0.3424, 0.3611, 0.3820, 0.4029, 0.4234, 0.4439, 0.4547, 0.4654, 0.4638, 0.4621, 0.4482, 0.4342, 0.4119, 0.3895, @@ -1141,7 +1008,20 @@ const double ColorTemp::ColorchechCyaF3_spect[97] = { 0.0732, 0.0745, 0.0757, 0.0763, 0.0768, 0.0764, 0.0759, 0.0748, 0.0736, 0.0723, 0.0710, 0.0703, 0.0696, 0.0707, 0.0718, 0.0756, 0.0793, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 : Purple D2 +const double ColorTemp::ColorchechCyaF3_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0813, 0.1048, 0.1382, 0.1711, 0.1940, 0.2298, 0.2456, 0.2575, 0.2693, 0.2907, 0.3021, 0.3079, 0.3237, 0.3624, 0.3611, 0.3820, 0.4029, 0.4234, 0.4439, 0.4547, 0.4654, 0.4638, 0.4621, 0.4482, 0.4342, 0.4119, 0.3895, + 0.3656, 0.3417, 0.3160, 0.2903, 0.2654, 0.2404, 0.2167, 0.1929, 0.1720, 0.1510, 0.1368, 0.1226, 0.1138, 0.1049, 0.0993, 0.0936, 0.0890, 0.0844, 0.0810, 0.0776, 0.0759, 0.0742, 0.0733, 0.0724, 0.0723, 0.0722, 0.0727, + 0.0732, 0.0745, 0.0757, 0.0763, 0.0768, 0.0764, 0.0759, 0.0748, 0.0736, 0.0723, 0.0710, 0.0703, 0.0696, 0.0707, 0.0718, 0.0756, 0.0793, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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::ColorchechCyaF3_spect3[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0813, 0.1048, 0.1282, 0.1411, 0.1840, 0.2098, 0.2356, 0.2575, 0.2593, 0.2807, 0.2821, 0.3079, 0.3137, 0.3424, 0.3611, 0.3820, 0.4029, 0.4234, 0.4439, 0.4547, 0.4654, 0.4638, 0.4621, 0.4482, 0.4342, 0.4119, 0.3895, + 0.3656, 0.3417, 0.3160, 0.2903, 0.2654, 0.2404, 0.2167, 0.1929, 0.1720, 0.1510, 0.1368, 0.1226, 0.1138, 0.1049, 0.0993, 0.0936, 0.0890, 0.0844, 0.0810, 0.0776, 0.0759, 0.0742, 0.0733, 0.0724, 0.0723, 0.0722, 0.0727, + 0.0732, 0.0745, 0.0757, 0.0763, 0.0768, 0.0764, 0.0759, 0.0748, 0.0736, 0.0723, 0.0710, 0.0703, 0.0696, 0.0707, 0.0718, 0.0756, 0.0793, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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::ColorchechPurD2_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0854, 0.1047, 0.1240, 0.1468, 0.1696, 0.1826, 0.1955, 0.1963, 0.1970, 0.1910, 0.1849, 0.1750, 0.1651, 0.1541, 0.1430, 0.1322, 0.1213, 0.1117, 0.1020, 0.0944, 0.0868, 0.0809, 0.0750, 0.0703, 0.0655, @@ -1149,7 +1029,6 @@ const double ColorTemp::ColorchechPurD2_spect[97] = { 0.1117, 0.1222, 0.1327, 0.1469, 0.1610, 0.1796, 0.1981, 0.2173, 0.2365, 0.2532, 0.2698, 0.2826, 0.2953, 0.3022, 0.3090, 0.3126, 0.3161, 0.3238, 0.3314, 0.3504, 0.3694, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 : Magenta E3 const double ColorTemp::ColorchechMagE3_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1112, 0.1438, 0.1763, 0.2294, 0.2824, 0.3188, 0.3552, 0.3623, 0.3693, 0.3653, 0.3612, 0.3510, 0.3407, 0.3269, 0.3130, 0.2981, 0.2832, 0.2686, 0.2539, 0.2385, 0.2230, 0.2083, 0.1935, 0.1818, 0.1700, 0.1600, 0.1499, @@ -1157,8 +1036,6 @@ const double ColorTemp::ColorchechMagE3_spect[97] = { 0.7232, 0.7391, 0.7550, 0.7629, 0.7707, 0.7737, 0.7766, 0.7778, 0.7790, 0.7803, 0.7815, 0.7835, 0.7854, 0.7896, 0.7937, 0.8026, 0.8114, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 : Skin A1 -//use also for palette WB const double ColorTemp::ColorchechSkiA138_13_14_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0479, 0.051, 0.0553, 0.058, 0.0610, 0.062, 0.0626, 0.0622, 0.0619, 0.0617, 0.0616, 0.0615, 0.0614, 0.0614, 0.0615, 0.0617, 0.0618, 0.0618, 0.0619, 0.0618, 0.0618, 0.062, 0.0622, 0.063, 0.0638, 0.066, 0.0696, @@ -1166,14 +1043,13 @@ const double ColorTemp::ColorchechSkiA138_13_14_spect[97] = { 0.173, 0.1772, 0.181, 0.1842, 0.1846, 0.1853, 0.1831, 0.1811, 0.1788, 0.1765, 0.1769, 0.1773, 0.181, 0.1834, 0.1874, 0.1914, 0.1965, 0.2018, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 : Gray C4 L=67 -//use also for palette WB const double ColorTemp::ColorchechGraC4_67_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1074, 0.1380, 0.1704, 0.22, 0.2705, 0.305, 0.3409, 0.35, 0.3601, 0.3628, 0.3655, 0.3675, 0.3698, 0.371, 0.3724, 0.373, 0.3733, 0.3725, 0.3715, 0.3705, 0.3692, 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, @@ -1188,10 +1064,7 @@ const double ColorTemp::JDC468_K15_87greyspect[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.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 const double ColorTemp::ColorchechSkiB166_18_18_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0962, 0.114, 0.1328, 0.152, 0.1706, 0.1755, 0.1877, 0.189, 0.1903, 0.1913, 0.1923, 0.1946, 0.1971, 0.2015, 0.2064, 0.215, 0.2245, 0.239, 0.2535, 0.273, 0.2922, 0.31, 0.3274, 0.337, 0.3473, @@ -1200,8 +1073,6 @@ const double ColorTemp::ColorchechSkiB166_18_18_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data Colorchecker24 : blue sky C1 -//use also for palette WB const double ColorTemp::ColorchechBluC150_m5_m22_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1053, 0.134, 0.1633, 0.2075, 0.2518, 0.283, 0.3163, 0.324, 0.3325, 0.334, 0.3355, 0.3352, 0.3349, 0.332, 0.3294, 0.325, 0.3199, 0.3127, 0.3055, 0.2955, 0.2863, 0.28, 0.2737, 0.267, 0.2612, 0.249, 0.2378, 0.228, 0.2199, @@ -1209,8 +1080,6 @@ const double ColorTemp::ColorchechBluC150_m5_m22_spect[97] = { 0.1367, 0.1372, 0.1356, 0.1340, 0.1311, 0.1288, 0.1253, 0.1227, 0.1205, 0.1187, 0.1195, 0.1205, 0.1255, 0.1303, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 ColorcheckerDC : blue sky N8 -//use also for palette WB const double ColorTemp::ColorchechDCBluN881_m7_m14_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1371, 0.17, 0.2029, 0.291, 0.3790, 0.495, 0.6100, 0.67, 0.7249, 0.737, 0.7501, 0.7545, 0.7597, 0.764, 0.7677, 0.7685, 0.7693, 0.7677, 0.7662, 0.763, 0.7593, 0.753, 0.7471, 0.737, 0.7289, 0.718, 0.7077, 0.705, 0.6819, 0.666, 0.6515, 0.636, 0.6244, @@ -1218,16 +1087,12 @@ const double ColorTemp::ColorchechDCBluN881_m7_m14_spect[97] = { 0.5375, 0.531, 0.5244, 0.522, 0.5207, 0.524, 0.5264, 0.532, 0.5369, 0.542, 0.5505, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 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.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 }; -//spectral data ColorcheckerSG : Skin K2 85 11 17 -//use also for palette WB const double ColorTemp::ColorchechSGSkiK285_11_17_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1122, 0.149, 0.1866, 0.259, 0.3318, 0.393, 0.4547, 0.469, 0.4846, 0.4845, 0.4844, 0.4838, 0.4834, 0.4837, 0.4840, 0.4847, 0.4854, 0.4852, 0.4849, 0.4842, 0.4835, 0.4832, 0.4828, 0.485, @@ -1236,8 +1101,6 @@ const double ColorTemp::ColorchechSGSkiK285_11_17_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data Colorcheck24 : White A4 L=96 -//use also for palette WB const double ColorTemp::ColorchechWhiA496_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1267, 0.172, 0.2179, 0.317, 0.4164, 0.505, 0.6780, 0.758, 0.8397, 0.865, 0.8911, 0.897, 0.9035, 0.9062, 0.9092, 0.9124, 0.9154, 0.9167, 0.9180, 0.9187, 0.9194, 0.92, 0.9225, 0.9217, 0.9209, 0.921, @@ -1246,7 +1109,6 @@ const double ColorTemp::ColorchechWhiA496_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data Colorcheck24 : foliage Green D1 const double ColorTemp::ColorchechGreD1_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0477, 0.0492, 0.0507, 0.0517, 0.0527, 0.0532, 0.0537, 0.054, 0.0544, 0.0554, 0.0563, 0.0573, 0.0584, 0.0592, 0.0601, 0.0607, 0.0611, 0.0613, 0.0619, 0.626, 0.0634, 0.0646, 0.0659, 0.069, @@ -1255,8 +1117,6 @@ const double ColorTemp::ColorchechGreD1_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorchecSG : black N3 L=6 -//use also for palette WB const double ColorTemp::ColorchechSGBlaN3_6_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0066, 0.0069, 0.0071, 0.0072, 0.0074, 0.0073, 0.0072, 0.0073, 0.0074, 0.0074, 0.0074, 0.0074, 0.0074, 0.0073, 0.0073, 0.0073, 0.0073, 0.0072, 0.0072, 0.0072, 0.0072, 0.0071, 0.0071, 0.0071, @@ -1265,8 +1125,6 @@ const double ColorTemp::ColorchechSGBlaN3_6_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data 468 color : gray K14 L=44 -//use also for palette WB const double ColorTemp::JDC468_GraK14_44_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.04240, 0.0485, 0.05500, 0.0624, 0.06930, 0.084, 0.09820, 0.109, 0.12160, 0.127, 0.13300, 0.13490, 0.13690, 0.1379, 0.13890, 0.1396, 0.14060, 0.1407, 0.14080, 0.1423, 0.14380, 0.1488, 0.15370, 0.157, 0.16040, @@ -1282,10 +1140,6 @@ const double ColorTemp::JDC468_BluM5_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.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, @@ -1293,8 +1147,7 @@ const double ColorTemp::JDC468_RedG21va_spect[97] = { 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, @@ -1303,8 +1156,6 @@ const double ColorTemp::JDC468_RedI9_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.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, @@ -1313,8 +1164,6 @@ const double ColorTemp::JDC468_YelN10_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.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, @@ -1323,8 +1172,6 @@ const double ColorTemp::JDC468_GreN7_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.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, @@ -1341,7 +1188,6 @@ const double ColorTemp::JDC468_GreQ7_spect[97] = { //468 Q7 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -1350,8 +1196,6 @@ const double ColorTemp::JDC468_GreK7_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.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, @@ -1359,10 +1203,7 @@ const double ColorTemp::JDC468_PurE24_spect[97] = { 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.5005, 0.49950, 0.4785, 0.45810, 0.429, 0.39950, 0.374, 0.35010, 0.3135, 0.29630, @@ -1370,9 +1211,6 @@ const double ColorTemp::JDC468_BluH10_spect[97] = { 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, @@ -1380,52 +1218,39 @@ const double ColorTemp::JDC468_BluD6_spect[97] = { 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] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0211, 0.022, 0.0225, 0.0234, 0.0244, 0.0294, 0.0349, 0.038, 0.0411, 0.0425, 0.0441, 0.0455, 0.0472, 0.0473, 0.0475, 0.0463, 0.0452, 0.0435, 0.0417, 0.0397, 0.0377, @@ -1434,7 +1259,6 @@ const double ColorTemp::ColabSkin35_15_17_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 57 22 18 const double ColorTemp::ColabSkin57_22_18_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0647, 0.0677, 0.0709, 0.0754, 0.0797, 0.099, 0.1181, 0.1296, 0.1409, 0.1469, 0.1529, 0.1594, 0.1657, 0.1672, 0.1683, 0.1648, 0.1615, 0.1561, 0.1506, 0.144, 0.1375, 0.136, 0.1339, @@ -1443,7 +1267,6 @@ const double ColorTemp::ColabSkin57_22_18_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 40 17 17 const double ColorTemp::ColabSkin40_17_17_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0296, 0.0306, 0.0317, 0.0332, 0.0346, 0.042, 0.0498, 0.0543, 0.0588, 0.061, 0.0632, 0.0624, 0.0678, 0.068, 0.0682, 0.0663, 0.0649, 0.0625, 0.0598, 0.057, 0.0540, 0.0535, 0.0529, 0.057, @@ -1452,7 +1275,6 @@ const double ColorTemp::ColabSkin40_17_17_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 91 4 14 const double ColorTemp::ColabSkin91_4_14_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1430, 0.16, 0.1778, 0.202, 0.2303, 0.301, 0.3813, 0.4245, 0.4692, 0.499, 0.5287, 0.5635, 0.5977, 0.6175, 0.6372, 0.6394, 0.6418, 0.638, 0.6341, 0.6228, 0.6117, 0.6121, 0.6125, @@ -1461,7 +1283,6 @@ const double ColorTemp::ColabSkin91_4_14_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 87 8 8 const double ColorTemp::ColabSkin87_8_8_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1433, 0.161, 0.1780, 0.204, 0.2305, 0.306, 0.3828, 0.428, 0.4722, 0.502, 0.5317, 0.5645, 0.5997, 0.618, 0.6366, 0.6368, 0.6370, 0.631, 0.6251, 0.6120, 0.5994, 0.596, @@ -1470,7 +1291,6 @@ const double ColorTemp::ColabSkin87_8_8_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 89 8 21 const double ColorTemp::ColabSkin89_8_21_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1394, 0.152, 0.1659, 0.1855, 0.2052, 0.266, 0.3277, 0.363, 0.3988, 0.422, 0.4450, 0.472, 0.4984, 0.512, 0.5270, 0.5274, 0.5278, 0.522, 0.5177, 0.5065, 0.4960, 0.4975, @@ -1479,7 +1299,6 @@ const double ColorTemp::ColabSkin89_8_21_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 75 8 4 const double ColorTemp::ColabSkin75_8_4_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1030, 0.116, 0.1294, 0.1495, 0.1696, 0.227, 0.2847, 0.319, 0.3524, 0.375, 0.3977, 0.423, 0.4492, 0.462, 0.4770, 0.4768, 0.4767, 0.471, 0.4675, 0.458, 0.4480, 0.444, 0.4408, @@ -1488,7 +1307,6 @@ const double ColorTemp::ColabSkin75_8_4_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 75 10 33 const double ColorTemp::ColabSkin75_10_33_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0873, 0.091, 0.0967, 0.103, 0.1097, 0.135, 0.1617, 0.177, 0.1913, 0.198, 0.2086, 0.218, 0.2289, 0.234, 0.2383, 0.2375, 0.2370, 0.2335, 0.2299, 0.223, 0.2180, 0.222, @@ -1497,7 +1315,6 @@ const double ColorTemp::ColabSkin75_10_33_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 65 33 11 const double ColorTemp::ColabSkin65_33_11_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1067, 0.113, 0.1182, 0.126, 0.1346, 0.165, 0.2033, 0.224, 0.2448, 0.259, 0.2666, 0.277, 0.2891, 0.291, 0.2927, 0.285, 0.2783, 0.268, 0.2569, 0.244, 0.2323, 0.225, 0.2195, @@ -1506,7 +1323,6 @@ const double ColorTemp::ColabSkin65_33_11_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 65 7 24 const double ColorTemp::ColabSkin65_7_24_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0619, 0.066, 0.0710, 0.077, 0.0840, 0.106, 0.1288, 0.142, 0.1546, 0.163, 0.1706, 0.179, 0.1893, 0.194, 0.1989, 0.1988, 0.1987, 0.196, 0.1941, 0.189, 0.1853, 0.188, 0.1894, @@ -1515,7 +1331,6 @@ const double ColorTemp::ColabSkin65_7_24_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 57 19 6 const double ColorTemp::ColabSkin57_19_6_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0662, 0.071, 0.0773, 0.085, 0.0939, 0.115, 0.1491, 0.165, 0.1821, 0.192, 0.2019, 0.214, 0.2236, 0.228, 0.2321, 0.2298, 0.2266, 0.221, 0.2161, 0.208, 0.2019, 0.199, @@ -1524,7 +1339,6 @@ const double ColorTemp::ColabSkin57_19_6_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 57 4 19 const double ColorTemp::ColabSkin57_4_19_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0430, 0.047, 0.0505, 0.056, 0.0614, 0.077, 0.0963, 0.1063, 0.1164, 0.123, 0.1294, 0.137, 0.1448, 0.149, 0.1533, 0.154, 0.1544, 0.153, 0.1521, 0.149, 0.1463, 0.148, @@ -1533,7 +1347,6 @@ const double ColorTemp::ColabSkin57_4_19_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 57 10 28 const double ColorTemp::ColabSkin57_10_28_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0463, 0.048, 0.0505, 0.053, 0.0563, 0.069, 0.0816, 0.088, 0.0961, 0.102, 0.1041, 0.1085, 0.1135, 0.1155, 0.1174, 0.1168, 0.1161, 0.114, 0.1118, 0.1085, 0.1054, 0.1074, 0.1094, 0.124, @@ -1542,7 +1355,6 @@ const double ColorTemp::ColabSkin57_10_28_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 40 7 19 const double ColorTemp::ColabSkin40_7_19_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0215, 0.023, 0.0240, 0.026, 0.0275, 0.033, 0.0409, 0.044, 0.0487, 0.051, 0.0532, 0.056, 0.0585, 0.0595, 0.0608, 0.0605, 0.0602, 0.059, 0.0581, 0.057, 0.0549, 0.0555, 0.0562, @@ -1551,7 +1363,6 @@ const double ColorTemp::ColabSkin40_7_19_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 40 17 6 const double ColorTemp::ColabSkin40_17_6_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0314, 0.033, 0.0359, 0.039, 0.0427, 0.054, 0.0668, 0.074, 0.0812, 0.085, 0.0895, 0.094, 0.0985, 0.10, 0.1015, 0.0991, 0.0984, 0.096, 0.0930, 0.089, 0.0861, 0.085, 0.0828, @@ -1560,7 +1371,6 @@ const double ColorTemp::ColabSkin40_17_6_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 40 4 11 const double ColorTemp::ColabSkin40_4_11_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0209, 0.023, 0.0250, 0.028, 0.0310, 0.039, 0.0497, 0.056, 0.0605, 0.064, 0.0675, 0.072, 0.0758, 0.078, 0.0802, 0.0803, 0.0804, 0.0797, 0.0790, 0.078, 0.0758, 0.076, 0.0764, 0.082, @@ -1569,7 +1379,6 @@ const double ColorTemp::ColabSkin40_4_11_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 33 6 15 const double ColorTemp::ColabSkin33_6_15_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0143, 0.015, 0.0162, 0.0175, 0.0189, 0.023, 0.0286, 0.031, 0.0342, 0.036, 0.0376, 0.039, 0.0415, 0.0425, 0.0434, 0.0432, 0.0431, 0.0425, 0.0418, 0.041, 0.0396, 0.04, @@ -1578,7 +1387,6 @@ const double ColorTemp::ColabSkin33_6_15_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 33 15 5 const double ColorTemp::ColabSkin33_15_5_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0212, 0.023, 0.0243, 0.0265, 0.0289, 0.037, 0.0451, 0.051, 0.0549, 0.058, 0.0605, 0.063, 0.0666, 0.0675, 0.0686, 0.0672, 0.0664, 0.065, 0.0627, 0.0061, 0.0580, 0.0565, 0.0557, @@ -1586,7 +1394,7 @@ const double ColorTemp::ColabSkin33_15_5_spect[97] = { 0.0992, 0.1132, 0.1272, 0.1345, 0.1425, 0.1455, 0.1489, 0.1505, 0.1518, 0.1527, 0.1536, 0.1545, 0.1552, 0.1555, 0.1557, 0.1558, 0.1559, 0.1558, 0.1557, 0.1155, 0.1552, 0.1551, 0.1550, 0.1551, 0.1552, 0.1560, 0.1569, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 : Skin 33 10 15 + const double ColorTemp::ColabSkin33_10_15_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0166, 0.0175, 0.0183, 0.0194, 0.0207, 0.0260, 0.0306, 0.033, 0.0364, 0.0380, 0.0396, 0.0415, 0.0431, 0.0437, 0.0443, 0.0438, 0.0432, 0.0420, 0.0409, 0.0395, 0.0380, 0.0380, @@ -1595,7 +1403,6 @@ const double ColorTemp::ColabSkin33_10_15_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 24 5 6 const double ColorTemp::ColabSkin24_5_6_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0086, 0.0095, 0.0102, 0.0112, 0.0127, 0.0167, 0.0203, 0.0225, 0.0248, 0.0265, 0.0277, 0.0295, 0.0309, 0.0315, 0.0325, 0.0324, 0.0323, 0.0319, 0.0315, 0.0307, 0.0299, 0.0298, @@ -1604,7 +1411,6 @@ const double ColorTemp::ColabSkin24_5_6_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 26 18 18 const double ColorTemp::ColabSkin26_18_18_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0135, 0.0137, 0.0138, 0.0139, 0.0140, 0.0163, 0.0187, 0.0202, 0.0215, 0.0220, 0.0224, 0.0228, 0.0231, 0.0227, 0.0222, 0.0212, 0.0202, 0.0189, 0.0174, 0.0161, 0.0146, 0.0143, @@ -1613,7 +1419,6 @@ const double ColorTemp::ColabSkin26_18_18_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 24 7 5 const double ColorTemp::ColabSkin24_7_5_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0093, 0.0105, 0.0111, 0.0125, 0.0137, 0.0180, 0.0221, 0.0245, 0.0270, 0.0285, 0.0301, 0.0316, 0.0336, 0.0345, 0.0353, 0.0350, 0.0349, 0.0343, 0.0338, 0.0329, 0.0320, 0.0317, 0.0315, @@ -1622,7 +1427,6 @@ const double ColorTemp::ColabSkin24_7_5_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 24 4 2 const double ColorTemp::ColabSkin20_4_2_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0064, 0.0074, 0.0080, 0.00903, 0.0104, 0.0139, 0.0174, 0.0189, 0.0216, 0.0222, 0.0243, 0.0258, 0.0274, 0.0282, 0.0291, 0.0290, 0.0290, 0.0288, 0.0284, 0.0278, 0.0272, 0.0270, 0.0267, 0.0276, @@ -1631,7 +1435,6 @@ const double ColorTemp::ColabSkin20_4_2_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 98 -2 10 const double ColorTemp::ColabSkin98_m2_10_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1627, 0.1870, 0.2115, 0.2480, 0.2860, 0.3870, 0.4878, 0.5460, 0.6050, 0.6460, 0.6874, 0.7355, 0.7836, 0.8130, 0.8424, 0.8494, 0.8543, 0.8520, 0.8508, 0.8390, 0.8267, 0.8274, 0.8280, @@ -1640,7 +1443,6 @@ const double ColorTemp::ColabSkin98_m2_10_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 90 -1 20 const double ColorTemp::ColabSkin90_m1_20_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1228, 0.138, 0.1532, 0.175, 0.1987, 0.261, 0.3279, 0.365, 0.4022, 0.428, 0.4537, 0.4842, 0.5147, 0.5337, 0.5521, 0.557, 0.5611, 0.5602, 0.5593, 0.551, 0.5438, 0.548, @@ -1649,7 +1451,6 @@ const double ColorTemp::ColabSkin90_m1_20_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 95 0 4 const double ColorTemp::ColabSkin95_0_4_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1614, 0.1865, 0.2118, 0.2495, 0.2889, 0.392, 0.4969, 0.557, 0.6185, 0.6605, 0.7035, 0.749, 0.8018, 0.832, 0.8605, 0.865, 0.8696, 0.866, 0.8633, 0.849, 0.8365, 0.834, @@ -1658,7 +1459,6 @@ const double ColorTemp::ColabSkin95_0_4_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 81 2 14 const double ColorTemp::ColabSkin81_2_14_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1029, 0.116, 0.1285, 0.148, 0.1672, 0.222, 0.2774, 0.311, 0.3412, 0.362, 0.3849, 0.410, 0.4359, 0.451, 0.4659, 0.468, 0.4706, 0.4685, 0.4664, 0.4685, 0.4512, 0.4525, 0.4536, @@ -1667,7 +1467,6 @@ const double ColorTemp::ColabSkin81_2_14_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 87 3 10 const double ColorTemp::ColabSkin87_3_10_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1295, 0.146, 0.1639, 0.190, 0.2160, 0.291, 0.3626, 0.405, 0.4480, 0.476, 0.5066, 0.541, 0.5743, 0.593, 0.6136, 0.616, 0.6186, 0.614, 0.6119, 0.601, 0.5911, 0.5905, @@ -1676,7 +1475,6 @@ const double ColorTemp::ColabSkin87_3_10_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 77 12 21 const double ColorTemp::ColabSkin77_12_21_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1039, 0.111, 0.1205, 0.132, 0.1448, 0.185, 0.2261, 0.249, 0.2734, 0.287, 0.3028, 0.318, 0.3364, 0.345, 0.3525, 0.351, 0.3499, 0.345, 0.3397, 0.3295, 0.3224, 0.329, 0.3234, @@ -1685,7 +1483,6 @@ const double ColorTemp::ColabSkin77_12_21_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Skin 70 7 32 const double ColorTemp::ColabSkin70_7_32_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0695, 0.074, 0.0777, 0.084, 0.0890, 0.104, 0.1321, 0.144, 0.1565, 0.164, 0.1713, 0.1795, 0.1889, 0.194, 0.1978, 0.198, 0.1983, 0.196, 0.1939, 0.189, 0.1853, 0.189, @@ -1694,7 +1491,6 @@ const double ColorTemp::ColabSkin70_7_32_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Sky 60 0 -31 const double ColorTemp::ColabSky60_0_m31_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0752, 0.094, 0.1121, 0.141, 0.1699, 0.243, 0.3150, 0.357, 0.4015, 0.432, 0.4631, 0.497, 0.5325, 0.553, 0.5730, 0.574, 0.5758, 0.572, 0.5695, 0.559, 0.5503, 0.539, @@ -1703,7 +1499,6 @@ const double ColorTemp::ColabSky60_0_m31_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//spectral data ColorLab : Sky 42 0 -24 const double ColorTemp::ColabSky42_0_m24_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0336, 0.041, 0.0501, 0.063, 0.0761, 0.103, 0.1412, 0.151, 0.1799, 0.193, 0.2076, 0.223, 0.2387, 0.248, 0.2569, 0.2575, 0.2581, 0.256, 0.2553, 0.250, 0.2466, 0.2411, @@ -1711,7 +1506,6 @@ 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, @@ -1720,9 +1514,7 @@ const double ColorTemp::Colorblue_spect[97] = { 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, @@ -1731,7 +1523,6 @@ const double ColorTemp::ColorViolA1_spect[97] = { 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, @@ -1741,7 +1532,6 @@ const double ColorTemp::ColorViolA4_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.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, @@ -1750,7 +1540,6 @@ const double ColorTemp::ColorViolA6_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.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, @@ -1759,8 +1548,6 @@ const double ColorTemp::ColorBlueSkyK3_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.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, @@ -1769,7 +1556,6 @@ const double ColorTemp::ColorBlueSkyK9_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.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, @@ -1778,8 +1564,6 @@ const double ColorTemp::ColorBlueSkyC4_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.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, @@ -1788,8 +1572,6 @@ const double ColorTemp::ColorBlueSkyC14_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.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, @@ -1798,8 +1580,6 @@ const double ColorTemp::ColorBlueSkyE4_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.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, @@ -1808,8 +1588,6 @@ const double ColorTemp::ColorBlueSkyM1_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.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, @@ -1818,8 +1596,6 @@ const double ColorTemp::ColorBlueSky2B1_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.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, @@ -1828,9 +1604,6 @@ const double ColorTemp::ColorBlueSkyT7_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.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, @@ -1839,8 +1612,6 @@ const double ColorTemp::ColorBlueSkyU19_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.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, @@ -1849,9 +1620,6 @@ const double ColorTemp::ColorBlueSkyU2_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.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, @@ -1860,8 +1628,6 @@ const double ColorTemp::ColorBlueSkyT17_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.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, @@ -1870,8 +1636,6 @@ const double ColorTemp::ColorBlackM8_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.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, @@ -1880,8 +1644,6 @@ const double ColorTemp::ColorBlackM12_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.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, @@ -1890,7 +1652,6 @@ const double ColorTemp::ColorBlackM13_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.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, @@ -1899,8 +1660,6 @@ const double ColorTemp::ColorWhite2B12_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.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, @@ -1909,7 +1668,6 @@ const double ColorTemp::ColorWhite2B14_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.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, @@ -1918,7 +1676,6 @@ const double ColorTemp::JDC468_Blackred97_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.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, @@ -1927,8 +1684,6 @@ const double ColorTemp::JDC468_Blackredbl443_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.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, @@ -1937,7 +1692,6 @@ const double ColorTemp::JDC468_Blackbl27_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.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, @@ -1946,7 +1700,6 @@ const double ColorTemp::JDC468_Blackbl28_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.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, @@ -1955,9 +1708,6 @@ const double ColorTemp::JDC468_Blackgr214_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.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, @@ -1966,9 +1716,6 @@ const double ColorTemp::JDC468_Blackbl436_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.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, @@ -1977,8 +1724,6 @@ const double ColorTemp::JDC468_Whitebl455_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.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, @@ -1987,7 +1732,6 @@ const double ColorTemp::JDC468_Blackvio101_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.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, @@ -1996,7 +1740,6 @@ const double ColorTemp::JDC468_Whitebl92_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.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, @@ -2005,10 +1748,6 @@ const double ColorTemp::JDC468_Greyredbl94_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.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, @@ -2017,9 +1756,6 @@ const double ColorTemp::JDC468_Blue32_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.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, @@ -2028,8 +1764,6 @@ const double ColorTemp::JDC468_Blue236_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.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, @@ -2038,7 +1772,6 @@ const double ColorTemp::JDC468_Gre300_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.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, @@ -2048,8 +1781,6 @@ const double ColorTemp::JDC468_Blue340_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.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, @@ -2058,7 +1789,6 @@ const double ColorTemp::JDC468_Gree110_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.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, @@ -2067,7 +1797,6 @@ const double ColorTemp::JDC468_Gree457_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.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, @@ -2076,8 +1805,6 @@ const double ColorTemp::JDC468_Yel241_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.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, @@ -2085,7 +1812,7 @@ const double ColorTemp::JDC468_Ora321_spect[97] = { 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, @@ -2094,8 +1821,6 @@ const double ColorTemp::JDC468_Yellow353_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.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, @@ -2104,8 +1829,6 @@ const double ColorTemp::JDC468_Mag465_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.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, @@ -2114,8 +1837,6 @@ const double ColorTemp::JDC468_Mag333_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.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, @@ -2123,7 +1844,7 @@ const double ColorTemp::JDC468_Mag203_spect[97] = { 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, @@ -2322,7 +2043,6 @@ const double ColorTemp::J570_BlueU8_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.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, @@ -2331,6 +2051,16 @@ const double ColorTemp::J570_NeuN8_spect[97] = { 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_NeuN8_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0632, -0.04, -0.0244, 0.01, 0.0135, 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, @@ -2339,6 +2069,16 @@ const double ColorTemp::J570_NeuN9_spect[97] = { 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_NeuN9_spect2[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.0459, 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, @@ -2347,6 +2087,16 @@ const double ColorTemp::J570_NeuO8_spect[97] = { 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_NeuO8_spect2[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.1276, 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.1220, 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, @@ -2355,6 +2105,16 @@ const double ColorTemp::J570_NeuO11_spect[97] = { 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_NeuO11_spect2[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.1861, 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.1647, 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, @@ -2364,6 +2124,15 @@ const double ColorTemp::J570_NeuD5_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +const double ColorTemp::J570_NeuD5_spect2[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.2854, 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.2405, 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, @@ -2371,6 +2140,13 @@ const double ColorTemp::J570_NeuE11_spect[97] = { 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_NeuE11_spect2[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.3993, 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.3248, 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, @@ -2379,6 +2155,15 @@ const double ColorTemp::J570_NeuK16_spect[97] = { 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_NeuK16_spect2[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.6617, 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.5652, 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, @@ -2386,6 +2171,15 @@ const double ColorTemp::J570_NeuM3_spect[97] = { 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_NeuM3_spect2[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.452, 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.341, 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, @@ -2393,6 +2187,15 @@ const double ColorTemp::J570_NeuN18_spect[97] = { 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_NeuN18_spect2[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.2819, 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.2382, 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, @@ -2401,6 +2204,16 @@ const double ColorTemp::J570_NeuQ1_spect[97] = { 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_NeuQ1_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0610, 0.06, 0.0592, 0.04, 0.0359, 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.0595, 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.0340, 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, @@ -2409,6 +2222,17 @@ const double ColorTemp::J570_NeuS7_spect[97] = { 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_NeuS7_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1447, 0.06, 0.0448, 0.042, 0.0511, 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.0666, 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, @@ -2417,6 +2241,17 @@ const double ColorTemp::J570_NeuV10_spect[97] = { 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_NeuV10_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1439, 0.07, 0.0583, 0.04, 0.0392, 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.0495, 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.0328, 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, @@ -2424,6 +2259,15 @@ const double ColorTemp::J570_NeuW18_spect[97] = { 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_NeuW18_spect2[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.5998, 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.7584, 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, @@ -2433,6 +2277,15 @@ const double ColorTemp::J570_NeuZ14_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +const double ColorTemp::J570_NeuZ14_spect2[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.2022, 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.1605, 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, @@ -2441,6 +2294,16 @@ const double ColorTemp::J570_NeuC18_spect[97] = { 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_NeuC18_spect2[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.1398, 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.0880, 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, @@ -2449,6 +2312,17 @@ const double ColorTemp::J570_NeuD17_spect[97] = { 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_NeuD17_spect2[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.1240, 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.0439, 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, @@ -2457,6 +2331,16 @@ const double ColorTemp::J570_NeuJ11_spect[97] = { 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_NeuJ11_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1274, 0.1, 0.0916, 0.08, 0.0756, 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.1413, 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, @@ -2466,6 +2350,15 @@ const double ColorTemp::J570_NeuL4_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +const double ColorTemp::J570_NeuL4_spect2[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.2452, 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.0826, 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, @@ -2482,6 +2375,34 @@ const double ColorTemp::Colorlab_10_n70_spect[97] = { 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_10_n70_spect2[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.65, 0.5530, 0.55, 0.4212, 0.3, 0.2974, 0.25, 0.1839, 0.12, 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.34, 0.3353, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_spect3[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.65, 0.5530, 0.55, 0.4212, 0.3, 0.2974, 0.25, 0.1839, 0.12, 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.22, 0.2556, 0.27, 0.2816, 0.29, 0.2925, 0.33, 0.3033, 0.33, 0.3175, 0.32, 0.3257, 0.325, 0.3246, 0.32, + 0.3187, 0.32, 0.3082, 0.305, 0.3014, 0.304, 0.3059, 0.36, 0.3353, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_spect4[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0964, 0.1, 0.1534, 0.2, 0.2437, 0.34, 0.4663, 0.55, 0.6005, 0.65, 0.6958, 0.75, 0.8010, 0.83, 0.8598, 0.858, 0.8579, 0.86, 0.8432, 0.82, 0.8102, 0.79, + 0.7607, 0.7, 0.6760, 0.6, 0.5530, 0.5, 0.4212, 0.3, 0.2974, 0.20, 0.1839, 0.12, 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.22, 0.2556, 0.27, 0.2816, 0.29, 0.2925, 0.33, 0.3033, 0.33, 0.3175, 0.32, 0.3257, 0.325, 0.3246, 0.32, + 0.3187, 0.32, 0.3082, 0.305, 0.3014, 0.304, 0.3059, 0.36, 0.3353, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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, @@ -2522,11 +2443,8 @@ const double ColorTemp::Colorlab_n80_26_spect[97] = { -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 }; -/* -//0,1767000 0,2207000 0,3142000 0,5269000 0,7018000 0,7605000 0,7580000 0,7366000 0,7182000 0,6929000 0,6661000 0,6542000 -//0,6420000 0,6085000 0,5752000 0,5728000 0,5723000 0,5318000 0,4982000 0,5226000 0,5670000 0,5929000 0,5977000 0,5975000 -//0,6002000 0,6065000 0,6177000 0,6352000 0,6526000 0,6623000 0,6633000 0,6593000 0,6517000 0,6479000 0,6607000 0,6908000 +/* const double ColorTemp::JDC468_greyc14_66_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1767, 0.19, 0.2207, 0.25, 0.3142, 0.40, 0.5269, 0.63, 0.7018, 0.73, 0.7605, 0.76, 0.7580, 0.74, 0.7366, 0.725, 0.7182, 0.705, 0.6929, 0.68, 0.6661, 0.66, 0.6542, 0.65, @@ -2534,9 +2452,6 @@ const double ColorTemp::JDC468_greyc14_66_spect[97] = { 0.6002, 0.602, 0.6065, 0.61, 0.6177, 0.62, 0.6352, 0.64, 0.6526, 0.66, 0.6623, 0.662, 0.6633, 0.66, 0.6593, 0.653, 0.6517, 0.65, 0.6479, 0.65, 0.6607, 0.69, 0.6908, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//0,1325000 0,1637000 0,2222000 0,3492000 0,4523000 0,4897000 0,4918000 0,4840000 0,4761000 0,4638000 0,4538000 0,4582000 -// 0,4588000 0,4360000 0,4091000 0,4101000 0,4128000 0,3785000 0,3494000 0,3720000 0,4122000 0,4339000 0,4362000 0,4355000 -// 0,4395000 0,4475000 0,4606000 0,4807000 0,5006000 0,5125000 0,5145000 0,5112000 0,5029000 0,4992000 0,5150000 0,5526000 const double ColorTemp::JDC468_greym13_325_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, @@ -2546,10 +2461,6 @@ const double ColorTemp::JDC468_greym13_325_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -//0,0823000 0,1036000 0,1337000 0,1966000 0,2468000 0,2679000 0,2728000 0,2726000 0,2724000 0,2698000 0,2705000 0,2810000 -// 0,2879000 0,2756000 0,2586000 0,2601000 0,2617000 0,2357000 0,2124000 0,2241000 0,2471000 0,2581000 0,2569000 0,2548000 -// 0,2579000 0,2653000 0,2765000 0,2941000 0,3126000 0,3230000 0,3238000 0,3189000 0,3091000 0,3043000 0,3200000 0,3579000 - const double ColorTemp::JDC468_greyf26_156_spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0823, 0.1, 0.1036, 0.11, 0.1337, 0.16, 0.1966, 0.22, 0.2468, 0.255, 0.2679, 0.27, 0.2728, 0.273, 0.2726, 0.273, 0.2724, 0.271, 0.2698, 0.27, 0.2705, 0.275, 0.2810, 0.285, @@ -2558,10 +2469,6 @@ const double ColorTemp::JDC468_greyf26_156_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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; */ -//A1 0.0912 0.1228 0.1712 0.2978 0.3713 0.4241 0.4861 0.5255 0.5355 0.5363 0.5237 0.5251 -// 0.5722 0.6554 0.6936 0.6675 0.6203 0.5651 0.5116 0.4825 0.4714 0.4866 0.5320 0.5729 -// 0.5968 0.6069 0.6131 0.6198 0.6285 0.6325 0.6316 0.6282 0.6227 0.6196 0.6215 0.6337 - const double ColorTemp::Colorlab_n80_5_9_5_9spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0912, 0.1, 0.1228, 0.15, 0.1712, 0.2, 0.2978, 0.32, 0.3713, 0.41, 0.4241, 0.44, 0.4861, 0.51, 0.5255, 0.53, 0.5355, 0.534, 0.5363, 0.53, 0.5237, 0.524, 0.5251, 0.56, @@ -2570,10 +2477,6 @@ const double ColorTemp::Colorlab_n80_5_9_5_9spect[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.0, 0.0, 0.0, 0.0, 0.0 }; /* -//A2 0.0385 0.0514 0.0711 0.1229 0.1528 0.1744 0.1999 0.2163 0.2209 0.2216 0.2167 0.2185 -//0.2414 0.2813 0.3012 0.2922 0.2734 0.2511 0.2292 0.2173 0.2127 0.2183 0.2354 0.2508 -//0.2599 0.2637 0.2662 0.2689 0.2725 0.2742 0.2738 0.2724 0.2701 0.2689 0.2697 0.2747 - const double ColorTemp::Colorlab_n57_5_6_9spect[97] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0385, 0.04, 0.0514, 0.06, 0.0711, 0.1, 0.1229, 0.14, 0.1528, 0.16, 0.1744, 0.18, 0.1999, 0.2, 0.2163, 0.22, 0.2209, 0.221, 0.2216, 0.22, 0.2167, 0.216, 0.2185, 0.23, @@ -2582,6 +2485,1720 @@ const double ColorTemp::Colorlab_n57_5_6_9spect[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.0, 0.0, 0.0, 0.0, 0.0 }; */ +const double ColorTemp::Colorlab_L61_110_110Rec2020spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2118, 0.2100, 0.1920, 0.1800, 0.1574, 0.1575, 0.1578, 0.1600, 0.1631, 0.1500, 0.1392, 0.1200, 0.1018, 0.650, 0.0430, 0.1000, -0.0212, 0.0543, -0.0929, -0.1111, -0.1519, -0.1600, -0.1876, -0.1923, -0.1950, -0.1850, -0.1775, -0.1600, -0.1448, -0.1000, -0.0914, -0.0100, -0.0271, 0.0120, 0.0300, 0.0550, 0.0732, 0.0900, 0.1017, 0.1234, 0.1425,//41 + 0.1468, 0.3619, 0.5434, 0.8773, 1.1111, 1.3269, 1.4355, 1.5694, 1.6100, 1.6707, 1.7100, 1.7137, 1.7235, 1.7332, 1.7410, 1.7420, 1.7420, 1.7422, 1.7450, 1.7475, 1.7510, 1.7519, 1.7550, 1.7584, 1.7610, 1.7627, 1.7600, 1.7601, 1.7620, 1.7630,//30 + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L63_120_m56Rec2020spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3223, 0.3500, 0.3687, 0.4000, 0.4394, 0.5100, 0.7018, 0.7500, 0.8667, 0.9000, 0.9539, 1.000, 1.0370, 1.040, 1.0410, 0.9800, 0.9653, 0.9200, 0.8675, 0.8100, 0.7631, 0.7100, + 0.6533, 0.5500, 0.5024, 0.4000, 0.3065, 0.2100, 0.1347, 0.1000, 0.0257, 0.0100, -0.0474, -0.0600, -0.1188, -0.1500, -0.1851, -0.2000, -0.2188, -0.2000, -0.1941, -0.0100, + 0.0977, 0.5000, 0.8071, 1.100, 1.4292, 1.5500, 1.7653, 1.8500, 1.9058, 1.9300, 1.9644, 1.9800, 1.9977, 2.010, 2.0234, 2.0300, 2.0337, 2.0250, 2.0381, 2.0360, 2.0358, 2.3010, 2.0302, 2.0280, 2.0265, 2.0227, 2.0292, 2.0290, 2.0547, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L63_m50_m60Rec2020spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0605, 0.1000, 0.1336, 0.2000, 0.2496, 0.4500, 0.5113, 0.6000, 0.6662, 0.7500, 0.7853, 0.9000, 0.9221, 0.9650, 1.0126, 1.0200, 1.0357, 1.0400, 1.0454, 1.0300, 1.0283, 1.0000, + 0.9940, 0.9500, 0.9371, 0.8800, 0.8515, 0.7900, 0.7337, 0.6500, 0.5897, 0.5300, 0.4428, 0.3200, 0.2986, 0.2100, 0.1731, 0.1300, 0.1012, 0.0800, 0.0678, 0.0500, 0.0461, 0.0300, 0.0176, 0.0100, + -0.0042, -0.0100, -0.0143, -0.0150, -0.0183, -0.0190, -0.0194, -0.0150, -0.0127, -0.0100, 0.0014, 0.0050, 0.0108, 0.0090, 0.0076, 0.0001, -0.0007, -0.0050, -0.0150, -0.0200, -0.0240, -0.0200, -0.0182, 0.0010, 0.0042, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L63_m120_80Rec2020spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0708, -0.0700, -0.0651, -0.0600, -0.0562, -0.0600, 0.0685, -0.0700, -0.0813, -0.0750, -0.0762, -0.0700, -0.0617, -0.0400, -0.0305, 0.0100, 0.0120, 0.0300, 0.0568, 0.0800, 0.0933, 0.1000, 0.1433, 0.2000, 0.2482, 0.31000, 0.4019, 0.4500, 0.5081, 0.5200, 0.5339, 0.5300, 0.5266, 0.5200, 0.5121, 0.5000, 0.4971, 0.4900, + 0.4877, 0.4700, 0.4672, 0.4000, 0.3479, 0.2000, 0.0648, -0.0100, -0.1825, -0.0250, -0.3147, -0.3500, -0.3697, -0.3800, -0.3911, -0.4000, -0.4007, -0.4020, -0.4050, + -0.4050, -0.4063, -0.4080, -0.4090, -0.4100, -0.4109, -0.4120, -0.4130, -0.4135, -0.4140, -0.4138, -0.4135, -0.4140, -0.4149, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L42_110_m100Prospect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2174, 0.2500, 0.2847, 0.3300, 0.3905, 0.5500, 0.6912, 0.7500, 0.8768, 0.9100, 0.9938, 1.0500, 1.1155, 1.1300, 1.1613, 1.1300, 1.1194, 1.0800, 1.0576, 1.0100, 0.9793, 0.9200, + 0.8769, 0.7700, 0.7035, 0.6000, 0.4573, 0.3400, 0.2303, 0.1100, 0.0648, 0.0100, -0.0656, -0.1100, -0.1884, -0.2300, -0.2951, -0.3200, -0.3541, -0.3542, -0.3546, -0.2300, + -0.1748, 0.1000, 0.2751, 0.4100, 0.6713, 0.7500, 0.8857, 0.9200, 0.9753, 1.000, 1.0120, 1.0200, 1.0363, 1.0400, 1.0595, 1.0600, 1.0712, 1.0720, 1.0726, 1.0700, 1.0669, 1.0600, 1.0558, 1.0500, 1.0484, 1.0501, 1.0534, 1.0700, 1.0805, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L42_m70_m100Prospect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0736, 0.1000, 0.1529, 0.2200, 0.2791, 0.4200, 0.5702, 0.6600, 0.7447, 0.8200, 0.8749, 0.9500, 1.0210, 1.0600, 1.1109, 1.1200, 1.1222, 1.1200, 1.1187, 1.0900, 1.0887, 1.0500, 1.0294, 0.9500, 0.9114, 0.8600, 0.7320, 0.6600, 0.5414, + 0.4500, 0.3630, 0.2500, 0.1980, 0.1100, 0.0409, 0.0100, -0.0935, -0.01200, -0.1707, -0.1900, -0.2017, -0.2000, -0.1920, -0.1700, -0.1434, -0.1200, -0.0975, -0.0800, -0.0714, + -0.7000, -0.0605, -0.0600, -0.0562, -0.0500, -0.0466, -0.0350, -0.0302, -0.0200, -0.0194, -0.0200, -0.0220, -0.0250, -0.0308, -0.0350, -0.0460, -0.0500, -0.0559, -0.0500, -0.0495, -0.0300, -0.0248, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L56_m120_90Prospect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0592, -0.0560, -0.0555, -0.0550, -0.0497, -0.0600, -0.0630, -0.0700, -0.0753, -0.0740, -0.0727, -0.0700, -0.0627, -0.0500, -0.0387, -0.0040, -0.0049, 0.0100, 0.0311, 0.0500, + 0.0607, 0.0800, 0.1009, 0.1500, 0.1840, 0.2500, 0.3055, 0.3400, 0.3899, 0.4000, 0.4115, 0.40800, 0.4069, 0.4000, 0.3968, 0.3900, 0.3862, 0.3800, 0.3795, 0.3700, 0.3633, 0.3200, 0.2672, 0.1300, 0.0388, + 0.0100, -0.1609, -0.2000, -0.2676, -0.3000, -0.3121, -0.3200, -0.3294, -0.3300, -0.3373, -0.3400, -0.3410, -0.3420, -0.3421, -0.3430, -0.3443, -0.3450, -0.3456, -0.3460, -0.3472, -0.3475, -0.3479, -0.3476, -0.3476, -0.3480, -0.3490, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L25_60_m120Prospect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1084, 0.1500, 0.1725, 0.2200, 0.2744, 0.4000, 0.5281, 0.6000, 0.6825, 0.7500, 0.7901, 0.8500, 0.9069, 0.9300, 0.9679, 0.9600, 0.9574, 0.9400, 0.9326, 0.9100, 0.8890, 0.8500, 0.8185, 0.7500, + 0.6837, 0.5400, 0.4837, 0.3500, 0.2905, 0.2000, 0.1352, 0.1000, 0.0028, -0.050, -0.1213, -0.2000, -0.2273, -0.2500, -0.2875, -0.2950, -0.3033, -0.2600, -0.2338, -0.1000, -0.0476, 0.0500, + 0.1181, 0.1500, 0.2081, 0.2200, 0.2458, 0.2550, 0.2608, 0.2650, 0.2741, 0.2800, 0.2906, 0.2950, 0.3003, 0.3000, 0.2994, 0.2950, 0.2930, 0.2850, 0.2813, 0.2800, 0.2735, 0.2750, 0.2786, 0.2900, 0.3006, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L75_50_120Prospect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1451, 0.1350, 0.1304, 0.1200, 0.1040, 0.1000, 0.0943, 0.0900, 0.0894, 0.8500, 0.0702, 0.0500, 0.0450, 0.0200, 0.0120, 0.0000, -0.0180, -0.0200, -0.0531, -0.0600, -0.0820, -0.0800, -0.0803, -0.0400, -0.0149, 0.0200, 0.1067, 0.1500, + 0.2101, 0.2500, 0.2775, 0.3000, 0.3323, 0.3500, 0.3756, 0.3900, 0.4057, 0.4100, 0.4259, 0.4300, 0.4494, 0.5000, 0.5688, 0.7500, 0.8473, 0.9500, 1.0899, 1.1500, 1.2215, 1.2500, + 1.2766, 1.2900, 1.3014, 1.305, 1.3127, 1.3150, 1.3176, 1.3170, 1.3169, 1.3180, 1.3199, 1.3200, 1.3227, 1.3250, 1.3272, 1.3300, 1.3306, 1.3300, 1.3285, 1.3295, 1.3301, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L75_m120_0Prospect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0548, -0.0200, -0.0126, 0.0100, 0.0544, 0.1100, 0.1678, 0.1900, 0.2289, 0.2500, 0.2929, 0.3300, 0.3761, 0.4100, 0.4556, 0.4800, 0.5149, 0.5400, 0.5703, 0.5900, 0.6035, 0.6300, 0.6419, 0.6800, 0.7270, 0.8000, 0.8497, 0.8700, + 0.9053, 0.8800, 0.8613, 0.8200, 0.7798, 0.7300, 0.6924, 0.6600, 0.6138, 0.5900, 0.5679, 0.5500, 0.5282, 0.4500, 0.3813, 0.2000, 0.0440, 0.0100, -0.2491, -0.3000, -0.4050, -0.4300, -0.4699, -0.4800, -0.4951, -0.5000, + -0.5029, -0.5020, -0.5010, -0.5000, -0.4978, -0.5000, -0.5025, -0.5050, -0.5087, -0.5100, -0.5181, -0.5200, -0.5237, -0.5220, -0.5203, -0.5200, -0.5111, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L22_2_1_3Prospect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0074, 0.008, 0.0095, 0.01, 0.0127, 0.02, 0.0215, 0.025, 0.0267, 0.03, 0.0302, 0.033, 0.0343, 0.035, 0.0366, 0.036, 0.0367, 0.037, 0.0362, 0.035, 0.0349, 0.035, 0.0344, 0.036, 0.0367, 0.040, 0.0411, 0.042, 0.0428, 0.041, + 0.0409, 0.038, 0.0379, 0.035, 0.0343, 0.032, 0.0309, 0.030, 0.0290, 0.029, 0.0286, 0.03, 0.0312, 0.035, 0.0381, 0.040, 0.0443, 0.045, 0.0477, 0.048, 0.0491, 0.0490, 0.0498, 0.050, + 0.0504, 0.051, 0.0511, 0.0512, 0.0514, 0.0514, 0.0514, 0.0512, 0.0511, 0.0510, 0.0508, 0.0507, 0.0506, 0.0506, 0.0507, 0.0510, 0.0516, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L44_2_8_3_9spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0277, 0.030, 0.0351, 0.040, 0.0464, 0.060, 0.0782, 0.085, 0.0969, 0.010, 0.1096, 0.11, 0.1240, 0.130, 0.1321, 0.132, 0.1325, 0.131, 0.1305, 0.130, 0.1255, 0.125, + 0.1240, 0.130, 0.1328, 0.140, 0.1497, 0.150, 0.1569, 0.153, 0.1505, 0.140, 0.1399, 0.130, 0.1274, 0.120, 0.1152, 0.110, 0.1086, 0.108, 0.1070, 0.117, 0.1172, 0.130, + 0.1438, 0.150, 0.1672, 0.170, 0.1803, 0.181, 0.1858, 0.186, 0.1885, 0.190, 0.1907, 0.192, 0.1932, 0.194, 0.1942, 0.1942, 0.1941, 0.193, 0.1934, 0.193, 0.1922, 0.192, 0.1915, 0.191, 0.1919, 0.194, 0.1950, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L44_2_8_3_9spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0277, 0.030, 0.0351, 0.040, 0.0564, 0.060, 0.0782, 0.085, 0.0969, 0.010, 0.1096, 0.11, 0.1240, 0.130, 0.1321, 0.132, 0.1325, 0.131, 0.1305, 0.130, 0.1255, 0.125, + 0.1240, 0.130, 0.1328, 0.140, 0.1597, 0.150, 0.1569, 0.153, 0.1505, 0.140, 0.1399, 0.130, 0.1274, 0.120, 0.1152, 0.110, 0.1086, 0.108, 0.1070, 0.117, 0.1172, 0.130, + 0.1438, 0.150, 0.1672, 0.170, 0.1903, 0.181, 0.1858, 0.186, 0.1885, 0.190, 0.1907, 0.192, 0.1932, 0.194, 0.1942, 0.1942, 0.1941, 0.193, 0.1934, 0.193, 0.1922, 0.192, 0.1915, 0.191, 0.1919, 0.194, 0.1950, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L95_2_3_15_6spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1546, 0.18, 0.1934, 0.22, 0.2519, 0.35, 0.4184, 0.45, 0.5150, 0.55, 0.5811, 0.625, 0.6582, 0.689, 0.7035, 0.71, 0.7106, 0.705, 0.7042, 0.70, 0.6812, 0.682, 0.6845, 0.715, + 0.7647, 0.82, 0.9074, 0.95, 0.9847, 0.97, 0.9662, 0.94, 0.9160, 0.888, 0.8522, 0.81, 0.7878, 0.77, 0.7534, 0.75, 0.7438, 0.76, 0.900, 0.905, 0.9109, 0.95, 1.0180, 1.03, + 1.0784, 1.1, 1.1039, 1.11, 1.1176, 1.12, 1.1290, 1.13, 1.1417, 1.145, 1.1469, 1.146, 1.1463, 1.143, 1.1425, 1.30, 1.1360, 1.20, 1.1327, 1.133, 1.1348, 1.14, 1.1514, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L95_2_3_15_6spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1546, 0.18, 0.1934, 0.22, 0.2519, 0.35, 0.4284, 0.45, 0.5150, 0.55, 0.5811, 0.625, 0.6582, 0.689, 0.7035, 0.71, 0.7106, 0.705, 0.7042, 0.70, 0.6812, 0.682, 0.6845, 0.715, + 0.7647, 0.82, 0.9074, 0.95, 0.9847, 0.97, 0.9362, 0.91, 0.9160, 0.888, 0.8522, 0.81, 0.7878, 0.77, 0.7534, 0.75, 0.7438, 0.76, 0.900, 0.905, 0.9109, 0.95, 1.0180, 1.03, + 1.0784, 1.1, 1.1039, 1.11, 1.1176, 1.12, 1.1090, 1.13, 1.1417, 1.145, 1.1469, 1.146, 1.1463, 1.143, 1.1425, 1.30, 1.1360, 1.20, 1.1327, 1.133, 1.1348, 1.14, 1.1514, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_3_5_10_7spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0207, 0.022, 0.0249, 0.03, 0.0312, 0.04, 0.0503, 0.055, 0.0614, 0.065, 0.0687, 0.077, 0.0772, 0.08, 0.0819, 0.082, 0.0823, 0.085, 0.0810, 0.08, 0.0778, 0.078, 0.0784, 0.08, + 0.0893, 0.1, 0.1088, 0.11, 0.1202, 0.12, 0.1195, 0.115, 0.1147, 0.11, 0.1082, 0.105, 0.1012, 0.1, 0.0976, 0.97, 0.0969, 0.1, 0.1043, 0.11, 0.1231, 0.13, 0.1397, 0.145, + 0.1490, 0.15, 0.1529, 0.153, 0.1549, 0.155, 0.1564, 0.157, 0.1580, 0.1585, 0.1586, 0.1585, 0.1585, 0.1584, 0.1582, 0.158, 0.1575, 0.1573, 0.1572, 0.1573, 0.1574, 0.158, 0.1593, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_3_5_10_7spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0207, 0.022, 0.0249, 0.03, 0.0312, 0.04, 0.0603, 0.055, 0.0614, 0.065, 0.0687, 0.077, 0.0772, 0.08, 0.0819, 0.082, 0.0823, 0.085, 0.0810, 0.08, 0.0778, 0.078, 0.0784, 0.08, + 0.0893, 0.1, 0.1088, 0.11, 0.1202, 0.12, 0.1295, 0.115, 0.1147, 0.11, 0.1082, 0.105, 0.1012, 0.1, 0.0976, 0.97, 0.0969, 0.1, 0.1043, 0.11, 0.1231, 0.13, 0.1397, 0.145, + 0.1490, 0.15, 0.1529, 0.153, 0.1549, 0.155, 0.1664, 0.157, 0.1580, 0.1585, 0.1586, 0.1585, 0.1585, 0.1584, 0.1582, 0.158, 0.1575, 0.1573, 0.1572, 0.1573, 0.1574, 0.158, 0.1593, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_3_5_10_7spect3[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0207, 0.022, 0.0249, 0.03, 0.0212, 0.04, 0.0503, 0.055, 0.0614, 0.065, 0.0687, 0.077, 0.0772, 0.08, 0.0819, 0.082, 0.0823, 0.085, 0.0810, 0.08, 0.0778, 0.078, 0.0784, 0.08, + 0.0893, 0.1, 0.1088, 0.11, 0.1102, 0.12, 0.1195, 0.115, 0.1147, 0.11, 0.1082, 0.105, 0.1012, 0.1, 0.0976, 0.97, 0.0969, 0.1, 0.1043, 0.11, 0.1231, 0.13, 0.1397, 0.145, + 0.1490, 0.15, 0.1529, 0.153, 0.1449, 0.155, 0.1564, 0.157, 0.1580, 0.1585, 0.1486, 0.1585, 0.1585, 0.1584, 0.1582, 0.158, 0.1575, 0.1573, 0.1572, 0.1573, 0.1574, 0.158, 0.1593, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L34_1_8_1_9spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0154, 0.018, 0.0199, 0.021, 0.0267, 0.03, 0.0454, 0.05, 0.0564, 0.06, 0.0639, 0.07, 0.0726, 0.075, 0.0776, 0.078, 0.0781, 0.078, 0.0771, 0.075, 0.0744, 0.074, 0.0737, 0.075, + 0.0788, 0.08, 0.0886, 0.09, 0.0926, 0.09, 0.0886, 0.085, 0.0821, 0.08, 0.0745, 0.07, 0.0672, 0.065, 0.0632, 0.063, 0.0621, 0.066, 0.0672, 0.08, 0.0807, 0.09, 0.0927, 0.095, + 0.0995, 0.1, 0.1023, 0.102, 0.1037, 0.104, 0.1049, 0.105, 0.1063, 0.1065, 0.1069, 0.1069, 0.1069, 0.1065, 0.1064, 0.106, 0.1057, 0.1055, 0.1053, 0.1054, 0.1055, 0.107, 0.1073, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L34_1_8_1_9spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0154, 0.018, 0.0199, 0.021, 0.0297, 0.03, 0.0454, 0.05, 0.0564, 0.06, 0.0639, 0.07, 0.0726, 0.075, 0.0776, 0.078, 0.0781, 0.078, 0.0771, 0.075, 0.0744, 0.074, 0.0737, 0.075, + 0.0788, 0.08, 0.0886, 0.09, 0.0826, 0.09, 0.0886, 0.085, 0.0821, 0.08, 0.0745, 0.07, 0.0672, 0.065, 0.0632, 0.063, 0.0621, 0.066, 0.0672, 0.08, 0.0807, 0.09, 0.0927, 0.095, + 0.0995, 0.1, 0.1023, 0.102, 0.1137, 0.104, 0.1049, 0.105, 0.1063, 0.1065, 0.1069, 0.1069, 0.1069, 0.1065, 0.1064, 0.106, 0.1057, 0.1055, 0.1053, 0.1054, 0.1055, 0.107, 0.1073, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L64_1_8_m1_9spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0652, 0.08, 0.0864, 0.1, 0.1189, 0.15, 0.2063, 0.22, 0.2577, 0.28, 0.2935, 0.31, 0.3344, 0.34, 0.3582, 0.36, 0.3608, 0.36, 0.3569, 0.35, 0.3449, 0.34, 0.3395, 0.34, + 0.3558, 0.37, 0.3884, 0.39, 0.3971, 0.38, 0.3738, 0.35, 0.3408, 0.32, 0.3038, 0.28, 0.2686, 0.25, 0.2493, 0.245, 0.2435, 0.26, 0.2645, 0.3, 0.3207, 0.33, 0.3706, 0.38, + 0.398, 0.4, 0.4103, 0.415, 0.4163, 0.42, 0.4216, 0.425, 0.4278, 0.43, 0.4307, 0.4305, 0.4304, 0.43, 0.4282, 0.425, 0.4246, 0.424, 0.4225, 0.425, 0.4238, 0.43, 0.4321, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L84_0_8_m1spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1232, 0.15, 0.1635, 0.2, 0.2255, 0.3, 0.3913, 0.4, 0.4886, 0.5, 0.5567, 0.6, 0.6349, 0.65, 0.6810, 0.682, 0.6871, 0.685, 0.6811, 0.67, 0.6591, 0.655, 0.6507, 0.67, 0.6864, 0.70, 0.7553, 0.76, 0.7770, 0.75, + 0.7343, 0.7, 0.6719, 0.65, 0.6014, 0.55, 0.5340, 0.5, 0.4973, 0.49, 0.4858, 0.5, 0.5227, 0.55, 0.6222, 0.65, 0.7108, 0.75, 0.7606, 0.77, 0.7817, 0.79, 0.7925, 0.8, + 0.8023, 0.81, 0.8141, 0.815, 0.8196, 0.818, 0.8188, 0.817, 0.8147, 0.81, 0.8077, 0.805, 0.8037, 0.804, 0.8063, 0.81, 0.8221, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L63_1_3_m2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0646, 0.07, 0.0858, 0.1, 0.1184, 0.15, 0.2058, 0.22, 0.2571, 0.27, 0.2929, 0.31, 0.3340, 0.34, 0.3580, 0.36, 0.3608, 0.355, 0.3572, 0.35, 0.3454, 0.345, 0.3402, 0.35, + 0.3568, 0.37, 0.3896, 0.39, 0.3985, 0.38, 0.3752, 0.36, 0.3420, 0.32, 0.3049, 0.29, 0.2695, 0.255, 0.2501, 0.245, 0.2442, 0.25, 0.2644, 0.3, 0.3188, 0.35, 0.3671, 0.38, + 0.3942, 0.4, 0.4056, 0.41, 0.4115, 0.415, 0.4167, 0.42, 0.4229, 0.425, 0.4258, 0.4255, 0.4254, 0.424, 0.4232, 0.42, 0.4196, 0.417, 0.4174, 0.418, 0.4188, 0.42, 0.4271, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L44_2_3_m3spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0287, 0.03, 0.0380, 0.04, 0.0523, 0.08, 0.0910, 0.1, 0.1137, 0.12, 0.1295, 0.13, 0.1475, 0.15, 0.1578, 0.158, 0.1586, 0.157, 0.1566, 0.155, 0.1510, 0.15, 0.1481, 0.15, + 0.1538, 0.16, 0.1657, 0.167, 0.1678, 0.16, 0.1569, 0.15, 0.1421, 0.13, 0.1258, 0.12, 0.1103, 0.11, 0.1018, 0.1, 0.0994, 0.1, 0.1093, 0.12, 0.1356, 0.14, 0.1590, 0.16, + 0.1720, 0.173, 0.1775, 0.18, 0.1802, 0.181, 0.1826, 0.184, 0.1854, 0.186, 0.1867, 0.1865, 0.1865, 0.186, 0.1856, 0.185, 0.1840, 0.184, 0.1830, 0.1835, 0.1836, 0.186, 0.1873, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L65_96_45spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2103, 0.2, 0.1996, 0.19, 0.1795, 0.19, 0.2091, 0.22, 0.2312, 0.23, 0.2217, 0.22, 0.2014, 0.18, 0.1560, 0.1, 0.0981, 0.05, 0.0316, 0.0, -0.0261, -0.05, -0.0622, -0.07, + -0.0700, -0.06, -0.0540, -0.04, -0.0294, -0.01, 0.0079, 0.03, 0.0536, 0.08, 0.0922, 0.1, 0.1193, 0.12, 0.1385, 0.16, 0.1735, 0.25, 0.3791, 0.5, 0.8646, 1.0, 1.2884, 1.35, + 1.5172, 1.6, 1.6128, 1.63, 1.6537, 1.66, 1.6730, 1.68, 1.682, 1.684, 1.6842, 1.685, 1.6888, 1.69, 1.6921, 1.695, 1.6967, 1.698, 1.6998, 1.699, 1.6979, 1.70, 1.7033, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L52_47_57spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0746, 0.7, 0.0693, 0.06, 0.0597, 0.06, 0.0637, 0.065, 0.0670, 0.063, 0.0611, 0.055, 0.0521, 0.04, 0.0367, 0.03, 0.0198, 0.0, -0.0001, -0.01, -0.0171, -0.02, -0.0218, -0.022, + -0.0029, 0.0, 0.0366, 0.05, 0.0710, 0.08, 0.0956, 0.1, 0.1172, 0.12, 0.1343, 0.14, 0.1459, 0.15, 0.1539, 0.16, 0.1656, 0.20, 0.2305, 0.3, 0.3828, 0.45, 0.5156, 0.55, + 0.5875, 0.6, 0.6176, 0.62, 0.6309, 0.632, 0.6371, 0.64, 0.6401, 0.6401, 0.6402, 0.6415, 0.6417, 0.642, 0.6430, 0.644, 0.6448, 0.645, 0.6462, 0.646, 0.6454, 0.646, 0.6469, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L31_62_27spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0456, 0.045, 0.0430, 0.04, 0.0383, 0.04, 0.0441, 0.045, 0.0486, 0.047, 0.0462, 0.045, 0.0413, 0.04, 0.0310, 0.02, 0.0180, 0.01, 0.0031, 0.0, -0.0096, -0.01, -0.0179, -0.02, + -0.0211, -0.02, -0.0198, -0.019, -0.0159, -0.01, -0.0081, 0.0, 0.0021, 0.02, 0.0109, 0.0105, 0.0172, 0.02, 0.0216, 0.025, 0.0294, 0.05, 0.0749, 0.1, 0.1824, 0.2, 0.2761, 0.3, + 0.3267, 0.33, 0.3479, 0.35, 0.3569, 0.36, 0.3611, 0.362, 0.3632, 0.363, 0.3635, 0.364, 0.3645, 0.365, 0.3653, 0.366, 0.3663, 0.367, 0.3670, 0.367, 0.3666, 0.367, 0.3677, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L79_m9_m28spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1188, 0.15, 0.1814, 0.2, 0.2793, 0.4, 0.5204, 0.6, 0.6631, 0.7, 0.7669, 0.8, 0.8855, 0.9, 0.9584, 0.96, 0.9703, 0.97, 0.9673, 0.96, 0.9410, 0.94, 0.9144, 0.91, 0.9020, 0.9, + 0.8941, 0.86, 0.8425, 0.8, 0.7410, 0.7, 0.6276, 0.6, 0.5106, 0.45, 0.4049, 0.35, 0.3456, 0.33, 0.3233, 0.33, 0.3475, 0.4, 0.4243, 0.45, 0.4941, 0.5, 0.5339, 0.54, 0.5507, 0.555, + 0.5593, 0.56, 0.5700, 0.575, 0.5852, 0.59, 0.5936, 0.592, 0.5918, 0.59, 0.5850, 0.58, 0.5735, 0.57, 0.5665, 0.57, 0.5710, 0.58, 0.5928, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L58_50_31spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1011, 0.11, 0.1006, 0.1, 0.0980, 0.11, 0.1257, 0.13, 0.1434, 0.145, 0.1459, 0.145, 0.1455, 0.14, 0.1325, 0.12, 0.1113, 0.1, 0.0852, 0.07, 0.0607, 0.05, 0.0494, 0.06, + 0.0625, 0.08, 0.0961, 0.1, 0.1233, 0.13, 0.1401, 0.15, 0.1549, 0.16, 0.1647, 0.165, 0.1692, 0.17, 0.1736, 0.18, 0.1864, 0.22, 0.2711, 0.35, 0.4721, 0.55, 0.6477, 0.7, 0.7428, 0.76, 0.7826, 0.79, + 0.8000, 0.804, 0.8088, 0.81, 0.8140, 0.815, 0.8150, 0.816, 0.8167, 0.817, 0.8176, 0.818, 0.8188, 0.819, 0.8198, 0.8195, 0.8192, 0.82, 0.8231, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L31_m52_27spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0093, -0.008, -0.0073, -0.005, -0.0042, -0.003, -0.0021, -0.002, -0.0018, 0.0, 0.0008, 0.004, 0.0053, 0.01, 0.0117, 0.015, 0.0191, 0.02, 0.0265, 0.03, 0.0321, 0.035, 0.0402, 0.05, 0.0582, 0.07, 0.0849, 0.1, + 0.1027, 0.103, 0.1056, 0.104, 0.1027, 0.1, 0.0984, 0.095, 0.0941, 0.093, 0.0915, 0.09, 0.0877, 0.08, 0.0684, 0.05, 0.0228, 0.0, -0.0170, -0.02, -0.0383, -0.04, -0.0471, -0.05, + -0.0505, -0.051, -0.0519, -0.052, -0.0523, -0.0523, -0.0524, -0.0528, -0.0529, -0.053, -0.0533, -0.0538, -0.0538, -0.54, -0.0541, -0.054, -0.0540, -0.054, -0.0538, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L44_2_2_m7_35spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0303, 0.04, 0.0412, 0.05, 0.0579, 0.08, 0.1021, 0.11, 0.1283, 0.135, 0.1465, 0.16, 0.1672, 0.17, 0.1790, 0.179, 0.1798, 0.178, 0.1775, 0.173, 0.1712, 0.17, 0.1668, 0.168, 0.1695, 0.18, 0.1769, 0.175, 0.1746, 0.17, 0.1600, 0.15, + 0.1422, 0.13, 0.1229, 0.11, 0.1049, 0.1, 0.0950, 0.093, 0.0921, 0.1, 0.1027, 0.12, 0.1314, 0.14, 0.1569, 0.16, 0.1711, 0.175, 0.1771, 0.18, 0.1800, 0.181, 0.1826, 0.184, 0.1857, 0.187, 0.1872, 0.1871, + 0.1871, 0.186, 0.1860, 0.185, 0.1841, 0.184, 0.1830, 0.183, 0.1837, 0.186, 0.1878, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L47_m10_8_0_41spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0213, 0.03, 0.0316, 0.04, 0.0475, 0.06, 0.0864, 0.09, 0.1088, 0.11, 0.1258, 0.13, 0.1458, 0.15, 0.1595, 0.16, 0.1641, 0.165, 0.1662, 0.164, 0.1639, 0.164, 0.1647, 0.17, 0.1775, 0.18, 0.1995, 0.2, 0.2080, 0.2, 0.1975, 0.19, 0.1809, 0.17, + 0.1621, 0.15, 0.1445, 0.14, 0.1347, 0.131, 0.1302, 0.13, 0.1289, 0.129, 0.1288, 0.129, 0.1291, 0.1295, 0.1298, 0.13, 0.1301, 0.1305, 0.1308, 0.131, 0.1323, 0.133, 0.1347, 0.135, + 0.1360, 0.136, 0.1355, 0.135, 0.1344, 0.133, 0.1325, 0.132, 0.1314, 0.132, 0.1321, 0.134, 0.1357, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L32_4_8_m3_2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0163, 0.02, 0.0211, 0.025, 0.0285, 0.03, 0.0490, 0.05, 0.0611, 0.065, 0.0694, 0.07, 0.0786, 0.08, 0.0837, 0.083, 0.0835, 0.082, 0.0819, 0.08, 0.0785, 0.077, 0.0764, 0.077, 0.0784, 0.08, 0.0833, 0.083, 0.0835, 0.08, 0.0776, 0.075, + 0.0701, 0.065, 0.0617, 0.06, 0.0538, 0.05, 0.0494, 0.045, 0.0484, 0.05, 0.0552, 0.06, 0.0729, 0.08, 0.0885, 0.09, 0.0972, 0.1, 0.1008, 0.102, 0.1026, 0.0103, 0.1039, 0.0104, + 0.1055, 0.0106, 0.1062, 0.0161, 0.1061, 0.0106, 0.1056, 0.0105, 0.1048, 0.0104, 0.1044, 0.01045, 0.1047, 0.0105, 0.1066, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L57_m6_9_2_9spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0379, 0.04, 0.0525, 0.06, 0.0750, 0.1, 0.1325, 0.14, 0.1658, 0.18, 0.1901, 0.2, 0.2187, 0.22, 0.2373, 0.24, 0.2425, 0.243, 0.2437, 0.24, 0.2387, 0.236, 0.2394, 0.24, 0.2594, 0.28, 0.2945, 0.3, 0.3096, 0.3, + 0.2963, 0.28, 0.2737, 0.26, 0.2478, 0.23, 0.2230, 0.21, 0.2093, 0.205, 0.2038, 0.206, 0.2078, 0.21, 0.2218, 0.225, 0.2346, 0.24, 0.2423, 0.244, 0.2456, 0.246, 0.2478, 0.25, + 0.2505, 0.252, 0.2543, 0.255, 0.2562, 0.257, 0.2557, 0.255, 0.2541, 0.253, 0.2515, 0.252, 0.2500, 0.25, 0.2509, 0.252, 0.2564, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L33_2_4_m4_5spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0167, 0.02, 0.0223, 0.03, 0.0310, 0.04, 0.054, 0.06, 0.0679, 0.07, 0.0774, 0.08, 0.0881, 0.09, 0.0943, 0.095, 0.0946, 0.094, 0.0933, 0.09, 0.0899, 0.088, 0.0877, 0.088, + 0.0898, 0.09, 0.0949, 0.095, 0.0947, 0.09, 0.0875, 0.08, 0.0785, 0.07, 0.0685, 0.06, 0.0592, 0.055, 0.0541, 0.053, 0.0527, 0.055, 0.0587, 0.06, 0.0748, 0.08, 0.0891, 0.09, + 0.0971, 0.1, 0.1005, 0.102, 0.1021, 0.103, 0.1035, 0.104, 0.1052, 0.1055, 0.1060, 0.106, 0.1059, 0.106, 0.1053, 0.105, 0.1043, 0.104, 0.1038, 0.104, 0.1041, 0.105, 0.1063, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L35_11_65_m1_1spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0226, 0.025, 0.0276, 0.03, 0.0351, 0.04, 0.0579, 0.06, 0.0715, 0.075, 0.0802, 0.085, 0.0897, 0.09, 0.0940, 0.093, 0.0925, 0.09, 0.0891, 0.085, 0.0841, 0.082, 0.0810, 0.082, + 0.0830, 0.085, 0.0888, 0.089, 0.0897, 0.085, 0.0842, 0.08, 0.0772, 0.07, 0.0691, 0.065, 0.0612, 0.055, 0.0570, 0.057, 0.0568, 0.06, 0.0691, 0.08, 0.0998, 0.1, 0.1269, 0.13, + 0.1417, 0.145, 0.1479, 0.15, 0.1508, 0.151, 0.1527, 0.153, 0.1546, 0.155, 0.1554, 0.1554, 0.1555, 0.155, 0.1550, 0.155, 0.1543, 0.153, 0.1538, 0.154, 0.1541, 0.155, 0.1564, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L52_m2_7_8_9spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0316, 0.04, 0.0411, 0.05, 0.0556, 0.08, 0.0946, 0.1, 0.1172, 0.12, 0.1332, 0.14, 0.1521, 0.16, 0.1640, 0.165, 0.1670, 0.167, 0.1670, 0.165, 0.1628, 0.164, 0.1643, 0.17, 0.1829, 0.2, 0.2154, 0.22, 0.2324, 0.23, + 0.2267, 0.22, 0.2135, 0.2, 0.1973, 0.19, 0.1812, 0.18, 0.1725, 0.17, 0.1694, 0.17, 0.1756, 0.18, 0.1930, 0.2, 0.2085, 0.21, 0.2175, 0.22, 0.2213, 0.222, 0.2236, 0.224, 0.2259, 0.227, + 0.2287, 0.229, 0.2299, 0.2298, 0.2296, 0.229, 0.2286, 0.227, 0.2270, 0.227, 0.2261, 0.2265, 0.2267, 0.23, 0.2305, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L32_7_m2_5spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0170, 0.02, 0.0216, 0.025, 0.0285, 0.04, 0.0483, 0.05, 0.0600, 0.065, 0.0678, 0.07, 0.0765, 0.08, 0.0809, 0.0802, 0.0804, 0.079, 0.0783, 0.075, 0.0747, 0.074, 0.0724, 0.073, 0.0742, 0.077, 0.0789, 0.079, 0.0792, 0.075, + 0.0738, 0.07, 0.0670, 0.06, 0.0593, 0.055, 0.0519, 0.05, 0.0479, 0.0476, 0.0472, 0.05, 0.0552, 0.06, 0.0756, 0.09, 0.0937, 0.1, 0.1036, 0.104, 0.1078, 0.108, 0.1097, 0.11, + 0.1112, 0.112, 0.1127, 0.113, 0.1134, 0.1134, 0.1134, 0.113, 0.1130, 0.113, 0.1122, 0.112, 0.1118, 0.112, 0.1121, 0.113, 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 +}; + +const double ColorTemp::Colorlab_L32_3_4_m3_8spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0156, 0.02, 0.0205, 0.025, 0.0281, 0.03, 0.0488, 0.06, 0.0611, 0.065, 0.0694, 0.07, 0.0789, 0.08, 0.0842, 0.0843, 0.0843, 0.084, 0.0830, 0.08, 0.0798, 0.078, 0.0777, 0.078, 0.0797, 0.08, + 0.0844, 0.0844, 0.0843, 0.08, 0.0781, 0.075, 0.0702, 0.065, 0.0615, 0.06, 0.0534, 0.05, 0.0489, 0.048, 0.0477, 0.05, 0.0538, 0.06, 0.0697, 0.07, 0.0838, 0.09, 0.0916, 0.093, + 0.0949, 0.095, 0.0965, 0.097, 0.0978, 0.098, 0.0993, 0.1, 0.1000, 0.1, 0.0999, 0.0996, 0.0994, 0.099, 0.0986, 0.0985, 0.0981, 0.0985, 0.0984, 0.1, 0.1004, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L50_m5_3_6_5spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0275, 0.03, 0.0370, 0.04, 0.0515, 0.06, 0.0893, 0.1, 0.1111, 0.12, 0.1269, 0.13, 0.1456, 0.15, 0.1578, 0.16, 0.1614, 0.162, 0.1622, 0.16, 0.1589, 0.16, 0.1604, 0.17, 0.1776, 0.19, 0.2074, 0.21, + 0.2223, 0.22, 0.2158, 0.21, 0.2020, 0.19, 0.1855, 0.18, 0.1695, 0.165, 0.1607, 0.16, 0.1572, 0.16, 0.1605, 0.17, 0.1711, 0.18, 0.1807, 0.185, 0.1864, 0.188, 0.1889, 0.19, + 0.1906, 0.191, 0.1925, 0.194, 0.1951, 0.196, 0.1963, 0.196, 0.1960, 0.195, 0.1949, 0.194, 0.1933, 0.193, 0.1923, 0.1925, 0.1929, 0.195, 0.1966, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L44_3_96_m8_8spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0320, 0.04, 0.0431, 0.05, 0.0604, 0.09, 0.1063, 0.12, 0.1336, 0.14, 0.1524, 0.16, 0.1737, 0.18, 0.1856, 0.186, 0.1860, 0.185, 0.1831, 0.18, 0.1761, 0.175, 0.1709, 0.172, 0.1721, 0.175, 0.1773, 0.175, + 0.1732, 0.16, 0.1576, 0.15, 0.1391, 0.13, 0.1192, 0.11, 0.1007, 0.1, 0.0905, 0.09, 0.0877, 0.1, 0.1001, 0.12, 0.1329, 0.15, 0.1620, 0.17, 0.1782, 0.1850, 0.188, 0.1882, 0.19, + 0.1910, 0.193, 0.1942, 0.195, 0.1958, 0.1956, 0.195, 0.195, 0.1945, 0.193, 0.1926, 0.192, 0.1915, 0.192, 0.1922, 0.195, 0.1965, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L34_3_6_m5_4spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0184, 0.02, 0.0245, 0.03, 0.0339, 0.04, 0.0591, 0.06, 0.0741, 0.08, 0.0844, 0.09, 0.0960, 0.1, 0.1025, 0.105, 0.1026, 0.101, 0.1009, 0.1, 0.0970, 0.095, 0.0944, 0.095, + 0.0959, 0.1, 0.1004, 0.1, 0.0993, 0.095, 0.0913, 0.09, 0.0815, 0.08, 0.0707, 0.065, 0.0607, 0.06, 0.0552, 0.055, 0.0537, 0.06, 0.0609, 0.07, 0.0799, 0.08, 0.0968, 0.1, 0.1061, 0.11, 0.1101, 0.111, 0.1119, 0.112, 0.1135, 0.114, + 0.1153, 0.116, 0.1162, 0.1161, 0.1161, 0.116, 0.1155, 0.115, 0.1145, 0.114, 0.1139, 0.114, 0.1143, 0.115, 0.1166, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L31_5_9_m4spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0166, 0.02, 0.0214, 0.025, 0.0288, 0.04, 0.0495, 0.05, 0.0618, 0.065, 0.0700, 0.07, 0.0793, 0.08, 0.0842, 0.084, 0.0839, 0.083, 0.0820, 0.08, 0.0784, 0.077, 0.0761, 0.077, 0.0774, 0.08, 0.0813, 0.081, + 0.0808, 0.08, 0.0747, 0.07, 0.0671, 0.06, 0.0587, 0.055, 0.0508, 0.05, 0.0465, 0.046, 0.0456, 0.05, 0.0530, 0.06, 0.0720, 0.08, 0.0888, 0.09, 0.0981, 0.1, 0.1020, 0.102, + 0.1039, 0.104, 0.1053, 0.106, 0.1068, 0.107, 0.1076, 0.1075, 0.1075, 0.1074, 0.1071, 0.107, 0.1062, 0.106, 0.1058, 0.106, 0.1061, 0.107, 0.1080, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L35_3_4_m11spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0211, 0.025, 0.0291, 0.03, 0.0414, 0.05, 0.0739, 0.08, 0.0932, 0.1, 0.1066, 0.12, 0.1217, 0.13, 0.1302, 0.1302, 0.1303, 0.129, 0.1283, 0.125, 0.1235, 0.12, 0.1193, 0.118, 0.1180, 0.118, 0.1183, 0.115, 0.1129, 0.105, 0.1007, 0.9, + 0.0871, 0.08, 0.0727, 0.065, 0.0595, 0.053, 0.0521, 0.503, 0.0501, 0.055, 0.0583, 0.07, 0.0804, 0.09, 0.1000, 0.11, 0.1109, 0.115, 0.1154, 0.116, 0.1176, 0.118, 0.1195, 0.12, + 0.1217, 0.122, 0.1229, 0.122, 0.1227, 0.122, 0.1219, 0.121, 0.1205, 0.12, 0.1197, 0.12, 0.1202, 0.121, 0.1233, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L31_4_5_m4_7spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0163, 0.02, 0.0214, 0.025, 0.0292, 0.04, 0.0507, 0.06, 0.0634, 0.07, 0.0720, 0.08, 0.0818, 0.082, 0.0871, 0.087, 0.0870, 0.086, 0.0854, 0.084, 0.0820, 0.08, 0.0796, 0.08, + 0.0810, 0.082, 0.0849, 0.084, 0.0842, 0.08, 0.0776, 0.07, 0.0694, 0.065, 0.0605, 0.055, 0.0520, 0.05, 0.047, 0.046, 0.0463, 0.05, 0.0531, 0.06, 0.0706, 0.08, + 0.0862, 0.09, 0.0948, 0.0948, 0.0984, 0.1, 0.1001, 0.101, 0.1015, 0.102, 0.1031, 0.1032, 0.1038, 0.1038, 0.1038, 0.1035, 0.1033, 0.103, 0.1024, 0.102, 0.1019, 0.102, 0.1022, 0.103, 0.1043, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L35_4_8_m6_4spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0202, 0.025, 0.0268, 0.03, 0.0369, 0.05, 0.0643, 0.07, 0.0805, 0.09, 0.0917, 0.095, 0.1042, 0.11, 0.1110, 0.1105, 0.1109, 0.11, 0.1089, 0.105, 0.1045, 0.102, + 0.1013, 0.102, 0.1023, 0.105, 0.1060, 0.105, 0.1040, 0.1, 0.0951, 0.09, 0.0845, 0.08, 0.0729, 0.07, 0.0621, 0.06, 0.0562, 0.055, 0.0547, 0.06, 0.0631, 0.07, + 0.0851, 0.09, 0.1045, 0.11, 0.1153, 0.116, 0.1198, 0.12, 0.1220, 0.123, 0.1237, 0.124, 0.1257, 0.126, 0.1267, 0.1266, 0.1266, 0.126, 0.1259, 0.125, 0.1248, 0.1245, 0.1242, 0.1242, 0.1246, 0.126, 0.1272, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L95_10_7_m14_3spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2133, 0.25, 0.2824, 0.32, 0.3890, 0.5, 0.6783, 0.8, 0.8501, 0.9, 0.9674, 1.05, 1.0994, 1.11, 1.1716, 1.1705, 1.1704, 1.15, 1.1487, 1.12, 1.1019, 1.09, 1.0679, 1.07, 1.0770, 1.1, 1.1145, 1.1, 1.0929, 1.0, 0.9987, 0.9, + 0.8859, 0.8, 0.7633, 0.7, 0.6498, 0.6, 0.5873, 0.57, 0.5718, 0.6, 0.6609, 0.7, 0.8939, 1.0, 1.1003, 1.1, 1.2145, 1.25, 1.2625, 1.27, 1.2851, 1.3, 1.3037, 1.31, 1.3246, 1.33, + 1.3346, 1.334, 1.3339, 1.33, 1.3270, 1.32, 1.3152, 1.31, 1.3082, 1.31, 1.3127, 1.33, 1.340, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L36_34_m7_5spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0401, 0.045, 0.0459, 0.05, 0.0545, 0.07, 0.0861, 0.1, 0.1055, 0.11, 0.1162, 0.12, 0.1270, 0.128, 0.1290, 0.125, 0.1221, 0.12, 0.1125, 0.11, 0.1015, 0.1, 0.0924, 0.09, 0.0859, 0.085, 0.0806, 0.08, 0.0731, 0.07, 0.0646, 0.06, + 0.0570, 0.05, 0.0484, 0.04, 0.0399, 0.036, 0.0356, 0.037, 0.0378, 0.05, 0.0685, 0.1, 0.1433, 0.15, 0.2088, 0.22, 0.2444, 0.25, 0.2593, 0.26, 0.2658, 0.266, 0.2695, 0.27, + 0.2726, 0.273, 0.2738, 0.274, 0.2742, 0.274, 0.2738, 0.2733, 0.2731, 0.273, 0.2727, 0.273, 0.2730, 0.275, 0.2762, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L37_59_2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0604, 0.061, 0.0622, 0.063, 0.0644, 0.07, 0.0898, 0.1, 0.1061, 0.11, 0.1114, 0.113, 0.1147, 0.11, 0.1079, 0.1, 0.0930, 0.08, 0.0749, 0.06, 0.0576, 0.05, 0.0442, 0.04, 0.0342, 0.03, 0.0265, 0.021, 0.0208, 0.02, 0.0197, 0.02, + 0.0219, 0.022, 0.0228, 0.022, 0.0220, 0.0225, 0.0225, 0.025, 0.0300, 0.05, 0.0857, 0.2, 0.2187, 0.3, 0.3350, 0.35, 0.3978, 0.4, 0.4241, 0.43, 0.4353, 0.44, 0.4410, 0.445, + 0.4447, 0.445, 0.4457, 0.446, 0.4467, 0.447, 0.4471, 0.4472, 0.4474, 0.4475, 0.4476, 0.4475, 0.4475, 0.45, 0.4504, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L69_14_m9spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1024, 0.12, 0.1316, 0.15, 0.1764, 0.2, 0.3024, 0.35, 0.3775, 0.4, 0.4274, 0.45, 0.4832, 0.5, 0.5118, 0.51, 0.5082, 0.5, 0.4953, 0.48, 0.4721, 0.46, 0.4554, 0.455, 0.4581, 0.46, 0.4737, 0.47, 0.4648, 0.44, 0.4258, 0.4, + 0.3795, 0.35, 0.3290, 0.3, 0.2813, 0.27, 0.2554, 0.253, 0.2506, 0.28, 0.2997, 0.33, 0.4254, 0.4, 0.5364, 0.55, 0.5976, 0.6, 0.6232, 0.63, 0.6351, 0.64, 0.6441, 0.65, + 0.6536, 0.655, 0.6580, 0.658, 0.6579, 0.656, 0.6551, 0.652, 0.6503, 0.65, 0.6474, 0.648, 0.6493, 0.67, 0.6613, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L92_13_m16spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2033, 0.23, 0.2685, 0.32, 0.3690, 0.5, 0.6430, 0.7, 0.8059, 0.85, 0.9166, 1.0, 1.0407, 1.1, 1.1075, 1.105, 1.1043, 1.09, 1.0816, 1.05, 1.0357, 1.02, 1.0006, 1.0, 1.0019, 1.02, 1.0261, 1.0, 0.9978, 0.95, 0.9063, 0.8, 0.7994, 0.75, 0.6845, 0.6, + 0.5772, 0.55, 0.5185, 0.52, 0.5047, 0.57, 0.5942, 0.7, 0.8269, 0.9, 1.0329, 1.1, 1.1466, 1.15, 1.1944, 1.2, 1.2167, 1.22, 1.2346, 1.24, 1.2546, 1.26, 1.2641, 1.264, + 1.2635, 1.26, 1.2571, 1.25, 1.2460, 1.24, 1.2394, 1.24, 1.2437, 1.25, 1.2695, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L49_21_m12spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0571, 0.06, 0.0711, 0.08, 0.0928, 0.11, 0.1566, 0.17, 0.1950, 0.2, 0.2195, 0.23, 0.2461, 0.25, 0.2579, 0.255, 0.2527, 0.25, 0.2427, 0.23, 0.2282, 0.22, 0.2160, 0.21, 0.2094, 0.206, 0.2057, 0.2, 0.1934, 0.18, 0.1722, 0.16, 0.1498, 0.13, 0.1258, 0.11, + 0.1033, 0.1, 0.0911, 0.0905, 0.0904, 0.1, 0.1245, 0.18, 0.2101, 0.25, 0.2855, 0.3, 0.3266, 0.33, 0.3439, 0.35, 0.3516, 0.355, 0.3568, 0.36, 0.3619, 0.363, 0.3642, 0.3644, + 0.3644, 0.364, 0.3631, 0.361, 0.3609, 0.36, 0.3596, 0.36, 0.3605, 0.365, 0.3665, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L56_20_m15spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0778, 0.08, 0.0988, 0.11, 0.1312, 0.19, 0.2241, 0.25, 0.2800, 0.3, 0.3163, 0.34, 0.3559, 0.36, 0.3744, 0.37, 0.3683, 0.36, 0.3553, 0.34, 0.3356, 0.32, 0.3184, 0.31, 0.3083, 0.305, 0.3014, 0.3, 0.2817, 0.26, 0.2492, 0.23, + 0.2150, 0.2, 0.1787, 0.15, 0.1448, 0.13, 0.1264, 0.125, 0.1244, 0.15, 0.1690, 0.22, 0.2816, 0.32, 0.3810, 0.4, 0.4353, 0.44, 0.4580, 0.46, 0.4682, 0.47, 0.4754, 0.48, + 0.4826, 0.483, 0.4859, 0.486, 0.4861, 0.485, 0.4842, 0.483, 0.4807, 0.48, 0.4787, 0.48, 0.4800, 0.485, 0.4888, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L68_21_m19spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1192, 0.13, 0.1536, 0.18, 0.2066, 0.3, 0.3562, 0.4, 0.4460, 0.45, 0.5051, 0.55, 0.5700, 0.6, 0.6015, 0.6, 0.5935, 0.58, 0.5748, 0.56, 0.5447, 0.53, 0.5182, 0.51, 0.5024, 0.5, 0.4912, 0.48, 0.4591, 0.42, 0.4053, 0.37, + 0.3484, 0.3, 0.2883, 0.25, 0.2325, 0.22, 0.2021, 0.2, 0.1976, 0.23, 0.2631, 0.33, 0.4293, 0.5, 0.5760, 0.6564, 0.6, 0.6901, 0.7, 0.7051, 0.71, 0.7161, 0.72, 0.7275, 0.73, + 0.7328, 0.733, 0.7329, 0.73, 0.7297, 0.725, 0.7241, 0.721, 0.7206, 0.722, 0.7229, 0.73, 0.7370, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L98_m2_m32spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2248, 0.3, 0.3270, 0.4, 0.4865, 0.6, 0.8902, 1.0, 1.1296, 1.13, 1.3004, 1.4, 1.4939, 1.5, 1.6083, 1.61, 1.6196, 1.61, 1.6050, 1.6, 1.5533, 1.54, 1.5033, 1.5, 1.4786, 1.47, 1.4628, 1.4, 1.3770, 1.3, 1.2127, 1.1, 1.0306, 0.9, 0.8418, 0.7, + 0.6705, 0.6, 0.574, 0.55, 0.5427, 0.6, 0.6117, 0.7, 0.8072, 0.9, 0.9823, 1.0, 1.0802, 1.1, 1.1215, 1.13, 1.1414, 1.15, 1.1617, 1.17, 1.1884, 1.2, 1.2025, 1.2, 1.2001, 1.19, + 1.1894, 1.18, 1.1710, 1.16, 1.1597, 1.16, 1.1670, 1.2, 1.2037, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L98_m2_m32spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2248, 0.3, 0.3370, 0.4, 0.4865, 0.6, 0.8902, 1.0, 1.1296, 1.13, 1.3004, 1.4, 1.4939, 1.5, 1.6083, 1.61, 1.6196, 1.61, 1.6050, 1.6, 1.5533, 1.54, 1.5033, 1.5, 1.4786, 1.47, 1.4628, 1.4, 1.3770, 1.3, 1.2127, 1.1, 1.0306, 0.9, 0.8418, 0.7, + 0.6705, 0.6, 0.584, 0.55, 0.5427, 0.6, 0.6117, 0.7, 0.8072, 0.9, 0.9823, 1.0, 1.0802, 1.1, 1.1215, 1.13, 1.1414, 1.15, 1.1617, 1.17, 1.1884, 1.2, 1.2025, 1.2, 1.2001, 1.19, + 1.1894, 1.18, 1.1810, 1.16, 1.1597, 1.16, 1.1670, 1.2, 1.2037, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L41_m27_m16spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0125, 0.02, 0.0262, 0.03, 0.0479, 0.06, 0.0964, 0.1, 0.1246, 0.13, 0.1469, 0.16, 0.1731, 0.18, 0.1917, 0.195, 0.1986, 0.2, 0.2028, 0.201, 0.2015, 0.2, 0.1997, 0.2, 0.2021, 0.203, 0.2066, 0.2, 0.1994, 0.18, 0.1778, 0.16, 0.1518, 0.13, + 0.1251, 0.11, 0.1012, 0.1, 0.0876, 0.085, 0.0805, 0.08, 0.0713, 0.06, 0.0537, 0.04, 0.0389, 0.035, 0.0313, 0.03, 0.0282, 0.025, 0.0273, 0.028, 0.0283, 0.03, 0.0308, 0.031, + 0.0325, 0.032, 0.0318, 0.031, 0.0301, 0.03, 0.0274, 0.028, 0.0258, 0.026, 0.0268, 0.03, 0.0311, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L41_m27_m16spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0125, 0.02, 0.0262, 0.03, 0.0489, 0.06, 0.0964, 0.1, 0.1246, 0.13, 0.1469, 0.16, 0.1731, 0.18, 0.1917, 0.195, 0.1986, 0.2, 0.2028, 0.201, 0.2015, 0.2, 0.1997, 0.2, 0.2021, 0.203, 0.2066, 0.2, 0.1994, 0.18, 0.1778, 0.16, 0.1518, 0.13, + 0.1251, 0.11, 0.1012, 0.1, 0.0886, 0.085, 0.0805, 0.08, 0.0713, 0.06, 0.0537, 0.04, 0.0389, 0.035, 0.0313, 0.03, 0.0282, 0.025, 0.0273, 0.028, 0.0283, 0.03, 0.0308, 0.031, + 0.0325, 0.032, 0.0318, 0.031, 0.0311, 0.03, 0.0274, 0.028, 0.0258, 0.026, 0.0268, 0.03, 0.0311, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L15_m9_4spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0016, 0.002, 0.0027, 0.003, 0.0043, 0.006, 0.0081, 0.009, 0.0102, 0.011, 0.0119, 0.012, 0.0140, 0.014, 0.0156, 0.016, 0.0164, 0.017, 0.0170, 0.017, 0.0171, 0.0175, 0.0177, 0.02, 0.0201, 0.022, 0.0241, 0.025, 0.0261, 0.026, 0.0254, 0.025, 0.0238, 0.23, + 0.0218, 0.02, 0.0200, 0.019, 0.0189, 0.0185, 0.0183, 0.018, 0.0172, 0.016, 0.0148, 0.013, 0.0127, 0.012, 0.0116, 0.0115, 0.0112, 0.0112, 0.0111, 0.0111, 0.0111, 0.0112, 0.0113, 0.0114, 0.0115, 0.0115, + 0.0114, 0.0114, 0.0113, 0.0112, 0.0111, 0.011, 0.0109, 0.0110, 0.011, 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 +}; + +const double ColorTemp::Colorlab_L15_m9_4spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0016, 0.002, 0.0027, 0.003, 0.0043, 0.006, 0.0081, 0.009, 0.0102, 0.011, 0.0119, 0.012, 0.0140, 0.014, 0.0156, 0.016, 0.0164, 0.017, 0.0170, 0.017, 0.0171, 0.0175, 0.0177, 0.02, 0.0201, 0.022, 0.0241, 0.025, 0.0261, 0.026, 0.0254, 0.025, 0.0238, 0.23, + 0.0218, 0.02, 0.0220, 0.019, 0.0199, 0.0188, 0.0183, 0.018, 0.0172, 0.016, 0.0148, 0.013, 0.0127, 0.012, 0.0116, 0.0115, 0.0112, 0.0112, 0.0111, 0.0111, 0.0111, 0.0112, 0.0113, 0.0114, 0.0115, 0.0115, + 0.0114, 0.0114, 0.0113, 0.0112, 0.0111, 0.011, 0.0109, 0.0110, 0.011, 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 +}; + +const double ColorTemp::Colorlab_L11_m11_2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0008, 0.001, 0.0015, 0.002, 0.0027, 0.004, 0.0053, 0.006, 0.0067, 0.007, 0.0080, 0.009, 0.0095, 0.01, 0.0107, 0.0105, 0.0113, 0.011, 0.0118, 0.012, 0.0120, 0.012, 0.0124, 0.013, 0.0140, 0.015, 0.0165, 0.017, 0.0178, 0.0175, 0.0172, 0.017, + 0.0160, 0.015, 0.0145, 0.014, 0.0132, 0.013, 0.0124, 0.012, 0.0119, 0.011, 0.0108, 0.09, 0.0085, 0.007, 0.0064, 0.006, 0.0053, 0.005, 0.0048, + 0.0049, 0.0048, 0.0047, 0.0048, 0.0048, 0.0049, 0.005, 0.0050, 0.005, 0.0049, 0.0049, 0.0048, 0.0047, 0.0047, 0.0047, 0.0046, 0.0046, 0.0046, 0.0048, 0.0049, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L14_m4_3spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0024, 0.003, 0.0034, 0.004, 0.0049, 0.007, 0.0086, 0.01, 0.0108, 0.011, 0.0124, 0.013, 0.0144, 0.015, 0.0157, 0.016, 0.0162, 0.0163, 0.0164, 0.0163, 0.0162, 0.0164, 0.0165, 0.017, 0.0183, 0.02, 0.0213, 0.022, 0.0228, 0.0225, 0.0221, 0.021, + 0.0206, 0.02, 0.0188, 0.018, 0.0172, 0.017, 0.0162, 0.016, 0.0158, 0.0158, 0.0157, 0.0158, 0.0158, 0.0159, 0.0159, 0.016, 0.0160, 0.016, 0.0160, 0.0161, 0.0161, 0.0162, + 0.0163, 0.0164, 0.0165, 0.0165, 0.0166, 0.0166, 0.0166, 0.0166, 0.0165, 0.0164, 0.0163, 0.0163, 0.0162, 0.0162, 0.0162, 0.0165, 0.0166, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L41_38_24spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0455, 0.0455, 0.0453, 0.045, 0.0443, 0.05, 0.0570, 0.06, 0.0651, 0.065, 0.0664, 0.066, 0.0664, 0.065, 0.0607, 0.06, 0.0513, 0.04, 0.0397, 0.03, 0.0288, 0.025, 0.0239, 0.03, 0.0302, 0.04, 0.0460, 0.05, 0.0586, 0.06, 0.0662, 0.07, + 0.0727, 0.075, 0.0769, 0.077, 0.0788, 0.08, 0.0807, 0.085, 0.0863, 0.11, 0.1241, 0.18, 0.2137, 0.24, 0.2920, 0.3, 0.3344, 0.34, 0.3522, 0.354, 0.3599, 0.36, 0.3639, 0.365, + 0.3662, 0.366, 0.3667, 0.367, 0.3674, 0.3675, 0.3678, 0.368, 0.3684, 0.3688, 0.3688, 0.3685, 0.3686, 0.37, 0.3703, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L41_38_24spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0455, 0.0455, 0.0453, 0.045, 0.0443, 0.05, 0.0580, 0.06, 0.0651, 0.065, 0.0664, 0.066, 0.0664, 0.065, 0.0607, 0.06, 0.0513, 0.04, 0.0397, 0.03, 0.0288, 0.025, 0.0239, 0.03, 0.0302, 0.04, 0.0460, 0.05, 0.0586, 0.06, 0.0662, 0.07, + 0.0727, 0.075, 0.0769, 0.077, 0.0798, 0.08, 0.0807, 0.085, 0.0863, 0.11, 0.1241, 0.18, 0.2137, 0.24, 0.2920, 0.3, 0.3344, 0.34, 0.3522, 0.354, 0.3599, 0.36, 0.3639, 0.365, + 0.3662, 0.366, 0.3667, 0.367, 0.3684, 0.3675, 0.3678, 0.368, 0.3684, 0.3688, 0.3688, 0.3685, 0.3686, 0.37, 0.3703, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L53_48_58spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0768, 0.075, 0.0714, 0.07, 0.0615, 0.064, 0.0656, 0.067, 0.0689, 0.065, 0.0628, 0.06, 0.0534, 0.04, 0.0375, 0.03, 0.0201, 0.0, -0.0004, -0.01, -0.0180, -0.02, -0.0228, -0.03, -0.0035, 0.0, 0.0370, 0.05, 0.0724, 0.08, 0.0977, 0.1, 0.1200, 0.13, + 0.1376, 0.14, 0.1497, 0.15, 0.1580, 0.16, 0.1701, 0.2, 0.2370, 0.3, 0.3941, 0.45, 0.5311, 0.55, 0.6053, 0.62, 0.6364, 0.64, 0.6500, 0.65, 0.6564, 0.656, 0.6596, 0.6597, + 0.6597, 0.66, 0.6612, 0.662, 0.6625, 0.663, 0.6644, 0.665, 0.6658, 0.6652, 0.6650, 0.666, 0.6665, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L53_48_58spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0768, 0.075, 0.0714, 0.07, 0.0615, 0.064, 0.0656, 0.067, 0.0689, 0.065, 0.0628, 0.06, 0.0534, 0.04, 0.0375, 0.03, 0.0201, 0.0, -0.0004, -0.01, -0.0180, -0.02, -0.0228, -0.03, -0.0035, 0.0, 0.0370, 0.05, 0.0724, 0.08, 0.0977, 0.1, 0.1200, 0.13, + 0.1376, 0.14, 0.1497, 0.15, 0.1580, 0.165, 0.1801, 0.2, 0.2370, 0.3, 0.3941, 0.45, 0.5311, 0.55, 0.6053, 0.62, 0.6364, 0.64, 0.6500, 0.65, 0.6564, 0.656, 0.6596, 0.6597, + 0.6597, 0.66, 0.6612, 0.662, 0.6625, 0.683, 0.6644, 0.675, 0.6658, 0.6652, 0.6650, 0.666, 0.6665, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L70_44_86spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1186, 0.11, 0.1086, 0.1, 0.0903, 0.09, 0.0888, 0.088, 0.0885, 0.08, 0.0760, 0.06, 0.0594, 0.04, 0.0356, 0.02, 0.0128, 0.0, -0.0144, -0.02, -0.0376, -0.035, -0.0356, 0.0, 0.0195, 0.15, 0.1214, 0.2, 0.2062, 0.24, 0.2585, 0.26, 0.2993, 0.3, 0.3307, 0.34, 0.3516, 0.36, + 0.3660, 0.37, 0.3838, 0.41, 0.4778, 0.55, 0.6974, 0.8, 0.8888, 0.95, 0.9927, 1.0, 1.0362, 1.04, 1.0559, 1.06, 1.0651, 1.066, 1.0694, 1.069, 1.0690, 1.07, 1.0713, 1.072, + 1.0733, 1.074, 1.0766, 1.076, 1.0791, 1.078, 1.0775, 1.079, 1.0794, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L70_44_86spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1186, 0.11, 0.1086, 0.1, 0.103, 0.09, 0.0888, 0.088, 0.0885, 0.08, 0.0760, 0.06, 0.0594, 0.04, 0.0356, 0.02, 0.0128, 0.0, -0.0144, -0.02, -0.0376, -0.035, -0.0356, 0.0, 0.0195, 0.15, 0.1214, 0.2, 0.2062, 0.24, 0.2585, 0.26, 0.2993, 0.3, 0.3307, 0.34, 0.3516, 0.36, + 0.3660, 0.37, 0.3838, 0.41, 0.4878, 0.55, 0.6974, 0.8, 0.8888, 0.95, 0.9927, 1.0, 1.0362, 1.04, 1.0559, 1.06, 1.0651, 1.066, 1.0694, 1.069, 1.0690, 1.07, 1.0713, 1.072, + 1.0733, 1.074, 1.0866, 1.076, 1.0891, 1.078, 1.0775, 1.079, 1.0794, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L38_42_19spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0438, 0.044, 0.0438, 0.0435, 0.0431, 0.05, 0.0562, 0.06, 0.0646, 0.065, 0.0661, 0.0662, 0.0662, 0.061, 0.0604, 0.055, 0.0506, 0.04, 0.0387, 0.03, 0.0275, 0.025, 0.0213, 0.022, 0.0233, 0.03, 0.0322, 0.035, 0.0397, 0.04, 0.0451, 0.05, + 0.0506, 0.052, 0.0543, 0.055, 0.0560, 0.0565, 0.0577, 0.06, 0.0633, 0.09, 0.1014, 0.15, 0.1919, 0.22, 0.2710, 0.3, 0.3138, 0.32, 0.3317, 0.335, 0.3394, 0.34, 0.3433, 0.345, + 0.3457, 0.346, 0.3461, 0.3465, 0.3469, 0.347, 0.3473, 0.3475, 0.3478, 0.348, 0.3482, 0.348, 0.3480, 0.349, 0.3497, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L38_42_19spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0438, 0.044, 0.0438, 0.0435, 0.0441, 0.05, 0.0562, 0.06, 0.0646, 0.065, 0.0661, 0.0662, 0.0662, 0.061, 0.0604, 0.055, 0.0506, 0.04, 0.0387, 0.03, 0.0275, 0.025, 0.0213, 0.022, 0.0233, 0.03, 0.0322, 0.035, 0.0397, 0.04, 0.0451, 0.05, + 0.0506, 0.052, 0.0543, 0.055, 0.0570, 0.0565, 0.0577, 0.06, 0.0633, 0.09, 0.1014, 0.15, 0.1919, 0.22, 0.2710, 0.3, 0.3138, 0.32, 0.3317, 0.335, 0.3394, 0.34, 0.3433, 0.345, + 0.3457, 0.346, 0.3461, 0.3465, 0.3569, 0.348, 0.3473, 0.3475, 0.3478, 0.348, 0.3482, 0.348, 0.3480, 0.349, 0.3497, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L60_63_85spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1186, 0.11, 0.1079, 0.1, 0.0890, 0.089, 0.0882, 0.089, 0.0895, 0.08, 0.0764, 0.06, 0.0573, 0.04, 0.0286, 0.0, -0.0013, -0.02, -0.0355, -0.05, -0.0640, -0.07, + -0.0738, -0.06, -0.0504, 0.0, 0.0021, 0.03, 0.0514, 0.08, 0.0918, 0.1, 0.1301, 0.14, 0.1619, 0.17, 0.1847, 0.19, 0.2000, 0.21, 0.2206, 0.28, 0.3301, 0.4, 0.5869, 0.7, + 0.8108, 0.9, 0.9318, 0.94, 0.9824, 1.0, 1.0045, 1.01, 1.0146, 1.015, 1.0192, 1.093, 1.0192, 1.02, 1.0218, 1.022, 1.0241, 1.024, 1.0275, 1.03, 1.0300, 1.029, 1.0285, 1.03, 1.0302, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L60_63_85spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1186, 0.11, 0.1079, 0.1, 0.0900, 0.089, 0.0882, 0.089, 0.0895, 0.08, 0.0764, 0.06, 0.0573, 0.04, 0.0286, 0.0, -0.0013, -0.02, -0.0355, -0.05, -0.0640, -0.07, + -0.0738, -0.06, -0.0504, 0.0, 0.0021, 0.03, 0.0514, 0.08, 0.0918, 0.1, 0.1301, 0.14, 0.1619, 0.17, 0.1847, 0.19, 0.2000, 0.21, 0.2206, 0.28, 0.3301, 0.4, 0.5869, 0.7, + 0.8108, 0.9, 0.9418, 0.94, 0.9924, 1.0, 1.0045, 1.01, 1.0146, 1.015, 1.0192, 1.093, 1.0192, 1.05, 1.0218, 1.022, 1.0241, 1.024, 1.0275, 1.03, 1.0300, 1.029, 1.0285, 1.03, 1.0302, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L80_75_30spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2541, 0.255, 0.2557, 0.255, 0.2543, 0.3, 0.3359, 0.35, 0.3885, 0.39, 0.3999, 0.4, 0.4038, 0.4, 0.3722, 0.35, 0.3159, 0.3, 0.2468, 0.2, 0.1816, 0.15, 0.1439, 0.15, 0.1522, 0.18, 0.1981, 0.21, 0.2359, 0.25, 0.2630, 0.28, 0.2910, 0.3, + 0.3087, 0.31, 0.3154, 0.32, 0.3236, 0.34, 0.3555, 0.4, 0.5755, 0.8, 1.0987, 1.4, 1.5560, 1.7, 1.8035, 1.9, 1.9070, 1.92, 1.9519, 1.96, 1.9747, 1.98, 1.9884, 1.99, + 1.9914, 1.994, 1.9958, 1.996, 1.9979, 2.0, 2.0004, 2.01, 2.0024, 2.02, 2.0013, 2.012, 2.0117, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L80_75_30spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2541, 0.255, 0.2557, 0.255, 0.2543, 0.3, 0.3359, 0.35, 0.3885, 0.39, 0.3999, 0.4, 0.4038, 0.4, 0.3722, 0.35, 0.3159, 0.3, 0.2468, 0.2, 0.1816, 0.15, 0.1439, 0.15, 0.1522, 0.18, 0.1981, 0.21, 0.2359, 0.25, 0.2630, 0.28, 0.2910, 0.3, + 0.3087, 0.31, 0.3154, 0.32, 0.3236, 0.36, 0.3555, 0.4, 0.5755, 0.8, 1.0987, 1.4, 1.5560, 1.7, 1.8035, 1.9, 1.9070, 1.92, 1.9519, 1.96, 1.9747, 1.98, 1.9884, 1.99, + 1.9984, 1.994, 1.9958, 1.986, 1.9979, 2.06, 2.0004, 2.01, 2.0024, 2.02, 2.0013, 2.012, 2.0117, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L28_m21_24spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0003, 0.0, 0.0008, 0.002, 0.0025, 0.003, 0.0049, 0.005, 0.0059, 0.006, 0.0075, 0.01, 0.0101, 0.012, 0.0133, 0.015, 0.0167, 0.018, 0.0199, 0.02, 0.0221, 0.023, 0.0266, 0.03, 0.0388, 0.05, 0.0577, 0.07, 0.0706, 0.073, 0.0736, 0.073, + 0.0728, 0.071, 0.0708, 0.07, 0.0686, 0.069, 0.0673, 0.068, 0.0657, 0.06, 0.0582, 0.05, 0.0407, 0.03, 0.0255, 0.02, 0.0174, 0.015, 0.0141, 0.013, 0.0129, 0.0126, + 0.0125, 0.0125, 0.0125, 0.0125, 0.0125, 0.0124, 0.0123, 0.0122, 0.0121, 0.012, 0.0118, 0.0117, 0.0117, 0.0118, 0.0118, 0.012, 0.0121, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L28_m21_24spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0003, 0.0, 0.0008, 0.002, 0.0025, 0.003, 0.0049, 0.005, 0.0059, 0.006, 0.0075, 0.01, 0.0101, 0.012, 0.0133, 0.015, 0.0167, 0.018, 0.0199, 0.02, 0.0221, 0.023, 0.0266, 0.03, 0.0388, 0.05, 0.0577, 0.07, 0.0706, 0.073, 0.0736, 0.073, + 0.0728, 0.071, 0.0728, 0.07, 0.0686, 0.069, 0.0653, 0.068, 0.0657, 0.06, 0.0582, 0.05, 0.0407, 0.03, 0.0255, 0.02, 0.0174, 0.015, 0.0141, 0.013, 0.0129, 0.0126, + 0.0125, 0.0125, 0.0135, 0.0125, 0.0125, 0.0124, 0.0123, 0.0122, 0.0121, 0.012, 0.0118, 0.0117, 0.0117, 0.0118, 0.0118, 0.012, 0.0121, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L45_m33_47spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0048, -0.004, -0.0032, -0.002, -0.0011, -0.001, -0.0007, -0.001, -0.0021, -0.001, 0.0003, 0.003, 0.0040, 0.009, 0.0115, 0.02, 0.0213, 0.03, 0.0311, 0.032, 0.0385, 0.04, 0.0527, 0.08, 0.0890, 0.1, 0.1449, 0.15, 0.1843, 0.19, 0.1961, 0.1967, + 0.1967, 0.195, 0.1942, 0.193, 0.1905, 0.19, 0.1884, 0.185, 0.1842, 0.17, 0.1610, 0.13, 0.1059, 0.09, 0.0578, 0.04, 0.0323, 0.03, 0.0217, 0.02, + 0.0179, 0.018, 0.0164, 0.016, 0.0159, 0.0158, 0.0157, 0.0154, 0.0151, 0.015, 0.0147, 0.0143, 0.0142, 0.0142, 0.0141, 0.0142, 0.0142, 0.0143, 0.0143, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L45_m33_47spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0048, -0.004, -0.0032, -0.002, -0.0011, -0.001, -0.0007, -0.001, -0.0021, -0.001, 0.0003, 0.003, 0.0040, 0.009, 0.0115, 0.02, 0.0213, 0.03, 0.0311, 0.032, 0.0385, 0.04, 0.0527, 0.08, 0.0890, 0.1, 0.1449, 0.15, 0.1843, 0.19, 0.1961, 0.1967, + 0.1967, 0.195, 0.1942, 0.193, 0.2005, 0.19, 0.1884, 0.185, 0.1842, 0.19, 0.1610, 0.13, 0.1059, 0.09, 0.0578, 0.04, 0.0323, 0.03, 0.0217, 0.02, + 0.0179, 0.018, 0.0164, 0.016, 0.0159, 0.0158, 0.0157, 0.0154, 0.0151, 0.015, 0.0157, 0.0143, 0.0142, 0.0142, 0.0141, 0.0142, 0.0142, 0.0143, 0.0143, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L26_m7_404spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0064, 0.008, 0.0094, 0.01, 0.0142, 0.02, 0.0258, 0.03, 0.0324, 0.033, 0.0375, 0.04, 0.0435, 0.044, 0.0475, 0.048, 0.0489, 0.049, 0.0495, 0.049, 0.0489, 0.049, 0.0491, 0.05, 0.0529, 0.053, 0.0595, 0.06, 0.0621, 0.055, 0.0590, 0.058, 0.0541, 0.05, + 0.0485, 0.045, 0.0432, 0.042, 0.0403, 0.04, 0.0390, 0.038, 0.0386, 0.0386, 0.0386, 0.0387, 0.0387, 0.0388, 0.0389, 0.039, 0.0390, 0.0391, 0.0392, 0.0395, 0.0396, 0.04, + 0.0403, 0.0402, 0.0407, 0.0406, 0.0406, 0.0404, 0.0402, 0.04, 0.0397, 0.0395, 0.0394, 0.0395, 0.0396, 0.04, 0.0406, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L34_m61_2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0084, -0.004, -0.0019, 0.0, 0.0084, 0.01, 0.0259, 0.03, 0.0352, 0.04, 0.0451, 0.05, 0.0580, 0.06, 0.0705, 0.075, 0.0800, 0.085, 0.0888, 0.09, 0.0942, 0.1, 0.1007, 0.11, + 0.1154, 0.12, 0.1367, 0.14, 0.1471, 0.142, 0.1409, 0.13, 0.1285, 0.12, 0.1150, 0.11, 0.1028, 0.1, 0.0957, 0.09, 0.0894, 0.07, 0.0660, 0.04, 0.0123, 0.0, -0.0345, -0.04, + -0.0593, -0.06, -0.0697, -0.07, -0.0737, -0.074, -0.0749, -0.0745, -0.0746, -0.0744, -0.0742, -0.0748, -0.0749, -0.075, -0.0759, -0.077, -0.0773, -0.078, -0.0782, -0.078, -0.0777, -0.077, -0.0762, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L32_m16_17spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0034, 0.004, 0.0056, 0.007, 0.0089, 0.01, 0.0160, 0.014, 0.0197, 0.02, 0.0232, 0.025, 0.0279, 0.03, 0.0322, 0.033, 0.0355, 0.037, 0.0383, 0.039, 0.0397, 0.04, 0.0436, 0.05, 0.0560, 0.07, 0.0757, 0.08, 0.0884, 0.09, + 0.0900, 0.089, 0.0875, 0.085, 0.0837, 0.08, 0.0796, 0.078, 0.0774, 0.076, 0.0756, 0.07, 0.0698, 0.06, 0.0566, 0.05, 0.0452, 0.04, 0.0392, 0.036, 0.0367, + 0.0360, 0.036, 0.0359, 0.036, 0.0363, 0.0364, 0.0364, 0.0363, 0.0362, 0.036, 0.0359, 0.0356, 0.0355, 0.0353, 0.0352, 0.0353, 0.0354, 0.036, 0.0361, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L30_m19_15spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0020, 0.003, 0.0043, 0.006, 0.0078, 0.01, 0.0149, 0.016, 0.0187, 0.02, 0.0223, 0.025, 0.0270, 0.03, 0.0315, 0.032, 0.0349, 0.036, 0.0379, 0.038, 0.0394, 0.04, 0.0431, 0.05, + 0.0542, 0.06, 0.0715, 0.08, 0.0824, 0.083, 0.0832, 0.081, 0.0801, 0.078, 0.0759, 0.074, 0.0717, 0.07, 0.0693, 0.068, 0.0673, 0.064, 0.0608, 0.05, 0.0458, 0.04, + 0.0328, 0.03, 0.0260, 0.025, 0.0232, 0.023, 0.0223, 0.0221, 0.0221, 0.0223, 0.0224, 0.0225, 0.0226, 0.0224, 0.0224, 0.0221, 0.0220, 0.022, 0.0216, 0.0215, 0.0213, 0.0214, 0.0215, 0.02, 0.0222, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L30_m17_16spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0027, 0.003, 0.0048, 0.006, 0.0080, 0.01, 0.0148, 0.015, 0.0183, 0.02, 0.0216, 0.025, 0.0261, 0.03, 0.0303, 0.032, 0.0334, 0.035, 0.0361, 0.037, 0.0375, 0.04, 0.0411, 0.05, 0.0524, 0.06, 0.0700, 0.08, 0.0813, 0.082, 0.0825, 0.08, 0.0799, 0.077, + 0.0761, 0.075, 0.0722, 0.07, 0.0700, 0.069, 0.0682, 0.067, 0.0624, 0.055, 0.0493, 0.04, 0.0378, 0.035, 0.0318, 0.03, 0.0294, 0.029, 0.0286, 0.0285, 0.0285, 0.0287, + 0.0288, 0.029, 0.0290, 0.029, 0.0287, 0.0285, 0.0284, 0.0282, 0.0280, 0.028, 0.0278, 0.0279, 0.0279, 0.028, 0.0286, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L35_m8_4spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0109, 0.014, 0.0158, 0.02, 0.0233, 0.03, 0.0419, 0.05, 0.0525, 0.06, 0.0606, 0.07, 0.0702, 0.075, 0.0768, 0.078, 0.0793, 0.08, 0.0805, 0.08, 0.0795, 0.08, 0.0806, 0.085, 0.0889, 0.1, 0.1028, 0.105, 0.1094, 0.106, 0.1054, 0.1, 0.0979, 0.09, + 0.0891, 0.085, 0.0807, 0.08, 0.0761, 0.075, 0.0739, 0.073, 0.0730, 0.073, 0.0722, 0.072, 0.0718, 0.0716, 0.0718, 0.0718, 0.0719, 0.072, 0.0722, 0.0725, 0.0729, 0.073, + 0.0741, 0.0745, 0.0746, 0.0744, 0.0744, 0.074, 0.0739, 0.073, 0.0730, 0.073, 0.0725, 0.0727, 0.0728, 0.073, 0.0745, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L37_m7_5spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0126, 0.015, 0.0178, 0.02, 0.0258, 0.03, 0.0457, 0.05, 0.0572, 0.06, 0.0658, 0.07, 0.0760, 0.08, 0.0830, 0.084, 0.0856, 0.086, 0.0867, 0.086, 0.0856, 0.086, 0.0868, 0.09, 0.0961, 0.1, 0.1120, 0.113, 0.1199, 0.118, 0.1160, 0.11, 0.1081, 0.1, + 0.0989, 0.09, 0.0900, 0.088, 0.0851, 0.084, 0.0828, 0.0825, 0.0825, 0.083, 0.0831, 0.0835, 0.0839, 0.084, 0.0846, 0.0845, 0.0849, 0.085, 0.0854, 0.086, 0.0862, 0.087, + 0.0875, 0.088, 0.0881, 0.088, 0.0879, 0.0875, 0.0873, 0.087, 0.0864, 0.086, 0.0858, 0.086, 0.0862, 0.087, 0.0881, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L45_m7_2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0213, 0.03, 0.0302, 0.04, 0.0438, 0.06, 0.0780, 0.09, 0.0979, 0.1, 0.1125, 0.12, 0.1297, 0.13, 0.1411, 0.143, 0.1445, 0.1454, 0.1456, 0.143, 0.1428, 0.143, 0.1433, 0.15, 0.1548, 0.16, 0.1750, 0.18, 0.1833, 0.18, 0.1749, 0.17, 0.1610, 0.15, + 0.1452, 0.14, 0.1301, 0.13, 0.1219, 0.12, 0.1183, 0.119, 0.1197, 0.12, 0.1254, 0.13, 0.1308, 0.133, 0.1342, 0.135, 0.1356, 0.136, 0.1367, 0.137, 0.1383, 0.14, 0.1405, 0.141, + 0.1416, 0.1415, 0.1413, 0.141, 0.1403, 0.14, 0.1387, 0.138, 0.1378, 0.138, 0.1384, 0.14, 0.1416, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_m6_5spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0164, 0.02, 0.0226, 0.03, 0.0320, 0.04, 0.0562, 0.06, 0.0701, 0.08, 0.0804, 0.09, 0.0925, 0.1, 0.1006, 0.103, 0.1031, 0.1035, 0.1039, 0.103, 0.1021, 0.103, 0.1030, 0.11, 0.1135, 0.12, 0.1316, 0.13, 0.1403, 0.14, 0.1356, 0.13, 0.1264, 0.12, 0.1155, 0.11, 0.1050, 0.1, + 0.0992, 0.097, 0.0968, 0.097, 0.0979, 0.1, 0.1024, 0.103, 0.1065, 0.108, 0.1091, 0.11, 0.1102, 0.111, 0.1110, 0.111, 0.1122, 0.113, 0.1138, 0.114, 0.1145, 0.1145, 0.1143, 0.114, + 0.1136, 0.113, 0.1125, 0.112, 0.1119, 0.112, 0.1123, 0.113, 0.1146, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L46_m6_2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0233, 0.03, 0.0322, 0.04, 0.0460, 0.06, 0.0811, 0.1, 0.1015, 0.11, 0.1163, 0.12, 0.1338, 0.14, 0.1451, 0.148, 0.1483, 0.145, 0.1489, 0.146, 0.1458, 0.146, 0.1461, 0.15, 0.1582, 0.17, 0.1795, 0.18, 0.1886, 0.181, 0.1804, 0.17, 0.1666, 0.16, + 0.1508, 0.14, 0.1356, 0.13, 0.1273, 0.125, 0.1239, 0.124, 0.1266, 0.13, 0.1356, 0.14, 0.1438, 0.145, 0.1488, 0.15, 0.1509, 0.152, 0.1523, 0.153, 0.1540, 0.155, 0.1563, 0.157, + 0.1574, 0.156, 0.1571, 0.157, 0.1562, 0.56, 0.1546, 0.154, 0.1537, 0.154, 0.1542, 0.156, 0.1576, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L48_m69_16spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0181, -0.01, -0.0091, 0.0, 0.0052, 0.01, 0.0259, 0.03, 0.0360, 0.04, 0.0492, 0.06, 0.0677, 0.08, 0.0879, 0.1, 0.1059, 0.11, 0.1233, 0.13, 0.1351, 0.14, 0.1511, 0.17, 0.1875, 0.2, 0.2413, 0.26, 0.2732, 0.271, 0.2706, 0.26, 0.2546, 0.24, + 0.2358, 0.22, 0.2184, 0.21, 0.2082, 0.2, 0.1975, 0.17, 0.1520, 0.06, 0.0462, 0.0, -0.0459, -0.06, -0.0950, -0.1, -0.1154, -0.12, -0.1232, -0.124, -0.1260, -0.126, + -0.1261, -0.126, -0.1257, -0.126, -0.1270, -0.128, -0.1285, -0.13, -0.1306, -0.132, -0.1318, -0.1312, -0.1311, -0.13, -0.1294, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L51_89_53spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1314, 0.13, 0.1218, 0.11, 0.1046, 0.11, 0.1137, 0.12, 0.1221, 0.12, 0.1115, 0.1, 0.0933, 0.08, 0.0607, 0.04, 0.0225, 0.0, -0.0208, -0.04, -0.0572, -0.06, -0.0798, -0.08, -0.0852, -0.08, -0.0759, -0.06, -0.0588, -0.04, -0.0307, 0.0, 0.0037, 0.0036, 0.0336, 0.04, + 0.0557, 0.06, 0.0706, 0.08, 0.0944, 0.15, 0.2271, 0.4, 0.5396, 0.7, 0.8124, 0.9, 0.9595, 1.0, 1.0210, 1.03, 1.0472, 1.05, 1.0593, 1.06, 1.0651, 1.0656, 1.0656, 1.067, + 1.0686, 1.07, 1.0711, 1.073, 1.0745, 1.075, 1.0768, 1.076, 1.0754, 1.077, 1.0780, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L49_84_33spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1189, 0.115, 0.1130, 0.11, 0.1020, 0.11, 0.1198, 0.125, 0.1331, 0.13, 0.1281, 0.12, 0.1169, 0.1, 0.0909, 0.07, 0.0573, 0.04, 0.0189, 0.0, -0.0145, -0.02, -0.0366, -0.04, + -0.0456, -0.044, -0.0438, -0.04, -0.0353, -0.02, -0.0165, 0.0, 0.0084, 0.01, 0.0297, 0.03, 0.0447, 0.05, 0.0554, 0.06, 0.0754, 0.1, 0.1935, 0.3, 0.4724, 0.6, 0.7159, 0.75, + 0.8473, 0.9, 0.9022, 0.91, 0.9255, 0.92, 0.9366, 0.94, 0.9423, 0.943, 0.9431, 0.944, 0.9457, 0.946, 0.9476, 0.95, 0.9501, 0.951, 0.9518, 0.951, 0.9508, 0.952, 0.9539, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L59_m51_31spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0123, -0.002, -0.0032, 0.0, 0.0108, 0.02, 0.0316, 0.04, 0.0410, 0.05, 0.0543, 0.06, 0.0737, 0.08, 0.0961, 0.1, 0.1175, 0.12, 0.1380, 0.14, 0.1519, 0.16, 0.1752, 0.2, 0.2340, 0.3, 0.3232, 0.35, 0.3810, 0.385, + 0.3880, 0.38, 0.3752, 0.36, 0.3573, 0.34, 0.3395, 0.33, 0.3292, 0.32, 0.3176, 0.3, 0.2669, 0.2, 0.1484, 0.1, 0.0451, 0.0, -0.0097, -0.02, -0.0324, -0.04, -0.0408, -0.042, + -0.0437, -0.0436, -0.0438, -0.0436, -0.0436, -0.045, -0.0450, -0.046, -0.0465, -0.047, -0.0486, -0.049, -0.0497, -0.0493, -0.0491, -0.048, -0.0472, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L48_m69_16spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0181, -0.02, -0.0090, 0.004, 0.0052, 0.01, 0.0259, 0.03, 0.0361, 0.04, 0.0493, 0.05, 0.0678, 0.07, 0.0880, 0.1, 0.1060, 0.11, 0.1235, 0.13, 0.1353, 0.14, 0.1513, 0.17, 0.1879, 0.21, 0.2419, 0.25, 0.2739, 0.273, 0.2713, 0.26, 0.2553, 0.24, 0.2366, 0.22, + 0.2191, 0.21, 0.2089, 0.2, 0.1982, 0.17, 0.1527, 0.08, 0.0468, 0.0, -0.0455, -0.05, -0.0946, -0.1, -0.1150, -0.12, -0.1228, -0.123, -0.1256, -0.125, -0.1258, -0.1255, + -0.1254, -0.125, -0.1267, -0.127, -0.1281, -0.13, -0.1303, -0.131, -0.1315, -0.131, -0.1308, -0.13, -0.1291, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L53_m71_6spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0168, -0.015, -0.0015, 0.01, 0.0226, 0.05, 0.0640, 0.07, 0.0860, 0.1, 0.1093, 0.12, 0.1397, 0.15, 0.1692, 0.18, 0.1916, 0.2, 0.2125, 0.22, 0.2250, 0.23, 0.2414, 0.27, 0.2802, 0.3, 0.3375, 0.35, 0.3670, 0.35, 0.3546, 0.33, + 0.3264, 0.3, 0.2951, 0.27, 0.2665, 0.25, 0.2499, 0.24, 0.2353, 0.2, 0.1811, 0.1, 0.0565, 0.0, -0.0519, -0.08, -0.1095, -0.1, -0.1334, -0.14, -0.1425, -0.143, + -0.1453, -0.145, -0.1446, -0.144, -0.1435, -0.144, -0.1452, -0.146, -0.1475, -0.15, -0.1509, -0.151, -0.1528, -0.153, -0.1516, -0.15, -0.1482, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L51_m89_53spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1331, 0.13, 0.1233, 0.11, 0.1059, 0.11, 0.1151, 0.12, 0.1236, 0.12, 0.1129, 0.1, 0.0946, 0.07, 0.0615, 0.05, 0.0228, 0.0, -0.0210, -0.04, -0.0579, -0.07, -0.0808, -0.08, -0.0863, -0.08, -0.0769, -0.06, -0.0595, -0.04, -0.0311, 0.001, 0.0037, 0.035, + 0.0341, 0.04, 0.0564, 0.06, 0.0716, 0.08, 0.0956, 0.15, 0.2300, 0.4, 0.5466, 0.7, 0.8229, 0.9, 0.9720, 1.0, 1.0342, 1.05, 1.0608, 1.07, 1.0730, 1.075, 1.0789, 1.079, + 1.0794, 1.08, 1.0825, 1.083, 1.0850, 1.088, 1.0884, 1.09, 1.0908, 1.09, 1.0894, 1.09, 1.0920, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L49_84_33spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1189, 0.125, 0.1130, 0.11, 0.1020, 0.11, 0.1198, 0.125, 0.1331, 0.13, 0.1281, 0.12, 0.1369, 0.1, 0.0909, 0.07, 0.0573, 0.04, 0.0189, 0.0, -0.0145, -0.02, -0.0366, -0.04, + -0.0456, -0.044, -0.0438, -0.04, -0.0353, -0.02, -0.0165, 0.0, 0.0084, 0.01, 0.0297, 0.03, 0.0447, 0.05, 0.0554, 0.06, 0.0754, 0.1, 0.1935, 0.3, 0.4724, 0.6, 0.7159, 0.75, + 0.8473, 0.9, 0.9122, 0.91, 0.9255, 0.92, 0.9366, 0.94, 0.9423, 0.943, 0.9431, 0.944, 0.9457, 0.946, 0.9476, 0.95, 0.9501, 0.951, 0.9518, 0.951, 0.9508, 0.952, 0.9539, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L36_m27_28spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0012, 0.0, 0.0007, 0.004, 0.0036, 0.007, 0.0079, 0.009, 0.0095, 0.01, 0.0123, 0.012, 0.0168, 0.02, 0.0223, 0.025, 0.0280, 0.03, 0.0335, 0.035, 0.0373, 0.04, 0.0447, 0.06, 0.0645, 0.08, 0.0949, 0.1, 0.1156, 0.12, 0.1202, 0.12, + 0.1185, 0.115, 0.1149, 0.113, 0.1110, 0.11, 0.1088, 0.107, 0.1060, 0.1, 0.0931, 0.08, 0.0628, 0.05, 0.0363, 0.03, 0.0224, 0.02, 0.0166, 0.015, 0.0145, 0.014, 0.0138, 0.0138, + 0.0138, 0.0138, 0.0138, 0.0135, 0.0134, 0.0132, 0.0131, 0.013, 0.0126, 0.0125, 0.0124, 0.0125, 0.0125, 0.013, 0.0130, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L36_m27_28spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0012, 0.0, 0.0007, 0.004, 0.0036, 0.007, 0.0079, 0.009, 0.0095, 0.01, 0.0153, 0.012, 0.0168, 0.02, 0.0223, 0.025, 0.0280, 0.03, 0.0335, 0.035, 0.0373, 0.04, 0.0447, 0.06, 0.0645, 0.08, 0.0949, 0.1, 0.1156, 0.12, 0.1202, 0.12, + 0.1185, 0.115, 0.1249, 0.113, 0.1110, 0.11, 0.1088, 0.107, 0.1060, 0.1, 0.0931, 0.08, 0.0628, 0.05, 0.0363, 0.03, 0.0224, 0.02, 0.0166, 0.015, 0.0145, 0.014, 0.0138, 0.0138, + 0.0138, 0.0138, 0.0138, 0.0135, 0.0134, 0.0132, 0.0131, 0.013, 0.0136, 0.0125, 0.0124, 0.0125, 0.0125, 0.013, 0.0130, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L36_m27_28spect3[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0012, 0.0, 0.0007, 0.004, 0.0036, 0.007, 0.0079, 0.009, 0.0095, 0.01, 0.0153, 0.012, 0.0168, 0.02, 0.0223, 0.025, 0.0280, 0.03, 0.0335, 0.035, 0.0373, 0.04, 0.0447, 0.06, 0.0645, 0.08, 0.0949, 0.1, 0.1156, 0.12, 0.1202, 0.12, + 0.1185, 0.115, 0.1049, 0.113, 0.1110, 0.11, 0.1088, 0.107, 0.1060, 0.1, 0.0931, 0.08, 0.0628, 0.05, 0.0363, 0.03, 0.0224, 0.02, 0.0166, 0.015, 0.0145, 0.014, 0.0138, 0.0138, + 0.0138, 0.0138, 0.0138, 0.0135, 0.0134, 0.0132, 0.0131, 0.012, 0.0136, 0.0115, 0.0124, 0.0125, 0.0125, 0.013, 0.0130, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L63_16_71spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0572, 0.055, 0.0533, 0.05, 0.0456, 0.0455, 0.0455, 0.045, 0.0446, 0.04, 0.0397, 0.035, 0.0344, 0.03, 0.0278, 0.025, 0.0233, 0.02, 0.0164, 0.01, 0.0099, 0.02, 0.0210, 0.05, 0.0751, 0.1, 0.1672, 0.2, 0.2386, 0.25, 0.2735, 0.28, + 0.2946, 0.3, 0.308, 0.31, 0.3164, 0.32, 0.3222, 0.325, 0.3282, 0.35, 0.3595, 0.4, 0.4319, 0.45, 0.4950, 0.5, 0.5297, 0.53, 0.5443, 0.55, 0.5516, 0.553, 0.5552, 0.556, + 0.5571, 0.557, 0.5568, 0.557, 0.5575, 0.558, 0.5582, 0.559, 0.5596, 0.56, 0.5608, 0.56, 0.5600, 0.56, 0.5611, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L84_4_46spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0967, 0.1, 0.1060, 0.11, 0.1183, 0.14, 0.1696, 0.18, 0.1976, 0.2, 0.2146, 0.22, 0.2361, 0.24, 0.2486, 0.25, 0.2527, 0.251, 0.2504, 0.25, 0.2420, 0.25, 0.2618, 0.3, 0.3581, 0.4, 0.5200, 0.6, 0.6329, 0.65, 0.6662, 0.67, + 0.6704, 0.67, 0.6620, 0.65, 0.6470, 0.645, 0.6405, 0.6402, 0.6404, 0.65, 0.6689, 0.7, 0.7383, 0.75, 0.7991, 0.8, 0.8336, 0.84, 0.8483, 0.85, 0.8569, 0.86, 0.8627, 0.865, 0.8680, 0.868, 0.8691, 0.869, 0.8693, 0.869, + 0.8685, 0.868, 0.8675, 0.8675, 0.8675, 0.8675, 0.8674, 0.87, 0.8737, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L84_4_46spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0967, 0.1, 0.1060, 0.12, 0.1183, 0.14, 0.1696, 0.18, 0.1976, 0.2, 0.2146, 0.22, 0.2361, 0.24, 0.2486, 0.25, 0.2527, 0.251, 0.2504, 0.25, 0.2420, 0.25, 0.2618, 0.3, 0.3581, 0.4, 0.5200, 0.6, 0.6329, 0.65, 0.6662, 0.67, + 0.6704, 0.67, 0.6620, 0.65, 0.6570, 0.645, 0.6405, 0.6402, 0.6404, 0.65, 0.6689, 0.7, 0.7383, 0.75, 0.7991, 0.8, 0.8336, 0.84, 0.8483, 0.85, 0.8569, 0.86, 0.8627, 0.865, 0.8680, 0.868, 0.8691, 0.869, 0.8693, 0.869, + 0.8685, 0.868, 0.8675, 0.8685, 0.8675, 0.8675, 0.8674, 0.87, 0.8737, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L75_m66_19spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0156, 0.0, 0.0098, 0.02, 0.0496, 0.1, 0.1201, 0.13, 0.1571, 0.18, 0.1958, 0.22, 0.2475, 0.28, 0.2978, 0.31, 0.3372, 0.35, 0.3735, 0.38, 0.3950, 0.4, 0.4291, 0.5, 0.5173, 0.6, 0.6511, 0.7, 0.7285, 0.72, 0.7189, 0.7, 0.6762, 0.67, 0.6258, 0.6, 0.5783, 0.56, 0.5509, 0.53, + 0.5265, 0.5, 0.4363, 0.3, 0.2287, 0.1, 0.0482, 0.0, -0.0474, -0.06, -0.0871, -0.1, -0.1017, -0.105, -0.1059, -0.105, -0.1043, -0.103, -0.1026, -0.104, -0.1055, -0.108, + -0.1092, -0.11, -0.1148, -0.115, -0.1179, -0.116, -0.1160, -0.11, -0.1098, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L75_m66_19spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0156, 0.0, 0.0098, 0.03, 0.0496, 0.1, 0.1201, 0.13, 0.1571, 0.18, 0.1958, 0.22, 0.2475, 0.28, 0.2978, 0.31, 0.3372, 0.35, 0.3735, 0.38, 0.3950, 0.4, 0.4291, 0.5, 0.5173, 0.6, 0.6511, 0.7, 0.7285, 0.72, 0.7189, 0.7, 0.6762, 0.67, 0.6258, 0.6, 0.5783, 0.56, 0.5509, 0.53, + 0.5265, 0.5, 0.4363, 0.3, 0.2587, 0.1, 0.0482, 0.0, -0.0494, -0.06, -0.0871, -0.1, -0.1017, -0.105, -0.1059, -0.105, -0.1043, -0.103, -0.1026, -0.104, -0.1055, -0.108, + -0.1092, -0.11, -0.1148, -0.115, -0.1179, -0.116, -0.1160, -0.11, -0.1098, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L64_m82_m6spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0171, 0.01, 0.0138, 0.05, 0.0628, 0.1, 0.1546, 0.2, 0.2056, 0.22, 0.2535, 0.3, 0.3138, 0.35, 0.3665, 0.4, 0.4005, 0.42, 0.4306, 0.44, 0.4457, 0.45, 0.4630, 0.5, 0.5062, 0.53, 0.5693, 0.58, 0.5909, 0.57, 0.5532, 0.5, 0.4940, 0.45, 0.4313, 0.4, + 0.3751, 0.35, 0.3425, 0.33, 0.3178, 0.3, 0.2396, 0.1, 0.0625, 0.0, -0.0910, -0.1, -0.1723, -0.2, -0.2062, -0.21, -0.2191, -0.22, -0.2221, -0.22, -0.2193, -0.219, -0.2165, -0.218, + -0.2193, -0.22, -0.2235, -0.23, -0.2302, -0.232, -0.2341, -0.232, -0.2317, -0.23, -0.2240, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L64_m82_m6spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + -0.0171, 0.01, 0.0138, 0.05, 0.0648, 0.1, 0.1546, 0.2, 0.2056, 0.22, 0.2535, 0.3, 0.3138, 0.35, 0.3665, 0.4, 0.4105, 0.42, 0.4306, 0.44, 0.4457, 0.45, 0.4630, 0.5, 0.5062, 0.53, 0.5693, 0.58, 0.5909, 0.57, 0.5532, 0.5, 0.4940, 0.45, 0.4313, 0.4, + 0.3751, 0.35, 0.3425, 0.33, 0.3378, 0.3, 0.2396, 0.1, 0.0625, 0.0, -0.0910, -0.1, -0.1723, -0.2, -0.2062, -0.21, -0.2191, -0.22, -0.2221, -0.22, -0.2193, -0.219, -0.2165, -0.218, + -0.2193, -0.22, -0.2235, -0.23, -0.2302, -0.232, -0.2341, -0.232, -0.2317, -0.23, -0.2240, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L66_m71_m17spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0007, 0.03, 0.0403, 0.08, 0.1029, 0.2, 0.2297, 0.25, 0.3019, 0.33, 0.3645, 0.4, 0.4407, 0.5, 0.5018, 0.52, 0.5344, 0.55, 0.5612, 0.57, 0.5702, 0.574, 0.5790, 0.6, 0.6080, 0.63, 0.6506, 0.65, 0.6510, 0.6, 0.5942, 0.55, 0.5179, 0.5, 0.4388, 0.4, + 0.3682, 0.34, 0.3275, 0.31, 0.3009, 0.25, 0.2329, 0.1, 0.0832, 0.0, -0.0461, -0.1, -0.1142, -0.12, -0.1425, -0.15, -0.1531, -0.154, -0.1542, -0.15, -0.1490, -0.145, + -0.1449, -0.148, -0.1478, -0.15, -0.1529, -0.16, -0.1611, -0.165, -0.1661, -0.164, -0.1630, -0.16, -0.1522, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L66_m71_m17spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0007, 0.03, 0.0403, 0.08, 0.1429, 0.2, 0.2297, 0.25, 0.3019, 0.33, 0.3645, 0.4, 0.4407, 0.54, 0.5018, 0.52, 0.5344, 0.55, 0.5612, 0.57, 0.5702, 0.574, 0.5790, 0.6, 0.6080, 0.63, 0.6506, 0.65, 0.6510, 0.6, 0.5942, 0.55, 0.5179, 0.5, 0.4388, 0.4, + 0.3682, 0.34, 0.3275, 0.31, 0.3009, 0.28, 0.2329, 0.1, 0.0832, 0.0, -0.0461, -0.1, -0.1142, -0.12, -0.1425, -0.15, -0.1531, -0.154, -0.1542, -0.15, -0.1490, -0.145, + -0.1449, -0.148, -0.1478, -0.15, -0.1529, -0.16, -0.1611, -0.165, -0.1661, -0.164, -0.1630, -0.16, -0.1522, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L22_m8_m60spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0228, 0.03, 0.0416, 0.06, 0.0715, 0.1, 0.1422, 0.15, 0.1848, 0.2, 0.2159, 0.24, 0.2505, 0.26, 0.2709, 0.272, 0.2720, 0.27, 0.2693, 0.265, 0.2605, 0.25, 0.2450, 0.22, 0.2153, 0.2, 0.1709, 0.15, 0.1245, 0.1, 0.0821, 0.06, 0.0434, 0.02, 0.0065, 0.0, + -0.0251, -0.03, -0.0432, -0.045, -0.0497, -0.043, -0.0419, -0.02, -0.0173, 0.0, 0.0051, 0.01, 0.0174, 0.03, 0.0226, 0.0225, 0.0247, 0.025, 0.0275, 0.03, 0.0317, 0.032, + 0.0343, 0.034, 0.0338, 0.032, 0.0318, 0.03, 0.0282, 0.027, 0.0259, 0.027, 0.0274, 0.03, 0.0335, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L22_m8_m60spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0228, 0.03, 0.0416, 0.07, 0.0715, 0.1, 0.1422, 0.15, 0.1848, 0.2, 0.2159, 0.26, 0.2505, 0.26, 0.2709, 0.272, 0.2720, 0.27, 0.2693, 0.265, 0.2605, 0.25, 0.2450, 0.22, 0.2153, 0.2, 0.1709, 0.15, 0.1245, 0.1, 0.0821, 0.06, 0.0434, 0.02, 0.0065, 0.0, + -0.0251, -0.03, -0.0432, -0.045, -0.0497, -0.043, -0.0419, -0.025, -0.0173, 0.0, 0.0051, 0.01, 0.0174, 0.03, 0.0226, 0.0225, 0.0247, 0.025, 0.0275, 0.03, 0.0317, 0.032, + 0.0343, 0.034, 0.0338, 0.032, 0.0318, 0.03, 0.0292, 0.027, 0.0259, 0.027, 0.0274, 0.03, 0.0335, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L15_m4_m42spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0109, 0.015, 0.0194, 0.02, 0.0328, 0.05, 0.0647, 0.07, 0.0839, 0.09, 0.0978, 0.1, 0.1134, 0.12, 0.1225, 0.123, 0.123, 0.122, 0.1217, 0.12, 0.1177, 0.115, 0.1108, 0.1, 0.0982, 0.08, 0.0795, 0.06, 0.0595, 0.05, 0.0408, 0.03, 0.0236, 0.01, + 0.0072, 0.007, -0.0070, -0.01, -0.0151, -0.016, -0.0180, -0.015, -0.0141, -0.001, -0.0023, 0.0, 0.0084, 0.01, 0.0143, 0.015, 0.0168, 0.017, 0.0178, 0.018, 0.0191, 0.02, + 0.0210, 0.022, 0.0222, 0.022, 0.0220, 0.022, 0.0211, 0.02, 0.0195, 0.019, 0.0185, 0.019, 0.0191, 0.02, 0.0219, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L15_m4_m42spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0109, 0.015, 0.0184, 0.02, 0.0328, 0.05, 0.0647, 0.07, 0.0839, 0.09, 0.0978, 0.1, 0.1134, 0.12, 0.1325, 0.123, 0.123, 0.122, 0.1217, 0.12, 0.1177, 0.115, 0.1108, 0.1, 0.0982, 0.08, 0.0795, 0.06, 0.0595, 0.05, 0.0408, 0.03, 0.0236, 0.01, + 0.0072, 0.007, -0.0070, -0.01, -0.0151, -0.016, -0.0180, -0.025, -0.0141, -0.001, -0.0023, 0.0, 0.0084, 0.01, 0.0143, 0.015, 0.0168, 0.017, 0.0178, 0.018, 0.0191, 0.02, + 0.0210, 0.022, 0.0222, 0.022, 0.0220, 0.022, 0.0211, 0.02, 0.0195, 0.019, 0.0185, 0.019, 0.0191, 0.02, 0.0219, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L13_3_m23spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0064, 0.007, 0.0098, 0.01, 0.0153, 0.02, 0.0290, 0.03, 0.0372, 0.04, 0.0430, 0.045, 0.0495, 0.05, 0.0531, 0.0531, 0.0531, 0.053, 0.0523, 0.051, 0.0503, 0.05, 0.0475, 0.045, + 0.0433, 0.04, 0.0373, 0.031, 0.0303, 0.025, 0.0232, 0.02, 0.0164, 0.01, 0.0098, 0.005, 0.0039, 0.001, 0.0007, 0.0, -0.0004, 0.0, 0.0024, 0.01, 0.0101, 0.012, 0.0170, 0.02, 0.0208, 0.023, 0.0223, 0.023, 0.0230, 0.0231, 0.0237, 0.024, + 0.0246, 0.025, 0.0251, 0.025, 0.0250, 0.0248, 0.0247, 0.0245, 0.0240, 0.024, 0.0236, 0.0236, 0.0239, 0.024, 0.0251, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L27_4_m90spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0543, 0.08, 0.0957, 0.12, 0.1617, 0.25, 0.3197, 0.35, 0.4152, 0.45, 0.4840, 0.5, 0.5600, 0.6, 0.6032, 0.603, 0.6029, 0.6, 0.5940, 0.595, 0.5722, 0.55, 0.5340, 0.5, 0.4601, 0.4, 0.3492, 0.3, 0.2374, 0.15, 0.1408, 0.1, + 0.0549, 0.0, -0.0262, -0.05, -0.0957, -0.1, -0.1353, -0.14, -0.1485, -0.13, -0.1237, -0.1, -0.0512, 0.0, 0.0139, 0.04, 0.0497, 0.05, 0.0646, 0.07, 0.0706, 0.071, 0.0773, 0.08, + 0.0870, 0.09, 0.0929, 0.092, 0.0920, 0.09, 0.0876, 0.08, 0.0798, 0.077, 0.0747, 0.076, 0.0781, 0.08, 0.0916, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L19_1_m29spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0109, 0.015, 0.0175, 0.02, 0.0278, 0.04, 0.0531, 0.06, 0.0682, 0.07, 0.0791, 0.08, 0.0912, 0.095, 0.0982, 0.098, 0.0983, 0.098, 0.0971, 0.095, 0.0936, 0.09, 0.0886, 0.085, 0.0806, 0.07, 0.0692, 0.06, 0.0561, 0.05, 0.0427, 0.03, 0.0299, 0.02, 0.0174, 0.01, + 0.0064, 0.003, 0.0002, 0.0, -0.0018, 0.0, 0.0025, 0.01, 0.0148, 0.02, 0.0259, 0.03, 0.0320, 0.033, 0.0346, 0.035, 0.0357, 0.036, 0.0368, 0.037, 0.0384, 0.039, + 0.0394, 0.0393, 0.0392, 0.039, 0.0385, 0.038, 0.0373, 0.037, 0.0366, 0.037, 0.0371, 0.038, 0.0393, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L27_4_m90spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0543, 0.09, 0.0957, 0.12, 0.1617, 0.28, 0.3197, 0.35, 0.4152, 0.45, 0.4840, 0.53, 0.5600, 0.6, 0.6032, 0.603, 0.6029, 0.6, 0.5940, 0.595, 0.5722, 0.55, 0.5340, 0.5, 0.4601, 0.4, 0.3492, 0.3, 0.2374, 0.15, 0.1408, 0.1, + 0.0549, 0.0, -0.0262, -0.05, -0.0957, -0.1, -0.1353, -0.15, -0.1485, -0.13, -0.1237, -0.1, -0.0512, 0.0, 0.0139, 0.04, 0.0497, 0.05, 0.0646, 0.07, 0.0706, 0.071, 0.0773, 0.08, + 0.0870, 0.09, 0.0929, 0.092, 0.0920, 0.09, 0.0876, 0.08, 0.0798, 0.077, 0.0747, 0.076, 0.0781, 0.08, 0.0916, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L16_0_m44spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0128, 0.02, 0.0219, 0.03, 0.0364, 0.06, 0.0714, 0.08, 0.0924, 0.1, 0.1076, 0.11, 0.1244, 0.13, 0.1341, 0.1341, 0.1343, 0.133, 0.1325, 0.13, 0.1278, 0.125, 0.1200, 0.11, 0.1057, 0.1, 0.0845, 0.07, 0.0623, 0.05, 0.0419, 0.03, 0.0232, 0.01, + 0.0055, 0.0, -0.0099, -0.01, -0.0186, -0.02, -0.0216, -0.02, -0.0163, -0.01, -0.0009, 0.0, 0.0130, 0.02, 0.0207, 0.022, 0.0239, 0.024, 0.0252, 0.026, 0.0267, 0.027, + 0.0288, 0.03, 0.0301, 0.03, 0.0299, 0.029, 0.0290, 0.028, 0.0273, 0.027, 0.0261, 0.0265, 0.0269, 0.028, 0.0299, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L16_0_m44spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0128, 0.02, 0.0219, 0.03, 0.0384, 0.06, 0.0714, 0.08, 0.0924, 0.1, 0.1076, 0.11, 0.1244, 0.13, 0.1371, 0.1341, 0.1343, 0.133, 0.1325, 0.13, 0.1278, 0.125, 0.1200, 0.11, 0.1057, 0.1, 0.0845, 0.07, 0.0623, 0.05, 0.0419, 0.03, 0.0232, 0.01, + 0.0055, 0.0, -0.0099, -0.01, -0.0186, -0.02, -0.0216, -0.02, -0.0163, -0.01, -0.0009, 0.0, 0.0130, 0.02, 0.0207, 0.022, 0.0239, 0.024, 0.0252, 0.026, 0.0267, 0.027, + 0.0288, 0.03, 0.0301, 0.03, 0.0299, 0.029, 0.0290, 0.028, 0.0283, 0.027, 0.0261, 0.0265, 0.0269, 0.028, 0.0299, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L13_m3_m36spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0078, 0.01, 0.0136, 0.02, 0.0228, 0.03, 0.0448, 0.05, 0.0581, 0.06, 0.0677, 0.07, 0.0784, 0.08, 0.0847, 0.085, 0.0850, 0.085, 0.0841, 0.083, 0.0813, 0.08, 0.0767, 0.07, 0.0682, 0.06, 0.0556, 0.05, 0.0420, 0.03, 0.0293, 0.02, 0.0175, 0.01, + 0.0062, 0.0, -0.0036, -0.005, -0.0092, -0.01, -0.0112, -0.003, -0.0084, -0.0001, -0.0001, 0.0, 0.0075, 0.01, 0.0117, 0.012, 0.0135, 0.014, 0.0142, 0.015, 0.0151, 0.016, + 0.0164, 0.017, 0.0172, 0.0171, 0.0171, 0.017, 0.0165, 0.016, 0.0154, 0.015, 0.0147, 0.015, 0.0151, 0.016, 0.0170, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L13_m3_m36spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0078, 0.01, 0.0136, 0.03, 0.0228, 0.03, 0.0448, 0.05, 0.0581, 0.06, 0.0677, 0.07, 0.0794, 0.08, 0.0847, 0.089, 0.0850, 0.085, 0.0841, 0.083, 0.0813, 0.08, 0.0767, 0.07, 0.0682, 0.06, 0.0556, 0.05, 0.0420, 0.03, 0.0293, 0.02, 0.0175, 0.01, + 0.0062, 0.0, -0.0036, -0.005, -0.0092, -0.01, -0.0112, -0.003, -0.0084, -0.0001, -0.0001, 0.0, 0.0085, 0.01, 0.0117, 0.012, 0.0135, 0.014, 0.0142, 0.015, 0.0151, 0.016, + 0.0164, 0.017, 0.0172, 0.0171, 0.0171, 0.017, 0.0165, 0.016, 0.0154, 0.015, 0.0147, 0.015, 0.0151, 0.016, 0.0170, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L31_m23_m60spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0283, 0.04, 0.0551, 0.07, 0.0978, 0.12, 0.1970, 0.23, 0.2564, 0.28, 0.3006, 0.34, 0.3502, 0.37, 0.3806, 0.381, 0.3845, 0.383, 0.3832, 0.38, 0.3728, 0.36, 0.3536, 0.33, 0.3176, 0.3, 0.2634, 0.25, 0.2037, 0.17, 0.1453, 0.1, 0.0903, 0.05, + 0.0375, 0.0, -0.0080, -0.05, -0.0340, -0.04, -0.0443, -0.04, -0.0399, -0.03, -0.0206, -0.02, -0.0026, 0.0, 0.0076, 0.01, 0.0119, 0.012, 0.0137, 0.015, 0.0171, 0.02, 0.0228, 0.025, + 0.0265, 0.026, 0.0256, 0.023, 0.0226, 0.02, 0.0175, 0.016, 0.0142, 0.016, 0.0164, 0.02, 0.0248, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L31_m23_m60spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0283, 0.04, 0.0551, 0.08, 0.0978, 0.12, 0.1970, 0.23, 0.2564, 0.28, 0.3006, 0.34, 0.3802, 0.37, 0.3806, 0.381, 0.3845, 0.385, 0.3832, 0.38, 0.3728, 0.36, 0.3536, 0.33, 0.3176, 0.3, 0.2634, 0.25, 0.2037, 0.17, 0.1453, 0.1, 0.0903, 0.05, + 0.0375, 0.0, -0.0080, -0.05, -0.0340, -0.04, -0.0443, -0.04, -0.0399, -0.03, -0.0206, -0.02, -0.0026, 0.0, 0.0076, 0.01, 0.0119, 0.012, 0.0137, 0.015, 0.0171, 0.02, 0.0228, 0.025, + 0.0265, 0.026, 0.0256, 0.023, 0.0246, 0.02, 0.0175, 0.016, 0.0142, 0.016, 0.0164, 0.02, 0.0248, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L17_3_m40spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0127, 0.02, 0.0210, 0.03, 0.0341, 0.05, 0.0660, 0.07, 0.0852, 0.09, 0.0990, 0.11, 0.1142, 0.12, 0.1229, 0.1228, 0.1228, 0.121, 0.1209, 0.12, 0.1164, 0.11, 0.1092, 0.1, 0.0964, 0.08, 0.0777, 0.06, 0.0578, 0.04, 0.0396, 0.03, 0.0229, 0.02, + 0.0069, 0.0, -0.0069, -0.01, -0.0148, -0.015, -0.0173, -0.015, -0.0116, 0.0, 0.0046, 0.01, 0.0191, 0.02, 0.0270, 0.03, 0.0304, 0.031, 0.0317, 0.032, 0.0332, 0.034, + 0.0352, 0.036, 0.0364, 0.0363, 0.0362, 0.036, 0.0353, 0.034, 0.0338, 0.033, 0.0328, 0.033, 0.0335, 0.035, 0.0362, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L17_3_m40spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0127, 0.02, 0.0210, 0.03, 0.0361, 0.05, 0.0660, 0.07, 0.0852, 0.09, 0.0990, 0.11, 0.1142, 0.12, 0.1229, 0.1248, 0.1228, 0.121, 0.1209, 0.12, 0.1164, 0.11, 0.1092, 0.1, 0.0964, 0.08, 0.0777, 0.06, 0.0578, 0.04, 0.0396, 0.03, 0.0229, 0.02, + 0.0069, 0.0, -0.0069, -0.01, -0.0148, -0.015, -0.0173, -0.015, -0.0116, 0.0, 0.0046, 0.015, 0.0191, 0.02, 0.0270, 0.03, 0.0304, 0.031, 0.0317, 0.032, 0.0332, 0.034, + 0.0352, 0.036, 0.0364, 0.0363, 0.0362, 0.036, 0.0353, 0.034, 0.0338, 0.033, 0.0328, 0.033, 0.0335, 0.035, 0.0362, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L17_3_m40spect3[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0127, 0.02, 0.0210, 0.03, 0.0341, 0.05, 0.0660, 0.07, 0.0852, 0.09, 0.0990, 0.11, 0.1142, 0.12, 0.1229, 0.1228, 0.1228, 0.121, 0.1209, 0.12, 0.1164, 0.11, 0.1092, 0.1, 0.0964, 0.08, 0.0777, 0.06, 0.0578, 0.04, 0.0396, 0.03, 0.0229, 0.02, + 0.0069, 0.0, -0.0069, -0.01, -0.0148, -0.015, -0.0173, -0.015, -0.0116, 0.0, 0.0046, 0.01, 0.0191, 0.02, 0.0270, 0.03, 0.0304, 0.031, 0.0317, 0.032, 0.0332, 0.034, + 0.0352, 0.036, 0.0364, 0.0363, 0.0362, 0.036, 0.0353, 0.034, 0.0338, 0.033, 0.0328, 0.033, 0.0335, 0.035, 0.0362, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L17_3_m40spect4[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0127, 0.02, 0.0210, 0.03, 0.0361, 0.05, 0.0660, 0.07, 0.0852, 0.09, 0.0990, 0.11, 0.1142, 0.12, 0.1229, 0.1248, 0.1228, 0.121, 0.1209, 0.12, 0.1164, 0.11, 0.1092, 0.1, 0.0964, 0.08, 0.0777, 0.06, 0.0578, 0.04, 0.0396, 0.03, 0.0229, 0.02, + 0.0069, 0.0, -0.0069, -0.01, -0.0148, -0.015, -0.0173, -0.015, -0.0116, 0.0, 0.0046, 0.015, 0.0191, 0.02, 0.0270, 0.03, 0.0304, 0.031, 0.0317, 0.032, 0.0332, 0.034, + 0.0352, 0.036, 0.0364, 0.0363, 0.0362, 0.036, 0.0353, 0.034, 0.0338, 0.033, 0.0328, 0.033, 0.0335, 0.035, 0.0362, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L17_3_m40spect5[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0127, 0.02, 0.0210, 0.03, 0.0361, 0.05, 0.0660, 0.07, 0.0852, 0.09, 0.0990, 0.11, 0.1142, 0.12, 0.1229, 0.1248, 0.1228, 0.121, 0.1209, 0.12, 0.1164, 0.11, 0.1092, 0.1, 0.0964, 0.08, 0.0777, 0.06, 0.0578, 0.04, 0.0396, 0.03, 0.0229, 0.02, + 0.0069, 0.0, -0.0069, -0.01, -0.0148, -0.015, -0.0173, -0.015, -0.0116, 0.0, 0.0046, 0.015, 0.0191, 0.02, 0.0270, 0.03, 0.0304, 0.031, 0.0317, 0.032, 0.0332, 0.034, + 0.0352, 0.036, 0.0364, 0.0363, 0.0362, 0.036, 0.0353, 0.034, 0.0338, 0.033, 0.0328, 0.033, 0.0335, 0.035, 0.0362, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L17_3_m40spect6[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0127, 0.02, 0.0210, 0.03, 0.0361, 0.05, 0.0660, 0.07, 0.0852, 0.09, 0.0990, 0.11, 0.1142, 0.12, 0.1229, 0.1248, 0.1228, 0.121, 0.1209, 0.12, 0.1164, 0.11, 0.1092, 0.1, 0.0964, 0.08, 0.0777, 0.06, 0.0578, 0.04, 0.0396, 0.03, 0.0229, 0.02, + 0.0069, 0.0, -0.0069, -0.01, -0.0148, -0.015, -0.0173, -0.015, -0.0116, 0.0, 0.0046, 0.015, 0.0191, 0.02, 0.0270, 0.03, 0.0304, 0.031, 0.0317, 0.032, 0.0332, 0.034, + 0.0352, 0.036, 0.0364, 0.0363, 0.0362, 0.036, 0.0353, 0.034, 0.0338, 0.033, 0.0328, 0.033, 0.0335, 0.035, 0.0362, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L21_9_m7spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0096, 0.01, 0.0122, 0.014, 0.0162, 0.02, 0.0277, 0.03, 0.0346, 0.035, 0.0391, 0.04, 0.0440, 0.045, 0.0464, 0.046, 0.0458, 0.045, 0.0443, 0.043, 0.0419, 0.041, 0.0400, 0.04, 0.0391, 0.039, 0.0389, 0.037, 0.0369, 0.035, 0.0330, 0.03, 0.0288, 0.025, 0.0243, 0.022, + 0.0201, 0.02, 0.0178, 0.0176, 0.0175, 0.02, 0.0227, 0.03, 0.0360, 0.04, 0.0477, 0.05, 0.0541, 0.055, 0.0568, 0.057, 0.0580, 0.058, 0.0589, 0.059, 0.0598, 0.06, 0.0602, 0.0602, 0.0602, 0.06, 0.0599, 0.0599, + 0.0595, 0.0595, 0.0592, 0.0594, 0.0594, 0.06, 0.0605, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L78_4_m74spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.2087, 0.3, 0.3297, 0.4, 0.5205, 0.8, 0.9908, 1.1, 1.2731, 1.3, 1.4747, 1.6, 1.6992, 1.75, 1.8277, 1.82, 1.8300, 1.82, 1.8050, 1.75, 1.7397, 1.7, 1.6470, 1.6, 1.5025, 1.4, 1.2968, 1.1, 1.0577, 1.0, 0.8101, 0.8, 0.5740, 0.4, 0.3430, 0.25, + 0.1407, 0.05, 0.0264, 0.0, -0.0107, 0.0, 0.0733, 0.2, 0.3116, 0.4, 0.5251, 0.6, 0.6429, 0.65, 0.6923, 0.7, 0.7137, 0.72, 0.7360, 0.75, 0.7658, 0.77, 0.7831, 0.782, + 0.7804, 0.77, 0.7677, 0.75, 0.7455, 0.74, 0.7313, 0.74, 0.7406, 0.77, 0.7819, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L31_m58_m66spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0229, 0.04, 0.0549, 0.08, 0.1059, 0.15, 0.2207, 0.24, 0.2892, 0.3, 0.3414, 0.36, 0.4006, 0.42, 0.4386, 0.44, 0.4461, 0.445, 0.4480, 0.44, 0.4387, 0.442, 0.4182, 0.4, 0.3771, 0.35, 0.3139, 0.3, 0.2436, 0.2, 0.1736, 0.15, 0.1070, 0.07, + 0.0432, 0.0, -0.0114, -0.02, -0.0429, -0.05, -0.0567, -0.06, -0.0618, -0.063, -0.0637, -0.0637, -0.0639, -0.0635, -0.0635, -0.0634, -0.0632, -0.0632, -0.0632, 0.06, -0.0601, -0.06, -0.0539, -0.05, + -0.0497, 0.05, -0.0510, -0.054, -0.0546, -0.06, -0.0608, -0.062, -0.0649, -0.0622, -0.0622, -0.055, -0.0526, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L61_m11_m12spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0509, 0.06, 0.0770, 0.1, 0.1178, 0.2, 0.2177, 0.25, 0.2762, 0.3, 0.3194, 0.32, 0.3695, 0.37, 0.4016, 0.402, 0.4093, 0.41, 0.4106, 0.41, 0.4017, 0.4, 0.3957, 0.4, 0.4047, 0.41, 0.4237, 0.42, 0.4184, 0.4, 0.3820, 0.35, 0.3365, 0.3, 0.2881, 0.25, + 0.2436, 0.22, 0.2188, 0.21, 0.2086, 0.21, 0.2133, 0.22, 0.2323, 0.24, 0.2499, 0.25, 0.2605, 0.265, 0.2650, 0.266, 0.2679, 0.27, 0.2720, 0.275, 0.2783, 0.28, 0.2816, 0.281, + 0.2808, 0.28, 0.2779, 0.275, 0.2731, 0.271, 0.2702, 0.272, 0.2720, 0.28, 0.2811, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L61_m11_m12spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0509, 0.06, 0.0770, 0.1, 0.1578, 0.2, 0.2177, 0.25, 0.2762, 0.3, 0.3194, 0.32, 0.3695, 0.37, 0.4016, 0.402, 0.4093, 0.41, 0.4106, 0.41, 0.4017, 0.4, 0.3957, 0.4, 0.4047, 0.41, 0.4237, 0.42, 0.4184, 0.4, 0.3820, 0.35, 0.3365, 0.3, 0.2881, 0.25, + 0.2436, 0.22, 0.2188, 0.21, 0.2186, 0.21, 0.2133, 0.22, 0.2323, 0.24, 0.2499, 0.25, 0.2605, 0.265, 0.2650, 0.266, 0.2679, 0.27, 0.2720, 0.275, 0.2783, 0.28, 0.2816, 0.281, + 0.2808, 0.28, 0.2779, 0.275, 0.2831, 0.271, 0.2702, 0.272, 0.2720, 0.28, 0.2811, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L29_1_m13spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0147, 0.02, 0.0212, 0.03, 0.0313, 0.04, 0.0571, 0.06, 0.0724, 0.08, 0.0832, 0.09, 0.0955, 0.1, 0.1026, 0.102, 0.1031, 0.102, 0.1019, 0.1, 0.0985, 0.096, 0.0950, 0.094, 0.0930, 0.092, 0.0914, 0.09, 0.0855, 0.08, 0.0749, 0.07, 0.0634, 0.06, 0.0515, 0.05, + 0.0407, 0.04, 0.0346, 0.04, 0.0327, 0.033, 0.0377, 0.04, 0.0517, 0.06, 0.0642, 0.07, 0.0711, 0.072, 0.0740, 0.075, 0.0754, 0.076, 0.0768, 0.077, 0.0785, 0.079, 0.0794, 0.0793, + 0.0792, 0.079, 0.0786, 0.078, 0.0774, 0.077, 0.0767, 0.077, 0.0772, 0.078, 0.0795, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L29_1_m13spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0147, 0.02, 0.0212, 0.03, 0.0343, 0.04, 0.0571, 0.06, 0.0724, 0.08, 0.0832, 0.09, 0.0995, 0.1, 0.1026, 0.102, 0.1031, 0.102, 0.1019, 0.1, 0.0985, 0.096, 0.0950, 0.094, 0.0930, 0.092, 0.0914, 0.09, 0.0855, 0.08, 0.0749, 0.07, 0.0634, 0.06, 0.0515, 0.05, + 0.0407, 0.04, 0.0346, 0.04, 0.0327, 0.033, 0.0377, 0.04, 0.0517, 0.06, 0.0642, 0.07, 0.0711, 0.072, 0.0740, 0.075, 0.0754, 0.076, 0.0768, 0.077, 0.0785, 0.079, 0.0794, 0.0793, + 0.0792, 0.079, 0.0786, 0.078, 0.0794, 0.077, 0.0767, 0.077, 0.0772, 0.078, 0.0795, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L2_14_m1spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0020, 0.002, 0.0021, 0.0021, 0.0022, 0.003, 0.0030, 0.0033, 0.0036, 0.0035, 0.0038, 0.0038, 0.0039, 0.0038, 0.0036, 0.0035, 0.0030, 0.003, 0.0024, 0.002, 0.0017, 0.0015, 0.0011, 0.001, 0.0004, 0.0, -0.0004, -0.001, -0.0010, -0.0011, -0.0012, -0.0011, -0.0011, -0.0011, -0.0011, -0.001, + -0.0011, -0.0011, -0.0011, -0.001, -0.0008, 0.0, 0.0012, 0.004, 0.0061, 0.01, 0.0104, 0.011, 0.0127, 0.013, 0.0136, 0.014, 0.0140, 0.0142, 0.0142, 0.0143, 0.0144, 0.0144, + 0.0144, 0.0144, 0.0144, 0.0145, 0.0145, 0.0145, 0.0145, 0.0145, 0.0145, 0.0145, 0.0145, 0.0145, 0.0146, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L5_39_m7spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0070, 0.007, 0.0072, 0.0075, 0.0076, 0.01, 0.0108, 0.011, 0.0129, 0.013, 0.0136, 0.014, 0.0140, 0.0135, 0.0131, 0.012, 0.0112, 0.01, 0.0088, 0.008, 0.0066, 0.005, 0.0046, 0.003, 0.0021, 0.0, -0.0009, -0.002, -0.0032, -0.003, + -0.0039, -0.0039, -0.0039, -0.004, -0.0040, -0.004, -0.0041, -0.0041, -0.0041, -0.0035, -0.0032, 0.0, 0.0038, 0.03, 0.0205, 0.03, 0.0351, 0.04, 0.0429, 0.045, 0.0462, 0.047, + 0.0476, 0.048, 0.0483, 0.0485, 0.0487, 0.0488, 0.0489, 0.049, 0.0490, 0.049, 0.0490, 0.049, 0.0491, 0.0491, 0.0491, 0.0491, 0.0491, 0.0492, 0.0494, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L15_5_m13spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0064, 0.007, 0.0089, 0.01, 0.0129, 0.02, 0.0233, 0.025, 0.0295, 0.03, 0.0338, 0.035, 0.0386, 0.04, 0.0411, 0.041, 0.0409, 0.04, 0.0400, 0.039, 0.0383, 0.037, 0.0364, 0.035, 0.0345, 0.033, 0.0321, 0.03, 0.0285, 0.025, 0.0240, 0.02, 0.0194, 0.015, 0.0148, 0.012, + 0.0106, 0.01, 0.0083, 0.008, 0.0077, 0.01, 0.0107, 0.015, 0.0188, 0.02, 0.0260, 0.027, 0.0299, 0.03, 0.0316, 0.032, 0.0323, 0.033, 0.0330, 0.033, 0.0337, 0.034, 0.0341, 0.034, + 0.0340, 0.034, 0.0338, 0.033, 0.0333, 0.033, 0.0330, 0.033, 0.0332, 0.034, 0.0342, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L12_5_m6spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0039, 0.004, 0.0052, 0.006, 0.0072, 0.01, 0.0127, 0.013, 0.0159, 0.016, 0.0181, 0.02, 0.0205, 0.021, 0.0218, 0.0217, 0.0217, 0.0215, 0.0212, 0.021, 0.0202, 0.02, 0.0194, 0.019, 0.0190, 0.019, 0.0187, 0.018, 0.0177, 0.016, 0.0157, 0.014, + 0.0135, 0.012, 0.0112, 0.01, 0.0091, 0.008, 0.0079, 0.0077, 0.0077, 0.008, 0.0096, 0.01, 0.0145, 0.015, 0.0189, 0.02, 0.0213, 0.021, 0.0223, 0.0222, 0.0227, 0.023, + 0.0231, 0.0231, 0.0235, 0.0236, 0.0237, 0.0237, 0.0237, 0.0236, 0.0235, 0.0233, 0.0233, 0.0232, 0.0233, 0.0233, 0.0235, 0.0238, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L12_5_m6spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0039, 0.004, 0.0062, 0.006, 0.0072, 0.01, 0.0147, 0.013, 0.0159, 0.016, 0.0181, 0.02, 0.0205, 0.021, 0.0218, 0.0257, 0.0217, 0.0215, 0.0212, 0.021, 0.0202, 0.02, 0.0194, 0.019, 0.0190, 0.019, 0.0187, 0.018, 0.0177, 0.016, 0.0157, 0.014, + 0.0135, 0.012, 0.0112, 0.01, 0.0099, 0.008, 0.0079, 0.0087, 0.0077, 0.008, 0.0096, 0.01, 0.0145, 0.015, 0.0189, 0.02, 0.0213, 0.021, 0.0223, 0.0222, 0.0227, 0.023, + 0.0231, 0.0231, 0.0235, 0.0236, 0.0237, 0.0237, 0.0237, 0.0236, 0.0235, 0.0233, 0.0233, 0.0232, 0.0233, 0.0233, 0.0235, 0.0238, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L37_m59_m24spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0007, 0.01, 0.0162, 0.03, 0.0407, 0.06, 0.0911, 0.1, 0.1203, 0.13, 0.1448, 0.16, 0.1741, 0.18, 0.1965, 0.2, 0.2068, 0.21, 0.2149, 0.215, 0.2165, 0.216, 0.2159, 0.216, 0.2165, 0.2165, 0.2165, 0.21, 0.2046, 0.19, 0.1781, 0.16, 0.1472, 0.13, 0.1161, 0.1, + 0.0889, 0.08, 0.0732, 0.07, 0.0636, 0.05, 0.0426, 0.0, -0.0029, -0.02, -0.0419, -0.05, -0.0625, -0.07, -0.0711, -0.073, -0.0743, -0.074, -0.0744, -0.073, -0.0722, -0.071, + -0.0705, -0.071, -0.0715, -0.072, -0.0735, -0.075, -0.0766, -0.077, -0.0786, -0.078, -0.0773, -0.074, -0.0731, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L37_m59_m24spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0007, 0.01, 0.0162, 0.03, 0.0427, 0.06, 0.0911, 0.1, 0.1203, 0.13, 0.1548, 0.16, 0.1741, 0.18, 0.1965, 0.2, 0.2068, 0.24, 0.2149, 0.215, 0.2165, 0.216, 0.2159, 0.216, 0.2165, 0.2165, 0.2165, 0.21, 0.2046, 0.19, 0.1781, 0.16, 0.1472, 0.13, 0.1161, 0.1, + 0.0889, 0.08, 0.0732, 0.07, 0.0636, 0.05, 0.0426, 0.0, -0.0029, -0.02, -0.0429, -0.05, -0.0625, -0.07, -0.0711, -0.073, -0.0743, -0.074, -0.0744, -0.073, -0.0722, -0.071, + -0.0705, -0.071, -0.0715, -0.072, -0.0735, -0.075, -0.0766, -0.077, -0.0786, -0.078, -0.0773, -0.074, -0.0731, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L15_55_23spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0184, 0.017, 0.0169, 0.015, 0.0143, 0.015, 0.0153, 0.016, 0.0164, 0.015, 0.0147, 0.013, 0.0119, 0.01, 0.0070, 0.005, 0.0012, 0.0, -0.0052, -0.01, -0.0106, -0.012, -0.0143, -0.015, -0.0166, -0.016, -0.0177, -0.017, -0.0169, -0.015, + -0.0134, -0.01, -0.0085, -0.005, -0.0041, -0.0008, -0.0008, 0.0, 0.0014, 0.002, 0.0049, 0.02, 0.0244, 0.05, 0.0701, 0.1, 0.1100, 0.12, 0.1315, 0.14, 0.1405, 0.142, 0.1443, 0.145, + 0.1461, 0.1463, 0.1469, 0.1469, 0.1469, 0.148, 0.1474, 0.1476, 0.1478, 0.148, 0.1483, 0.1485, 0.1486, 0.1486, 0.1484, 0.1485, 0.1487, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L11_m55_m11spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0164, 0.017, 0.0170, 0.017, 0.0179, 0.02, 0.0254, 0.03, 0.0304, 0.0302, 0.0321, 0.031, 0.0331, 0.032, 0.0310, 0.03, 0.0264, 0.025, 0.0209, 0.02, 0.0156, 0.0120, 0.0108, 0.01, 0.0048, 0.0, -0.0025, -0.005, -0.0079, -0.008, -0.0098, -0.0098, -0.0098, -0.0098, -0.0099, -0.01, + -0.0103, -0.0102, -0.0102, -0.01, -0.0080, 0.0, 0.0084, 0.02, 0.0478, 0.06, 0.0823, 0.09, 0.1008, 0.105, 0.1086, 0.11, 0.1118, 0.112, 0.1135, 0.114, 0.1145, 0.1146, 0.1148, 0.115, + 0.1152, 0.1152, 0.1153, 0.1153, 0.1153, 0.1153, 0.1154, 0.1154, 0.1154, 0.116, 0.1162, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L8_m10_m2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0006, 0.001, 0.0013, 0.002, 0.0025, 0.004, 0.0050, 0.0055, 0.0064, 0.007, 0.0076, 0.008, 0.0090, 0.01, 0.0101, 0.0102, 0.0106, 0.011, 0.0111, 0.0111, 0.0111, 0.0112, 0.0113, 0.012, 0.0122, 0.013, 0.0135, 0.014, 0.0140, 0.014, + 0.0131, 0.012, 0.0118, 0.011, 0.0104, 0.01, 0.0091, 0.009, 0.0083, 0.008, 0.0079, 0.0075, 0.0070, 0.006, 0.0050, 0.004, 0.0033, 0.003, 0.0024, 0.0022, 0.0021, 0.002, 0.0019, 0.002, 0.0020, 0.002, 0.0021, 0.0022, 0.0022, 0.0021, + 0.0021, 0.002, 0.0020, 0.002, 0.0019, 0.0018, 0.0018, 0.0018, 0.0018, 0.0019, 0.0021, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L14_m10_m7spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0023, 0.003, 0.0042, 0.006, 0.0071, 0.01, 0.0139, 0.015, 0.0179, 0.02, 0.0209, 0.022, 0.0245, 0.026, 0.0270, 0.0275, 0.0278, 0.028, 0.0283, 0.028, 0.0280, 0.028, 0.0277, 0.028, 0.0282, 0.029, 0.0293, 0.029, 0.0286, 0.027, 0.0258, 0.024, 0.0224, 0.02, + 0.0188, 0.017, 0.0156, 0.014, 0.0137, 0.013, 0.0128, 0.0125, 0.0120, 0.011, 0.0107, 0.01, 0.0096, 0.0094, 0.0091, 0.009, 0.0089, 0.0089, 0.0089, 0.009, 0.0091, 0.0092, 0.0095, 0.0095, + 0.0097, 0.0096, 0.0096, 0.0095, 0.0094, 0.0093, 0.0090, 0.009, 0.0088, 0.0089, 0.0089, 0.009, 0.0095, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L20_m16_m13spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0039, 0.005, 0.0080, 0.01, 0.0144, 0.02, 0.0290, 0.03, 0.0375, 0.04, 0.0442, 0.05, 0.0519, 0.054, 0.0573, 0.058, 0.0591, 0.06, 0.0600, 0.06, 0.0594, 0.059, 0.0584, 0.058, 0.0579, 0.0578, 0.0575, 0.056, 0.0540, 0.05, 0.0471, 0.04, + 0.0393, 0.035, 0.0313, 0.03, 0.0242, 0.022, 0.0202, 0.02, 0.0182, 0.017, 0.0161, 0.014, 0.0125, 0.01, 0.0095, 0.009, 0.0081, 0.008, 0.0075, 0.0074, 0.0073, 0.0075, + 0.0076, 0.008, 0.0084, 0.0087, 0.0089, 0.0088, 0.0087, 0.0085, 0.0082, 0.008, 0.0074, 0.007, 0.0069, 0.007, 0.0073, 0.008, 0.0085, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L8_m10_m2spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0006, 0.001, 0.0013, 0.003, 0.0025, 0.004, 0.0050, 0.0055, 0.0064, 0.007, 0.0076, 0.009, 0.0090, 0.01, 0.0101, 0.0102, 0.0106, 0.012, 0.0111, 0.0111, 0.0121, 0.0122, 0.0113, 0.012, 0.0122, 0.013, 0.0135, 0.014, 0.0140, 0.014, + 0.0131, 0.012, 0.0128, 0.011, 0.0114, 0.01, 0.0091, 0.009, 0.0083, 0.008, 0.0079, 0.0075, 0.0070, 0.006, 0.0050, 0.004, 0.0033, 0.003, 0.0024, 0.0022, 0.0021, 0.002, 0.0019, 0.002, 0.0020, 0.002, 0.0021, 0.0022, 0.0022, 0.0021, + 0.0021, 0.002, 0.0020, 0.002, 0.0019, 0.0018, 0.0018, 0.0018, 0.0018, 0.0019, 0.0021, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L14_m10_m7spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0023, 0.003, 0.0042, 0.006, 0.0091, 0.01, 0.0149, 0.015, 0.0179, 0.02, 0.0209, 0.022, 0.0265, 0.026, 0.0270, 0.0275, 0.0278, 0.028, 0.0293, 0.028, 0.0280, 0.029, 0.0277, 0.028, 0.0282, 0.029, 0.0293, 0.029, 0.0286, 0.027, 0.0258, 0.024, 0.0224, 0.02, + 0.0198, 0.017, 0.0156, 0.014, 0.0137, 0.013, 0.0128, 0.0125, 0.0120, 0.011, 0.0107, 0.01, 0.0096, 0.0094, 0.0091, 0.009, 0.0089, 0.0089, 0.0089, 0.009, 0.0091, 0.0092, 0.0095, 0.0095, + 0.0097, 0.0096, 0.0096, 0.0095, 0.0094, 0.0093, 0.0090, 0.009, 0.0088, 0.0089, 0.0089, 0.009, 0.0095, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L20_m16_m13spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0039, 0.005, 0.0080, 0.01, 0.0144, 0.02, 0.0290, 0.03, 0.0375, 0.04, 0.0442, 0.05, 0.0519, 0.054, 0.0573, 0.06, 0.0591, 0.06, 0.0600, 0.06, 0.0654, 0.065, 0.0654, 0.065, 0.0659, 0.0578, 0.0575, 0.056, 0.0540, 0.05, 0.0471, 0.04, + 0.0393, 0.035, 0.0313, 0.03, 0.0242, 0.022, 0.0202, 0.02, 0.0182, 0.017, 0.0161, 0.014, 0.0125, 0.01, 0.0095, 0.009, 0.0081, 0.008, 0.0075, 0.0074, 0.0073, 0.0075, + 0.0076, 0.008, 0.0084, 0.0087, 0.0089, 0.0088, 0.0087, 0.0085, 0.0082, 0.008, 0.0074, 0.007, 0.0069, 0.007, 0.0073, 0.008, 0.0085, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L6_m9_1spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0002, 0.0005, 0.0007, 0.001, 0.0014, 0.002, 0.0030, 0.0035, 0.0039, 0.004, 0.0046, 0.005, 0.0056, 0.006, 0.0064, 0.0064, 0.0069, 0.007, 0.0073, 0.0073, 0.0074, 0.0076, 0.0077, 0.008, 0.0087, 0.009, 0.0101, 0.0102, 0.0108, 0.011, + 0.0103, 0.01, 0.0095, 0.009, 0.0085, 0.008, 0.0076, 0.0075, 0.0071, 0.007, 0.0068, 0.006, 0.0058, 0.004, 0.0037, 0.002, 0.0018, 0.001, 0.0008, 0.0006, 0.0004, 0.0004, + 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0004, 0.0004, 0.0004, 0.0004, 0.0003, 0.0003, 0.0003, 0.0002, 0.0002, 0.0001, 0.0001, 0.0002, 0.0002, 0.0003, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L20_m9_m10spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0050, 0.006, 0.0084, 0.01, 0.0139, 0.02, 0.0266, 0.03, 0.0342, 0.035, 0.0398, 0.04, 0.0464, 0.05, 0.0507, 0.052, 0.0518, 0.052, 0.0522, 0.052, 0.0513, 0.051, 0.0503, 0.0502, 0.0502, 0.0503, 0.0504, 0.05, 0.0480, 0.048, 0.0425, 0.04, 0.0361, 0.03, + 0.0296, 0.025, 0.0236, 0.022, 0.0203, 0.02, 0.0188, 0.0185, 0.0185, 0.0188, 0.0188, 0.019, 0.0191, 0.0195, 0.0195, 0.0195, 0.0196, 0.0197, 0.0198, 0.02, 0.0202, 0.0205, + 0.0209, 0.021, 0.0214, 0.0214, 0.0213, 0.021, 0.0209, 0.0205, 0.0202, 0.02, 0.0198, 0.02, 0.0201, 0.021, 0.0212, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L85_10_45spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1141, 0.12, 0.1230, 0.13, 0.1346, 0.16, 0.1906, 0.2, 0.2220, 0.23, 0.2391, 0.25, 0.2598, 0.26, 0.2687, 0.267, 0.2673, 0.26, 0.2587, 0.25, 0.2448, 0.25, 0.2597, 0.3, 0.3501, 0.4, 0.5052, 0.55, 0.6139, 0.63, 0.6472, 0.65, + 0.6535, 0.65, 0.6470, 0.64, 0.6334, 0.63, 0.6279, 0.63, 0.6307, 0.66, 0.6778, 0.7, 0.7914, 0.82, 0.8909, 0.9, 0.9462, 0.95, 0.9695, 0.97, 0.9817, 0.982, + 0.9893, 0.99, 0.9956, 0.996, 0.9969, 0.997, 0.9975, 0.997, 0.9969, 0.9965, 0.9962, 0.9963, 0.9963, 0.9962, 0.9962, 1.0, 1.0030, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L90_m7_82spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0733, 0.073, 0.0730, 0.07, 0.0698, 0.07, 0.0777, 0.0777, 0.0779, 0.078, 0.0780, 0.08, 0.0835, 0.09, 0.0925, 0.1, 0.1077, 0.11, 0.1187, 0.12, 0.1248, 0.15, 0.1700, 0.25, 0.3233, 0.4, 0.5715, 0.65, 0.7545, 0.8, 0.8254, 0.84, 0.8529, 0.86, 0.8634, 0.864, 0.8632, 0.864, + 0.8651, 0.864, 0.8637, 0.86, 0.8584, 0.85, 0.8439, 0.84, 0.8309, 0.83, 0.8259, 0.825, 0.8241, 0.824, 0.8265, 0.827, 0.8286, 0.83, 0.8306, 0.83, 0.8299, 0.829, + 0.8296, 0.8296, 0.8296, 0.83, 0.8301, 0.831, 0.8314, 0.831, 0.8305, 0.832, 0.8331, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L95_2_18spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1508, 0.16, 0.1879, 0.2, 0.2437, 0.3, 0.4029, 0.45, 0.4951, 0.52, 0.5582, 0.6, 0.6321, 0.65, 0.6760, 0.68, 0.6838, 0.68, 0.6784, 0.66, 0.6570, 0.66, 0.6625, 0.7, 0.7471, 0.8, 0.8962, 0.9, 0.9795, 0.97, 0.9654, 0.95, 0.9187, 0.9, + 0.8583, 0.8, 0.7967, 0.78, 0.7639, 0.76, 0.7546, 0.77, 0.7979, 0.85, 0.9113, 1.0, 1.0117, 1.04, 1.0684, 1.08, 1.0924, 1.1, 1.1055, 1.11, 1.1164, 1.12, 1.1286, 1.13, + 1.1336, 1.133, 1.1330, 1.13, 1.1293, 1.125, 1.1232, 1.122, 1.1200, 1.121, 1.1220, 1.13, 1.1380, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L39_7_4spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0233, 0.025, 0.0285, 0.03, 0.0364, 0.04, 0.0599, 0.065, 0.0737, 0.08, 0.0827, 0.09, 0.0929, 0.095, 0.0982, 0.098, 0.0978, 0.096, 0.0954, 0.094, 0.0910, 0.09, 0.0896, 0.093, 0.0965, 0.1, 0.1100, 0.112, 0.1163, 0.113, 0.1124, 0.11, 0.1055, 0.1, 0.0970, 0.09, + 0.0885, 0.086, 0.0840, 0.084, 0.0834, 0.09, 0.0936, 0.1, 0.1194, 0.13, 0.1421, 0.15, 0.1547, 0.157, 0.1600, 0.162, 0.1625, 0.163, 0.1644, 0.165, 0.1663, 0.167, 0.1671, 0.1671, + 0.1671, 0.167, 0.1666, 0.166, 0.1658, 0.1656, 0.1653, 0.1655, 0.1656, 0.167, 0.1679, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L39_4_1spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0226, 0.025, 0.0290, 0.03, 0.0386, 0.05, 0.0656, 0.07, 0.0815, 0.09, 0.0923, 0.1, 0.1046, 0.11, 0.1114, 0.1113, 0.1116, 0.11, 0.1098, 0.108, 0.1056, 0.104, 0.1038, 0.108, 0.1097, 0.11, 0.1214, 0.123, 0.1256, 0.12, 0.1193, 0.115, + 0.1100, 0.1, 0.0992, 0.09, 0.0888, 0.085, 0.0831, 0.082, 0.0817, 0.085, 0.0903, 0.1, 0.1126, 0.12, 0.1324, 0.135, 0.1434, 0.145, 0.1480, 0.15, 0.1503, 0.152, 0.1521, 0.153, + 0.1541, 0.155, 0.1550, 0.155, 0.1549, 0.1545, 0.1543, 0.154, 0.1533, 0.153, 0.1527, 0.153, 0.1531, 0.154, 0.1557, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L39_3_m1spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0221, 0.025, 0.0288, 0.03, 0.0392, 0.05, 0.0673, 0.07, 0.0839, 0.09, 0.0953, 0.1, 0.1083, 0.11, 0.1158, 0.116, 0.1163, 0.115, 0.1147, 0.112, 0.1105, 0.11, 0.1087, 0.11, 0.1140, 0.12, 0.1248, 0.125, 0.1279, 0.125, 0.1207, 0.115, 0.1104, 0.1, 0.0988, 0.09, 0.0876, 0.085, 0.0816, 0.08, 0.0799, 0.08, + 0.0877, 0.09, 0.1083, 0.11, 0.1265, 0.13, 0.1367, 0.14, 0.1410, 0.142, 0.1431, 0.144, 0.1449, 0.146, 0.1470, 0.1474, 0.1479, 0.1478, 0.1478, 0.1475, 0.1472, 0.147, 0.1460, 0.146, 0.1454, 0.1456, 0.1458, 0.147, 0.1485, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_3_m2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0242, 0.03, 0.0316, 0.035, 0.0430, 0.06, 0.0740, 0.08, 0.0923, 0.1, 0.1049, 0.11, 0.1192, 0.12, 0.1272, 0.1275, 0.1275, 0.126, 0.1256, 0.124, 0.1208, 0.12, 0.1184, 0.12, 0.1232, 0.13, 0.1333, 0.134, 0.1355, 0.13, 0.1272, 0.12, + 0.1157, 0.11, 0.1029, 0.1, 0.0906, 0.09, 0.0840, 0.083, 0.0822, 0.09, 0.0913, 0.1, 0.1150, 0.12, 0.1360, 0.14, 0.1477, 0.15, 0.1526, 0.154, 0.1550, 0.156, 0.1570, 0.158, + 0.1593, 0.16, 0.1603, 0.1602, 0.1602, 0.16, 0.1595, 0.1594, 0.1582, 0.158, 0.1575, 0.158, 0.1580, 0.159, 0.1609, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L36_2_2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0173, 0.02, 0.0222, 0.025, 0.0296, 0.04, 0.0501, 0.055, 0.0621, 0.07, 0.0704, 0.075, 0.0798, 0.08, 0.0852, 0.085, 0.0856, 0.085, 0.0845, 0.083, 0.0815, 0.081, 0.0806, 0.084, 0.0864, 0.09, 0.0975, 0.1, 0.1021, 0.1, 0.0979, 0.095, + 0.0909, 0.09, 0.0827, 0.08, 0.0747, 0.073, 0.0703, 0.07, 0.0692, 0.07, 0.0752, 0.08, 0.0908, 0.1, 0.1046, 0.11, 0.1124, 0.113, 0.1156, 0.116, 0.1173, 0.118, 0.1187, 0.123, + 0.1202, 0.1205, 0.1209, 0.1208, 0.1208, 0.1205, 0.1203, 0.12, 0.1195, 0.1194, 0.1191, 0.1193, 0.1194, 0.12, 0.1213, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L39_7_4spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0233, 0.028, 0.0285, 0.03, 0.0364, 0.04, 0.0599, 0.065, 0.0737, 0.08, 0.0927, 0.09, 0.0929, 0.095, 0.0982, 0.098, 0.0978, 0.096, 0.0954, 0.094, 0.0910, 0.09, 0.0896, 0.093, 0.0965, 0.1, 0.1100, 0.112, 0.1163, 0.113, 0.1124, 0.11, 0.1055, 0.1, 0.0970, 0.09, + 0.0885, 0.086, 0.0840, 0.084, 0.0834, 0.09, 0.0936, 0.1, 0.1294, 0.15, 0.1521, 0.17, 0.1647, 0.167, 0.1600, 0.162, 0.1625, 0.163, 0.1644, 0.165, 0.1663, 0.167, 0.1671, 0.1671, + 0.1671, 0.167, 0.1666, 0.166, 0.1658, 0.1656, 0.1653, 0.1655, 0.1656, 0.167, 0.1679, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L39_4_1spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0226, 0.025, 0.0290, 0.035, 0.0386, 0.05, 0.0656, 0.07, 0.0855, 0.09, 0.0923, 0.105, 0.1046, 0.11, 0.1114, 0.1113, 0.1216, 0.13, 0.1298, 0.118, 0.1056, 0.104, 0.1038, 0.108, 0.1097, 0.11, 0.1214, 0.123, 0.1256, 0.12, 0.1193, 0.115, + 0.1100, 0.1, 0.0992, 0.09, 0.0888, 0.085, 0.0831, 0.082, 0.0817, 0.085, 0.0903, 0.1, 0.1126, 0.12, 0.1324, 0.135, 0.1434, 0.145, 0.1480, 0.15, 0.1503, 0.152, 0.1521, 0.153, + 0.1541, 0.155, 0.1550, 0.155, 0.1549, 0.1545, 0.1543, 0.154, 0.1533, 0.153, 0.1527, 0.153, 0.1531, 0.154, 0.1557, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L39_3_m1spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0221, 0.025, 0.0288, 0.03, 0.0392, 0.05, 0.0693, 0.07, 0.0839, 0.09, 0.0953, 0.1, 0.1083, 0.11, 0.1258, 0.126, 0.1263, 0.125, 0.1247, 0.122, 0.1205, 0.11, 0.1087, 0.11, 0.1140, 0.12, 0.1248, 0.125, 0.1279, 0.125, 0.1207, 0.115, 0.1104, 0.1, 0.0988, 0.09, 0.0876, 0.085, 0.0816, 0.08, 0.0799, 0.08, + 0.0877, 0.09, 0.1083, 0.11, 0.1265, 0.13, 0.1367, 0.14, 0.1410, 0.142, 0.1431, 0.144, 0.1449, 0.146, 0.1470, 0.1474, 0.1479, 0.1478, 0.1478, 0.1475, 0.1472, 0.147, 0.1460, 0.146, 0.1454, 0.1456, 0.1458, 0.147, 0.1485, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_3_m2spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0242, 0.03, 0.0316, 0.035, 0.0430, 0.06, 0.080, 0.088, 0.0923, 0.1, 0.1049, 0.11, 0.1192, 0.12, 0.1372, 0.1375, 0.1375, 0.136, 0.1356, 0.134, 0.1308, 0.13, 0.1284, 0.12, 0.1232, 0.13, 0.1333, 0.134, 0.1355, 0.13, 0.1272, 0.12, + 0.1157, 0.11, 0.1029, 0.1, 0.0906, 0.09, 0.0840, 0.083, 0.0822, 0.09, 0.0913, 0.1, 0.1150, 0.12, 0.1360, 0.14, 0.1477, 0.15, 0.1526, 0.154, 0.1550, 0.156, 0.1570, 0.158, + 0.1593, 0.16, 0.1603, 0.1602, 0.1602, 0.16, 0.1595, 0.1594, 0.1582, 0.158, 0.1575, 0.158, 0.1580, 0.159, 0.1609, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L36_2_2spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0173, 0.02, 0.0222, 0.025, 0.0296, 0.05, 0.0501, 0.055, 0.0621, 0.07, 0.0704, 0.075, 0.0798, 0.08, 0.0852, 0.085, 0.0856, 0.095, 0.0945, 0.083, 0.0815, 0.081, 0.0806, 0.084, 0.0864, 0.09, 0.0975, 0.1, 0.1021, 0.1, 0.0979, 0.095, + 0.0909, 0.09, 0.0827, 0.08, 0.0747, 0.073, 0.0703, 0.07, 0.0692, 0.07, 0.0752, 0.08, 0.0908, 0.11, 0.1146, 0.12, 0.1224, 0.123, 0.1256, 0.126, 0.1273, 0.128, 0.1287, 0.123, + 0.1202, 0.1205, 0.1209, 0.1208, 0.1208, 0.1205, 0.1203, 0.12, 0.1195, 0.1194, 0.1191, 0.1193, 0.1194, 0.12, 0.1213, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_4_m2spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0248, 0.03, 0.0323, 0.04, 0.0437, 0.06, 0.0752, 0.08, 0.0937, 0.1, 0.1064, 0.11, 0.1208, 0.124, 0.1289, 0.129, 0.1292, 0.128, 0.1271, 0.125, 0.1222, 0.12, 0.1197, 0.12, 0.1246, 0.13, 0.1350, 0.136, 0.1373, 0.13, 0.1289, 0.12, 0.1174, 0.11, + 0.1045, 0.1, 0.0921, 0.09, 0.0854, 0.084, 0.0837, 0.09, 0.0931, 0.1, 0.1177, 0.12, 0.1396, 0.14, 0.1517, 0.153, 0.1568, 0.158, 0.1593, 0.16, 0.1613, 0.162, 0.1636, 0.164, + 0.1647, 0.1646, 0.1646, 0.164, 0.1639, 0.163, 0.1626, 0.162, 0.1619, 0.162, 0.1624, 0.164, 0.1654, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L41_1_m6spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0259, 0.03, 0.0352, 0.04, 0.0494, 0.07, 0.0872, 0.1, 0.1094, 0.11, 0.1250, 0.13, 0.1427, 0.15, 0.1530, 0.153, 0.1539, 0.153, 0.1522, 0.15, 0.1470, 0.145, 0.1436, 0.145, 0.1469, 0.15, 0.1549, 0.155, 0.1541, 0.15, 0.1421, 0.13, 0.1269, 0.12, + 0.1105, 0.1, 0.0951, 0.09, 0.0866, 0.085, 0.0840, 0.09, 0.0926, 0.1, 0.1159, 0.12, 0.1366, 0.14, 0.1482, 0.15, 0.1531, 0.154, 0.1555, 0.156, 0.1577, 0.16, 0.1603, 0.161, + 0.1616, 0.1615, 0.1614, 0.161, 0.1605, 0.16, 0.1588, 0.158, 0.1579, 0.158, 0.1585, 0.16, 0.1620, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_4_m2spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0248, 0.03, 0.0323, 0.04, 0.0437, 0.06, 0.0752, 0.08, 0.0937, 0.1, 0.1064, 0.11, 0.1208, 0.134, 0.1389, 0.139, 0.1292, 0.128, 0.1271, 0.125, 0.1222, 0.12, 0.1197, 0.12, 0.1246, 0.13, 0.1350, 0.136, 0.1373, 0.13, 0.1289, 0.12, 0.1174, 0.11, + 0.1145, 0.12, 0.0921, 0.09, 0.0854, 0.084, 0.0837, 0.09, 0.0931, 0.1, 0.1177, 0.12, 0.1396, 0.14, 0.1517, 0.153, 0.1568, 0.158, 0.1593, 0.16, 0.1613, 0.162, 0.1636, 0.164, + 0.1647, 0.1646, 0.1646, 0.164, 0.1639, 0.163, 0.1626, 0.162, 0.1619, 0.162, 0.1624, 0.164, 0.1654, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L41_1_m6spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0259, 0.03, 0.0352, 0.04, 0.0494, 0.07, 0.0872, 0.1, 0.1194, 0.12, 0.1350, 0.14, 0.1527, 0.15, 0.1530, 0.153, 0.1539, 0.153, 0.1522, 0.15, 0.1470, 0.145, 0.1436, 0.145, 0.1469, 0.15, 0.1549, 0.155, 0.1541, 0.15, 0.1421, 0.13, 0.1269, 0.12, + 0.1105, 0.1, 0.0951, 0.09, 0.0866, 0.085, 0.0840, 0.09, 0.0926, 0.1, 0.1259, 0.13, 0.1366, 0.14, 0.1482, 0.15, 0.1531, 0.154, 0.1555, 0.156, 0.1577, 0.16, 0.1603, 0.161, + 0.1616, 0.1615, 0.1614, 0.161, 0.1605, 0.16, 0.1588, 0.158, 0.1579, 0.158, 0.1585, 0.16, 0.1620, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L41_12_14spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0272, 0.03, 0.0306, 0.033, 0.0354, 0.04, 0.0536, 0.06, 0.0644, 0.07, 0.0705, 0.074, 0.0774, 0.078, 0.0799, 0.079, 0.0780, 0.075, 0.0744, 0.07, 0.0694, 0.069, 0.0688, 0.07, 0.0795, 0.09, 0.0995, 0.1, 0.1121, 0.113, 0.1134, 0.112, + 0.1112, 0.11, 0.1069, 0.105, 0.1018, 0.1, 0.0993, 0.1, 0.1001, 0.11, 0.1147, 0.13, 0.1503, 0.16, 0.1815, 0.19, 0.1986, 0.2, 0.2058, 0.206, 0.2093, 0.21, 0.2114, 0.212, + 0.2132, 0.2134, 0.2137, 0.2139, 0.2139, 0.2138, 0.2137, 0.2134, 0.2133, 0.2132, 0.2131, 0.2132, 0.2132, 0.214, 0.2152, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L41_12_14spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0272, 0.03, 0.0306, 0.035, 0.0354, 0.04, 0.0536, 0.06, 0.0644, 0.07, 0.0705, 0.074, 0.0774, 0.078, 0.0799, 0.079, 0.0780, 0.075, 0.0744, 0.07, 0.0694, 0.069, 0.0688, 0.07, 0.0795, 0.09, 0.0995, 0.1, 0.1121, 0.113, 0.1134, 0.112, + 0.1112, 0.11, 0.1069, 0.105, 0.1018, 0.1, 0.0993, 0.11, 0.1101, 0.12, 0.1147, 0.13, 0.1503, 0.16, 0.1815, 0.19, 0.1986, 0.2, 0.2058, 0.206, 0.2093, 0.21, 0.2114, 0.212, + 0.2132, 0.2134, 0.2137, 0.2239, 0.2139, 0.2158, 0.2237, 0.2234, 0.2133, 0.2132, 0.2131, 0.2132, 0.2132, 0.214, 0.2152, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L10_0_m22spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0048, 0.006, 0.0077, 0.009, 0.0124, 0.015, 0.0238, 0.025, 0.0306, 0.033, 0.0356, 0.04, 0.0410, 0.042, 0.0442, 0.0443, 0.0443, 0.044, 0.0438, 0.043, 0.0422, 0.041, 0.0400, 0.038, 0.0363, 0.035, 0.0310, 0.03, 0.0250, 0.02, 0.0188, 0.015, 0.0130, 0.01, + 0.0073, 0.005, 0.0024, 0.0, -0.0004, -0.0005, -0.0014, 0.0, 0.0004, 0.001, 0.0057, 0.01, 0.0104, 0.012, 0.0130, 0.013, 0.0141, 0.0144, 0.0146, 0.015, 0.0151, 0.0155, + 0.0158, 0.016, 0.0162, 0.0162, 0.0161, 0.016, 0.0158, 0.0155, 0.0153, 0.015, 0.0149, 0.015, 0.0152, 0.016, 0.0162, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L38_60_8spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0621, 0.0625, 0.0627, 0.0627, 0.0627, 0.07, 0.0842, 0.09, 0.0982, 0.1, 0.1014, 0.102, 0.1024, 0.1, 0.0937, 0.08, 0.0780, 0.07, 0.0591, 0.05, 0.0416, 0.03, 0.0288, 0.025, 0.0210, 0.02, 0.0170, 0.016, 0.0150, 0.016, 0.0173, 0.02, 0.0226, 0.025, + 0.0263, 0.027, 0.0279, 0.029, 0.0298, 0.03, 0.0382, 0.07, 0.0962, 0.12, 0.2343, 0.3, 0.3551, 0.4, 0.4203, 0.43, 0.4476, 0.45, 0.4592, 0.46, 0.4651, 0.466, 0.4686, 0.469, + 0.4694, 0.48, 0.4706, 0.471, 0.4711, 0.4712, 0.4717, 0.472, 0.4721, 0.472, 0.4719, 0.473, 0.4745, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L49_85_39spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1217, 0.12, 0.1146, 0.11, 0.1016, 0.11, 0.1161, 0.12, 0.1275, 0.123, 0.1207, 0.11, 0.1072, 0.09, 0.0793, 0.06, 0.0447, 0.05, 0.0051, 0.0, -0.0289, -0.03, -0.0507, -0.055, -0.0582, -0.055, -0.0533, -0.05, -0.0417, -0.02, -0.0198, 0.0, 0.0081, 0.02, 0.0321, 0.04, + 0.0494, 0.05, 0.0614, 0.07, 0.0824, 0.1, 0.2039, 0.35, 0.4906, 0.6, 0.7408, 0.84, 0.8758, 0.9, 0.9322, 0.94, 0.9562, 0.96, 0.9675, 0.97, 0.9731, 0.974, 0.9738, 0.975, + 0.9766, 0.977, 0.9786, 0.98, 0.9814, 0.983, 0.9833, 0.983, 0.9822, 0.984, 0.9851, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L42_1_m18spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0312, 0.04, 0.0454, 0.06, 0.0676, 0.1, 0.1240, 0.14, 0.1575, 0.17, 0.1813, 0.19, 0.2081, 0.21, 0.2238, 0.223, 0.2249, 0.223, 0.2224, 0.22, 0.2149, 0.21, 0.2071, 0.205, 0.2014, 0.2, 0.1956, 0.19, 0.1811, 0.17, 0.1572, 0.14, 0.1316, 0.12, 0.1053, 0.1, + 0.0815, 0.07, 0.0682, 0.065, 0.0639, 0.07, 0.0744, 0.09, 0.1040, 0.11, 0.1304, 0.135, 0.1451, 0.15, 0.1513, 0.153, 0.1542, 0.155, 0.1571, 0.16, 0.1608, 0.161, 0.1628, 0.1625, + 0.1625, 0.162, 0.1610, 0.16, 0.1585, 0.157, 0.1569, 0.157, 0.1579, 0.16, 0.1630, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L48_19_m25spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0617, 0.07, 0.0822, 0.1, 0.1139, 0.15, 0.2009, 0.22, 0.2533, 0.27, 0.2882, 0.3, 0.3264, 0.33, 0.3452, 0.342, 0.3406, 0.335, 0.3301, 0.32, 0.3131, 0.3, 0.2953, 0.28, 0.2766, 0.26, 0.2542, 0.24, 0.2234, 0.2, 0.1866, 0.17, 0.1506, 0.13, 0.1139, 0.1, 0.0806, 0.07, + 0.0623, 0.06, 0.0591, 0.08, 0.0942, 0.14, 0.1841, 0.21, 0.2635, 0.28, 0.3069, 0.31, 0.3251, 0.33, 0.3331, 0.335, 0.3391, 0.34, 0.3455, 0.346, 0.3487, 0.3467, 0.3486, 0.347, + 0.3467, 0.345, 0.3432, 0.342, 0.3411, 0.342, 0.3425, 0.35, 0.3505, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L30_21_m25spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0291, 0.03, 0.0386, 0.04, 0.0533, 0.08, 0.0940, 0.1, 0.1187, 0.12, 0.1349, 0.14, 0.1524, 0.16, 0.1605, 0.16, 0.1574, 0.155, 0.1515, 0.15, 0.1428, 0.14, 0.1330, 0.13, 0.1204, 0.11, 0.1039, 0.09, 0.0852, 0.07, 0.0667, 0.05, + 0.0496, 0.04, 0.0326, 0.02, 0.0173, 0.01, 0.0089, 0.008, 0.0078, 0.005, 0.0265, 0.005, 0.0738, 0.1, 0.1155, 0.12, 0.1383, 0.14, 0.1478, 0.15, 0.1519, 0.154, 0.1548, 0.156, + 0.1579, 0.158, 0.1594, 0.1594, 0.1594, 0.159, 0.1585, 0.1575, 0.1570, 0.156, 0.1559, 0.156, 0.1566, 0.159, 0.1603, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L15_10_m15spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0079, 0.01, 0.0107, 0.012, 0.0149, 0.02, 0.0264, 0.03, 0.0334, 0.035, 0.0381, 0.04, 0.0431, 0.044, 0.0456, 0.045, 0.0449, 0.044, 0.0435, 0.042, 0.0412, 0.04, 0.0386, 0.036, 0.0355, 0.033, 0.0316, 0.03, 0.0268, 0.025, 0.0216, 0.02, 0.0167, 0.015, + 0.0118, 0.01, 0.0073, 0.006, 0.0049, 0.004, 0.0045, 0.008, 0.0092, 0.001, 0.0212, 0.003, 0.0318, 0.0033, 0.0376, 0.04, 0.0401, 0.042, 0.0411, 0.0411, 0.0419, 0.042, + 0.0428, 0.043, 0.0432, 0.0432, 0.0432, 0.043, 0.0429, 0.0426, 0.0425, 0.0423, 0.0422, 0.0423, 0.0424, 0.043, 0.0434, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L48_19_m25spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0617, 0.07, 0.0822, 0.1, 0.1339, 0.25, 0.2009, 0.22, 0.2533, 0.29, 0.2882, 0.333, 0.3264, 0.38, 0.3452, 0.362, 0.3406, 0.335, 0.3301, 0.32, 0.3131, 0.3, 0.2953, 0.28, 0.2766, 0.26, 0.2542, 0.24, 0.2234, 0.2, 0.1866, 0.17, 0.1506, 0.13, 0.1139, 0.1, 0.0806, 0.07, + 0.0623, 0.06, 0.0591, 0.08, 0.0942, 0.14, 0.1841, 0.21, 0.2635, 0.28, 0.3069, 0.31, 0.3251, 0.33, 0.3331, 0.335, 0.3391, 0.34, 0.3455, 0.346, 0.3487, 0.3467, 0.3486, 0.347, + 0.3467, 0.345, 0.3432, 0.342, 0.3411, 0.342, 0.3425, 0.35, 0.3505, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L30_21_m25spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0291, 0.03, 0.0386, 0.04, 0.0533, 0.08, 0.0940, 0.1, 0.1187, 0.12, 0.1349, 0.15, 0.1624, 0.18, 0.1805, 0.18, 0.1774, 0.165, 0.1715, 0.15, 0.1428, 0.14, 0.1330, 0.13, 0.1204, 0.11, 0.1039, 0.09, 0.0852, 0.07, 0.0667, 0.05, + 0.0496, 0.04, 0.0326, 0.02, 0.0173, 0.01, 0.0089, 0.008, 0.0078, 0.005, 0.0265, 0.005, 0.0738, 0.1, 0.1155, 0.12, 0.1383, 0.14, 0.1478, 0.15, 0.1519, 0.154, 0.1548, 0.156, + 0.1579, 0.158, 0.1594, 0.1594, 0.1594, 0.159, 0.1585, 0.1575, 0.1570, 0.156, 0.1559, 0.156, 0.1566, 0.159, 0.1603, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L15_10_m15spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0079, 0.01, 0.0107, 0.012, 0.0149, 0.02, 0.0364, 0.04, 0.0434, 0.045, 0.0481, 0.04, 0.0431, 0.044, 0.0456, 0.045, 0.0449, 0.044, 0.0435, 0.042, 0.0412, 0.04, 0.0386, 0.036, 0.0355, 0.033, 0.0316, 0.03, 0.0268, 0.025, 0.0216, 0.02, 0.0167, 0.015, + 0.0118, 0.01, 0.0073, 0.006, 0.0049, 0.004, 0.0045, 0.008, 0.0092, 0.001, 0.0212, 0.003, 0.0318, 0.0033, 0.0376, 0.04, 0.0401, 0.042, 0.0411, 0.0411, 0.0419, 0.042, + 0.0528, 0.053, 0.0532, 0.0532, 0.0532, 0.043, 0.0429, 0.0426, 0.0425, 0.0423, 0.0422, 0.0423, 0.0424, 0.043, 0.0434, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L60_26_m25spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1040, 0.12, 0.1343, 0.15, 0.1812, 0.25, 0.3138, 0.35, 0.3938, 0.42, 0.4460, 0.48, 0.5027, 0.51, 0.5290, 0.52, 0.5196, 0.51, 0.5009, 0.49, 0.4726, 0.46, 0.4448, 0.43, 0.4186, 0.4, 0.3893, 0.36, 0.3469, 0.3, 0.2943, 0.28, 0.2426, 0.2, 0.1892, 0.16, 0.1403, 0.13, + 0.1136, 0.112, 0.1104, 0.15, 0.1729, 0.2, 0.3309, 0.4, 0.4702, 0.5, 0.5463, 0.56, 0.5782, 0.58, 0.5922, 0.6, 0.6022, 0.61, 0.6123, 0.615, 0.6171, 0.616, 0.6173, 0.616, + 0.6145, 0.61, 0.6095, 0.62, 0.6064, 0.607, 0.6085, 0.61, 0.6208, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_26_m45spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0615, 0.07, 0.0862, 0.1, 0.1249, 0.2, 0.2272, 0.25, 0.2893, 0.3, 0.3312, 0.35, 0.3766, 0.38, 0.3991, 0.395, 0.3933, 0.39, 0.3810, 0.37, 0.3613, 0.35, 0.3361, 0.3, 0.2979, 0.26, 0.2449, 0.2, 0.1884, 0.15, 0.1364, 0.1, 0.0895, 0.06, 0.0437, 0.04, + 0.0034, 0.0, -0.0191, -0.002, -0.0235, 0.0, 0.0145, 0.1, 0.1129, 0.15, 0.2000, 0.22, 0.2475, 0.25, 0.2673, 0.27, 0.2757, 0.28, 0.2822, 0.285, 0.2894, 0.29, + 0.2933, 0.293, 0.2932, 0.292, 0.2908, 0.29, 0.2865, 0.286, 0.2837, 0.285, 0.2855, 0.29, 0.2947, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_26_m45spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0615, 0.07, 0.0862, 0.1, 0.1249, 0.2, 0.2272, 0.25, 0.2893, 0.3, 0.3312, 0.35, 0.3766, 0.38, 0.3991, 0.395, 0.3933, 0.39, 0.3810, 0.37, 0.3613, 0.35, 0.3361, 0.3, 0.2979, 0.26, 0.2449, 0.2, 0.1884, 0.15, 0.1364, 0.1, 0.0895, 0.06, 0.0437, 0.04, + 0.0034, 0.0, -0.0191, -0.002, -0.0235, 0.0, 0.0145, 0.1, 0.1129, 0.15, 0.2000, 0.22, 0.2475, 0.25, 0.2673, 0.27, 0.2757, 0.28, 0.2822, 0.285, 0.2894, 0.29, + 0.2933, 0.293, 0.2932, 0.292, 0.2908, 0.29, 0.2865, 0.286, 0.2837, 0.285, 0.2855, 0.29, 0.2947, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L20_10_m45spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0196, 0.02, 0.0309, 0.04, 0.0487, 0.08, 0.0931, 0.1, 0.1199, 0.12, 0.1388, 0.14, 0.1595, 0.16, 0.1708, 0.17, 0.1699, 0.167, 0.1665, 0.16, 0.1595, 0.15, 0.1489, 0.14, 0.1303, 0.12, 0.1032, 0.09, 0.0751, 0.06, 0.0499, 0.03, 0.0273, 0.04, + 0.0056, 0.0, -0.0131, -0.02, -0.0237, -0.025, -0.0268, -0.02, -0.0165, 0.01, 0.0117, 0.02, 0.0369, 0.04, 0.0507, 0.051, 0.0564, 0.057, 0.0588, 0.06, 0.0610, 0.062, + 0.0639, 0.064, 0.0656, 0.0655, 0.0654, 0.065, 0.0642, 0.063, 0.0622, 0.061, 0.0608, 0.061, 0.0617, 0.064, 0.0656, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L20_10_m45spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0196, 0.02, 0.0309, 0.04, 0.0487, 0.08, 0.0931, 0.1, 0.1299, 0.14, 0.1588, 0.16, 0.1795, 0.18, 0.1908, 0.18, 0.1799, 0.187, 0.1665, 0.16, 0.1595, 0.15, 0.1489, 0.14, 0.1303, 0.12, 0.1032, 0.09, 0.0751, 0.06, 0.0499, 0.03, 0.0273, 0.04, + 0.0056, 0.0, 0., 0., 0., 0., 0., 0., 0., 0.01, 0.0117, 0.02, 0.0369, 0.04, 0.0507, 0.051, 0.0564, 0.057, 0.0588, 0.06, 0.0610, 0.062, + 0.0639, 0.064, 0.0656, 0.0655, 0.0654, 0.065, 0.0642, 0.063, 0.0622, 0.061, 0.0608, 0.061, 0.0617, 0.064, 0.0656, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L20_10_m45spect3[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0196, 0.02, 0.0309, 0.04, 0.0387, 0.08, 0.0831, 0.1, 0.1099, 0.11, 0.1188, 0.11, 0.1395, 0.14, 0.1508, 0.16, 0.1599, 0.157, 0.1465, 0.16, 0.1595, 0.15, 0.1489, 0.14, 0.1303, 0.12, 0.1032, 0.09, 0.0751, 0.06, 0.0499, 0.03, 0.0273, 0.04, + 0.0056, 0.0, -0.0131, -0.02, -0.0237, -0.025, -0.0268, -0.02, -0.0165, 0.01, 0.0117, 0.02, 0.0369, 0.04, 0.0507, 0.051, 0.0564, 0.057, 0.0588, 0.06, 0.0610, 0.062, + 0.0639, 0.064, 0.0656, 0.0655, 0.0654, 0.065, 0.0642, 0.063, 0.0622, 0.061, 0.0608, 0.061, 0.0617, 0.064, 0.0656, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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::ColorBlueSkyK3_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.4939, 0.435, 0.3859, 0.403, 0.4298, 0.456, 0.4880, 0.525, 0.5528, 0.572, 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 +}; + +const double ColorTemp::ColorBlueSkyK9_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.4058, 0.441, 0.4734, 0.562, 0.5572, 0.65, 0.6051, 0.643, 0.7098, 0.725, 0.7392, 0.735, 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 +}; + +const double ColorTemp::ColorBlueSkyC4_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3280, 0.2950, 0.2611, 0.334, 0.3981, 0.453, 0.4946, 0.548, 0.5692, 0.585, 0.5932, 0.611, 0.6512, 0.6621, 0.6507, 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 +}; + +const double ColorTemp::ColorBlueSkyC14_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.5697, 0.511, 0.4660, 0.481, 0.5500, 0.588, 0.5560, 0.633, 0.6572, 0.682, 0.6902, 0.693, 0.6932, 0.684, 0.6950, 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 +}; + +const double ColorTemp::ColorBlueSkyE4_spect2[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.3584, 0.391, 0.3965, 0.437, 0.4589, 0.495, 0.4946, 0.526, 0.5427, 0.569, 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 +}; + +const double ColorTemp::ColorBlueSkyM1_spect2[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.4342, 0.484, 0.4843, 0.497, 0.4969, 0.497, 0.5502, 0.557, 0.5633, 0.556, 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 +}; + +const double ColorTemp::ColorBlueSky2B1_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.5277, 0.485, 0.4431, 0.476, 0.5472, 0.599, 0.5920, 0.667, 0.6887, 0.693, 0.6950, 0.721, 0.7401, 0.737, 0.7640, 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 +}; + +const double ColorTemp::ColorBlueSkyT7_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.1943, 0.256, 0.3199, 0.376, 0.4836, 0.554, 0.5843, 0.592, 0.6643, 0.661, 0.6899, 0.694, 0.6939, 0.708, 0.7525, 0.756, 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 +}; + +const double ColorTemp::ColorBlueSkyU19_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.5829, 0.534, 0.4865, 0.489, 0.5227, 0.552, 0.5890, 0.633, 0.6621, 0.661, 0.6832, 0.682, 0.6928, 0.694, 0.6932, 0.687, 0.6989, 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 +}; + +const double ColorTemp::ColorBlueSkyU2_spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.3594, 0.345, 0.3625, 0.363, 0.3614, 0.376, 0.3854, 0.397, 0.4497, 0.484, 0.4960, 0.496, 0.4990, 0.497, 0.4993, 0.494, 0.5302, 0.537, 0.5434, 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 +}; + +const double ColorTemp::Colorlab_L40_1_m40spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0411, 0.05, 0.0646, 0.09, 0.1016, 0.15, 0.1929, 0.22, 0.2476, 0.26, 0.2868, 0.3, 0.3304, 0.34, 0.3556, 0.356, 0.3564, 0.352, 0.3519, 0.34, 0.3395, 0.33, 0.3223, 0.3, 0.2967, 0.28, 0.2606, 0.23, 0.2170, 0.19, 0.1700, 0.15, 0.1245, 0.1, 0.0798, 0.06, + 0.0405, 0.03, 0.0183, 0.015, 0.0110, 0.02, 0.0267, 0.05, 0.0715, 0.1, 0.1117, 0.12, 0.1339, 0.14, 0.1432, 0.145, 0.1473, 0.15, 0.1516, 0.155, 0.1574, 0.16, 0.1608, 0.1605, + 0.1602, 0.16, 0.1578, 0.155, 0.1535, 0.153, 0.1507, 0.152, 0.1525, 0.158, 0.1605, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L30_4_m30spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0229, 0.03, 0.0346, 0.04, 0.0531, 0.08, 0.0995, 0.11, 0.1274, 0.13, 0.1471, 0.15, 0.1690, 0.17, 0.1813, 0.182, 0.1812, 0.18, 0.1784, 0.175, 0.1716, 0.17, 0.1627, 0.16, 0.1501, 0.14, 0.1326, 0.12, 0.1112, 0.1, 0.0880, 0.07, 0.0655, 0.05, + 0.0433, 0.03, 0.0237, 0.02, 0.0126, 0.009, 0.0092, 0.01, 0.0190, 0.03, 0.0460, 0.06, 0.0701, 0.075, 0.0834, 0.085, 0.0889, 0.09, 0.0914, 0.092, 0.0937, 0.095, 0.0967, 0.097, + 0.0984, 0.0982, 0.0982, 0.098, 0.0970, 0.096, 0.0949, 0.094, 0.0935, 0.094, 0.0944, 0.097, 0.0985, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L8_11_m25spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0057, 0.007, 0.0084, 0.01, 0.0126, 0.02, 0.0234, 0.025, 0.0300, 0.032, 0.0345, 0.036, 0.0395, 0.04, 0.0420, 0.042, 0.0415, 0.041, 0.0404, 0.04, 0.0385, 0.037, 0.0358, 0.034, 0.0314, 0.03, 0.0250, 0.02, 0.0184, 0.015, 0.0126, 0.01, + 0.0073, 0.005, 0.0022, 0.0, -0.0022, -0.003, -0.0047, -0.005, -0.0053, -0.003, -0.0019, 0.0, 0.0070, 0.01, 0.0149, 0.016, 0.0192, 0.02, 0.0210, 0.022, 0.0217, 0.022, 0.0224, 0.0224, + 0.0231, 0.0234, 0.0235, 0.0235, 0.0235, 0.0233, 0.0232, 0.023, 0.0227, 0.0225, 0.0224, 0.0225, 0.0226, 0.023, 0.0236, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_1_m40spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0411, 0.05, 0.0686, 0.09, 0.1016, 0.15, 0.1929, 0.22, 0.2776, 0.28, 0.2968, 0.34, 0.3804, 0.39, 0.3756, 0.356, 0.3564, 0.352, 0.3519, 0.34, 0.3395, 0.33, 0.3223, 0.3, 0.2967, 0.28, 0.2606, 0.23, 0.2170, 0.19, 0.1700, 0.15, 0.1245, 0.1, 0.0798, 0.06, + 0.0405, 0.03, 0.0183, 0.015, 0.0110, 0.02, 0.0267, 0.05, 0.0715, 0.1, 0.1117, 0.12, 0.1339, 0.14, 0.1432, 0.145, 0.1473, 0.15, 0.1516, 0.155, 0.1574, 0.16, 0.1608, 0.1605, + 0.1602, 0.16, 0.1578, 0.155, 0.1535, 0.153, 0.1507, 0.152, 0.1525, 0.158, 0.1605, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L30_4_m30spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0229, 0.03, 0.0346, 0.04, 0.0531, 0.08, 0.0995, 0.11, 0.1274, 0.13, 0.1871, 0.19, 0.1990, 0.21, 0.2013, 0.212, 0.2012, 0.18, 0.1784, 0.175, 0.1716, 0.17, 0.1627, 0.16, 0.1501, 0.14, 0.1326, 0.12, 0.1112, 0.1, 0.0880, 0.07, 0.0655, 0.05, + 0.0433, 0.03, 0.0237, 0.02, 0.0126, 0.009, 0.0092, 0.01, 0.0190, 0.03, 0.0460, 0.06, 0.0701, 0.075, 0.0834, 0.085, 0.0889, 0.09, 0.0914, 0.092, 0.0937, 0.095, 0.0967, 0.097, + 0.0984, 0.0982, 0.0982, 0.098, 0.0970, 0.096, 0.0949, 0.094, 0.0935, 0.094, 0.0944, 0.097, 0.0985, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L8_11_m25spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0057, 0.007, 0.0094, 0.01, 0.0126, 0.02, 0.0234, 0.045, 0.0300, 0.032, 0.0445, 0.036, 0.0395, 0.04, 0.0440, 0.042, 0.0415, 0.041, 0.0404, 0.04, 0.0455, 0.037, 0.0358, 0.034, 0.0314, 0.03, 0.0250, 0.02, 0.0184, 0.015, 0.0126, 0.01, + 0.0073, 0.005, 0.0022, 0.0, -0.0022, -0.003, -0.0047, -0.005, -0.0053, -0.003, -0.0019, 0.0, 0.0070, 0.01, 0.0149, 0.016, 0.0192, 0.02, 0.0210, 0.022, 0.0217, 0.022, 0.0224, 0.0224, + 0.0231, 0.0234, 0.0235, 0.0235, 0.0235, 0.0233, 0.0232, 0.023, 0.0227, 0.0225, 0.0224, 0.0225, 0.0226, 0.023, 0.0236, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L26_m8_m25spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0133, 0.02, 0.0223, 0.03, 0.0365, 0.05, 0.0706, 0.08, 0.0908, 0.1, 0.1057, 0.11, 0.1225, 0.13, 0.1328, 0.133, 0.1343, 0.134, 0.1337, 0.1232, 0.1300, 0.126, 0.1247, 0.12, 0.1174, 0.11, 0.1072, 0.1, 0.0930, 0.08, 0.0757, 0.06, 0.0583, 0.05, + 0.0410, 0.03, 0.0258, 0.02, 0.0172, 0.015, 0.0139, 0.015, 0.0166, 0.02, 0.0259, 0.03, 0.0344, 0.036, 0.0392, 0.04, 0.0412, 0.042, 0.0421, 0.043, 0.0435, 0.044, + 0.0456, 0.046, 0.0468, 0.0465, 0.0465, 0.046, 0.0455, 0.044, 0.0439, 0.043, 0.0428, 0.043, 0.0435, 0.045, 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 +}; + +const double ColorTemp::Colorlab_L26_m8_m25spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0133, 0.02, 0.0223, 0.03, 0.0385, 0.07, 0.0806, 0.09, 0.1008, 0.12, 0.1357, 0.13, 0.1425, 0.14, 0.1428, 0.143, 0.1443, 0.134, 0.1337, 0.1232, 0.1300, 0.126, 0.1247, 0.12, 0.1174, 0.11, 0.1072, 0.1, 0.0930, 0.08, 0.0757, 0.06, 0.0583, 0.05, + 0.0410, 0.03, 0.0258, 0.02, 0.0172, 0.015, 0.0139, 0.015, 0.0166, 0.02, 0.0259, 0.03, 0.0344, 0.036, 0.0392, 0.04, 0.0412, 0.042, 0.0421, 0.043, 0.0435, 0.044, + 0.0456, 0.046, 0.0468, 0.0465, 0.0465, 0.046, 0.0455, 0.044, 0.0439, 0.043, 0.0428, 0.043, 0.0435, 0.045, 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 +}; + +const double ColorTemp::Colorlab_L26_m8_m25spect3[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0133, 0.02, 0.0223, 0.03, 0.0265, 0.05, 0.0606, 0.08, 0.0808, 0.09, 0.1057, 0.10, 0.1125, 0.12, 0.1228, 0.123, 0.1243, 0.124, 0.1337, 0.1232, 0.1300, 0.126, 0.1247, 0.12, 0.1174, 0.11, 0.1072, 0.1, 0.0930, 0.08, 0.0757, 0.06, 0.0583, 0.05, + 0.0410, 0.03, 0.0258, 0.02, 0.0172, 0.015, 0.0139, 0.015, 0.0166, 0.02, 0.0259, 0.03, 0.0344, 0.036, 0.0392, 0.04, 0.0412, 0.042, 0.0421, 0.043, 0.0435, 0.044, + 0.0456, 0.046, 0.0468, 0.0465, 0.0465, 0.046, 0.0455, 0.044, 0.0439, 0.043, 0.0428, 0.043, 0.0435, 0.045, 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 +}; + +const double ColorTemp::Colorlab_L22_1_m42spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0170, 0.02, 0.0284, 0.03, 0.0463, 0.06, 0.0898, 0.1, 0.1160, 0.12, 0.1348, 0.14, 0.1557, 0.16, 0.1678, 0.168, 0.1680, 0.167, 0.1658, 0.164, 0.1600, 0.155, 0.1507, 0.14, 0.1346, 0.12, 0.1109, 0.1, 0.0853, 0.07, 0.0608, 0.05, 0.0380, 0.02, 0.0161, 0.0, + -0.0028, -0.01, -0.0136, -0.015, -0.0172, -0.012, -0.0104, 0.0, 0.0095, 0.02, 0.0274, 0.03, 0.0372, 0.04, 0.0413, 0.042, 0.0431, 0.044, 0.0450, 0.046, 0.0477, 0.048, 0.0493, 0.049, + 0.0490, 0.048, 0.0478, 0.046, 0.0457, 0.045, 0.0444, 0.045, 0.0453, 0.048, 0.0490, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L22_1_m42spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0170, 0.02, 0.0284, 0.03, 0.0463, 0.06, 0.0898, 0.1, 0.1160, 0.12, 0.1548, 0.16, 0.1657, 0.17, 0.1778, 0.168, 0.1680, 0.167, 0.1658, 0.164, 0.1600, 0.155, 0.1507, 0.14, 0.1346, 0.12, 0.1109, 0.1, 0.0853, 0.07, 0.0608, 0.05, 0.0380, 0.02, 0.0161, 0.0, + -0.0028, -0.01, -0.0136, -0.015, -0.0172, -0.012, -0.0104, 0.0, 0.0095, 0.02, 0.0274, 0.03, 0.0372, 0.04, 0.0413, 0.042, 0.0431, 0.044, 0.0450, 0.046, 0.0477, 0.048, 0.0493, 0.049, + 0.0490, 0.048, 0.0478, 0.046, 0.0457, 0.045, 0.0444, 0.045, 0.0453, 0.048, 0.0490, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L22_1_m42spect3[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0170, 0.02, 0.0284, 0.03, 0.0463, 0.06, 0.0898, 0.1, 0.1160, 0.12, 0.1548, 0.16, 0.1657, 0.17, 0.1778, 0.168, 0.1680, 0.167, 0.1658, 0.164, 0.1600, 0.155, 0.1507, 0.14, 0.1346, 0.12, 0.1109, 0.1, 0.0853, 0.07, 0.0608, 0.05, 0.0380, 0.02, 0.0161, 0.0, + 0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0095, 0.02, 0.0274, 0.03, 0.0372, 0.04, 0.0413, 0.042, 0.0431, 0.044, 0.0450, 0.046, 0.0477, 0.048, 0.0493, 0.049, + 0.0490, 0.048, 0.0478, 0.046, 0.0457, 0.045, 0.0444, 0.045, 0.0453, 0.048, 0.0490, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L22_1_m42spect4[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0170, 0.02, 0.0284, 0.03, 0.0463, 0.06, 0.0898, 0.1, 0.1160, 0.12, 0.1548, 0.16, 0.1657, 0.17, 0.1778, 0.168, 0.1680, 0.167, 0.1658, 0.164, 0.1600, 0.155, 0.1507, 0.14, 0.1346, 0.12, 0.1109, 0.1, 0.0853, 0.07, 0.0608, 0.05, 0.0380, 0.02, 0.0161, 0.0, + 0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0095, 0.02, 0.0274, 0.03, 0.0372, 0.04, 0.0413, 0.042, 0.0431, 0.044, 0.0450, 0.046, 0.0477, 0.048, 0.0493, 0.049, + 0.0490, 0.048, 0.0478, 0.046, 0.0457, 0.045, 0.0444, 0.045, 0.0453, 0.048, 0.0490, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L27_m1_m47spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0237, 0.03, 0.0400, 0.05, 0.0657, 0.09, 0.1278, 0.14, 0.1651, 0.18, 0.1921, 0.21, 0.2221, 0.23, 0.2395, 0.24, 0.2400, 0.24, 0.2371, 0.23, 0.2289, 0.22, 0.2159, 0.2, 0.1930, 0.18, 0.1595, 0.14, 0.1230, 0.1, + 0.0879, 0.07, 0.0553, 0.04, 0.0239, 0.0, -0.0034, -0.01, -0.0188, -0.02, -0.0241, -0.02, -0.0151, 0.0, 0.0117, 0.02, 0.0359, 0.04, 0.0492, 0.05, 0.0548, 0.055, 0.0571, 0.058, + 0.0598, 0.06, 0.0637, 0.065, 0.0660, 0.066, 0.0656, 0.064, 0.0638, 0.062, 0.0608, 0.06, 0.0589, 0.06, 0.0601, 0.065, 0.0655, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L27_m1_m47spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0237, 0.03, 0.0450, 0.05, 0.0657, 0.09, 0.1478, 0.16, 0.1751, 0.21, 0.2221, 0.23, 0.2421, 0.24, 0.2495, 0.25, 0.2500, 0.25, 0.2471, 0.24, 0.2389, 0.22, 0.2159, 0.2, 0.1930, 0.18, 0.1595, 0.14, 0.1230, 0.1, + 0.0879, 0.07, 0.0553, 0.04, 0.0239, 0.0, -0.0034, -0.01, -0.0188, -0.02, -0.0241, -0.02, -0.0151, 0.0, 0.0117, 0.02, 0.0359, 0.04, 0.0492, 0.05, 0.0548, 0.055, 0.0571, 0.058, + 0.0598, 0.06, 0.0637, 0.065, 0.0660, 0.066, 0.0656, 0.064, 0.0638, 0.062, 0.0608, 0.06, 0.0589, 0.06, 0.0601, 0.065, 0.0655, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_30_m30spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0552, 0.06, 0.0713, 0.08, 0.0964, 0.12, 0.1678, 0.19, 0.2112, 0.22, 0.2391, 0.25, 0.2689, 0.275, 0.2818, 0.28, 0.2749, 0.27, 0.2630, 0.25, 0.2464, 0.23, 0.2282, 0.21, 0.2049, 0.19, 0.1748, 0.16, 0.1415, 0.12, 0.1097, 0.1, + 0.0810, 0.07, 0.0523, 0.04, 0.0265, 0.02, 0.0123, 0.012, 0.0113, 0.03, 0.0487, 0.1, 0.1428, 0.18, 0.2257, 0.25, 0.2708, 0.28, 0.2897, 0.29, 0.2977, 0.3, 0.3033, 0.304, + 0.3088, 0.31, 0.3115, 0.3116, 0.3117, 0.3108, 0.3102, 0.31, 0.3076, 0.306, 0.3059, 0.306, 0.3070, 0.31, 0.3136, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_30_m30spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0552, 0.06, 0.0713, 0.08, 0.0864, 0.1, 0.1478, 0.19, 0.212, 0.22, 0.2391, 0.24, 0.2589, 0.255, 0.2818, 0.28, 0.2749, 0.27, 0.2630, 0.25, 0.2464, 0.23, 0.2282, 0.21, 0.2049, 0.19, 0.1748, 0.16, 0.1415, 0.12, 0.1097, 0.1, + 0.0810, 0.07, 0.0523, 0.04, 0.0265, 0.02, 0.0123, 0.012, 0.0113, 0.03, 0.0487, 0.1, 0.1428, 0.18, 0.2257, 0.25, 0.2708, 0.28, 0.2897, 0.29, 0.2977, 0.3, 0.3033, 0.304, + 0.3088, 0.3, 0.3015, 0.3016, 0.3017, 0.3108, 0.3002, 0.29, 0.2876, 0.286, 0.2859, 0.286, 0.2870, 0.28, 0.2836, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_20_m35spect[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0502, .06, 0.0694, 0.08, 0.0994, 0.13, 0.1794, 0.2, 0.2277, 0.25, 0.2604, 0.28, 0.2959, 0.3, 0.3137, 0.31, 0.3096, 0.305, 0.3004, 0.29, 0.2852, 0.27, 0.2669, 0.25, 0.2418, 0.22, 0.2080, 0.19, + 0.1696, 0.15, 0.1312, 0.1, 0.0955, 0.08, 0.0602, 0.04, 0.0288, 0.02, 0.0113, 0.01, 0.0078, 0.03, 0.0373, 0.1, 0.1136, 0.15, 0.1811, 0.2, 0.2180, 0.22, 0.2334, 0.24, + 0.2400, 0.241, 0.2452, 0.25, 0.2508, 0.252, 0.2538, 0.254, 0.2537, 0.252, 0.2519, 0.25, 0.2485, 0.246, 0.2464, 0.247, 0.2478, 0.26, 0.2550, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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_L40_20_m35spect2[97] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0502, .06, 0.0694, 0.08, 0.0994, 0.13, 0.1794, 0.2, 0.2277, 0.25, 0.2604, 0.28, 0.2959, 0.3, 0.3137, 0.31, 0.2896, 0.285, 0.2804, 0.27, 0.2652, 0.25, 0.2469, 0.25, 0.2418, 0.22, 0.2080, 0.19, + 0.1696, 0.15, 0.1312, 0.1, 0.0955, 0.08, 0.0602, 0.04, 0.0288, 0.02, 0.0113, 0.01, 0.0078, 0.03, 0.0373, 0.1, 0.1136, 0.15, 0.1811, 0.2, 0.2180, 0.22, 0.2334, 0.24, + 0.2400, 0.241, 0.2452, 0.23, 0.2308, 0.232, 0.2338, 0.234, 0.2337, 0.232, 0.2319, 0.23, 0.2385, 0.236, 0.2364, 0.237, 0.2378, 0.24, 0.2450, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +}; + + + +//3 A3 0.0552 0.0713 0.0964 0.1678 0.2112 0.2391 0.2689 0.2818 0.2749 0.2630 0.2464 0.2282 0.2049 0.1748 0.1415 0.1097 0.0810 0.0523 0.0265 0.0123 0.0113 0.0487 0.1428 0.2257 0.2708 0.2897 0.2977 0.3033 0.3088 0.3115 0.3117 0.3102 0.3076 0.3059 0.3070 0.3136 +//4 A4 0.0502 0.0694 0.0994 0.1794 0.2277 0.2604 0.2959 0.3137 0.3096 0.3004 0.2852 0.2669 0.2418 0.2080 0.1696 0.1312 0.0955 0.0602 0.0288 0.0113 0.0078 0.0373 0.1136 0.1811 0.2180 0.2334 0.2400 0.2452 0.2508 0.2538 0.2537 0.2519 0.2485 0.2464 0.2478 0.2550 + + /* * Name: XYZtoCorColorTemp.c * @@ -2686,7 +4303,7 @@ int ColorTemp::XYZtoCorColorTemp(double x0, double y0, double z0, double &temp) return 0; /* success */ } -void ColorTemp::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 ) +void ColorTemp::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) { // CIECAT02 - J.Desmis January 2012 review September 2012 @@ -2738,20 +4355,20 @@ void ColorTemp::cieCAT02(double Xw, double Yw, double Zw, double &CAM02BB00, dou 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++) { + 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++) { + 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++) { + 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]; } @@ -2969,19 +4586,20 @@ void ColorTemp::icieCAT02float(float Xw, float Yw, float Zw, float &iCAM02BB00, } -void ColorTemp::temp2mulxyz (double temp, const std::string &method, StandardObserver observer, double &Xxyz, double &Zxyz) +void ColorTemp::temp2mulxyz(double temp, const std::string &method, StandardObserver observer, double &Xxyz, double &Zxyz) { double x, y, z; // We first test for specially handled methods const auto iterator = spectMap.find(method); const auto &color_match = (observer == StandardObserver::TEN_DEGREES) ? cie_colour_match_jd : cie_colour_match_jd2; -/* if(observer == StandardObserver::TEN_DEGREES){ - printf("General Observer 10°\n"); - } else { - printf("General Observer 2°\n"); - } -*/ +/* + if(observer == StandardObserver::TEN_DEGREES){ + printf("General Observer 10°\n"); + } else { + printf("General Observer 2°\n"); + } +*/ if (iterator != spectMap.end()) { spectrum_to_xyz_preset(iterator->second, x, y, z, color_match); } else { @@ -2998,7 +4616,7 @@ void ColorTemp::temp2mulxyz (double temp, const std::string &method, StandardObs x_D = -4.6070e9 / (temp * temp * temp) + 2.9678e6 / (temp * temp) + 0.09911e3 / temp + 0.244063; } else if (temp <= 25000) { x_D = -2.0064e9 / (temp * temp * temp) + 1.9018e6 / (temp * temp) + 0.24748e3 / temp + 0.237040; - } else /*if (temp > 25000)*/ { + } else { /*if (temp > 25000)*/ x_D = -2.0064e9 / (temp * temp * temp) + 1.9018e6 / (temp * temp) + 0.24748e3 / temp + 0.237040 - ((temp - 25000) / 25000) * 0.025; //Jacques empirical adjustment for very high temp (underwater !) } @@ -3016,7 +4634,7 @@ void ColorTemp::temp2mulxyz (double temp, const std::string &method, StandardObs Zxyz = (1.0 - x - y) / y; } -void ColorTemp::temp2mul (double temp, double green, double equal, StandardObserver observer, double& rmul, double& gmul, double& bmul) const +void ColorTemp::temp2mul(double temp, double green, double equal, StandardObserver observer, double& rmul, double& gmul, double& bmul) const { clip(temp, green, equal); double Xwb, Zwb; @@ -3024,8 +4642,8 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser double adj = 1.0; - if(equal < 0.9999 || equal > 1.0001 ) { - adj = (100.0 + ( 1000.0 - (1000.0 * equal) ) / 20.0) / 100.0; + if (equal < 0.9999 || equal > 1.0001) { + adj = (100.0 + (1000.0 - (1000.0 * equal)) / 20.0) / 100.0; } @@ -3048,7 +4666,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser bmul /= maxRGB; - if(settings->CRI_color != 0) { //activate if CRi_color !=0 + if (settings->CRI_color != 0) { //activate if CRi_color !=0 // begin CRI_RT : color rendering index RT - adaptation of CRI by J.Desmis // CRI = 100 for Blackbody and Daylight // calculate from spectral data values X, Y, Z , for color of colorchecker24 , SG, DC, JDC_468 @@ -3083,7 +4701,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser bool CRI_type = false; double tempw; - if (method == "Fluo F1") { + if (method == "Fluo F1") { CRI_type = true; tempw = 6430; illum = 1; @@ -3151,7 +4769,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser CRI_type = true; tempw = 3930; illum = 17; - } else if (method == "Solux Lamp 4700K" ) { + } else if (method == "Solux Lamp 4700K") { CRI_type = true; tempw = 4700; illum = 18; @@ -3188,20 +4806,21 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser float CRI_RTs = 0.0, CRIs[8]; const auto &color_match = (observer == StandardObserver::TEN_DEGREES) ? cie_colour_match_jd : cie_colour_match_jd2; + //exceptional must be used by advice people - if(observer == StandardObserver::TEN_DEGREES){ + if (observer == StandardObserver::TEN_DEGREES) { printf("CRI Observer 10°\n"); } else { printf("CRI Observer 2°\n"); } - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { spectrum_to_color_xyz_preset(spec_color[i], spect_illum[illum + 3], XchkLamp[i], YchkLamp[i], ZchkLamp[i], color_match); } //calculate XYZ for each color : for Blackbody and Daylight at tempw - if(tempw <= INITIALBLACKBODY) { - for(int i = 0; i < N_c; i++) { + if (tempw <= INITIALBLACKBODY) { + for (int i = 0; i < N_c; i++) { spectrum_to_color_xyz_blackbody(spec_color[i], tempw, Xchk[i], Ychk[i], Zchk[i], color_match); } @@ -3222,7 +4841,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser 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++) { + for (int i = 0; i < N_c; i++) { spectrum_to_color_xyz_daylight(spec_color[i], m11, m22, Xchk[i], Ychk[i], Zchk[i], color_match); } @@ -3245,7 +4864,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser cieCAT02(Xwb, Ywb, Zwb, CAM02BB00, CAM02BB01, CAM02BB02, CAM02BB10, CAM02BB11, CAM02BB12, CAM02BB20, CAM02BB21, CAM02BB22, adap); //here new value of X,Y,Z for lamp with chromatic CAM02 adaptation - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { Xcam02Lamp[i] = CAM02BB00 * XchkLamp[i] + CAM02BB01 * YchkLamp[i] + CAM02BB02 * ZchkLamp[i] ; Ycam02Lamp[i] = CAM02BB10 * XchkLamp[i] + CAM02BB11 * YchkLamp[i] + CAM02BB12 * ZchkLamp[i] ; Zcam02Lamp[i] = CAM02BB20 * XchkLamp[i] + CAM02BB21 * YchkLamp[i] + CAM02BB22 * ZchkLamp[i] ; @@ -3257,7 +4876,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser //here new value of X,Y,Z for blackbody with chromatic CAM02 adaptation - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { Xcam02[i] = CAM02BB00 * Xchk[i] + CAM02BB01 * Ychk[i] + CAM02BB02 * Zchk[i] ; Ycam02[i] = CAM02BB10 * Xchk[i] + CAM02BB11 * Ychk[i] + CAM02BB12 * Zchk[i] ; Zcam02[i] = CAM02BB20 * Xchk[i] + CAM02BB21 * Ychk[i] + CAM02BB22 * Zchk[i] ; @@ -3269,25 +4888,25 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser // Lamp double fx[50], fy[50], fz[50]; - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { xr[i] = Xcam02Lamp[i] / whiteD50[0]; yr[i] = Ycam02Lamp[i] / whiteD50[1]; zr[i] = Zcam02Lamp[i] / whiteD50[2]; // xr, yr , zr > epsilon - if(xr[i] > epsilon) { + if (xr[i] > epsilon) { fx[i] = std::cbrt(xr[i]); } else { fx[i] = (903.3 * xr[i] + 16.0) / 116.0; } - if(yr[i] > epsilon) { + if (yr[i] > epsilon) { fy[i] = std::cbrt(yr[i]); } else { fy[i] = (903.3 * yr[i] + 16.0) / 116.0; } - if(zr[i] > epsilon) { + if (zr[i] > epsilon) { fz[i] = std::cbrt(zr[i]); } else { fz[i] = (903.3 * zr[i] + 16.0) / 116.0; @@ -3295,32 +4914,33 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser } double Llamp[50], alamp[50], blamp[50]; - for(int i = 0; i < N_c; i++) { + + for (int i = 0; i < N_c; i++) { Llamp[i] = 116.0 * fy[i] - 16.0; alamp[i] = 500.0 * (fx[i] - fy[i]); blamp[i] = 200.0 * (fy[i] - fz[i]); } //blackbody at tempx - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { xr[i] = Xcam02[i] / whiteD50[0]; yr[i] = Ycam02[i] / whiteD50[1]; zr[i] = Zcam02[i] / whiteD50[2]; // - if(xr[i] > epsilon) { + if (xr[i] > epsilon) { fx[i] = std::cbrt(xr[i]); } else { fx[i] = (903.3 * xr[i] + 16.0) / 116.0; } - if(yr[i] > epsilon) { + if (yr[i] > epsilon) { fy[i] = std::cbrt(yr[i]); } else { fy[i] = (903.3 * yr[i] + 16.0) / 116.0; } - if(zr[i] > epsilon) { + if (zr[i] > epsilon) { fz[i] = std::cbrt(zr[i]); } else { fz[i] = (903.3 * zr[i] + 16.0) / 116.0; @@ -3329,61 +4949,61 @@ void ColorTemp::temp2mul (double temp, double green, double equal, StandardObser double Lbb[50], abb[50], bbb[50]; - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { Lbb[i] = 116.*fy[i] - 16.; abb[i] = 500.*(fx[i] - fy[i]); bbb[i] = 200.*(fy[i] - fz[i]); } //display value to verify calculus - if(settings->CRI_color != 0) { + if (settings->CRI_color != 0) { printf("Color Number %i\n", numero_color); printf("L_refer=%2.2f a=%2.2f b=%2.2f\n", Lbb[numero_color], abb[numero_color], bbb[numero_color]); printf("L_lamp=%2.2f al=%2.2f bl=%2.2f\n", Llamp[numero_color], alamp[numero_color], blamp[numero_color]); } //then calculate DeltaE CIE 1976 - for(int i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) { DeltaEs[i] = sqrt((Lbb[i] - Llamp[i]) * (Lbb[i] - Llamp[i]) + (abb[i] - alamp[i]) * (abb[i] - alamp[i]) + (bbb[i] - blamp[i]) * (bbb[i] - blamp[i])); } - for(int i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) { CRIs[i] = 100 - 3.f * DeltaEs[i]; //3.0 coef to adapt ==> same results than CRI "official" } - for(int i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) { CRI_RTs += CRIs[i]; } CRI_RTs /= 8; - for(int i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) { quadCRIs += (CRIs[i] - CRI_RTs) * (CRIs[i] - CRI_RTs); } quadCRIs /= 8; - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { DeltaE[i] = sqrt((Lbb[i] - Llamp[i]) * (Lbb[i] - Llamp[i]) + (abb[i] - alamp[i]) * (abb[i] - alamp[i]) + (bbb[i] - blamp[i]) * (bbb[i] - blamp[i])); } - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { CRI[i] = 100 - 3.f * DeltaE[i]; //3.0 coef to adapt ==> same results than CRI "official" } - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { CRI_RT += CRI[i]; } CRI_RT /= N_c; - for(int i = 0; i < N_c; i++) { + for (int i = 0; i < N_c; i++) { quadCRI += (CRI[i] - CRI_RT) * (CRI[i] - CRI_RT); } quadCRI /= N_c; - if(settings->CRI_color != 0) { + if (settings->CRI_color != 0) { printf("CRI_standard=%i CRI:1->8=%i %i %i %i %i %i %i %i Sigma=%2.1f\n", (int) CRI_RTs, (int) CRIs[0], (int) CRIs[1], (int) CRIs[2], (int) CRIs[3], (int) CRIs[4], (int) CRIs[5], (int) CRIs[6], (int) CRIs[7], sqrt(static_cast(quadCRIs))); printf("CRI_RT_exten=%i CRI:9->20=%i %i %i %i %i %i %i %i %i %i %i %i Sigma=%2.1f\n", (int) CRI_RT, (int) CRI[8], (int) CRI[9], (int) CRI[10], (int) CRI[11], (int) CRI[12], (int) CRI[13], (int) CRI[14], (int) CRI[15], (int) CRI[16], (int) CRI[17], (int) CRI[18], (int) CRI[19], static_cast(sqrt(quadCRI))); } @@ -3400,6 +5020,7 @@ double ColorTemp::blackbody_spect(double wavelength, double temperature) const double wlm = wavelength * 1e-9; /* Wavelength in meters */ return (3.7417715247e-16 / rtengine::pow5(wlm)) / //3.7417..= c1 = 2*Pi*h*c2 where h=Planck constant, c=velocity of light (xexp(1.438786e-2 / (wlm * temperature)) - 1.0); //1.4387..= c2 = h*c/k where k=Boltzmann constant + } /* @@ -3427,6 +5048,7 @@ void ColorTemp::spectrum_to_xyz_daylight(double _m1, double _m2, double &x, doub for (i = 0, lambda = 350.; lambda < 830.1; i++, lambda += 5.) { double Me = daylight_spect(lambda, _m1, _m2); + // printf("Day Me=%f \n", Me); X += Me * color_match[i][0]; Y += Me * color_match[i][1]; Z += Me * color_match[i][2]; @@ -3526,7 +5148,7 @@ void ColorTemp::spectrum_to_color_xyz_preset(const double* spec_color, const dou void ColorTemp::spectrum_to_color_xyz_daylight(const double* spec_color, double _m1, double _m2, double &xx, double &yy, double &zz, const color_match_type &color_match) { int i; - double lambda, X = 0, Y = 0, Z = 0; + double lambda, X = 0, Y = 0, Z = 0, Yo = 0; for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { const double Me = spec_color[i]; @@ -3536,16 +5158,67 @@ void ColorTemp::spectrum_to_color_xyz_daylight(const double* spec_color, double Z += Mc * color_match[i][2] * Me; } - xx = X / Y; - yy = 1.0; - zz = Z / Y; + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + + const double Mc1 = daylight_spect(lambda, _m1, _m2); + Yo += color_match[i][1] * Mc1; + } + + xx = X / Yo; + yy = Y / Yo; + zz = Z / Yo; } -//calculate XYZ from spectrum data (color) and illuminant : J.Desmis december 2011 +void ColorTemp::whitepoint(double tempw, double &xx, double &yy, double &zz, const color_match_type &color_match) +{ + if (tempw <= INITIALBLACKBODY) { + spectrum_to_whitepoint_xyz_blackbody(tempw, xx, yy, zz, color_match); + } 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; + + spectrum_to_whitepoint_xyz_daylight(m11, m22, xx, yy, zz, color_match); + } +} + +void ColorTemp::spectrum_to_whitepoint_xyz_daylight(double _m1, double _m2, double &xx, double &yy, double &zz, const color_match_type &color_match) +{ + int i; + double lambda, X = 0, Z = 0, Yo = 0; + + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + const double Mc = daylight_spect(lambda, _m1, _m2); + X += Mc * color_match[i][0]; + Z += Mc * color_match[i][2]; + } + + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + const double Mc1 = daylight_spect(lambda, _m1, _m2); + Yo += color_match[i][1] * Mc1; + } + + xx = X / Yo; + yy = 1.; + zz = Z / Yo; +} + +//calculate XYZ from spectrum data (color) and illuminant : J.Desmis december 2011 bug found 4/2023 void ColorTemp::spectrum_to_color_xyz_blackbody(const double* spec_color, double _temp, double &xx, double &yy, double &zz, const color_match_type &color_match) { int i; - double lambda, X = 0, Y = 0, Z = 0; + double lambda, X = 0, Y = 0, Z = 0, Yo = 0; for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { const double Me = spec_color[i]; @@ -3555,11 +5228,39 @@ void ColorTemp::spectrum_to_color_xyz_blackbody(const double* spec_color, double Z += Mc * color_match[i][2] * Me; } - xx = X / Y; - yy = 1.0; - zz = Z / Y; + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + const double Mc1 = blackbody_spect(lambda, _temp); + Yo += color_match[i][1] * Mc1; + } + + xx = X / Yo; + yy = Y / Yo; + zz = Z / Yo; } +void ColorTemp::spectrum_to_whitepoint_xyz_blackbody(double _temp, double &xx, double &yy, double &zz, const color_match_type &color_match) +{ + int i; + double lambda, X = 0, Z = 0, Yo = 0; + + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + const double Mc = blackbody_spect(lambda, _temp); + X += Mc * color_match[i][0]; + Z += Mc * color_match[i][2]; + } + + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + const double Mc1 = blackbody_spect(lambda, _temp); + Yo += color_match[i][1] * Mc1; + } + + xx = X / Yo; + yy = 1.; + zz = Z / Yo; +} + + + double ColorTemp::daylight_spect(double wavelength, double m1, double m2) { //Values for Daylight illuminant: s0 s1 s2 @@ -3581,17 +5282,116 @@ double ColorTemp::daylight_spect(double wavelength, double m1, double m2) 9.60, 9.05, 8.50, 7.75, 7.00, 7.30, 7.60, 7.80, 8.00, 7.35, 6.70, 5.95, 5.20, 6.30, 7.40, 7.10, 6.80, 6.90, 7.00, 6.70, 6.40, 5.95, 5.50, 5.80, 6.10, 6.30, 6.50 }; - int wlm = (int) ((wavelength - 350.) / 5.); + int wlm = (int)((wavelength - 350.) / 5.); 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 + + +//tempxy : return x and y of xyY for 406 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) +//copyright J.Desmis august 2017 and june 2018 - 05/2023 +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, int ttbeg, int ttend, double &wpx, double &wpz, double *WPX, double *WPZ) { 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,//194 + Colorlab_10_n70_spect, Colorlab_n33_n70_spect, Colorlab_n8_n74_spect, Colorlab_19_n69_spect, Colorlab_n80_10_spect, Colorlab_n80_26_spect,//200 + Colorlab_n80_5_9_5_9spect, /* JDC468_greyc14_66_spect, JDC468_greym13_325_spect, JDC468_greyf26_156_spect, Colorlab_n57_5_6_9spect,*/ Colorlab_L61_110_110Rec2020spect,//202 + Colorlab_L63_120_m56Rec2020spect, Colorlab_L63_m50_m60Rec2020spect, Colorlab_L63_m120_80Rec2020spect, Colorlab_L42_110_m100Prospect, Colorlab_L42_m70_m100Prospect,//207 + Colorlab_L56_m120_90Prospect, Colorlab_L25_60_m120Prospect, Colorlab_L75_50_120Prospect, Colorlab_L75_m120_0Prospect, J570_NeuN8_spect2, J570_NeuN9_spect2, //213 + J570_NeuO8_spect2, J570_NeuO11_spect2, J570_NeuD5_spect2, J570_NeuE11_spect2, J570_NeuK16_spect2, J570_NeuM3_spect2, Colorlab_L22_2_1_3Prospect,//220 + Colorlab_L44_2_8_3_9spect, Colorlab_L44_2_8_3_9spect2, Colorlab_L95_2_3_15_6spect, Colorlab_L95_2_3_15_6spect2, Colorlab_L40_3_5_10_7spect,//225 + Colorlab_L40_3_5_10_7spect2, /*Colorlab_L40_3_5_10_7Prospect3,*/ Colorlab_L34_1_8_1_9spect, Colorlab_L34_1_8_1_9spect2, Colorlab_L64_1_8_m1_9spect,//229 + Colorlab_L84_0_8_m1spect, Colorlab_L63_1_3_m2spect, Colorlab_L44_2_3_m3spect, Colorlab_L65_96_45spect, Colorlab_L52_47_57spect, Colorlab_L31_62_27spect, //235 + Colorlab_L79_m9_m28spect, Colorlab_L58_50_31spect, Colorlab_L31_m52_27spect, Colorlab_L44_2_2_m7_35spect, Colorlab_L47_m10_8_0_41spect, Colorlab_L32_4_8_m3_2spect,//241 + Colorlab_L57_m6_9_2_9spect, Colorlab_L33_2_4_m4_5spect, Colorlab_L35_11_65_m1_1spect, Colorlab_L52_m2_7_8_9spect, Colorlab_L32_7_m2_5spect, Colorlab_L32_3_4_m3_8spect,//247 + Colorlab_L50_m5_3_6_5spect, Colorlab_L44_3_96_m8_8spect, Colorlab_L34_3_6_m5_4spect, Colorlab_L31_5_9_m4spect, Colorlab_L35_3_4_m11spect, Colorlab_L31_4_5_m4_7spect, //253 + Colorlab_L35_4_8_m6_4spect, Colorlab_L95_10_7_m14_3spect, Colorlab_L36_34_m7_5spect, Colorlab_L37_59_2spect, Colorlab_L69_14_m9spect, Colorlab_L92_13_m16spect,//259 + Colorlab_L49_21_m12spect, Colorlab_L56_20_m15spect, Colorlab_L68_21_m19spect, //262 + Colorlab_L98_m2_m32spect, Colorlab_L98_m2_m32spect2, Colorlab_L41_m27_m16spect, Colorlab_L41_m27_m16spect2, Colorlab_L15_m9_4spect, Colorlab_L15_m9_4spect2,//268 + Colorlab_L11_m11_2spect, Colorlab_L14_m4_3spect, Colorlab_L41_38_24spect, Colorlab_L41_38_24spect2, Colorlab_L53_48_58spect, Colorlab_L53_48_58spect2,//274 + Colorlab_L70_44_86spect, Colorlab_L70_44_86spect2, Colorlab_L38_42_19spect, Colorlab_L38_42_19spect2, //278 + Colorlab_L60_63_85spect, Colorlab_L60_63_85spect2, Colorlab_L80_75_30spect, Colorlab_L80_75_30spect2, Colorlab_L28_m21_24spect,//284 + Colorlab_L45_m33_47spect, Colorlab_L45_m33_47spect2, Colorlab_L26_m7_404spect, Colorlab_L34_m61_2spect, Colorlab_L32_m16_17spect, Colorlab_L30_m19_15spect, + Colorlab_L30_m17_16spect, Colorlab_L35_m8_4spect, Colorlab_L37_m7_5spect, Colorlab_L45_m7_2spect, Colorlab_L40_m6_5spect, Colorlab_L46_m6_2spect, Colorlab_L48_m69_16spect, + Colorlab_L51_89_53spect, Colorlab_L49_84_33spect, Colorlab_L59_m51_31spect, Colorlab_L48_m69_16spect2, Colorlab_L53_m71_6spect, Colorlab_L51_m89_53spect2, + Colorlab_L49_84_33spect2, Colorlab_L36_m27_28spect, Colorlab_L36_m27_28spect2, Colorlab_L36_m27_28spect3, Colorlab_L63_16_71spect, + Colorlab_L84_4_46spect, Colorlab_L84_4_46spect2, Colorlab_L75_m66_19spect, Colorlab_L75_m66_19spect2, Colorlab_L64_m82_m6spect, Colorlab_L64_m82_m6spect2, + Colorlab_L66_m71_m17spect, Colorlab_L66_m71_m17spect2, Colorlab_L22_m8_m60spect, //317 + Colorlab_L22_m8_m60spect2, Colorlab_L15_m4_m42spect, Colorlab_L15_m4_m42spect2, Colorlab_L13_3_m23spect, Colorlab_L27_4_m90spect, Colorlab_L19_1_m29spect, + Colorlab_L27_4_m90spect2, Colorlab_L16_0_m44spect, Colorlab_L16_0_m44spect2, Colorlab_L13_m3_m36spect, Colorlab_L13_m3_m36spect2, + Colorlab_L31_m23_m60spect, Colorlab_L31_m23_m60spect2, Colorlab_L17_3_m40spect, Colorlab_L17_3_m40spect2, Colorlab_L21_9_m7spect, Colorlab_L78_4_m74spect, + Colorlab_L31_m58_m66spect, Colorlab_L61_m11_m12spect, Colorlab_L61_m11_m12spect2, Colorlab_L29_1_m13spect, Colorlab_L29_1_m13spect2, Colorlab_L2_14_m1spect, //339 + Colorlab_L5_39_m7spect, Colorlab_L15_5_m13spect, Colorlab_L12_5_m6spect, Colorlab_L12_5_m6spect2, Colorlab_L37_m59_m24spect, Colorlab_L37_m59_m24spect2,//345 + Colorlab_L15_55_23spect, Colorlab_L11_m55_m11spect, Colorlab_L8_m10_m2spect, Colorlab_L14_m10_m7spect, Colorlab_L20_m16_m13spect, Colorlab_L8_m10_m2spect2, Colorlab_L14_m10_m7spect2, Colorlab_L20_m16_m13spect2, //353 + Colorlab_L6_m9_1spect, Colorlab_L20_m9_m10spect, Colorlab_L85_10_45spect, Colorlab_L90_m7_82spect, Colorlab_L95_2_18spect, + Colorlab_L39_7_4spect, Colorlab_L39_4_1spect, Colorlab_L39_3_m1spect, Colorlab_L40_3_m2spect, Colorlab_L36_2_2spect, + Colorlab_L39_7_4spect2, Colorlab_L39_4_1spect2, Colorlab_L39_3_m1spect2, Colorlab_L40_3_m2spect2, Colorlab_L36_2_2spect2, //369 + Colorlab_L40_4_m2spect, Colorlab_L41_1_m6spect, Colorlab_L40_4_m2spect2, Colorlab_L41_1_m6spect2, Colorlab_L41_12_14spect, Colorlab_L41_12_14spect2, + Colorlab_L10_0_m22spect, Colorlab_L38_60_8spect, Colorlab_L49_85_39spect, Colorlab_L42_1_m18spect, //379 + Colorlab_L48_19_m25spect, Colorlab_L30_21_m25spect, Colorlab_L15_10_m15spect, Colorlab_L48_19_m25spect2, Colorlab_L30_21_m25spect2, Colorlab_L15_10_m15spect2, + Colorlab_L60_26_m25spect, Colorlab_L40_26_m45spect, Colorlab_L20_10_m45spect, //388 + ColorBlueSkyK3_spect2, ColorBlueSkyK9_spect2, ColorBlueSkyC4_spect2, ColorBlueSkyC14_spect2, ColorBlueSkyE4_spect2, + ColorBlueSkyM1_spect2, ColorBlueSky2B1_spect2, ColorBlueSkyT7_spect2, ColorBlueSkyU19_spect2, ColorBlueSkyU2_spect2, + Colorlab_L40_1_m40spect, Colorlab_L30_4_m30spect, Colorlab_L8_11_m25spect, Colorlab_L40_1_m40spect2, Colorlab_L30_4_m30spect2, Colorlab_L8_11_m25spect2, + Colorlab_L26_m8_m25spect, Colorlab_L26_m8_m25spect2, //406 + Colorlab_L17_3_m40spect3, Colorlab_L17_3_m40spect4, Colorlab_L17_3_m40spect5, Colorlab_L40_26_m45spect2, Colorlab_L17_3_m40spect6, ColorchechCyaF3_spect2, ColorchechCyaF3_spect3, + Colorlab_L22_1_m42spect, Colorlab_L27_m1_m47spect, Colorlab_L26_m8_m25spect3, Colorlab_L22_1_m42spect2, Colorlab_L27_m1_m47spect2, + Colorlab_L40_30_m30spect, Colorlab_L40_20_m35spect, Colorlab_L20_10_m45spect2, Colorlab_L20_10_m45spect3, + Colorlab_L40_30_m30spect2, Colorlab_L40_20_m35spect2, Colorlab_10_n70_spect2, Colorlab_L22_1_m42spect3, Colorlab_10_n70_spect3, Colorlab_L22_1_m42spect4, Colorlab_10_n70_spect4 + //J570_NeuN18_spect2, J570_NeuQ1_spect2 //J570_NeuS7_spect2, J570_NeuV10_spect2, J570_NeuW18_spect2, + //J570_NeuZ14_spect2, + //J570_NeuC18_spect2, + //J570_NeuD17_spect2, + //J570_NeuJ11_spect2, + //J570_NeuL4_spect2 + };// + + const double* spec_colorforxcyc_old[] = {//color references for 5.9 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 @@ -3641,17 +5441,212 @@ void ColorTemp::tempxy(bool separated, int repref, float **Tx, float **Ty, float Colorlab_10_n70_spect, Colorlab_n33_n70_spect, Colorlab_n8_n74_spect, Colorlab_19_n69_spect, Colorlab_n80_10_spect, Colorlab_n80_26_spect, Colorlab_n80_5_9_5_9spect //, Colorlab_n57_5_6_9spect - /*JDC468_greyc14_66_spect, JDC468_greym13_325_spect, JDC468_greyf26_156_spect*/ }; + typedef struct WbTxyz { double Tem; double XX; double ZZ; } WbTxyz; //probably can be "passed" with rawimagesource.cc but I don't know how to do this. - constexpr WbTxyz Txyz[118] = {//temperature Xwb Zwb 118 values - same table as in Rawimagesource.cc x wb and y wb are calculated after + constexpr WbTxyz Txyz[191] = {//temperature Xwb Zwb 191 values - same table as in Rawimagesource.cc x wb and y wb are calculated after + {2001., 1.273842, 0.145295}, + {2051., 1.258802, 0.156066}, + {2101., 1.244008, 0.167533}, + {2151., 1.230570, 0.178778}, + {2201., 1.217338, 0.190697}, + {2251., 1.205305, 0.202338}, + {2301., 1.193444, 0.214632}, + {2351., 1.182648, 0.226598}, + {2401., 1.171996, 0.239195}, + {2451., 1.162290, 0.251421}, + {2501., 1.152883, 0.264539}, + {2551., 1.143965, 0.276682}, + {2605., 1.134667, 0.290722}, + {2655., 1.126659, 0.303556}, + {2705., 1.119049, 0.316446}, + {2755., 1.111814, 0.329381}, + {2790., 1.106961, 0.338455}, + {2803., 1.105381, 0.342193}, + {2825., 1.102275, 0.347542}, + {2856., 1.098258, 0.355599}, + {2880., 1.095233, 0.361840}, + {2910., 1.091550, 0.369645}, + {2930., 1.089155, 0.374849}, + {2960., 1.085649, 0.382655}, + {2980., 1.083369, 0.387858}, + {3003., 1.080982, 0.394258}, + {3025., 1.078397, 0.399561}, + {3050., 1.075727, 0.406057}, + {3075., 1.073122, 0.412550}, + {3103., 1.070277, 0.419815}, + {3128., 1.067801, 0.426296}, + {3153., 1.065384, 0.432769}, + {3175., 1.063305, 0.438459}, + {3203., 1.060906, 0.446161}, + {3225., 1.058738, 0.451367}, + {3250., 1.056535, 0.457806}, + {3280., 1.053960, 0.465519}, + {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}, + {4914., 0.965682, 0.806658}, + {4927., 0.965414, 0.809229}, + {4940., 0.965149, 0.811937}, + {4952., 0.964908, 0.814366}, + {4965., 0.964650, 0.816993}, + {4977., 0.964415, 0.819412}, + {4990., 0.964163, 0.822028}, + {5002., 0.963934, 0.824438},//80 + {5015., 0.963689, 0.827044}, + {5027., 0.963465, 0.829444}, + {5040., 0.963226, 0.832039}, + {5051., 0.963008, 0.834429}, + {5065., 0.963226, 0.832039}, + {5077., 0.962563, 0.839395}, + {5090., 0.962336, 0.841968}, + {5102., 0.962129, 0.844339}, + {5115., 0.961907, 0.846902}, + {5127., 0.961706, 0.849263}, + {5140., 0.961490, 0.851815}, + {5151., 0.961294, 0.854166}, + {5177., 0.960893, 0.859049}, + {5202., 0.960501, 0.863911}, + {5253., 0.959749, 0.873572}, + {5302., 0.959313, 0.883815}, + {5351., 0.958361, 0.892644}, + {5402., 0.957903, 0.902793}, + {5452., 0.957116, 0.911379}, + {5502., 0.956639, 0.921431}, + {5553., 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}, + {6380., 0.950576, 1.069386}, + {6402., 0.950143, 1.074055}, + {6425., 0.950428, 1.076341}, + {6452., 0.950345, 1.080484}, + {6475., 0.950277, 1.083996}, + {6502., 0.950201, 1.088097}, + {6525., 0.950139, 1.091573}, + {6552., 0.950070, 1.095633}, + {6575., 0.950014, 1.099075}, + {6602., 0.949952, 1.103094}, + {6625., 0.949902, 1.106501}, + {6652., 0.949846, 1.110479}, + {6675., 0.949801, 1.113852}, + {6702., 0.949752, 1.119138}, + {6725., 0.949712, 1.121128}, + {6752., 0.949668, 1.125027}, + {6802., 0.949596, 1.132190}, + {6852., 0.949533, 1.139281}, + {6902., 0.949033, 1.147691}, + {6952., 0.949437, 1.153246}, + {7002., 0.949402, 1.160129}, + {7052., 0.949376, 1.166966}, + {7102., 0.949358, 1.173732}, + {7152., 0.949348, 1.180429}, + {7202., 0.949346, 1.187058}, + {7252., 0.949350, 1.193619}, + {7301., 0.948896, 1.201432}, + {7352., 0.949380, 1.206541}, + {7402., 0.949405, 1.212904}, + {7451., 0.949434, 1.219076}, + {7501., 0.949471, 1.225312}, + {7551., 0.949512, 1.231485}, + {7601., 0.949099, 1.239061}, + {7675., 0.949638, 1.246525}, + {7751., 0.949729, 1.255559}, + {7825., 0.949828, 1.264225}, + {7901., 0.949498, 1.274460}, + {7952., 0.950018, 1.278800}, + {8025., 0.950137, 1.287013}, + {8095., 0.950259, 1.294777}, + {8151., 0.950361, 1.300912}, + {8225., 0.950501, 1.308915}, + {8301., 0.950253, 1.318464}, + {8375., 0.950804, 1.324786}, + {8451., 0.950966, 1.332651}, + {8525., 0.951129, 1.340199}, + {8601., 0.950941, 1.349261}, + {8701., 0.951533, 1.357724}, + {8801., 0.951772, 1.367421}, + {8901., 0.952018, 1.376935}, + {9001., 0.951969, 1.387639}, + {9201., 0.952784, 1.404422}, + {9401., 0.953081, 1.423213},//since 5 2023 I increased the number of temp references above 9401K + {9651., 0.953993, 1.442883}, + {9901., 0.954537, 1.464134}, + {10201., 0.955520, 1.485825}, + {10501., 0.956321, 1.508623}, + {10751., 0.957057, 1.524806}, + {11001., 0.957747, 1.541281}, + {11251., 0.958436, 1.557207}, + {11501., 0.959112, 1.572366}, + {11751., 0.959784, 1.587037}, + {12001., 0.960440, 1.601019},//since 5 2023 I increased the number of temp references above 12000K + {12251., 0.961090, 1.614566}, + {12501., 0.963963, 1.627492}, + {12751., 0.962350, 1.640031}, + {13001., 0.962962, 1.652055}, + {13251., 0.963561, 1.663638}, + {13501., 0.964147, 1.674804}, + {13751., 0.964720, 1.685571}, + {14001., 0.965279, 1.695919}, + {14251., 0.965827, 1.705950}, + {14501., 0.966363, 1.715637}, + {14751., 0.966886, 1.724998}, + {15001., 0.967397, 1.734047} + }; + + //compatibility 5.9 + constexpr WbTxyz Txyzs[118] = {//temperature Xwb Zwb 118 values - same table as in Rawimagesource.cc x wb and y wb are calculated after for 5.9 {2001., 1.273842, 0.145295}, {2101., 1.244008, 0.167533}, {2201., 1.217338, 0.190697}, @@ -3773,12 +5768,28 @@ void ColorTemp::tempxy(bool separated, int repref, float **Tx, float **Ty, float }; int N_c = sizeof(spec_colorforxcyc) / sizeof(spec_colorforxcyc[0]); //number of color + + if (wbpar.itcwb_sampling) { + N_c = sizeof(spec_colorforxcyc_old) / sizeof(spec_colorforxcyc_old[0]); //number of color 5.9 + } + + int N_t = sizeof(Txyz) / sizeof(Txyz[0]); //number of temperature White point + + if (wbpar.itcwb_sampling) { + N_t = sizeof(Txyzs) / sizeof(Txyzs[0]); //number of temperature White point 5.9 + } + + if (settings->verbose) { + printf("Number max spectral colors=%i Number sampling temp=%i\n", N_c, N_t); + } + typedef struct XYZref { double Xref; double Yref; double Zref; } XYZref; + XYZref Refxyz[N_c + 1]; for (int i = 0; i < N_c; i++) { @@ -3787,16 +5798,33 @@ void ColorTemp::tempxy(bool separated, int repref, float **Tx, float **Ty, float Refxyz[i].Zref = 0.f; } - const color_match_type &color_match = (wbpar.observer == StandardObserver::TEN_DEGREES) ? cie_colour_match_jd : cie_colour_match_jd2; - - // const color_match_type &color_match = (wbpar.observer == StandardObserver::TEN_DEGREES) ? cie_colour_match_jd : cie_colour_match_jd2; + bool observerchoice = false; + + observerchoice = (wbpar.observer == StandardObserver::TEN_DEGREES); + + if (wbpar.itcwb_sampling) { + observerchoice = false; + } + + const color_match_type &color_match = observerchoice ? cie_colour_match_jd : cie_colour_match_jd2; if (separated) { - const double tempw = Txyz[repref].Tem; + double tempw = Txyz[repref].Tem; + + if (wbpar.itcwb_sampling) { + tempw = Txyzs[repref].Tem; + } + + double yy = 0.; + whitepoint(tempw, wpx, yy, wpz, color_match); if (tempw <= INITIALBLACKBODY) { - for (int i = 0; i < N_c; i++) { - spectrum_to_color_xyz_blackbody(spec_colorforxcyc[i], tempw, TX[i], TY[i], TZ[i], color_match); + for (int i = 0; i < N_c; i++) { + if (! wbpar.itcwb_sampling) { + spectrum_to_color_xyz_blackbody(spec_colorforxcyc[i], tempw, TX[i], TY[i], TZ[i], color_match); + } else { + spectrum_to_color_xyz_blackbody(spec_colorforxcyc_old[i], tempw, TX[i], TY[i], TZ[i], color_match); + } } } else { double m11, m22, x_DD, y_DD, interm2; @@ -3815,16 +5843,33 @@ void ColorTemp::tempxy(bool separated, int repref, float **Tx, float **Ty, float 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, TX[i], TY[i], TZ[i], color_match); + if (! wbpar.itcwb_sampling) { + spectrum_to_color_xyz_daylight(spec_colorforxcyc[i], m11, m22, TX[i], TY[i], TZ[i], color_match); + } else { + spectrum_to_color_xyz_daylight(spec_colorforxcyc_old[i], m11, m22, TX[i], TY[i], TZ[i], color_match); + } } } } else { - for (int tt = 0; tt < N_t; tt++) { - const double tempw = Txyz[tt].Tem; + for (int tt = ttbeg; tt < ttend; tt++) { + double tempw = Txyz[tt].Tem; + + if (wbpar.itcwb_sampling) { + tempw = Txyzs[repref].Tem; + } + + double yy = 0.; + whitepoint(tempw, wpx, yy, wpz, color_match); + WPX[tt] = wpx; + WPZ[tt] = wpz; 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, color_match); + if (! wbpar.itcwb_sampling) { + spectrum_to_color_xyz_blackbody(spec_colorforxcyc[i], tempw, Refxyz[i].Xref, Refxyz[i].Yref, Refxyz[i].Zref, color_match); + } else { + spectrum_to_color_xyz_blackbody(spec_colorforxcyc_old[i], tempw, Refxyz[i].Xref, Refxyz[i].Yref, Refxyz[i].Zref, color_match); + } } } else { double x_DD; @@ -3843,7 +5888,11 @@ void ColorTemp::tempxy(bool separated, int repref, float **Tx, float **Ty, float const double 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, color_match); + if (! wbpar.itcwb_sampling) { + spectrum_to_color_xyz_daylight(spec_colorforxcyc[i], m11, m22, Refxyz[i].Xref, Refxyz[i].Yref, Refxyz[i].Zref, color_match); + } else { + spectrum_to_color_xyz_daylight(spec_colorforxcyc_old[i], m11, m22, Refxyz[i].Xref, Refxyz[i].Yref, Refxyz[i].Zref, color_match); + } } } diff --git a/rtengine/colortemp.h b/rtengine/colortemp.h index 0fe56b7cd..db69abe2d 100644 --- a/rtengine/colortemp.h +++ b/rtengine/colortemp.h @@ -56,13 +56,13 @@ private: void temp2mul (double temp, double green, double equal, StandardObserver observer, double& rmul, double& gmul, double& bmul) const; const static std::map spectMap; public: - static constexpr StandardObserver DEFAULT_OBSERVER = StandardObserver::TEN_DEGREES; - + // static constexpr StandardObserver DEFAULT_OBSERVER = StandardObserver::TEN_DEGREES; + static constexpr StandardObserver DEFAULT_OBSERVER = StandardObserver::TWO_DEGREES; ColorTemp () : temp(-1.), green(-1.), equal (1.), method("Custom") {} explicit ColorTemp (double e) : temp(-1.), green(-1.), equal (e), method("Custom") {} ColorTemp (double t, double g, double e, const std::string &m, StandardObserver o); ColorTemp (double mulr, double mulg, double mulb, double e, StandardObserver observer); - 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); + 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, int ttbeg, int ttend, double &wpx, double &wpz, double *WPX, double *WPZ); void update (const double rmul, const double gmul, const double bmul, const double equal, StandardObserver observer, const double tempBias=0.0) { @@ -169,6 +169,8 @@ public: static const double ColorchechGreE2_spect[97]; static const double ColorchechGreB3_spect[97]; static const double ColorchechCyaF3_spect[97]; + static const double ColorchechCyaF3_spect2[97]; + static const double ColorchechCyaF3_spect3[97]; static const double ColorchechPurD2_spect[97]; static const double ColorchechMagE3_spect[97]; static const double ColorchechSkiA138_13_14_spect[97]; @@ -376,21 +378,259 @@ public: 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 J570_NeuN8_spect2[97];//neutral + static const double J570_NeuN9_spect2[97];//neutral + static const double J570_NeuO8_spect2[97];//neutral + static const double J570_NeuO11_spect2[97];//neutral + static const double J570_NeuD5_spect2[97];//neutral + static const double J570_NeuE11_spect2[97];//neutral + static const double J570_NeuK16_spect2[97];//neutral + static const double J570_NeuM3_spect2[97];//neutral + static const double J570_NeuN18_spect2[97];//neutral + static const double J570_NeuQ1_spect2[97];//neutral + static const double J570_NeuS7_spect2[97];//neutral + static const double J570_NeuV10_spect2[97];//neutral + + static const double J570_NeuW18_spect2[97];//neutral + static const double J570_NeuZ14_spect2[97];//neutral + static const double J570_NeuC18_spect2[97];//neutral + static const double J570_NeuD17_spect2[97];//neutral + static const double J570_NeuJ11_spect2[97];//neutral + static const double J570_NeuL4_spect2[97];//neutral + static const double Colorlab_n72_n2_spect[97]; static const double Colorlab_10_n70_spect[97]; + static const double Colorlab_10_n70_spect2[97]; + static const double Colorlab_10_n70_spect3[97]; + static const double Colorlab_10_n70_spect4[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 const double Colorlab_n80_5_9_5_9spect[97]; +// static const double JDC468_greyc14_66_spect[97]; +// static const double JDC468_greym13_325_spect[97]; +// static const double JDC468_greyf26_156_spect[97]; // static const double Colorlab_n57_5_6_9spect[97]; - - /* - static const double JDC468_greyc14_66_spect[97]; - static const double JDC468_greym13_325_spect[97]; - static const double JDC468_greyf26_156_spect[97]; - */ + static const double Colorlab_L61_110_110Rec2020spect[97]; + static const double Colorlab_L63_120_m56Rec2020spect[97]; + static const double Colorlab_L63_m50_m60Rec2020spect[97]; + static const double Colorlab_L63_m120_80Rec2020spect[97]; + static const double Colorlab_L42_110_m100Prospect[97]; + static const double Colorlab_L42_m70_m100Prospect[97]; + static const double Colorlab_L56_m120_90Prospect[97]; + static const double Colorlab_L25_60_m120Prospect[97]; + static const double Colorlab_L75_50_120Prospect[97]; + static const double Colorlab_L75_m120_0Prospect[97]; + static const double Colorlab_L22_2_1_3Prospect[97]; + static const double Colorlab_L44_2_8_3_9spect[97]; + static const double Colorlab_L44_2_8_3_9spect2[97]; + static const double Colorlab_L95_2_3_15_6spect[97]; + static const double Colorlab_L95_2_3_15_6spect2[97]; + static const double Colorlab_L40_3_5_10_7spect[97]; + static const double Colorlab_L40_3_5_10_7spect2[97]; + static const double Colorlab_L40_3_5_10_7spect3[97]; + static const double Colorlab_L34_1_8_1_9spect[97]; + static const double Colorlab_L34_1_8_1_9spect2[97]; + static const double Colorlab_L64_1_8_m1_9spect[97]; + static const double Colorlab_L84_0_8_m1spect[97]; + static const double Colorlab_L63_1_3_m2spect[97]; + static const double Colorlab_L44_2_3_m3spect[97]; + static const double Colorlab_L65_96_45spect[97]; + static const double Colorlab_L52_47_57spect[97]; + static const double Colorlab_L31_62_27spect[97]; + static const double Colorlab_L79_m9_m28spect[97]; + static const double Colorlab_L58_50_31spect[97]; + static const double Colorlab_L31_m52_27spect[97]; + static const double Colorlab_L44_2_2_m7_35spect[97]; + static const double Colorlab_L47_m10_8_0_41spect[97]; + static const double Colorlab_L32_4_8_m3_2spect[97]; + static const double Colorlab_L57_m6_9_2_9spect[97]; + static const double Colorlab_L33_2_4_m4_5spect[97]; + static const double Colorlab_L35_11_65_m1_1spect[97]; + static const double Colorlab_L52_m2_7_8_9spect[97]; + static const double Colorlab_L32_7_m2_5spect[97]; + static const double Colorlab_L32_3_4_m3_8spect[97]; + static const double Colorlab_L50_m5_3_6_5spect[97]; + static const double Colorlab_L44_3_96_m8_8spect[97]; + static const double Colorlab_L34_3_6_m5_4spect[97]; + static const double Colorlab_L31_5_9_m4spect[97]; + static const double Colorlab_L35_3_4_m11spect[97]; + static const double Colorlab_L31_4_5_m4_7spect[97]; + static const double Colorlab_L35_4_8_m6_4spect[97]; + static const double Colorlab_L95_10_7_m14_3spect[97]; + static const double Colorlab_L36_34_m7_5spect[97]; + static const double Colorlab_L37_59_2spect[97]; + static const double Colorlab_L69_14_m9spect[97]; + static const double Colorlab_L92_13_m16spect[97]; + static const double Colorlab_L49_21_m12spect[97]; + static const double Colorlab_L56_20_m15spect[97]; + static const double Colorlab_L68_21_m19spect[97]; + static const double Colorlab_L98_m2_m32spect[97]; + static const double Colorlab_L98_m2_m32spect2[97]; + static const double Colorlab_L41_m27_m16spect[97]; + static const double Colorlab_L41_m27_m16spect2[97]; + static const double Colorlab_L15_m9_4spect[97]; + static const double Colorlab_L15_m9_4spect2[97]; + static const double Colorlab_L11_m11_2spect[97]; + static const double Colorlab_L14_m4_3spect[97]; + static const double Colorlab_L41_38_24spect[97]; + static const double Colorlab_L41_38_24spect2[97]; + static const double Colorlab_L53_48_58spect[97]; + static const double Colorlab_L53_48_58spect2[97]; + static const double Colorlab_L70_44_86spect[97]; + static const double Colorlab_L70_44_86spect2[97]; + static const double Colorlab_L38_42_19spect[97]; + static const double Colorlab_L38_42_19spect2[97]; + static const double Colorlab_L60_63_85spect[97]; + static const double Colorlab_L60_63_85spect2[97]; + static const double Colorlab_L80_75_30spect[97]; + static const double Colorlab_L80_75_30spect2[97]; + static const double Colorlab_L28_m21_24spect[97]; + static const double Colorlab_L28_m21_24spect2[97]; + static const double Colorlab_L45_m33_47spect[97]; + static const double Colorlab_L45_m33_47spect2[97]; + static const double Colorlab_L26_m7_404spect[97]; + static const double Colorlab_L34_m61_2spect[97]; + static const double Colorlab_L32_m16_17spect[97]; + static const double Colorlab_L30_m19_15spect[97]; + static const double Colorlab_L30_m17_16spect[97]; + static const double Colorlab_L35_m8_4spect[97]; + static const double Colorlab_L37_m7_5spect[97]; + static const double Colorlab_L45_m7_2spect[97]; + static const double Colorlab_L40_m6_5spect[97]; + static const double Colorlab_L46_m6_2spect[97]; + static const double Colorlab_L48_m69_16spect[97]; + static const double Colorlab_L51_89_53spect[97]; + static const double Colorlab_L49_84_33spect[97]; + static const double Colorlab_L59_m51_31spect[97]; + static const double Colorlab_L48_m69_16spect2[97]; + static const double Colorlab_L53_m71_6spect[97]; + static const double Colorlab_L51_m89_53spect2[97]; + static const double Colorlab_L49_84_33spect2[97]; + static const double Colorlab_L36_m27_28spect[97]; + static const double Colorlab_L36_m27_28spect2[97]; + static const double Colorlab_L36_m27_28spect3[97]; + static const double Colorlab_L63_16_71spect[97]; + static const double Colorlab_L84_4_46spect[97]; + static const double Colorlab_L84_4_46spect2[97]; + static const double Colorlab_L75_m66_19spect[97]; + static const double Colorlab_L75_m66_19spect2[97]; + static const double Colorlab_L64_m82_m6spect[97]; + static const double Colorlab_L64_m82_m6spect2[97]; + static const double Colorlab_L66_m71_m17spect[97]; + static const double Colorlab_L66_m71_m17spect2[97]; + static const double Colorlab_L22_m8_m60spect[97]; + static const double Colorlab_L22_m8_m60spect2[97]; + static const double Colorlab_L15_m4_m42spect[97]; + static const double Colorlab_L15_m4_m42spect2[97]; + static const double Colorlab_L13_3_m23spect[97]; + static const double Colorlab_L27_4_m90spect[97]; + static const double Colorlab_L19_1_m29spect[97]; + static const double Colorlab_L27_4_m90spect2[97]; + static const double Colorlab_L16_0_m44spect[97]; + static const double Colorlab_L16_0_m44spect2[97]; + static const double Colorlab_L13_m3_m36spect[97]; + static const double Colorlab_L13_m3_m36spect2[97]; + static const double Colorlab_L31_m23_m60spect[97]; + static const double Colorlab_L31_m23_m60spect2[97]; + static const double Colorlab_L17_3_m40spect[97]; + static const double Colorlab_L17_3_m40spect2[97]; + static const double Colorlab_L17_3_m40spect3[97]; + static const double Colorlab_L17_3_m40spect4[97]; + static const double Colorlab_L17_3_m40spect5[97]; + static const double Colorlab_L17_3_m40spect6[97]; + static const double Colorlab_L21_9_m7spect[97]; + static const double Colorlab_L78_4_m74spect[97]; + static const double Colorlab_L31_m58_m66spect[97]; + static const double Colorlab_L61_m11_m12spect[97]; + static const double Colorlab_L61_m11_m12spect2[97]; + static const double Colorlab_L29_1_m13spect[97]; + static const double Colorlab_L29_1_m13spect2[97]; + static const double Colorlab_L2_14_m1spect[97]; + static const double Colorlab_L5_39_m7spect[97]; + static const double Colorlab_L15_5_m13spect[97]; + static const double Colorlab_L12_5_m6spect[97]; + static const double Colorlab_L12_5_m6spect2[97]; + static const double Colorlab_L37_m59_m24spect[97]; + static const double Colorlab_L37_m59_m24spect2[97]; + static const double Colorlab_L15_55_23spect[97]; + static const double Colorlab_L11_m55_m11spect[97]; + static const double Colorlab_L8_m10_m2spect[97]; + static const double Colorlab_L14_m10_m7spect[97]; + static const double Colorlab_L20_m16_m13spect[97]; + static const double Colorlab_L8_m10_m2spect2[97]; + static const double Colorlab_L14_m10_m7spect2[97]; + static const double Colorlab_L20_m16_m13spect2[97]; + static const double Colorlab_L6_m9_1spect[97]; + static const double Colorlab_L20_m9_m10spect[97]; + static const double Colorlab_L85_10_45spect[97]; + static const double Colorlab_L90_m7_82spect[97]; + static const double Colorlab_L95_2_18spect[97]; + static const double Colorlab_L39_7_4spect[97]; + static const double Colorlab_L39_4_1spect[97]; + static const double Colorlab_L39_3_m1spect[97]; + static const double Colorlab_L40_3_m2spect[97]; + static const double Colorlab_L36_2_2spect[97]; + static const double Colorlab_L39_7_4spect2[97]; + static const double Colorlab_L39_4_1spect2[97]; + static const double Colorlab_L39_3_m1spect2[97]; + static const double Colorlab_L40_3_m2spect2[97]; + static const double Colorlab_L36_2_2spect2[97]; + static const double Colorlab_L40_4_m2spect[97]; + static const double Colorlab_L41_1_m6spect[97]; + static const double Colorlab_L40_4_m2spect2[97]; + static const double Colorlab_L41_1_m6spect2[97]; + static const double Colorlab_L41_12_14spect[97]; + static const double Colorlab_L41_12_14spect2[97]; + static const double Colorlab_L10_0_m22spect[97]; + static const double Colorlab_L38_60_8spect[97]; + static const double Colorlab_L49_85_39spect[97]; + static const double Colorlab_L42_1_m18spect[97]; + static const double Colorlab_L48_19_m25spect[97]; + static const double Colorlab_L30_21_m25spect[97]; + static const double Colorlab_L15_10_m15spect[97]; + static const double Colorlab_L48_19_m25spect2[97]; + static const double Colorlab_L30_21_m25spect2[97]; + static const double Colorlab_L15_10_m15spect2[97]; + static const double Colorlab_L60_26_m25spect[97]; + static const double Colorlab_L40_26_m45spect[97]; + static const double Colorlab_L40_26_m45spect2[97]; + static const double Colorlab_L20_10_m45spect[97]; + static const double Colorlab_L20_10_m45spect2[97]; + static const double Colorlab_L20_10_m45spect3[97]; + static const double ColorBlueSkyK3_spect2[97]; + static const double ColorBlueSkyK9_spect2[97]; + static const double ColorBlueSkyC4_spect2[97]; + static const double ColorBlueSkyC14_spect2[97]; + static const double ColorBlueSkyE4_spect2[97]; + static const double ColorBlueSkyM1_spect2[97]; + static const double ColorBlueSky2B1_spect2[97]; + static const double ColorBlueSkyT7_spect2[97]; + static const double ColorBlueSkyU19_spect2[97]; + static const double ColorBlueSkyU2_spect2[97]; + static const double Colorlab_L40_1_m40spect[97]; + static const double Colorlab_L30_4_m30spect[97]; + static const double Colorlab_L8_11_m25spect[97]; + static const double Colorlab_L40_1_m40spect2[97]; + static const double Colorlab_L30_4_m30spect2[97]; + static const double Colorlab_L8_11_m25spect2[97]; + static const double Colorlab_L26_m8_m25spect[97]; + static const double Colorlab_L26_m8_m25spect2[97]; + static const double Colorlab_L26_m8_m25spect3[97]; + static const double Colorlab_L22_1_m42spect[97]; + static const double Colorlab_L22_1_m42spect2[97]; + static const double Colorlab_L22_1_m42spect3[97]; + static const double Colorlab_L22_1_m42spect4[97]; + static const double Colorlab_L27_m1_m47spect[97]; + static const double Colorlab_L27_m1_m47spect2[97]; + static const double Colorlab_L40_30_m30spect[97]; + static const double Colorlab_L40_30_m30spect2[97]; + static const double Colorlab_L40_20_m35spect[97]; + static const double Colorlab_L40_20_m35spect2[97]; + static void spectrum_to_xyz_daylight (double _m1, double _m2, double &x, double &y, double &z, const color_match_type &color_match); static void spectrum_to_xyz_blackbody (double _temp, double &x, double &y, double &z, const color_match_type &color_match); static void spectrum_to_xyz_preset (const double* spec_intens, double &x, double &y, double &z, const color_match_type &color_match); @@ -398,6 +638,9 @@ public: static void spectrum_to_color_xyz_daylight (const double* spec_color, double _m1, double _m2, double &xx, double &yy, double &zz, const color_match_type &color_match); static void spectrum_to_color_xyz_blackbody (const double* spec_color, double _temp, double &xx, double &yy, double &zz, const color_match_type &color_match); static void spectrum_to_color_xyz_preset (const double* spec_color, const double* spec_intens, double &xx, double &yy, double &zz, const color_match_type &color_match); + static void spectrum_to_whitepoint_xyz_daylight (double _m1, double _m2, double &xx, double &yy, double &zz, const color_match_type &color_match); + static void spectrum_to_whitepoint_xyz_blackbody (double _temp, double &xx, double &yy, double &zz, const color_match_type &color_match); + static void whitepoint (double tempw, double &xx, double &yy, double &zz,const color_match_type &color_match); }; } diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 7a2a5b4d5..82c72a53b 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -4422,10 +4422,10 @@ void CLASS crop_masked_pixels() } } else { if (height + top_margin > raw_height) { - top_margin = raw_height - height; + top_margin = raw_height - MIN(height, raw_height); } if (width + left_margin > raw_width) { - left_margin = raw_width - width; + left_margin = raw_width - MIN(width, raw_width); } #ifdef _OPENMP #pragma omp parallel for @@ -6812,17 +6812,17 @@ guess_cfa_pc: linear_table (len); break; case 50713: /* BlackLevelRepeatDim */ - if (tiff_ifd[ifd].new_sub_file_type != 0) continue; + if (tiff_ifd[ifd].new_sub_file_type != 0) break; cblack[4] = get2(); cblack[5] = get2(); if (cblack[4] * cblack[5] > sizeof cblack / sizeof *cblack - 6) cblack[4] = cblack[5] = 1; break; case 61450: - if (tiff_ifd[ifd].new_sub_file_type != 0) continue; + if (tiff_ifd[ifd].new_sub_file_type != 0) break; cblack[4] = cblack[5] = MIN(sqrt(len),64); case 50714: /* BlackLevel */ - if (tiff_ifd[ifd].new_sub_file_type != 0) continue; + if (tiff_ifd[ifd].new_sub_file_type != 0) break; RT_blacklevel_from_constant = ThreeValBool::F; //----------------------------------------------------------------------------- // taken from LibRaw. @@ -8675,7 +8675,8 @@ void CLASS adobe_coeff (const char *make, const char *model) { "Olympus E-M5MarkII", 0, 0, { 9422,-3258,-711,-2655,10898,2015,-512,1354,5512 } }, { "Olympus E-M5", 0, 0xfe1, - { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } }, + { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },//D65 +// { 9033,-3597, 26,-2351, 9700, 3111, -181, 807, 5838} },//stDA { "Olympus PEN-F", 0, 0, { 9476,-3182,-765,-2613,10958,1893,-449,1315,5268 } }, { "Olympus SH-2", 0, 0, @@ -9807,9 +9808,9 @@ void CLASS identify() if (!strncasecmp (model, make, i) && model[i++] == ' ') memmove (model, model+i, 64-i); if (!strncmp (model,"FinePix ",8)) - strcpy (model, model+8); +/* RT */ memmove (model, model+8, 64-8); if (!strncmp (model,"Digital Camera ",15)) - strcpy (model, model+15); +/* RT */ memmove (model, model+15, 64-15); desc[511] = artist[63] = make[63] = model[63] = model2[63] = 0; if (!is_raw) goto notraw; @@ -10138,8 +10139,8 @@ canon_a5: width = raw_width = 5504; height = raw_height = 3856; } - top_margin = (raw_height - height) >> 2 << 1; - left_margin = (raw_width - width ) >> 2 << 1; + top_margin = (raw_height - MIN(height, raw_height)) >> 2 << 1; + left_margin = (raw_width - MIN(width, raw_width) ) >> 2 << 1; if (width == 2848 || width == 3664) filters = 0x16161616; if (width == 4032 || width == 4952 || width == 6032 || width == 8280) left_margin = 0; if (width == 3328 && (width -= 66)) left_margin = 34; diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 8ddaa5f75..dda8489df 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -18,6 +18,9 @@ * along with RawTherapee. If not, see . */ +#include +#include + #include "cieimage.h" #include "color.h" #include "curves.h" @@ -597,7 +600,6 @@ void Crop::update(int todo) params.dirpyrDenoise.redchro = maxr; params.dirpyrDenoise.bluechro = maxb; parent->denoiseInfoStore.valid = true; - if (parent->adnListener) { parent->adnListener->chromaChanged(params.dirpyrDenoise.chroma, params.dirpyrDenoise.redchro, params.dirpyrDenoise.bluechro); } @@ -845,7 +847,7 @@ void Crop::update(int todo) if ((todo & (M_AUTOEXP | M_RGBCURVE)) && params.locallab.enabled && !params.locallab.spots.empty()) { - + //I made a little change here. Rather than have luminanceCurve (and others) use in/out lab images, we can do more if we copy right here. parent->ipf.rgb2lab(*baseCrop, *laboCrop, params.icm.workingProfile); @@ -942,16 +944,7 @@ void Crop::update(int todo) auto& locwavCurveden = parent->locwavCurveden; auto& lmasklocal_curve2 = parent->lmasklocal_curve; auto& loclmasCurve_wav = parent->loclmasCurve_wav; -// const int sizespot = (int)params.locallab.spots.size(); -/* float *huerefp = nullptr; - huerefp = new float[sizespot]; - float *chromarefp = nullptr; - chromarefp = new float[sizespot]; - float *lumarefp = nullptr; - lumarefp = new float[sizespot]; - float *fabrefp = nullptr; - fabrefp = new float[sizespot]; -*/ + for (int sp = 0; sp < (int)params.locallab.spots.size(); sp++) { locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); locRETtransCurve.Set(params.locallab.spots.at(sp).localTtranscurve); @@ -1045,6 +1038,7 @@ void Crop::update(int todo) if (black < 0. && params.locallab.spots.at(sp).expMethod == "pde" ) { black *= 1.5; } + std::vector localldenoiselc; double cont = params.locallab.spots.at(sp).contrast; double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre; @@ -1060,6 +1054,7 @@ void Crop::update(int todo) float stdtme = parent->stdtms[sp]; float meanretie = parent->meanretis[sp]; float stdretie = parent->stdretis[sp]; + float fab = 1.f; float minCD; float maxCD; @@ -1070,7 +1065,14 @@ void Crop::update(int todo) float Tmin; float Tmax; int lastsav; - + float highresi = 0.f; + float nresi = 0.f; + float highresi46 =0.f; + float nresi46 = 0.f; + float Lhighresi = 0.f; + float Lnresi = 0.f; + float Lhighresi46 = 0.f; + float Lnresi46 = 0.f; /* huerefp[sp] = huere; chromarefp[sp] = chromare; lumarefp[sp] = lumare; @@ -1139,9 +1141,20 @@ void Crop::update(int todo) huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, parent->previewDeltaE, parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallvibMask, parent->localllcMask, parent->locallsharMask, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask, parent->localllogMask, parent->locall_Mask, parent->locallcieMask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, - meantme, stdtme, meanretie, stdretie, fab); - // fabrefp[sp] = fab; - + meantme, stdtme, meanretie, stdretie, fab, + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); + + LocallabListener::locallabDenoiseLC denoiselc; + denoiselc.highres = highresi; + denoiselc.nres = nresi; + denoiselc.highres46 = highresi46; + denoiselc.nres46 = nresi46; + denoiselc.Lhighres = Lhighresi; + denoiselc.Lnres = Lnresi; + denoiselc.Lhighres46 = Lhighresi46; + denoiselc.Lnres46 = Lnresi46; + localldenoiselc.push_back(denoiselc); + if (parent->previewDeltaE || parent->locallColorMask == 5 || parent->locallvibMask == 4 || parent->locallExpMask == 5 || parent->locallSHMask == 4 || parent->localllcMask == 4 || parent->localltmMask == 4 || parent->localllogMask == 4 || parent->locallsoftMask == 6 || parent->localllcMask == 4 || parent->locallcieMask == 4) { params.blackwhite.enabled = false; params.colorToning.enabled = false; @@ -1171,6 +1184,20 @@ void Crop::update(int todo) } */ + denoiselc.highres = highresi; + denoiselc.nres = nresi; + denoiselc.highres46 = highresi46; + denoiselc.nres46 = nresi46; + denoiselc.Lhighres = Lhighresi; + denoiselc.Lnres = Lnresi; + denoiselc.Lhighres46 = Lhighresi46; + denoiselc.Lnres46 = Lnresi46; + localldenoiselc.push_back(denoiselc); + + + if (parent->locallListener) { + parent->locallListener->denChanged(localldenoiselc, params.locallab.selspot); + } } else { parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), savenormtmCrop.get(), savenormretiCrop.get(), lastorigCrop.get(), fw, fh, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, @@ -1226,8 +1253,11 @@ void Crop::update(int todo) LHutili, HHutili, CHutili, HHutilijz, CHutilijz, LHutilijz, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, - meantme, stdtme, meanretie, stdretie, fab); + meantme, stdtme, meanretie, stdretie, fab, + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); } + + if (sp + 1u < params.locallab.spots.size()) { // do not copy for last spot as it is not needed anymore lastorigCrop->CopyFrom(labnCrop); @@ -1735,6 +1765,11 @@ void Crop::freeAll() shbuffer = nullptr; } + if (shbuf_real) { + delete [] shbuf_real; + shbuf_real = nullptr; + } + PipetteBuffer::flush(); } diff --git a/rtengine/gauss.cc b/rtengine/gauss.cc index 99201a860..0575f73c0 100644 --- a/rtengine/gauss.cc +++ b/rtengine/gauss.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include "gauss.h" @@ -1129,40 +1130,45 @@ template void gaussVertical (T** src, T** dst, const int W, const int H // process 'numcols' columns for better usage of L1 cpu cache (especially faster for large values of H) static const int numcols = 8; - double temp2[H][numcols] ALIGNED16; + std::vector temp2(H * numcols); double temp2Hm1[numcols], temp2H[numcols], temp2Hp1[numcols]; + + auto coord = + [](const int &x, const int &y) -> int { + return x * numcols + y; + }; #ifdef _OPENMP #pragma omp for nowait #endif for (unsigned int i = 0; i < static_cast(std::max(0, W - numcols + 1)); i += numcols) { for (int k = 0; k < numcols; k++) { - temp2[0][k] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k]; - temp2[1][k] = B * src[1][i + k] + b1 * temp2[0][k] + b2 * src[0][i + k] + b3 * src[0][i + k]; - temp2[2][k] = B * src[2][i + k] + b1 * temp2[1][k] + b2 * temp2[0][k] + b3 * src[0][i + k]; + temp2[coord(0, k)] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k]; + temp2[coord(1, k)] = B * src[1][i + k] + b1 * temp2[coord(0, k)] + b2 * src[0][i + k] + b3 * src[0][i + k]; + temp2[coord(2, k)] = B * src[2][i + k] + b1 * temp2[coord(1, k)] + b2 * temp2[coord(0, k)] + b3 * src[0][i + k]; } for (int j = 3; j < H; j++) { for (int k = 0; k < numcols; k++) { - temp2[j][k] = B * src[j][i + k] + b1 * temp2[j - 1][k] + b2 * temp2[j - 2][k] + b3 * temp2[j - 3][k]; + temp2[coord(j, k)] = B * src[j][i + k] + b1 * temp2[coord(j - 1, k)] + b2 * temp2[coord(j - 2, k)] + b3 * temp2[coord(j - 3, k)]; } } for (int k = 0; k < numcols; k++) { - temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[0][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[0][2] * (temp2[H - 3][k] - src[H - 1][i + k]); - temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[1][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[1][2] * (temp2[H - 3][k] - src[H - 1][i + k]); - temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[2][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[2][2] * (temp2[H - 3][k] - src[H - 1][i + k]); + temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[0][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[0][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); + temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[1][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[1][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); + temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[2][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[2][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); } for (int k = 0; k < numcols; k++) { - dst[H - 1][i + k] = temp2[H - 1][k] = temp2Hm1[k]; - dst[H - 2][i + k] = temp2[H - 2][k] = B * temp2[H - 2][k] + b1 * temp2[H - 1][k] + b2 * temp2H[k] + b3 * temp2Hp1[k]; - dst[H - 3][i + k] = temp2[H - 3][k] = B * temp2[H - 3][k] + b1 * temp2[H - 2][k] + b2 * temp2[H - 1][k] + b3 * temp2H[k]; + dst[H - 1][i + k] = temp2[coord(H - 1, k)] = temp2Hm1[k]; + dst[H - 2][i + k] = temp2[coord(H - 2, k)] = B * temp2[coord(H - 2, k)] + b1 * temp2[coord(H - 1, k)] + b2 * temp2H[k] + b3 * temp2Hp1[k]; + dst[H - 3][i + k] = temp2[coord(H - 3, k)] = B * temp2[coord(H - 3, k)] + b1 * temp2[coord(H - 2, k)] + b2 * temp2[coord(H - 1, k)] + b3 * temp2H[k]; } for (int j = H - 4; j >= 0; j--) { for (int k = 0; k < numcols; k++) { - dst[j][i + k] = temp2[j][k] = B * temp2[j][k] + b1 * temp2[j + 1][k] + b2 * temp2[j + 2][k] + b3 * temp2[j + 3][k]; + dst[j][i + k] = temp2[coord(j, k)] = B * temp2[coord(j, k)] + b1 * temp2[coord(j + 1, k)] + b2 * temp2[coord(j + 2, k)] + b3 * temp2[coord(j + 3, k)]; } } } @@ -1173,24 +1179,24 @@ template void gaussVertical (T** src, T** dst, const int W, const int H // process remaining columns for (int i = W - (W % numcols); i < W; i++) { - temp2[0][0] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i]; - temp2[1][0] = B * src[1][i] + b1 * temp2[0][0] + b2 * src[0][i] + b3 * src[0][i]; - temp2[2][0] = B * src[2][i] + b1 * temp2[1][0] + b2 * temp2[0][0] + b3 * src[0][i]; + temp2[coord(0, 0)] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i]; + temp2[coord(1, 0)] = B * src[1][i] + b1 * temp2[coord(0, 0)] + b2 * src[0][i] + b3 * src[0][i]; + temp2[coord(2, 0)] = B * src[2][i] + b1 * temp2[coord(1, 0)] + b2 * temp2[coord(0, 0)] + b3 * src[0][i]; for (int j = 3; j < H; j++) { - temp2[j][0] = B * src[j][i] + b1 * temp2[j - 1][0] + b2 * temp2[j - 2][0] + b3 * temp2[j - 3][0]; + temp2[coord(j, 0)] = B * src[j][i] + b1 * temp2[coord(j - 1, 0)] + b2 * temp2[coord(j - 2, 0)] + b3 * temp2[coord(j - 3, 0)]; } - double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[0][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[0][2] * (temp2[H - 3][0] - src[H - 1][i]); - double temp2H = src[H - 1][i] + M[1][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[1][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[1][2] * (temp2[H - 3][0] - src[H - 1][i]); - double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[2][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[2][2] * (temp2[H - 3][0] - src[H - 1][i]); + double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[0][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[0][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); + double temp2H = src[H - 1][i] + M[1][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[1][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[1][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); + double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[2][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[2][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); - dst[H - 1][i] = temp2[H - 1][0] = temp2Hm1; - dst[H - 2][i] = temp2[H - 2][0] = B * temp2[H - 2][0] + b1 * temp2[H - 1][0] + b2 * temp2H + b3 * temp2Hp1; - dst[H - 3][i] = temp2[H - 3][0] = B * temp2[H - 3][0] + b1 * temp2[H - 2][0] + b2 * temp2[H - 1][0] + b3 * temp2H; + dst[H - 1][i] = temp2[coord(H - 1, 0)] = temp2Hm1; + dst[H - 2][i] = temp2[coord(H - 2, 0)] = B * temp2[coord(H - 2, 0)] + b1 * temp2[coord(H - 1, 0)] + b2 * temp2H + b3 * temp2Hp1; + dst[H - 3][i] = temp2[coord(H - 3, 0)] = B * temp2[coord(H - 3, 0)] + b1 * temp2[coord(H - 2, 0)] + b2 * temp2[coord(H - 1, 0)] + b3 * temp2H; for (int j = H - 4; j >= 0; j--) { - dst[j][i] = temp2[j][0] = B * temp2[j][0] + b1 * temp2[j + 1][0] + b2 * temp2[j + 2][0] + b3 * temp2[j + 3][0]; + dst[j][i] = temp2[coord(j, 0)] = B * temp2[coord(j, 0)] + b1 * temp2[coord(j + 1, 0)] + b2 * temp2[coord(j + 2, 0)] + b3 * temp2[coord(j + 3, 0)]; } } } @@ -1208,40 +1214,45 @@ template void gaussVerticaldiv (T** src, T** dst, T** divBuffer, const // process 'numcols' columns for better usage of L1 cpu cache (especially faster for large values of H) static const int numcols = 8; - double temp2[H][numcols] ALIGNED16; + std::vector temp2(H * numcols); double temp2Hm1[numcols], temp2H[numcols], temp2Hp1[numcols]; + + auto coord = + [](const int &x, const int &y) -> int { + return x * numcols + y; + }; #ifdef _OPENMP #pragma omp for nowait #endif for (int i = 0; i < W - numcols + 1; i += numcols) { for (int k = 0; k < numcols; k++) { - temp2[0][k] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k]; - temp2[1][k] = B * src[1][i + k] + b1 * temp2[0][k] + b2 * src[0][i + k] + b3 * src[0][i + k]; - temp2[2][k] = B * src[2][i + k] + b1 * temp2[1][k] + b2 * temp2[0][k] + b3 * src[0][i + k]; + temp2[coord(0, k)] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k]; + temp2[coord(1, k)] = B * src[1][i + k] + b1 * temp2[coord(0, k)] + b2 * src[0][i + k] + b3 * src[0][i + k]; + temp2[coord(2, k)] = B * src[2][i + k] + b1 * temp2[coord(1, k)] + b2 * temp2[coord(0, k)] + b3 * src[0][i + k]; } for (int j = 3; j < H; j++) { for (int k = 0; k < numcols; k++) { - temp2[j][k] = B * src[j][i + k] + b1 * temp2[j - 1][k] + b2 * temp2[j - 2][k] + b3 * temp2[j - 3][k]; + temp2[coord(j, k)] = B * src[j][i + k] + b1 * temp2[coord(j - 1, k)] + b2 * temp2[coord(j - 2, k)] + b3 * temp2[coord(j - 3, k)]; } } for (int k = 0; k < numcols; k++) { - temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[0][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[0][2] * (temp2[H - 3][k] - src[H - 1][i + k]); - temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[1][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[1][2] * (temp2[H - 3][k] - src[H - 1][i + k]); - temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[2][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[2][2] * (temp2[H - 3][k] - src[H - 1][i + k]); + temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[0][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[0][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); + temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[1][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[1][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); + temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[2][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[2][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); } for (int k = 0; k < numcols; k++) { - dst[H - 1][i + k] = rtengine::max(divBuffer[H - 1][i + k] / (temp2[H - 1][k] = temp2Hm1[k]), 0.0); - dst[H - 2][i + k] = rtengine::max(divBuffer[H - 2][i + k] / (temp2[H - 2][k] = B * temp2[H - 2][k] + b1 * temp2[H - 1][k] + b2 * temp2H[k] + b3 * temp2Hp1[k]), 0.0); - dst[H - 3][i + k] = rtengine::max(divBuffer[H - 3][i + k] / (temp2[H - 3][k] = B * temp2[H - 3][k] + b1 * temp2[H - 2][k] + b2 * temp2[H - 1][k] + b3 * temp2H[k]), 0.0); + dst[H - 1][i + k] = rtengine::max(divBuffer[H - 1][i + k] / (temp2[coord(H - 1, k)] = temp2Hm1[k]), 0.0); + dst[H - 2][i + k] = rtengine::max(divBuffer[H - 2][i + k] / (temp2[coord(H - 2, k)] = B * temp2[coord(H - 2, k)] + b1 * temp2[coord(H - 1, k)] + b2 * temp2H[k] + b3 * temp2Hp1[k]), 0.0); + dst[H - 3][i + k] = rtengine::max(divBuffer[H - 3][i + k] / (temp2[coord(H - 3, k)] = B * temp2[coord(H - 3, k)] + b1 * temp2[coord(H - 2, k)] + b2 * temp2[coord(H - 1, k)] + b3 * temp2H[k]), 0.0); } for (int j = H - 4; j >= 0; j--) { for (int k = 0; k < numcols; k++) { - dst[j][i + k] = rtengine::max(divBuffer[j][i + k] / (temp2[j][k] = B * temp2[j][k] + b1 * temp2[j + 1][k] + b2 * temp2[j + 2][k] + b3 * temp2[j + 3][k]), 0.0); + dst[j][i + k] = rtengine::max(divBuffer[j][i + k] / (temp2[coord(j, k)] = B * temp2[coord(j, k)] + b1 * temp2[coord(j + 1, k)] + b2 * temp2[coord(j + 2, k)] + b3 * temp2[coord(j + 3, k)]), 0.0); } } } @@ -1252,24 +1263,24 @@ template void gaussVerticaldiv (T** src, T** dst, T** divBuffer, const // process remaining columns for (int i = W - (W % numcols); i < W; i++) { - temp2[0][0] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i]; - temp2[1][0] = B * src[1][i] + b1 * temp2[0][0] + b2 * src[0][i] + b3 * src[0][i]; - temp2[2][0] = B * src[2][i] + b1 * temp2[1][0] + b2 * temp2[0][0] + b3 * src[0][i]; + temp2[coord(0, 0)] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i]; + temp2[coord(1, 0)] = B * src[1][i] + b1 * temp2[coord(0, 0)] + b2 * src[0][i] + b3 * src[0][i]; + temp2[coord(2, 0)] = B * src[2][i] + b1 * temp2[coord(1, 0)] + b2 * temp2[coord(0, 0)] + b3 * src[0][i]; for (int j = 3; j < H; j++) { - temp2[j][0] = B * src[j][i] + b1 * temp2[j - 1][0] + b2 * temp2[j - 2][0] + b3 * temp2[j - 3][0]; + temp2[coord(j, 0)] = B * src[j][i] + b1 * temp2[coord(j - 1, 0)] + b2 * temp2[coord(j - 2, 0)] + b3 * temp2[coord(j - 3, 0)]; } - double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[0][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[0][2] * (temp2[H - 3][0] - src[H - 1][i]); - double temp2H = src[H - 1][i] + M[1][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[1][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[1][2] * (temp2[H - 3][0] - src[H - 1][i]); - double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[2][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[2][2] * (temp2[H - 3][0] - src[H - 1][i]); + double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[0][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[0][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); + double temp2H = src[H - 1][i] + M[1][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[1][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[1][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); + double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[2][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[2][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); - dst[H - 1][i] = rtengine::max(divBuffer[H - 1][i] / (temp2[H - 1][0] = temp2Hm1), 0.0); - dst[H - 2][i] = rtengine::max(divBuffer[H - 2][i] / (temp2[H - 2][0] = B * temp2[H - 2][0] + b1 * temp2[H - 1][0] + b2 * temp2H + b3 * temp2Hp1), 0.0); - dst[H - 3][i] = rtengine::max(divBuffer[H - 3][i] / (temp2[H - 3][0] = B * temp2[H - 3][0] + b1 * temp2[H - 2][0] + b2 * temp2[H - 1][0] + b3 * temp2H), 0.0); + dst[H - 1][i] = rtengine::max(divBuffer[H - 1][i] / (temp2[coord(H - 1, 0)] = temp2Hm1), 0.0); + dst[H - 2][i] = rtengine::max(divBuffer[H - 2][i] / (temp2[coord(H - 2, 0)] = B * temp2[coord(H - 2, 0)] + b1 * temp2[coord(H - 1, 0)] + b2 * temp2H + b3 * temp2Hp1), 0.0); + dst[H - 3][i] = rtengine::max(divBuffer[H - 3][i] / (temp2[coord(H - 3, 0)] = B * temp2[coord(H - 3, 0)] + b1 * temp2[coord(H - 2, 0)] + b2 * temp2[coord(H - 1, 0)] + b3 * temp2H), 0.0); for (int j = H - 4; j >= 0; j--) { - dst[j][i] = rtengine::max(divBuffer[j][i] / (temp2[j][0] = B * temp2[j][0] + b1 * temp2[j + 1][0] + b2 * temp2[j + 2][0] + b3 * temp2[j + 3][0]), 0.0); + dst[j][i] = rtengine::max(divBuffer[j][i] / (temp2[coord(j, 0)] = B * temp2[coord(j, 0)] + b1 * temp2[coord(j + 1, 0)] + b2 * temp2[coord(j + 2, 0)] + b3 * temp2[coord(j + 3, 0)]), 0.0); } } } @@ -1286,40 +1297,45 @@ template void gaussVerticalmult (T** src, T** dst, const int W, const i // process 'numcols' columns for better usage of L1 cpu cache (especially faster for large values of H) static const int numcols = 8; - double temp2[H][numcols] ALIGNED16; + std::vector temp2(H * numcols); double temp2Hm1[numcols], temp2H[numcols], temp2Hp1[numcols]; + + auto coord = + [](const int &x, const int &y) -> int { + return x * numcols + y; + }; #ifdef _OPENMP #pragma omp for nowait #endif for (int i = 0; i < W - numcols + 1; i += numcols) { for (int k = 0; k < numcols; k++) { - temp2[0][k] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k]; - temp2[1][k] = B * src[1][i + k] + b1 * temp2[0][k] + b2 * src[0][i + k] + b3 * src[0][i + k]; - temp2[2][k] = B * src[2][i + k] + b1 * temp2[1][k] + b2 * temp2[0][k] + b3 * src[0][i + k]; + temp2[coord(0, k)] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k]; + temp2[coord(1, k)] = B * src[1][i + k] + b1 * temp2[coord(0, k)] + b2 * src[0][i + k] + b3 * src[0][i + k]; + temp2[coord(2, k)] = B * src[2][i + k] + b1 * temp2[coord(1, k)] + b2 * temp2[coord(0, k)] + b3 * src[0][i + k]; } for (int j = 3; j < H; j++) { for (int k = 0; k < numcols; k++) { - temp2[j][k] = B * src[j][i + k] + b1 * temp2[j - 1][k] + b2 * temp2[j - 2][k] + b3 * temp2[j - 3][k]; + temp2[coord(j, k)] = B * src[j][i + k] + b1 * temp2[coord(j - 1, k)] + b2 * temp2[coord(j - 2, k)] + b3 * temp2[coord(j - 3, k)]; } } for (int k = 0; k < numcols; k++) { - temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[0][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[0][2] * (temp2[H - 3][k] - src[H - 1][i + k]); - temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[1][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[1][2] * (temp2[H - 3][k] - src[H - 1][i + k]); - temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[2][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[2][2] * (temp2[H - 3][k] - src[H - 1][i + k]); + temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[0][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[0][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); + temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[1][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[1][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); + temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[2][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[2][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]); } for (int k = 0; k < numcols; k++) { - dst[H - 1][i + k] *= temp2[H - 1][k] = temp2Hm1[k]; - dst[H - 2][i + k] *= temp2[H - 2][k] = B * temp2[H - 2][k] + b1 * temp2[H - 1][k] + b2 * temp2H[k] + b3 * temp2Hp1[k]; - dst[H - 3][i + k] *= temp2[H - 3][k] = B * temp2[H - 3][k] + b1 * temp2[H - 2][k] + b2 * temp2[H - 1][k] + b3 * temp2H[k]; + dst[H - 1][i + k] *= temp2[coord(H - 1, k)] = temp2Hm1[k]; + dst[H - 2][i + k] *= temp2[coord(H - 2, k)] = B * temp2[coord(H - 2, k)] + b1 * temp2[coord(H - 1, k)] + b2 * temp2H[k] + b3 * temp2Hp1[k]; + dst[H - 3][i + k] *= temp2[coord(H - 3, k)] = B * temp2[coord(H - 3, k)] + b1 * temp2[coord(H - 2, k)] + b2 * temp2[coord(H - 1, k)] + b3 * temp2H[k]; } for (int j = H - 4; j >= 0; j--) { for (int k = 0; k < numcols; k++) { - dst[j][i + k] *= (temp2[j][k] = B * temp2[j][k] + b1 * temp2[j + 1][k] + b2 * temp2[j + 2][k] + b3 * temp2[j + 3][k]); + dst[j][i + k] *= (temp2[coord(j, k)] = B * temp2[coord(j, k)] + b1 * temp2[coord(j + 1, k)] + b2 * temp2[coord(j + 2, k)] + b3 * temp2[coord(j + 3, k)]); } } } @@ -1330,24 +1346,24 @@ template void gaussVerticalmult (T** src, T** dst, const int W, const i // process remaining columns for (int i = W - (W % numcols); i < W; i++) { - temp2[0][0] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i]; - temp2[1][0] = B * src[1][i] + b1 * temp2[0][0] + b2 * src[0][i] + b3 * src[0][i]; - temp2[2][0] = B * src[2][i] + b1 * temp2[1][0] + b2 * temp2[0][0] + b3 * src[0][i]; + temp2[coord(0, 0)] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i]; + temp2[coord(1, 0)] = B * src[1][i] + b1 * temp2[coord(0, 0)] + b2 * src[0][i] + b3 * src[0][i]; + temp2[coord(2, 0)] = B * src[2][i] + b1 * temp2[coord(1, 0)] + b2 * temp2[coord(0, 0)] + b3 * src[0][i]; for (int j = 3; j < H; j++) { - temp2[j][0] = B * src[j][i] + b1 * temp2[j - 1][0] + b2 * temp2[j - 2][0] + b3 * temp2[j - 3][0]; + temp2[coord(j, 0)] = B * src[j][i] + b1 * temp2[coord(j - 1, 0)] + b2 * temp2[coord(j - 2, 0)] + b3 * temp2[coord(j - 3, 0)]; } - double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[0][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[0][2] * (temp2[H - 3][0] - src[H - 1][i]); - double temp2H = src[H - 1][i] + M[1][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[1][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[1][2] * (temp2[H - 3][0] - src[H - 1][i]); - double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[2][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[2][2] * (temp2[H - 3][0] - src[H - 1][i]); + double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[0][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[0][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); + double temp2H = src[H - 1][i] + M[1][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[1][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[1][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); + double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[2][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[2][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]); - dst[H - 1][i] *= temp2[H - 1][0] = temp2Hm1; - dst[H - 2][i] *= temp2[H - 2][0] = B * temp2[H - 2][0] + b1 * temp2[H - 1][0] + b2 * temp2H + b3 * temp2Hp1; - dst[H - 3][i] *= temp2[H - 3][0] = B * temp2[H - 3][0] + b1 * temp2[H - 2][0] + b2 * temp2[H - 1][0] + b3 * temp2H; + dst[H - 1][i] *= temp2[coord(H - 1, 0)] = temp2Hm1; + dst[H - 2][i] *= temp2[coord(H - 2, 0)] = B * temp2[coord(H - 2, 0)] + b1 * temp2[coord(H - 1, 0)] + b2 * temp2H + b3 * temp2Hp1; + dst[H - 3][i] *= temp2[coord(H - 3, 0)] = B * temp2[coord(H - 3, 0)] + b1 * temp2[coord(H - 2, 0)] + b2 * temp2[coord(H - 1, 0)] + b3 * temp2H; for (int j = H - 4; j >= 0; j--) { - dst[j][i] *= (temp2[j][0] = B * temp2[j][0] + b1 * temp2[j + 1][0] + b2 * temp2[j + 2][0] + b3 * temp2[j + 3][0]); + dst[j][i] *= (temp2[coord(j, 0)] = B * temp2[coord(j, 0)] + b1 * temp2[coord(j + 1, 0)] + b2 * temp2[coord(j + 2, 0)] + b3 * temp2[coord(j + 3, 0)]); } } } diff --git a/rtengine/iccmatrices.h b/rtengine/iccmatrices.h index 5b9883421..be685b676 100644 --- a/rtengine/iccmatrices.h +++ b/rtengine/iccmatrices.h @@ -90,6 +90,19 @@ constexpr double ACESp0_xyz[3][3] = { {0.00845768, -0.01403193, 1.21893277} }; +constexpr double xyz_jdcmax[3][3] = {//prim red 0.734702 0.265302 gr 0.021908 0.930288 bl 0.120593 0.001583 + {0.8394088, 0.0163780, 0.1084133}, + {0.3031122, 0.6954651, 0.0014227}, + {-0.000048, 0.0357376, 0.7891671} +}; + +constexpr double jdcmax_xyz[3][3] = { + {1.1984508, -0.0197646, -0.1646037}, + {-0.5223824, 1.4466349, 0.0691553}, + {0.0236634, -0.0655113, 1.2640260} +}; + + constexpr double xyz_ACESp1[3][3] = { {0.689697, 0.149944, 0.124559}, {0.284448, 0.671758 , 0.043794}, diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index 2f443522c..20fc07234 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include +#include #include #include @@ -195,9 +196,9 @@ cmsHPROFILE createXYZProfile() return rtengine::ICCStore::createFromMatrix(mat, false, "XYZ"); } -const double(*wprofiles[])[3] = {xyz_sRGB, xyz_adobe, xyz_prophoto, xyz_widegamut, xyz_bruce, xyz_beta, xyz_best, xyz_rec2020, xyz_ACESp0, xyz_ACESp1};// -const double(*iwprofiles[])[3] = {sRGB_xyz, adobe_xyz, prophoto_xyz, widegamut_xyz, bruce_xyz, beta_xyz, best_xyz, rec2020_xyz, ACESp0_xyz, ACESp1_xyz};// -const char* wpnames[] = {"sRGB", "Adobe RGB", "ProPhoto", "WideGamut", "BruceRGB", "Beta RGB", "BestRGB", "Rec2020", "ACESp0", "ACESp1"};// +const double(*wprofiles[])[3] = {xyz_sRGB, xyz_adobe, xyz_prophoto, xyz_widegamut, xyz_jdcmax, xyz_beta, xyz_best, xyz_rec2020, xyz_ACESp0, xyz_ACESp1, xyz_bruce};// +const double(*iwprofiles[])[3] = {sRGB_xyz, adobe_xyz, prophoto_xyz, widegamut_xyz, jdcmax_xyz, beta_xyz, best_xyz, rec2020_xyz, ACESp0_xyz, ACESp1_xyz, bruce_xyz};// +const char* wpnames[] = {"sRGB", "Adobe RGB", "ProPhoto", "WideGamut", "JDCmax", "Beta RGB", "BestRGB", "Rec2020", "ACESp0", "ACESp1", "BruceRGB"};// //default = gamma inside profile //BT709 g=2.22 s=4.5 sRGB g=2.4 s=12.92310 //linear g=1.0 @@ -454,6 +455,8 @@ public: if (loadAll) { loadProfiles(profilesDir, &fileProfiles, &fileProfileContents, nullptr, false); loadProfiles(userICCDir, &fileProfiles, &fileProfileContents, nullptr, false); + Glib::ustring user_output_icc_dir = Glib::build_filename(options.rtdir, "iccprofiles", "output"); + loadProfiles(user_output_icc_dir, &fileProfiles, &fileProfileContents, nullptr, false); } // Input profiles diff --git a/rtengine/iimage.h b/rtengine/iimage.h index cdb7dd6eb..426b0c4c0 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -111,7 +111,7 @@ public: { rm = gm = bm = 1.0; } - virtual void getAutoWBMultipliersitc(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, const procparams::ToneCurveParams &hrp) + virtual void getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, 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, const procparams::ToneCurveParams &hrp) { rm = gm = bm = 1.0; } @@ -1858,7 +1858,7 @@ class IImage : virtual public ImageDimensions public: virtual ~IImage() {} - /** @brief Returns a mutex that can is useful in many situations. No image operations shuold be performed without locking this mutex. + /** @brief Returns a mutex that can is useful in many situations. No image operations should be performed without locking this mutex. * @return The mutex */ virtual MyMutex& getMutex () = 0; virtual cmsHPROFILE getProfile () const = 0; diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 7bc75fe6d..e4cb28e6b 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -341,6 +341,38 @@ void Imagefloat::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* imag #endif } +// From ART. +void Imagefloat::multiply(float factor, bool multithread) +{ + const int W = width; + const int H = height; +#ifdef __SSE2__ + vfloat vfactor = F2V(factor); +#endif + +#ifdef _OPENMP +# pragma omp parallel for firstprivate(W, H) schedule(dynamic, 5) if (multithread) +#endif + for (int y = 0; y < H; y++) { + int x = 0; +#ifdef __SSE2__ + for (; x < W-3; x += 4) { + vfloat rv = LVF(r(y, x)); + vfloat gv = LVF(g(y, x)); + vfloat bv = LVF(b(y, x)); + STVF(r(y, x), rv * vfactor); + STVF(g(y, x), gv * vfactor); + STVF(b(y, x), bv * vfactor); + } +#endif + for (; x < W; ++x) { + r(y, x) *= factor; + g(y, x) *= factor; + b(y, x) *= factor; + } + } +} + void Imagefloat::normalizeFloat(float srcMinVal, float srcMaxVal) { @@ -362,43 +394,15 @@ void Imagefloat::normalizeFloat(float srcMinVal, float srcMaxVal) } // convert values's range to [0;1] ; this method assumes that the input values's range is [0;65535] -void Imagefloat::normalizeFloatTo1() +void Imagefloat::normalizeFloatTo1(bool multithread) { - - const int w = width; - const int h = height; - -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic, 5) -#endif - - for (int y = 0; y < h; y++) { - for (int x = 0; x < w; x++) { - r(y, x) /= 65535.f; - g(y, x) /= 65535.f; - b(y, x) /= 65535.f; - } - } + multiply(1.f/65535.f, multithread); } // convert values's range to [0;65535 ; this method assumes that the input values's range is [0;1] -void Imagefloat::normalizeFloatTo65535() +void Imagefloat::normalizeFloatTo65535(bool multithread) { - - const int w = width; - const int h = height; - -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic, 5) -#endif - - for (int y = 0; y < h; y++) { - for (int x = 0; x < w; x++) { - r(y, x) *= 65535.f; - g(y, x) *= 65535.f; - b(y, x) *= 65535.f; - } - } + multiply(65535.f, multithread); } // Parallelized transformation; create transform with cmsFLAGS_NOCACHE! diff --git a/rtengine/imagefloat.h b/rtengine/imagefloat.h index d69df9325..38a4bf651 100644 --- a/rtengine/imagefloat.h +++ b/rtengine/imagefloat.h @@ -213,9 +213,10 @@ public: return (uint32_t) ((lsign << 31) | (exponent << 23) | mantissa); } + void multiply(float factor, bool multithread); void normalizeFloat(float srcMinVal, float srcMaxVal) override; - void normalizeFloatTo1(); - void normalizeFloatTo65535(); + void normalizeFloatTo1(bool multithread=true); + void normalizeFloatTo65535(bool multithread=true); void ExecCMSTransform(cmsHTRANSFORM hTransform); void ExecCMSTransform(cmsHTRANSFORM hTransform, const LabImage &labImage, int cx, int cy); }; diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 87b560088..bda1ceb74 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -117,10 +117,10 @@ public: virtual void convertColorSpace (Imagefloat* image, const procparams::ColorManagementParams &cmp, const ColorTemp &wb) = 0; // DIRTY HACK: this method is derived in rawimagesource and strimagesource, but (...,RAWParams raw) will be used ONLY for raw images virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) = 0; - virtual void getAutoWBMultipliersitc(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, const procparams::ToneCurveParams &hrp) = 0; + virtual void getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double & greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, 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, const procparams::ToneCurveParams &hrp) = 0; virtual ColorTemp getWB () const = 0; virtual ColorTemp getSpotWB (std::vector &red, std::vector &green, std::vector &blue, int tran, double equal, StandardObserver observer) = 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 procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) = 0; + virtual void WBauto(bool extra, 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 &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) = 0; virtual void getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, const procparams::WBParams & wbpar) = 0; virtual double getDefGain () const diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 45f75b0ca..f939535c2 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1,6 +1,6 @@ /* * This file is part of RawTherapee. - * + * * Copyright (c) 2004-2010 Gabor Horvath * * RawTherapee is free software: you can redistribute it and/or modify @@ -306,9 +306,11 @@ void ImProcCoordinator::backupParams() if (!params) { return; } + if (!paramsBackup) { paramsBackup.reset(new ProcParams()); } + *paramsBackup = *params; } @@ -317,6 +319,7 @@ void ImProcCoordinator::restoreParams() if (!paramsBackup || !params) { return; } + *params = *paramsBackup; } @@ -331,11 +334,10 @@ DetailedCrop* ImProcCoordinator::createCrop(::EditDataProvider *editDataProvider void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) { // TODO Locallab printf - MyMutex::MyLock processingLock(mProcessing); bool highDetailNeeded = options.prevdemo == PD_Sidecar ? true : (todo & M_HIGHQUAL); - // printf("metwb=%s \n", params->wb.method.c_str()); + // printf("metwb=%s \n", params->wb.method.c_str()); // Check if any detail crops need high detail. If not, take a fast path short cut if (!highDetailNeeded) { @@ -411,11 +413,13 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if (imageTypeListener) { imageTypeListener->imageTypeChanged(imgsrc->isRAW(), imgsrc->getSensorType() == ST_BAYER, imgsrc->getSensorType() == ST_FUJI_XTRANS, imgsrc->isMono(), imgsrc->isGainMapSupported()); } - bool iscolor = (params->toneCurve.method == "Color");// || params->toneCurve.method == "Coloropp"); + + bool iscolor = (params->toneCurve.method == "Color");// || params->toneCurve.method == "Coloropp"); + if ((todo & M_RAW) || (!highDetailRawComputed && highDetailNeeded) - // || (params->toneCurve.hrenabled && params->toneCurve.method != "Color" && imgsrc->isRGBSourceModified()) - // || (!params->toneCurve.hrenabled && params->toneCurve.method == "Color" && imgsrc->isRGBSourceModified())) { + // || (params->toneCurve.hrenabled && params->toneCurve.method != "Color" && imgsrc->isRGBSourceModified()) + // || (!params->toneCurve.hrenabled && params->toneCurve.method == "Color" && imgsrc->isRGBSourceModified())) { || (params->toneCurve.hrenabled && !iscolor && imgsrc->isRGBSourceModified()) || (!params->toneCurve.hrenabled && iscolor && imgsrc->isRGBSourceModified())) { @@ -470,8 +474,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if ((todo & M_RAW) || (!highDetailRawComputed && highDetailNeeded) - // || (params->toneCurve.hrenabled && params->toneCurve.method != "Color" && imgsrc->isRGBSourceModified()) - // || (!params->toneCurve.hrenabled && params->toneCurve.method == "Color" && imgsrc->isRGBSourceModified())) { + // || (params->toneCurve.hrenabled && params->toneCurve.method != "Color" && imgsrc->isRGBSourceModified()) + // || (!params->toneCurve.hrenabled && params->toneCurve.method == "Color" && imgsrc->isRGBSourceModified())) { || (params->toneCurve.hrenabled && !iscolor && imgsrc->isRGBSourceModified()) || (!params->toneCurve.hrenabled && iscolor && imgsrc->isRGBSourceModified())) { if (highDetailNeeded) { @@ -511,12 +515,14 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } const bool autowb = (params->wb.method == "autold" || params->wb.method == "autitcgreen"); + if (settings->verbose) { printf("automethod=%s \n", params->wb.method.c_str()); } + if (todo & (M_INIT | M_LINDENOISE | M_HDR)) { MyMutex::MyLock initLock(minit); // Also used in crop window - // imgsrc->HLRecovery_Global(params->toneCurve); // this handles Color HLRecovery + //imgsrc->HLRecovery_Global(params->toneCurve); // this handles Color HLRecovery if (settings->verbose) { @@ -524,7 +530,22 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } currWB = ColorTemp(params->wb.temperature, params->wb.green, params->wb.equal, params->wb.method, params->wb.observer); + + int dread = 0; + int bia = 1; float studgood = 1000.f; + int nocam = 0; + int kcam = 0; + float minchrom = 1000.f; + float delta = 0.f; + int kmin = 20; + float minhist = 1000000000.f; + float maxhist = -1000.f; + double tempitc = 5000.f; + double greenitc = 1.; + float temp0 = 5000.f; + bool extra = false; + bool forcewbgrey = false; if (!params->wb.enabled) { currWB = ColorTemp(); @@ -532,29 +553,223 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) currWB = imgsrc->getWB(); lastAwbauto = ""; //reinitialize auto } else if (autowb) { - if (params->wb.method == "autitcgreen" || lastAwbEqual != params->wb.equal || lastAwbObserver != params->wb.observer || lastAwbTempBias != params->wb.tempBias || lastAwbauto != params->wb.method) { - double rm, gm, bm; - double tempitc = 5000.f; - double greenitc = 1.; + float tem = 5000.f; + float gre = 1.f; + double tempref0bias = 5000.; + tempitc = 5000.f; + bool autowb1 = true; + double green_thres = 0.8; + + if (params->wb.method == "autitcgreen") { + currWBitc = imgsrc->getWB(); - double tempref = currWBitc.getTemp() * (1. + params->wb.tempBias); + double greenref = currWBitc.getGreen(); - if (settings->verbose && params->wb.method == "autitcgreen") { - printf("tempref=%f greref=%f\n", tempref, greenref); + double tempref0bias0 = currWBitc.getTemp(); + + if (greenref > green_thres && params->wb.itcwb_prim == "srgb") { + forcewbgrey = true; } - imgsrc->getAutoWBMultipliersitc(tempref, greenref, tempitc, greenitc, studgood, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve); + if (!forcewbgrey && (tempref0bias0 < 3300.f) && (greenref < 1.13f && greenref > 0.88f)) { //seems good with temp and green...To fixe...limits 1.13 and 0.88 + if (settings->verbose) { + printf("Keep camera settings temp=%f green=%f\n", tempref0bias0, greenref); + } + + autowb1 = true; + kcam = 1; + } + + if (autowb1) { + //alternative to camera if camera settings out, using autowb grey to find new ref, then mixed with camera + // kcam = 0; + params->wb.method = "autold"; + double rm, gm, bm; + tempitc = 5000.f; + greenitc = 1.; + currWBitc = imgsrc->getWB(); + tempref0bias = currWBitc.getTemp(); + double greenref = currWBitc.getGreen(); + bool pargref = true; + bool pargre = true; + + if ((greenref > 1.5f || tempref0bias < 3300.f || tempref0bias > 7700.f || forcewbgrey) && kcam != 1 && !params->wb.itcwb_sampling) { //probably camera out to adjust... + imgsrc->getAutoWBMultipliersitc(extra, tempref0bias, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve); + imgsrc->wbMul2Camera(rm, gm, bm); + imgsrc->wbCamera2Mul(rm, gm, bm); + ColorTemp ct(rm, gm, bm, 1.0, currWB.getObserver()); + tem = ct.getTemp(); + gre = ct.getGreen(); + + if (gre > 1.3f) { + pargre = false; + } + + if (greenref > 1.3f) { + pargref = false; + } + + double deltemp = tem - tempref0bias; + + if (gre > 1.5f && !forcewbgrey) { //probable wrong value + tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value + gre = 0.5f + 0.5f * LIM(gre, 0.9f, 1.1f);//empirical formula in case system out + } else { + if (!forcewbgrey) { + gre = 0.2f + 0.8f * LIM(gre, 0.85f, 1.15f); + tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value + nocam = 0; + } else {//set temp and green to init itcwb algorithm + double grepro = LIM(greenref, green_thres, 1.15); + gre = 0.5f * grepro + 0.5f * LIM(gre, 0.9f, 1.1f);//empirical green between green camera and autowb grey + + if (abs(deltemp) < 400.) { //arbitraries thresholds to refine + tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey + + if (deltemp > 0.) { + nocam = 1; + } else { + nocam = 2; + } + } else if (abs(deltemp) < 900.) { //other arbitrary threshold + tem = 0.4 * tem + 0.6 * tempref0bias;//find a mixed value between camera and auto grey + + if (deltemp > 0.) { + nocam = 3; + } else { + nocam = 4; + } + } else if (abs(deltemp) < 1500. && tempref0bias < 4500.f) { + if ((pargre && pargref) || (!pargre && !pargref)) { + tem = 0.45 * tem + 0.55 * tempref0bias;//find a mixed value between camera and auto grey + } + + if (pargre && !pargref) { + tem = 0.7 * tem + 0.3 * tempref0bias;//find a mixed value between camera and auto grey + } + + if (!pargre && pargref) { + tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey + } + + nocam = 5; + } else if (abs(deltemp) < 1500. && tempref0bias >= 4500.f) { + if ((pargre && pargref) || (!pargre && !pargref)) { + tem = 0.45 * tem + 0.55 * tempref0bias;//find a mixed value between camera and auto grey + } + + if (pargre && !pargref) { + tem = 0.7 * tem + 0.3 * tempref0bias;//find a mixed value between camera and auto grey + } + + if (!pargre && pargref) { + tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey + } + + nocam = 6; + } else if (abs(deltemp) >= 1500. && tempref0bias < 5500.f) { + if (tem >= 4500.f) { + if ((pargre && pargref) || (!pargre && !pargref)) { + tem = 0.7 * tem + 0.3 * tempref0bias;//find a mixed value between camera and auto grey + } + + if (pargre && !pargref) { + tem = 0.8 * tem + 0.2 * tempref0bias;//find a mixed value between camera and auto grey + } + + if (!pargre && pargref) { + tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey + } + + nocam = 7; + } else { + tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey + nocam = 8; + } + } else if (abs(deltemp) >= 1500. && tempref0bias >= 5500.f) { + if (tem >= 10000.f) { + tem = 0.99 * tem + 0.01 * tempref0bias;//find a mixed value between camera and auto grey + nocam = 9; + } else { + if ((pargre && pargref) || (!pargre && !pargref)) { + tem = 0.45 * tem + 0.55 * tempref0bias;//find a mixed value between camera and auto grey + } + + if (pargre && !pargref) { + tem = 0.7 * tem + 0.3 * tempref0bias;//find a mixed value between camera and auto grey + } + + if (!pargre && pargref) { + tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey + } + + nocam = 10; + } + } else { + tem = 0.4 * tem + 0.6 * tempref0bias; + nocam = 11; + } + } + } + + tempitc = tem ; + + extra = true; + + if (settings->verbose) { + printf("Using new references AWB grey or mixed Enable Extra - temgrey=%f gregrey=%f tempitc=%f nocam=%i\n", (double) tem, (double) gre, (double) tempitc, nocam); + } + } + } + + params->wb.method = "autitcgreen"; + + } + float greenitc_low = 1.f; + float tempitc_low = 5000.f; + if (params->wb.method == "autitcgreen" || lastAwbEqual != params->wb.equal || lastAwbObserver != params->wb.observer || lastAwbTempBias != params->wb.tempBias || lastAwbauto != params->wb.method) { + double rm, gm, bm; + greenitc = 1.; + currWBitc = imgsrc->getWB(); + currWBitc = currWBitc.convertObserver(params->wb.observer);//change the temp/green couple with the same multipliers + + double tempref = currWBitc.getTemp() * (1. + params->wb.tempBias); + double greenref = currWBitc.getGreen(); + greenitc = greenref; + + if ((greenref > 1.5f || tempref0bias < 3300.f || tempref0bias > 7700.f || forcewbgrey) && autowb1 && kcam != 1 && !params->wb.itcwb_sampling) { //probably camera out to adjust = greenref ? tempref0bias ? + tempref = tem * (1. + params->wb.tempBias); + greenref = gre; + } else { + + } + + if(params->wb.itcwb_sampling) { + greenitc_low = greenref; + tempitc_low = tempref; + } + + if (settings->verbose && params->wb.method == "autitcgreen") { + printf("tempref=%f greref=%f tempitc=%f greenitc=%f\n", tempref, greenref, tempitc, greenitc); + } + + imgsrc->getAutoWBMultipliersitc(extra, tempref, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve); if (params->wb.method == "autitcgreen") { params->wb.temperature = tempitc; params->wb.green = greenitc; - currWB = ColorTemp(params->wb.temperature, params->wb.green, 1., params->wb.method, params->wb.observer); - //printf("tempitc=%f greitc=%f\n", tempitc, greenitc); + if(params->wb.itcwb_sampling) { + params->wb.temperature = tempitc_low; + params->wb.green = greenitc_low; + } + currWB = ColorTemp(params->wb.temperature, params->wb.green, 1., params->wb.method, params->wb.observer); currWB.getMultipliers(rm, gm, bm); + autoWB.update(rm, gm, bm, params->wb.equal, params->wb.observer, params->wb.tempBias); } if (rm != -1.) { + double bias = params->wb.tempBias; if (params->wb.method == "autitcgreen") { @@ -573,30 +788,54 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) lastAwbauto = ""; autoWB.useDefaults(params->wb.equal, params->wb.observer); } - - } currWB = autoWB; } + double rw = 1.; double gw = 1.; double bw = 1.; - if (params->wb.enabled) { currWB = currWB.convertObserver(params->wb.observer); params->wb.temperature = static_cast(currWB.getTemp()); params->wb.green = currWB.getGreen(); + currWB.getMultipliers(rw, gw, bw); imgsrc->wbMul2Camera(rw, gw, bw); - // printf("ra=%f ga=%f ba=%f\n", rw, gw, bw); + // params->wb.itcwb_sampling = false; + /* + printf("ra=%f ga=%f ba=%f\n", rw, gw, bw); + //recalculate temp and green with wb multipliers. + imgsrc->wbCamera2Mul(rw, gw, bw); + ColorTemp ct(rw, gw, bw, 1.0, currWB.getObserver()); + //allows to calculate temp and green with multipliers in case of we want in GUI + float tem = ct.getTemp(); + float gre = ct.getGreen(); + printf("tem=%f gre=%f \n", (double) tem, (double) gre); + */ } + int met = 0; + if (awbListener) { if (params->wb.method == "autitcgreen") { - awbListener->WBChanged(params->wb.temperature, params->wb.green, rw, gw, bw, studgood); + if (params->wb.itcwb_sampling) { + dread = 1; + studgood = 1.f; + awbListener->WBChanged(met, params->wb.temperature, params->wb.green, rw, gw, bw, 0, 1, 0, dread, studgood, 0, 0, 0, 0); + + } else { + minchrom = LIM(minchrom, 0.f, 0.9f); + delta = LIM(delta, 0.f, 0.9f); + minhist = std::max(minhist, 100.f); + maxhist = std::max(maxhist, 1000.f); + kmin = std::max(kmin, 18); + dread = LIM(dread, 10, 239); + awbListener->WBChanged(met, params->wb.temperature, params->wb.green, rw, gw, bw, temp0, delta, bia, dread, studgood, minchrom, kmin, minhist, maxhist); + } } else { - awbListener->WBChanged(params->wb.temperature, params->wb.green, rw, gw, bw, -1.f); + awbListener->WBChanged(met, params->wb.temperature, params->wb.green, rw, gw, bw, -1.f, -1.f, 1, 1, -1.f, -1.f, 1, -1.f, -1.f); } } @@ -726,6 +965,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } } } + if (spotprev) { spotprev->copyData(orig_prev); } @@ -763,12 +1003,12 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } for (int sp = 0; sp < (int)params->locallab.spots.size(); sp++) { - if(params->locallab.spots.at(sp).expsharp && params->dirpyrequalizer.cbdlMethod == "bef") { - if(params->locallab.spots.at(sp).shardamping < 1) { - params->locallab.spots.at(sp).shardamping = 1; - } - } - } + if (params->locallab.spots.at(sp).expsharp && params->dirpyrequalizer.cbdlMethod == "bef") { + if (params->locallab.spots.at(sp).shardamping < 1) { + params->locallab.spots.at(sp).shardamping = 1; + } + } + } if ((todo & (M_TRANSFORM | M_RGBCURVE)) && params->dirpyrequalizer.cbdlMethod == "bef" && params->dirpyrequalizer.enabled && !params->colorappearance.enabled) { const int W = oprevi->getWidth(); @@ -901,7 +1141,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } ipf.getAutoLogloc(sp, imgsrc, sourceg, blackev, whiteev, Autogr, sourceab, fw, fh, xsta, xend, ysta, yend, SCALE); - // printf("sp=%i sg=%f sab=%f\n", sp, sourceg[sp], sourceab[sp]); + // printf("sp=%i sg=%f sab=%f\n", sp, sourceg[sp], sourceab[sp]); params->locallab.spots.at(sp).blackEv = blackev[sp]; params->locallab.spots.at(sp).whiteEv = whiteev[sp]; params->locallab.spots.at(sp).blackEvjz = blackev[sp]; @@ -911,6 +1151,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) params->locallab.spots.at(sp).sourceGraycie = sourceg[sp]; params->locallab.spots.at(sp).sourceabscie = sourceab[sp]; float jz1 = defSpot.jz100; + if (locallListener) { locallListener->logencodChanged(blackev[sp], whiteev[sp], sourceg[sp], sourceab[sp], targetg[sp], autocomput[sp], autocie[sp], jz1); } @@ -1011,6 +1252,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if (params->locallab.spots.at(sp).equilret && params->locallab.spots.at(sp).expreti) { savenormreti.reset(new LabImage(*oprevl, true)); } + // Set local curves of current spot to LUT locRETgainCurve.Set(params->locallab.spots.at(sp).localTgaincurve); locRETtransCurve.Set(params->locallab.spots.at(sp).localTtranscurve); @@ -1131,10 +1373,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float yend = 1.f; float xsta = 0.f; float xend = 1.f; + if (istm || isreti) { locx = params->locallab.spots.at(sp).loc.at(0) / 2000.0; locy = params->locallab.spots.at(sp).loc.at(2) / 2000.0; - locxl= params->locallab.spots.at(sp).loc.at(1) / 2000.0; + locxl = params->locallab.spots.at(sp).loc.at(1) / 2000.0; locyt = params->locallab.spots.at(sp).loc.at(3) / 2000.0; centx = params->locallab.spots.at(sp).centerX / 2000.0 + 0.5; centy = params->locallab.spots.at(sp).centerY / 2000.0 + 0.5; @@ -1142,8 +1385,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) yend = std::min(static_cast(centy + locy), 1.f); xsta = std::max(static_cast(centx - locxl), 0.f); xend = std::min(static_cast(centx + locx), 1.f); - // printf("xsta=%f xend=%f ysta=%f yend=%f \n", xsta, xend, ysta, yend); + // printf("xsta=%f xend=%f ysta=%f yend=%f \n", xsta, xend, ysta, yend); } + int ww = nprevl->W; int hh = nprevl->H; int xxs = xsta * ww; @@ -1152,10 +1396,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) int yye = yend * hh; if (istm) { //calculate mean and sigma on full image for RT-spot use by normalize_mean_dt - ipf.mean_sig (nprevl->L, meantme, stdtme, xxs, xxe, yys, yye); + ipf.mean_sig(nprevl->L, meantme, stdtme, xxs, xxe, yys, yye); } + if (isreti) { //calculate mean and sigma on full image for RT-spot use by normalize_mean_dt - ipf.mean_sig (nprevl->L, meanretie, stdretie,xxs, xxe, yys, yye) ; + ipf.mean_sig(nprevl->L, meanretie, stdretie, xxs, xxe, yys, yye) ; } double huerblu = huerefblurs[sp] = huerefblu; @@ -1170,7 +1415,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float stdtm = stdtms[sp] = stdtme; float meanreti = meanretis[sp] = meanretie; float stdreti = stdretis[sp] = stdretie; - huerefp[sp] = huer; chromarefp[sp] = chromar; lumarefp[sp] = lumar; @@ -1204,6 +1448,15 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float Tmax; int lastsav; + float highresi = 0.f; + float nresi = 0.f; + float highresi46 = 0.f; + float nresi46 = 0.f; + float Lhighresi = 0.f; + float Lnresi = 0.f; + float Lhighresi46 = 0.f; + float Lnresi46 = 0.f; + ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv.get(), savenormtm.get(), savenormreti.get(), lastorigimp.get(), fw, fh, 0, 0, pW, pH, scale, locRETgainCurve, locRETtransCurve, lllocalcurve, locallutili, cllocalcurve, localclutili, @@ -1257,14 +1510,16 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) LHutili, HHutili, CHutili, HHutilijz, CHutilijz, LHutilijz, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, - meantm, stdtm, meanreti, stdreti, fab); + meantm, stdtm, meanreti, stdreti, fab, + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); fabrefp[sp] = fab; + if (istm) { //calculate mean and sigma on full image for use by normalize_mean_dt float meanf = 0.f; float stdf = 0.f; - ipf.mean_sig (savenormtm->L, meanf, stdf, xxs, xxe, yys, yye); + ipf.mean_sig(savenormtm->L, meanf, stdf, xxs, xxe, yys, yye); //using 2 unused variables noiselumc and softradiustm params->locallab.spots.at(sp).noiselumc = (int) meanf; @@ -1274,7 +1529,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if (isreti) { //calculate mean and sigma on full image for use by normalize_mean_dt float meanf = 0.f; float stdf = 0.f; - ipf.mean_sig (savenormreti->L, meanf, stdf,xxs, xxe, yys, yye ); + ipf.mean_sig(savenormreti->L, meanf, stdf, xxs, xxe, yys, yye); //using 2 unused variables sensihs and sensiv params->locallab.spots.at(sp).sensihs = (int) meanf; params->locallab.spots.at(sp).sensiv = (int) stdf; @@ -1304,6 +1559,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } else { ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili); } + // Update Locallab reference values according to recurs parameter if (params->locallab.spots.at(sp).recurs) { /* @@ -1322,17 +1578,19 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) fabrefp[sp] = fab; } - // spotref.fab = fab; - // locallref.at(sp).fab = fab; - // locallref.push_back(spotref); - if (locallListener) { - // locallListener->refChanged(locallref, params->locallab.selspot); - locallListener->refChanged2(huerefp, chromarefp, lumarefp, fabrefp, params->locallab.selspot); - locallListener->minmaxChanged(locallretiminmax, params->locallab.selspot); - } + // spotref.fab = fab; + // locallref.at(sp).fab = fab; + + // locallref.push_back(spotref); + if (locallListener) { + // locallListener->refChanged(locallref, params->locallab.selspot); + locallListener->refChanged2(huerefp, chromarefp, lumarefp, fabrefp, params->locallab.selspot); + locallListener->minmaxChanged(locallretiminmax, params->locallab.selspot); + } } + delete [] huerefp; delete [] chromarefp; delete [] lumarefp; @@ -1515,16 +1773,18 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) nprevl->CopyFrom(oprevl); histCCurve.clear(); histLCurve.clear(); + if (params->colorToning.enabled && params->colorToning.method == "LabGrid") { - ipf.colorToningLabGrid(nprevl, 0, nprevl->W, 0, nprevl->H, false); + ipf.colorToningLabGrid(nprevl, 0, nprevl->W, 0, nprevl->H, false); } - ipf.shadowsHighlights(nprevl, params->sh.enabled, params->sh.lab,params->sh.highlights ,params->sh.shadows, params->sh.radius, scale, params->sh.htonalwidth, params->sh.stonalwidth); + ipf.shadowsHighlights(nprevl, params->sh.enabled, params->sh.lab, params->sh.highlights, params->sh.shadows, params->sh.radius, scale, params->sh.htonalwidth, params->sh.stonalwidth); if (params->localContrast.enabled) { - // Alberto's local contrast + // Alberto's local contrast ipf.localContrast(nprevl, nprevl->L, params->localContrast, false, scale); } + ipf.chromiLuminanceCurve(nullptr, pW, nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, histCCurve, histLCurve); ipf.vibrance(nprevl, params->vibrance, params->toneCurve.hrenabled, params->icm.workingProfile); ipf.labColorCorrectionRegions(nprevl); @@ -1556,8 +1816,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) bool pronois = WaveParams.expnoise; if (WaveParams.showmask) { - // WaveParams.showmask = false; - // WaveParams.expclari = true; + // WaveParams.showmask = false; + // WaveParams.expclari = true; } if (WaveParams.softrad > 0.f) { @@ -1647,7 +1907,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) nprevl->L[ir][jr] = L; } - delete tmpImage; + delete tmpImage; } @@ -1679,15 +1939,17 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) background = 0.f; show = 0; } - float indic = 1.f; - if (WaveParams.showmask){ - mL0 = mC0 = -1.f; - indic = -1.f; - mL = fabs(mL); - mC = fabs(mC); - show = 1; - } + float indic = 1.f; + + if (WaveParams.showmask) { + mL0 = mC0 = -1.f; + indic = -1.f; + mL = fabs(mL); + mC = fabs(mC); + show = 1; + } + #ifdef _OPENMP #pragma omp parallel for #endif @@ -1703,41 +1965,41 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) unshar = NULL; -/* - if (WaveParams.softrad > 0.f) { - array2D ble(pW, pH); - array2D guid(pW, pH); -#ifdef _OPENMP - #pragma omp parallel for -#endif + /* + if (WaveParams.softrad > 0.f) { + array2D ble(pW, pH); + array2D guid(pW, pH); + #ifdef _OPENMP + #pragma omp parallel for + #endif - for (int ir = 0; ir < pH; ir++) - for (int jr = 0; jr < pW; jr++) { - ble[ir][jr] = (nprevl->L[ir][jr] - provradius->L[ir][jr]) / 32768.f; - guid[ir][jr] = provradius->L[ir][jr] / 32768.f; - } - double epsilmax = 0.001; - double epsilmin = 0.0001; - double aepsil = (epsilmax - epsilmin) / 90.f; - double bepsil = epsilmax - 100.f * aepsil; - double epsil = aepsil * WaveParams.softrad + bepsil; + for (int ir = 0; ir < pH; ir++) + for (int jr = 0; jr < pW; jr++) { + ble[ir][jr] = (nprevl->L[ir][jr] - provradius->L[ir][jr]) / 32768.f; + guid[ir][jr] = provradius->L[ir][jr] / 32768.f; + } + double epsilmax = 0.001; + double epsilmin = 0.0001; + double aepsil = (epsilmax - epsilmin) / 90.f; + double bepsil = epsilmax - 100.f * aepsil; + double epsil = aepsil * WaveParams.softrad + bepsil; - float blur = 10.f / scale * (0.001f + 0.8f * WaveParams.softrad); - // rtengine::guidedFilter(guid, ble, ble, blur, 0.001, multiTh); - rtengine::guidedFilter(guid, ble, ble, blur, epsil, false); + float blur = 10.f / scale * (0.001f + 0.8f * WaveParams.softrad); + // rtengine::guidedFilter(guid, ble, ble, blur, 0.001, multiTh); + rtengine::guidedFilter(guid, ble, ble, blur, epsil, false); -#ifdef _OPENMP - #pragma omp parallel for -#endif + #ifdef _OPENMP + #pragma omp parallel for + #endif - for (int ir = 0; ir < pH; ir++) - for (int jr = 0; jr < pW; jr++) { - nprevl->L[ir][jr] = provradius->L[ir][jr] + 32768.f * ble[ir][jr]; - } - } -*/ + for (int ir = 0; ir < pH; ir++) + for (int jr = 0; jr < pW; jr++) { + nprevl->L[ir][jr] = provradius->L[ir][jr] + 32768.f * ble[ir][jr]; + } + } + */ if (WaveParams.softrad > 0.f) { delete provradius; @@ -1757,6 +2019,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) const int GH = nprevl->H; std::unique_ptr provis; const float pres = 0.01f * params->icm.preser; + if (pres > 0.f && params->icm.wprim != ColorManagementParams::Primaries::DEFAULT) { provis.reset(new LabImage(GW, GH)); provis->CopyFrom(nprevl); @@ -1779,14 +2042,17 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) ipf.workingtrc(tmpImage1.get(), tmpImage1.get(), GW, GH, 5, prof, gamtone, slotone, illum, prim, dummy, false, true, true); ipf.rgb2lab(*tmpImage1, *nprevl, params->icm.workingProfile); + //nprevl and provis if (provis) { ipf.preserv(nprevl, provis.get(), GW, GH); } + if (params->icm.fbw) { #ifdef _OPENMP #pragma omp parallel for #endif + for (int x = 0; x < GH; x++) for (int y = 0; y < GW; y++) { nprevl->a[x][y] = 0.f; @@ -1796,7 +2062,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) tmpImage1.reset(); - if (prim == 12) {//pass red gre blue xy in function of area dats Ciexy + if (prim == 13) {//pass red gre blue xy in function of area dats Ciexy float redgraphx = params->icm.labgridcieALow; float redgraphy = params->icm.labgridcieBLow; float blugraphx = params->icm.labgridcieAHigh; @@ -1818,7 +2084,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) greyy = rtengine::LIM(greyy, 0.5f, 1.f); if (primListener) { - primListener->primChanged (redxx, redyy, bluxx, bluyy, grexx, greyy); + primListener->primChanged(redxx, redyy, bluxx, bluyy, grexx, greyy); } } else {//all other cases - pass Cie xy to update graph Ciexy float r_x = params->icm.redx; @@ -1832,57 +2098,66 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float wy = 0.33f; switch (illum) { - case 1://D41 - wx = 0.37798f; - wy = 0.38123f; - break; - case 2://D50 - wx = 0.3457f; - wy = 0.3585f; - break; - case 3://D55 - wx = 0.3324f; - wy = 0.3474f; - break; - case 4://D60 - wx = 0.3217f; - wy = 0.3377f; - break; - case 5://D65 - wx = 0.3127f; - wy = 0.3290f; - break; - case 6://D80 - wx = 0.2937f; - wy = 0.3092f; - break; - case 7://D120 - wx = 0.2697f; - wy = 0.2808f; - break; - case 8://stdA - wx = 0.4476f; - wy = 0.4074f; - break; - case 9://2000K - wx = 0.5266f; - wy = 0.4133f; - break; - case 10://1500K - wx = 0.5857f; - wy = 0.3932f; - break; + case 1://D41 + wx = 0.37798f; + wy = 0.38123f; + break; + + case 2://D50 + wx = 0.3457f; + wy = 0.3585f; + break; + + case 3://D55 + wx = 0.3324f; + wy = 0.3474f; + break; + + case 4://D60 + wx = 0.3217f; + wy = 0.3377f; + break; + + case 5://D65 + wx = 0.3127f; + wy = 0.3290f; + break; + + case 6://D80 + wx = 0.2937f; + wy = 0.3092f; + break; + + case 7://D120 + wx = 0.2697f; + wy = 0.2808f; + break; + + case 8://stdA + wx = 0.4476f; + wy = 0.4074f; + break; + + case 9://2000K + wx = 0.5266f; + wy = 0.4133f; + break; + + case 10://1500K + wx = 0.5857f; + wy = 0.3932f; + break; } if (primListener) { - primListener->iprimChanged (r_x, r_y, b_x, b_y, g_x, g_y, wx, wy); + primListener->iprimChanged(r_x, r_y, b_x, b_y, g_x, g_y, wx, wy); } } } if (params->colorappearance.enabled) { // L histo and Chroma histo for ciecam - // histogram well be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C + // histogram will be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C int x1, y1, x2, y2; params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); lhist16CAM.clear(); @@ -1919,9 +2194,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) adap = pow(2.0, E_V - 3.0); // cd / m2 // end calculation adaptation scene luminosity } - if(params->colorappearance.catmethod == "symg") {//force abolute luminance scenescene to 400 in symmetric - adap = 400.; - } + + if (params->colorappearance.catmethod == "symg") { //force abolute luminance scenescene to 400 in symmetric + adap = 400.; + } + float d, dj, yb; bool execsharp = false; @@ -1943,13 +2220,15 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) CAMBrightCurveQ.dirty = true; ipf.ciecam_02float(ncie, float (adap), pW, 2, nprevl, params.get(), customColCurve1, customColCurve2, customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 0, scale, execsharp, d, dj, yb, 1); - //call listener + + //call listener if ((params->colorappearance.autodegree || params->colorappearance.autodegreeout) && acListener && params->colorappearance.enabled) { - if(params->colorappearance.catmethod == "symg") {//force chromatic adaptation to 90 in symmetric - d = 0.9; - dj = 0.9; - } - acListener->autoCamChanged(100.* (double)d, 100.* (double)dj); + if (params->colorappearance.catmethod == "symg") { //force chromatic adaptation to 90 in symmetric + d = 0.9; + dj = 0.9; + } + + acListener->autoCamChanged(100.* (double)d, 100.* (double)dj); } if (params->colorappearance.autoadapscen && acListener && params->colorappearance.enabled) { @@ -1957,45 +2236,48 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled) { - if(params->colorappearance.catmethod == "symg") {//force yb scene to 18 in symmetric - yb = 18; - } + if (params->colorappearance.catmethod == "symg") { //force yb scene to 18 in symmetric + yb = 18; + } acListener->ybCamChanged((int) yb); //real value Yb scene } - double tempsym = 5003.; - int wmodel = 0;//wmodel allows - arbitrary - choice of illuminant and temp with choice - if (params->colorappearance.wbmodel == "RawT") { - wmodel = 0; - } else if (params->colorappearance.wbmodel == "RawTCAT02") { - wmodel = 1; - } else if (params->colorappearance.wbmodel == "free") { - wmodel = 2;//force white balance in symmetric - } - if(params->colorappearance.catmethod == "symg" && wmodel == 2) { - tempsym = params->wb.temperature;//force white balance in symmetric - } else { - if (params->colorappearance.illum == "iA") {//otherwise force illuminant source - tempsym = 2856.; - } else if (params->colorappearance.illum == "i41") { - tempsym = 4100.; - } else if (params->colorappearance.illum == "i50") { - tempsym = 5003.; - } else if (params->colorappearance.illum == "i55") { - tempsym = 5503.; - } else if (params->colorappearance.illum == "i60") { - tempsym = 6000. ; - } else if (params->colorappearance.illum == "i65") { - tempsym = 6504.; - } else if (params->colorappearance.illum == "i75") { - tempsym = 7504.; - } else if (params->colorappearance.illum == "ifree") { - tempsym = params->wb.temperature;//force white balance in symmetric - } - } + double tempsym = 5003.; + int wmodel = 0;//wmodel allows - arbitrary - choice of illuminant and temp with choice + + if (params->colorappearance.wbmodel == "RawT") { + wmodel = 0; + } else if (params->colorappearance.wbmodel == "RawTCAT02") { + wmodel = 1; + } else if (params->colorappearance.wbmodel == "free") { + wmodel = 2;//force white balance in symmetric + } + + if (params->colorappearance.catmethod == "symg" && wmodel == 2) { + tempsym = params->wb.temperature;//force white balance in symmetric + } else { + if (params->colorappearance.illum == "iA") {//otherwise force illuminant source + tempsym = 2856.; + } else if (params->colorappearance.illum == "i41") { + tempsym = 4100.; + } else if (params->colorappearance.illum == "i50") { + tempsym = 5003.; + } else if (params->colorappearance.illum == "i55") { + tempsym = 5503.; + } else if (params->colorappearance.illum == "i60") { + tempsym = 6000. ; + } else if (params->colorappearance.illum == "i65") { + tempsym = 6504.; + } else if (params->colorappearance.illum == "i75") { + tempsym = 7504.; + } else if (params->colorappearance.illum == "ifree") { + tempsym = params->wb.temperature;//force white balance in symmetric + } + } + if (params->colorappearance.enabled && params->colorappearance.autotempout) { - acListener->wbCamChanged(tempsym, 1.f); //real temp and tint = 1. + acListener->wbCamChanged(tempsym, 1.f); //real temp and tint = 1. } } else { @@ -2016,7 +2298,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } } - // if (todo & (M_AUTOEXP | M_RGBCURVE)) { + // if (todo & (M_AUTOEXP | M_RGBCURVE)) { // Update the monitor color transform if necessary if ((todo & M_MONITOR) || (lastOutputProfile != params->icm.outputProfile) || lastOutputIntent != params->icm.outputIntent || lastOutputBPC != params->icm.outputBPC) { @@ -2066,19 +2348,24 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } hist_lrgb_dirty = vectorscope_hc_dirty = vectorscope_hs_dirty = waveform_dirty = true; + if (hListener) { if (hListener->updateHistogram()) { updateLRGBHistograms(); } + if (hListener->updateVectorscopeHC()) { updateVectorscopeHC(); } + if (hListener->updateVectorscopeHS()) { updateVectorscopeHS(); } + if (hListener->updateWaveform()) { updateWaveforms(); } + notifyHistogramChanged(); } } @@ -2089,14 +2376,14 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } } -void ImProcCoordinator::setTweakOperator (TweakOperator *tOperator) +void ImProcCoordinator::setTweakOperator(TweakOperator *tOperator) { if (tOperator) { tweakOperator = tOperator; } } -void ImProcCoordinator::unsetTweakOperator (TweakOperator *tOperator) +void ImProcCoordinator::unsetTweakOperator(TweakOperator *tOperator) { if (tOperator && tOperator == tweakOperator) { tweakOperator = nullptr; @@ -2110,6 +2397,7 @@ void ImProcCoordinator::freeAll() if (spotprev && spotprev != oprevi) { delete spotprev; } + spotprev = nullptr; if (orig_prev != oprevi) { @@ -2144,7 +2432,7 @@ void ImProcCoordinator::freeAll() allocated = false; } -void ImProcCoordinator::allocCache (Imagefloat* &imgfloat) +void ImProcCoordinator::allocCache(Imagefloat* &imgfloat) { if (imgfloat == nullptr) { imgfloat = new Imagefloat(pW, pH); @@ -2171,8 +2459,8 @@ void ImProcCoordinator::setScale(int prevscale) do { prevscale--; - PreviewProps pp (0, 0, fw, fh, prevscale); - imgsrc->getSize (pp, nW, nH); + PreviewProps pp(0, 0, fw, fh, prevscale); + imgsrc->getSize(pp, nW, nH); } while (nH < 400 && prevscale > 1 && (nW * nH < 1000000)); // actually hardcoded values, perhaps a better choice is possible if (nW != pW || nH != pH) { @@ -2331,15 +2619,18 @@ bool ImProcCoordinator::updateVectorscopeHC() #ifdef _OPENMP #pragma omp for nowait #endif + for (int i = y1; i < y2; ++i) { for (int j = x1, ofs_lab = (i - y1) * (x2 - x1); j < x2; ++j, ++ofs_lab) { const int col = norm_factor * a[ofs_lab] + size / 2 + 0.5f; const int row = norm_factor * b[ofs_lab] + size / 2 + 0.5f; + if (col >= 0 && col < size && row >= 0 && row < size) { vectorscopeThr[row][col]++; } } } + #ifdef _OPENMP #pragma omp critical #endif @@ -2374,8 +2665,10 @@ bool ImProcCoordinator::updateVectorscopeHS() #ifdef _OPENMP #pragma omp for nowait #endif + for (int i = y1; i < y2; ++i) { int ofs = (i * pW + x1) * 3; + for (int j = x1; j < x2; ++j) { const float red = 257.f * workimg->data[ofs++]; const float green = 257.f * workimg->data[ofs++]; @@ -2385,11 +2678,13 @@ bool ImProcCoordinator::updateVectorscopeHS() const auto sincosval = xsincosf(2.f * RT_PI_F * h); const int col = s * sincosval.y * (size / 2) + size / 2; const int row = s * sincosval.x * (size / 2) + size / 2; + if (col >= 0 && col < size && row >= 0 && row < size) { vectorscopeThr[row][col]++; } } } + #ifdef _OPENMP #pragma omp critical #endif @@ -2437,6 +2732,7 @@ bool ImProcCoordinator::updateWaveforms() waveformLuma.fill(0); constexpr float luma_factor = 255.f / 32768.f; + for (int i = y1; i < y2; i++) { int ofs = (i * pW + x1) * 3; float* L_row = nprevl->L[i] + x1; @@ -2463,12 +2759,23 @@ bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, Sta double rm, gm, bm; params->wb.method = "autold";//same result as before multiple Auto WB - // imgsrc->getAutoWBMultipliers(rm, gm, bm); + // imgsrc->getAutoWBMultipliers(rm, gm, bm); double tempitc = 5000.; double greenitc = 1.; + int dread = 0; + int bia = 0; + float temp0 = 5000.f; float studgood = 1000.f; + int nocam = 0; + int kcam = 0; + float minchrom = 1000.f; + float delta = 0.f; + int kmin = 20; + float minhist = 10000000.f; + float maxhist = -1000.f; double tempref, greenref; - imgsrc->getAutoWBMultipliersitc(tempref, greenref, tempitc, greenitc, studgood, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve); + bool extra = false; + imgsrc->getAutoWBMultipliersitc(extra, tempref, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve); if (rm != -1) { autoWB.update(rm, gm, bm, equal, observer, tempBias); @@ -2787,11 +3094,13 @@ void ImProcCoordinator::process() || params->rgbCurves != nextParams->rgbCurves || params->colorToning != nextParams->colorToning || params->vibrance != nextParams->vibrance + // || params->wb != nextParams->wb //isPanningRelatedChange(nextParams->wb) || params->wb.isPanningRelatedChange(nextParams->wb) || params->colorappearance != nextParams->colorappearance || params->epd != nextParams->epd || params->fattal != nextParams->fattal || params->sh != nextParams->sh + || params->toneEqualizer != nextParams->toneEqualizer || params->crop != nextParams->crop || params->coarse != nextParams->coarse || params->commonTrans != nextParams->commonTrans @@ -2901,7 +3210,9 @@ void ImProcCoordinator::requestUpdateWaveform() if (!hListener) { return; } + bool updated = updateWaveforms(); + if (updated) { notifyHistogramChanged(); } @@ -2912,7 +3223,9 @@ void ImProcCoordinator::requestUpdateHistogram() if (!hListener) { return; } + bool updated = updateLRGBHistograms(); + if (updated) { notifyHistogramChanged(); } @@ -2923,6 +3236,7 @@ void ImProcCoordinator::requestUpdateHistogramRaw() if (!hListener) { return; } + // Don't need to actually update histogram because it is always // up-to-date. if (hist_raw_dirty) { @@ -2936,7 +3250,9 @@ void ImProcCoordinator::requestUpdateVectorscopeHC() if (!hListener) { return; } + bool updated = updateVectorscopeHC(); + if (updated) { notifyHistogramChanged(); } @@ -2947,7 +3263,9 @@ void ImProcCoordinator::requestUpdateVectorscopeHS() if (!hListener) { return; } + bool updated = updateVectorscopeHS(); + if (updated) { notifyHistogramChanged(); } diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 92cdd91c7..7e4e3bb06 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -74,6 +74,7 @@ protected: ImageSource* imgsrc; ColorTemp currWB; + ColorTemp currWBcust; ColorTemp autoWB; ColorTemp currWBloc; ColorTemp autoWBloc; @@ -365,6 +366,7 @@ protected: std::vector stdtms; std::vector meanretis; std::vector stdretis; + bool lastspotdup; bool previewDeltaE; int locallColorMask; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index f1adbe043..a0472b1fd 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -1979,11 +1979,13 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer stop.reset(new StopWatch("rgb processing")); } - Imagefloat *tmpImage = nullptr; + const bool split_tiled_parts_1_2 = params->toneEqualizer.enabled; + + std::unique_ptr tmpImage; Imagefloat* editImgFloat = nullptr; PlanarWhateverData* editWhatever = nullptr; - EditUniqueID editID = pipetteBuffer ? pipetteBuffer->getEditID() : EUID_None; + EditUniqueID editID = pipetteBuffer && pipetteBuffer->bufferCreated() ? pipetteBuffer->getEditID() : EUID_None; if (editID != EUID_None) { switch (pipetteBuffer->getDataProvider()->getCurrSubscriber()->getPipetteBufferType()) { @@ -2139,6 +2141,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer const float comp = (max(0.0, expcomp) + 1.0) * hlcompr / 100.0; const float shoulder = ((65536.f / max(1.0f, exp_scale)) * (hlcomprthresh / 200.f)) + 0.1f; const float hlrange = 65536.f - shoulder; + const int tone_curve_black = params->toneCurve.black; const bool isProPhoto = (params->icm.workingProfile == "ProPhoto"); // extracting data from 'params' to avoid cache flush (to be confirmed) ToneCurveMode curveMode = params->toneCurve.curveMode; @@ -2247,8 +2250,8 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer } bool hasgammabw = gammabwr != 1.f || gammabwg != 1.f || gammabwb != 1.f; - if (hasColorToning || blackwhite || (params->dirpyrequalizer.cbdlMethod == "bef" && params->dirpyrequalizer.enabled)) { - tmpImage = new Imagefloat(working->getWidth(), working->getHeight()); + if (hasColorToning || blackwhite || (params->dirpyrequalizer.cbdlMethod == "bef" && params->dirpyrequalizer.enabled) || split_tiled_parts_1_2) { + tmpImage.reset(new Imagefloat(working->getWidth(), working->getHeight())); } // For tonecurve histogram @@ -2263,9 +2266,53 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer // For tonecurve histogram const float lumimulf[3] = {static_cast(lumimul[0]), static_cast(lumimul[1]), static_cast(lumimul[2])}; - #define TS 112 + const auto tiled_part_1 = + [working, + mixchannels, + &hltonecurve, &shtonecurve, + chMixRR, chMixRG, chMixRB, + chMixGR, chMixGG, chMixGB, + chMixBR, chMixBG, chMixBB, + exp_scale, comp, hlrange, tone_curve_black]( + int istart, int jstart, int tH, int tW, + float *rtemp, float *gtemp, float *btemp) { + + for (int i = istart, ti = 0; i < tH; i++, ti++) { + for (int j = jstart, tj = 0; j < tW; j++, tj++) { + rtemp[ti * TS + tj] = working->r(i, j); + gtemp[ti * TS + tj] = working->g(i, j); + btemp[ti * TS + tj] = working->b(i, j); + } + } + + if (mixchannels) { + for (int i = istart, ti = 0; i < tH; i++, ti++) { + for (int j = jstart, tj = 0; j < tW; j++, tj++) { + float r = rtemp[ti * TS + tj]; + float g = gtemp[ti * TS + tj]; + float b = btemp[ti * TS + tj]; + + // if (i==100 & j==100) printf("rgbProc input R= %f G= %f B= %f \n",r,g,b); + float rmix = (r * chMixRR + g * chMixRG + b * chMixRB) / 100.f; + float gmix = (r * chMixGR + g * chMixGG + b * chMixGB) / 100.f; + float bmix = (r * chMixBR + g * chMixBG + b * chMixBB) / 100.f; + + rtemp[ti * TS + tj] = rmix; + gtemp[ti * TS + tj] = gmix; + btemp[ti * TS + tj] = bmix; + } + } + } + + highlightToneCurve(hltonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS, exp_scale, comp, hlrange); + + if (tone_curve_black != 0) { + shadowToneCurve(shtonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS); + } + }; + #ifdef _OPENMP #pragma omp parallel if (multiThread) #endif @@ -2316,6 +2363,41 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer histToneCurveThr.clear(); } + if (split_tiled_parts_1_2) { + +#ifdef _OPENMP + #pragma omp for schedule(dynamic, chunkSize) collapse(2) +#endif + + for (int ii = 0; ii < working->getHeight(); ii += TS) { + for (int jj = 0; jj < working->getWidth(); jj += TS) { + istart = ii; + jstart = jj; + tH = min(ii + TS, working->getHeight()); + tW = min(jj + TS, working->getWidth()); + + + tiled_part_1(istart, jstart, tH, tW, rtemp, gtemp, btemp); + + // Copy tile to image. + for (int i = istart, ti = 0; i < tH; i++, ti++) { + for (int j = jstart, tj = 0; j < tW; j++, tj++) { + tmpImage->r(i, j) = rtemp[ti * TS + tj]; + tmpImage->g(i, j) = gtemp[ti * TS + tj]; + tmpImage->b(i, j) = btemp[ti * TS + tj]; + } + } + } + } + } + +#ifdef _OPENMP + #pragma omp single +#endif + if (params->toneEqualizer.enabled) { + toneEqualizer(tmpImage.get()); + } + #ifdef _OPENMP #pragma omp for schedule(dynamic, chunkSize) collapse(2) #endif @@ -2327,38 +2409,16 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer tH = min(ii + TS, working->getHeight()); tW = min(jj + TS, working->getWidth()); - - for (int i = istart, ti = 0; i < tH; i++, ti++) { - for (int j = jstart, tj = 0; j < tW; j++, tj++) { - rtemp[ti * TS + tj] = working->r(i, j); - gtemp[ti * TS + tj] = working->g(i, j); - btemp[ti * TS + tj] = working->b(i, j); - } - } - - if (mixchannels) { + if (split_tiled_parts_1_2) { for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - float r = rtemp[ti * TS + tj]; - float g = gtemp[ti * TS + tj]; - float b = btemp[ti * TS + tj]; - - //if (i==100 & j==100) printf("rgbProc input R= %f G= %f B= %f \n",r,g,b); - float rmix = (r * chMixRR + g * chMixRG + b * chMixRB) / 100.f; - float gmix = (r * chMixGR + g * chMixGG + b * chMixGB) / 100.f; - float bmix = (r * chMixBR + g * chMixBG + b * chMixBB) / 100.f; - - rtemp[ti * TS + tj] = rmix; - gtemp[ti * TS + tj] = gmix; - btemp[ti * TS + tj] = bmix; + rtemp[ti * TS + tj] = tmpImage->r(i, j); + gtemp[ti * TS + tj] = tmpImage->g(i, j); + btemp[ti * TS + tj] = tmpImage->b(i, j); } } - } - - highlightToneCurve(hltonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS, exp_scale, comp, hlrange); - - if (params->toneCurve.black != 0.0) { - shadowToneCurve(shtonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS); + } else { + tiled_part_1(istart, jstart, tH, tW, rtemp, gtemp, btemp); } if (dcpProf) { @@ -3509,10 +3569,6 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer } - if (tmpImage) { - delete tmpImage; - } - if (hCurveEnabled) { delete hCurve; } @@ -4176,9 +4232,6 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, } - const float histLFactor = pW != 1 ? histLCurve.getSize() / 100.f : 1.f; - const float histCFactor = pW != 1 ? histCCurve.getSize() / 48000.f : 1.f; - float adjustr = 1.0f; // if(params->labCurve.avoidclip ){ @@ -4200,6 +4253,9 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, adjustr = 1.8f; } + const float histLFactor = pW != 1 ? histLCurve.getSize() / 100.f : 1.f; + const float histCFactor = pW != 1 ? histCCurve.getSize() * adjustr / 65536.f : 1.f; + // reference to the params structure has to be done outside of the parallelization to avoid CPU cache problem const bool highlight = params->toneCurve.hrenabled; //Get the value if "highlight reconstruction" is activated const int chromaticity = params->labCurve.chromaticity; @@ -4359,11 +4415,11 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, if (editPipette) { if (editID == EUID_Lab_aCurve) { // Lab a pipette - float chromapipa = lold->a[i][j] + (32768.f * 1.28f); - editWhatever->v(i, j) = LIM01 ((chromapipa) / (65536.f * 1.28f)); + float chromapipa = lold->a[i][j] + 32768.f; + editWhatever->v(i, j) = LIM01 ((chromapipa) / (65536.f)); } else if (editID == EUID_Lab_bCurve) { //Lab b pipette - float chromapipb = lold->b[i][j] + (32768.f * 1.28f); - editWhatever->v(i, j) = LIM01 ((chromapipb) / (65536.f * 1.28f)); + float chromapipb = lold->b[i][j] + 32768.f; + editWhatever->v(i, j) = LIM01 ((chromapipb) / (65536.f)); } } @@ -4602,7 +4658,7 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, // I have placed C=f(C) after all C treatments to assure maximum amplitude of "C" if (editPipette && editID == EUID_Lab_CCurve) { float chromapip = sqrt(SQR(atmp) + SQR(btmp) + 0.001f); - editWhatever->v(i, j) = LIM01 ((chromapip) / (48000.f)); + editWhatever->v(i, j) = LIM01 ((chromapip) / (65536.f / adjustr)); }//Lab C=f(C) pipette if (ccut) { @@ -4669,7 +4725,7 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, if (editPipette && editID == EUID_Lab_LCCurve) { float chromapiplc = sqrt(SQR(atmp) + SQR(btmp) + 0.001f); - editWhatever->v(i, j) = LIM01 ((chromapiplc) / (48000.f)); + editWhatever->v(i, j) = LIM01 ((chromapiplc) / (65536.f / adjustr)); }//Lab L=f(C) pipette @@ -5667,6 +5723,11 @@ void ImProcFunctions::rgb2lab(const Imagefloat &src, LabImage &dst, const Glib:: } void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings) const +{ + rgb2lab(src, x, y, w, h, L, a, b, icm, consider_histogram_settings, multiThread); +} + +void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings, bool multiThread) { // Adapted from ImProcFunctions::lab2rgb const int src_width = src.getWidth(); @@ -5779,6 +5840,21 @@ void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, flo } } +void ImProcFunctions::rgb2lab(std::uint8_t red, std::uint8_t green, std::uint8_t blue, float &L, float &a, float &b, const procparams::ColorManagementParams &icm, bool consider_histogram_settings) +{ + float l_channel[1]; + float a_channel[1]; + float b_channel[1]; + rtengine::Image8 buf(1, 1); + buf.r(0, 0) = red; + buf.g(0, 0) = green; + buf.b(0, 0) = blue; + ImProcFunctions::rgb2lab(buf, 0, 0, 1, 1, l_channel, a_channel, b_channel, icm, consider_histogram_settings, false); + L = l_channel[0]; + a = a_channel[0]; + b = b_channel[0]; +} + void ImProcFunctions::lab2rgb(const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace) { TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(workingSpace); diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 36c571291..ea11e40bd 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -97,6 +97,7 @@ struct LocalContrastParams; struct LocallabParams; struct SharpeningParams; struct SoftLightParams; +struct ToneEqualizerParams; struct VibranceParams; struct VignettingParams; struct WaveletParams; @@ -116,6 +117,7 @@ class ImProcFunctions bool multiThread; void calcVignettingParams(int oW, int oH, const procparams::VignettingParams& vignetting, double &w2, double &h2, double& maxRadius, double &v, double &b, double &mul); + static void rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings, bool multithread); void transformLuminanceOnly(Imagefloat* original, Imagefloat* transformed, int cx, int cy, int oW, int oH, int fW, int fH); void transformGeneral(bool highQuality, Imagefloat *original, Imagefloat *transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const LensCorrection *pLCPMap, bool useOriginalBuffer); @@ -360,7 +362,8 @@ enum class BlurType { double& huerefblur, double &chromarefblur, double& lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, int &lastsav, bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, int llcieMask, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, - float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab); + float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab, + float &highresi, float &nresi, float &highresi46, float &nresi46, float &Lhighresi, float &Lnresi, float &Lhighresi46, float &Lnresi46); void addGaNoise(LabImage *lab, LabImage *dst, const float mean, const float variance, const int sk); void BlurNoise_Localold(int call, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy); @@ -399,7 +402,8 @@ enum class BlurType { void DeNoise_Local(int call, const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); void DeNoise_Local2(const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); - void DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili); + void DeNoise(int call, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, + int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili, float& highresi, float& nresi, float& highresi46, float& nresi46, float& Lhighresi, float& Lnresi, float& Lhighresi46, float& Lnresi46); void fftw_denoise(int sk, int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom); @@ -436,7 +440,7 @@ enum class BlurType { void Sigma(const float* HH_Coeffs, int datalen, float averagePlus, float averageNeg, float &sigmaPlus, float &sigmaNeg, int numThreads); void calckoe(const float* WavCoeffs_LL, float gradw, float tloww, float *koeLi, int level, int W_L, int H_L, float edd, float &maxkoeLi, float **tmC, bool multiThread = false); - void Median_Denoise(float **src, float **dst, int width, int height, Median medianType, int iterations, int numThreads, float **buffer = nullptr); + static void Median_Denoise(float **src, float **dst, int width, int height, Median medianType, int iterations, int numThreads, float **buffer = nullptr); void Median_Denoise(float **src, float **dst, float upperBound, int width, int height, Median medianType, int iterations, int numThreads, float **buffer = nullptr); void RGB_denoise(int kall, Imagefloat * src, Imagefloat * dst, Imagefloat * calclum, float * ch_M, float *max_r, float *max_b, bool isRAW, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, const NoiseCurve & noiseLCurve, const NoiseCurve & noiseCCurve, float &nresi, float &highresi); void RGB_denoise_infoGamCurve(const procparams::DirPyrDenoiseParams & dnparams, const bool isRAW, LUTf &gamcurve, float &gam, float &gamthresh, float &gamslope); @@ -462,7 +466,7 @@ enum class BlurType { void ShrinkAll_info(const float* const* WavCoeffs_a, const float* const* WavCoeffs_b, int W_ab, int H_ab, float **noisevarlum, float **noisevarchrom, float **noisevarhue, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, int schoice, int lvl, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, float &maxchred, float &maxchblue, float &minchred, float &minchblue, int &nb, float &chau, float &chred, float &chblue, bool denoiseMethodRgb); - void Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb); + void Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb, int beg, int end); void calcautodn_info(float &chaut, float &delta, int Nb, int levaut, float maxmax, float lumema, float chromina, int mode, int lissage, float redyel, float skinc, float nsknc); float Mad(const float * DataList, int datalen); float MadRgb(const float * DataList, int datalen); @@ -491,12 +495,14 @@ enum class BlurType { void colorToningLabGrid(LabImage *lab, int xstart, int xend, int ystart, int yend, bool MultiThread); //void shadowsHighlights(LabImage *lab); void shadowsHighlights(LabImage *lab, bool ena, int labmode, int hightli, int shado, int rad, int scal, int hltonal, int shtonal); - + void toneEqualizer(Imagefloat *rgb); + void toneEqualizer(Imagefloat *rgb, const procparams::ToneEqualizerParams ¶ms, const Glib::ustring &workingProfile, double scale, bool multiThread); void softLight(LabImage *lab, const procparams::SoftLightParams &softLightParams); void labColorCorrectionRegions(LabImage *lab); Image8* lab2rgb(LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool consider_histogram_settings = true); void rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings = true) const; + static void rgb2lab(std::uint8_t red, std::uint8_t green, std::uint8_t blue, float &L, float &a, float &b, const procparams::ColorManagementParams &icm, bool consider_histogram_settings = true); Imagefloat* lab2rgbOut(LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm); // CieImage *ciec; void workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, int ch, int mul, Glib::ustring &profile, double gampos, double slpos, int &illum, int prim, cmsHTRANSFORM &transform, bool normalizeIn = true, bool normalizeOut = true, bool keepTransForm = false) const; diff --git a/rtengine/init.cc b/rtengine/init.cc index b7c6b9f56..04faa98a8 100644 --- a/rtengine/init.cc +++ b/rtengine/init.cc @@ -17,7 +17,8 @@ * along with RawTherapee. If not, see . */ #include -#include "../rtgui/profilestorecombobox.h" +#include +#include #include "color.h" #include "rtengine.h" #include "iccstore.h" diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index dd02b8f0f..7620068a4 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -434,7 +434,7 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, } }; - if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") { + if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1" || profile == "JDCmax") { if (settings->verbose) { printf("Profile=%s\n", profile.c_str()); } @@ -509,7 +509,7 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, float greyy = params->icm.grey; float epsil = 0.0001f; - if (prim == 12) {//convert datas area to xy + if (prim == 13) {//convert datas area to xy float redgraphx = params->icm.labgridcieALow; float redgraphy = params->icm.labgridcieBLow; float blugraphx = params->icm.labgridcieAHigh; @@ -597,6 +597,12 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, } case ColorManagementParams::Primaries::ACES_P0: { + profile = "ACESp0"; + break; + } + + case ColorManagementParams::Primaries::JDC_MAX: { + profile = "JDCmax"; break; } @@ -754,6 +760,17 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, Wx = 0.952646075; Wz = 1.008825184; + } else if (profile == "JDCmax") { + p[0] = 0.734702; // JDC max primaries + p[1] = 0.265302; + p[2] = 0.021908; + p[3] = 0.930288; + p[4] = 0.120593; + p[5] = 0.001583; + illum = toUnderlying(ColorManagementParams::Illuminant::D50); + Wx = 0.964295676; + Wz = 0.825104603; + } else if (profile == "ACESp1") { p[0] = 0.713; // ACES P1 primaries p[1] = 0.293; diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index eaa5e857e..6689e2d7c 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -703,6 +703,7 @@ struct local_params { float mulloc[6]; int mullocsh[5]; int detailsh; + double tePivot; float threshol; float chromacb; float strengt; @@ -1700,6 +1701,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.detailsh = locallab.spots.at(sp).detailSH; + lp.tePivot = locallab.spots.at(sp).tePivot; lp.threshol = thresho; lp.chromacb = chromcbdl; lp.expvib = locallab.spots.at(sp).expvibrance && lp.activspot ; @@ -2258,231 +2260,14 @@ void ImProcFunctions::getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, } } -void tone_eq(array2D &R, array2D &G, array2D &B, const struct local_params & lp, const Glib::ustring &workingProfile, double scale, bool multithread) -// adapted from the tone equalizer of darktable -/* - Copyright 2019 Alberto Griggio - Small adaptation to Local Adjustment 10 2019 Jacques Desmis - This file is part of darktable, - copyright (c) 2018 Aurelien Pierre. - - darktable is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - darktable is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with darktable. If not, see . -*/ - +void tone_eq(ImProcFunctions *ipf, Imagefloat *rgb, const struct local_params &lp, const Glib::ustring &workingProfile, double scale, bool multithread) { - // BENCHFUN - - const int W = R.getWidth(); - const int H = R.getHeight(); - array2D Y(W, H); - - const auto log2 = - [](float x) -> float { - static const float l2 = xlogf(2); - return xlogf(x) / l2; - }; - - const auto exp2 = - [](float x) -> float { - return pow_F(2.f, x); - }; - // Build the luma channels: band-pass filters with gaussian windows of - // std 2 EV, spaced by 2 EV - const float centers[12] = { - -18.0f, -16.0f, -14.0f, -12.0f, -10.0f, -8.0f, -6.0f, - -4.0f, -2.0f, 0.0f, 2.0f, 4.0f - }; - - const auto conv = [&](int v, float lo, float hi) -> float { - const float f = v < 0 ? lo : hi; - return exp2(float(v) / 100.f * f); - }; - const float factors[12] = { - conv(lp.mullocsh[0], 2.f, 3.f), // -18 EV - conv(lp.mullocsh[0], 2.f, 3.f), // -16 EV - conv(lp.mullocsh[0], 2.f, 3.f), // -14 EV - conv(lp.mullocsh[0], 2.f, 3.f), // -12 EV - conv(lp.mullocsh[0], 2.f, 3.f), // -10 EV - conv(lp.mullocsh[0], 2.f, 3.f), // -8 EV - conv(lp.mullocsh[1], 2.f, 3.f), // -6 EV - conv(lp.mullocsh[2], 2.5f, 2.5f), // -4 EV - conv(lp.mullocsh[3], 3.f, 2.f), // -2 EV - conv(lp.mullocsh[4], 3.f, 2.f), // 0 EV - conv(lp.mullocsh[4], 3.f, 2.f), // 2 EV - conv(lp.mullocsh[4], 3.f, 2.f) // 4 EV - }; - - TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(workingProfile); - -#ifdef _OPENMP - #pragma omp parallel for if (multithread) -#endif - for (int y = 0; y < H; ++y) { - for (int x = 0; x < W; ++x) { - Y[y][x] = Color::rgbLuminance(R[y][x], G[y][x], B[y][x], ws); - } - } - - int detail = LIM(lp.detailsh + 5, 0, 5); - int radius = detail / scale + 0.5; - float epsilon2 = 0.01f + 0.002f * rtengine::max(detail - 3, 0); - - if (radius > 0) { - rtengine::guidedFilterLog(10.f, Y, radius, epsilon2, multithread); - } - - if (lp.detailsh > 0) { - array2D Y2(W, H); - constexpr float base_epsilon = 0.02f; - constexpr float base_posterization = 5.f; - -#ifdef _OPENMP - #pragma omp parallel for if (multithread) -#endif - for (int y = 0; y < H; ++y) { - for (int x = 0; x < W; ++x) { - float l = LIM(log2(rtengine::max(Y[y][x], 1e-9f)), centers[0], centers[11]); - float ll = round(l * base_posterization) / base_posterization; - Y2[y][x] = Y[y][x]; - Y[y][x] = exp2(ll); - } - } - - radius = 350.0 / scale; - epsilon2 = base_epsilon / float(6 - rtengine::min(lp.detailsh, 5)); - rtengine::guidedFilter(Y2, Y, Y, radius, epsilon2, multithread); - } - - const auto gauss = - [](float b, float x) -> float { - return xexpf((-SQR(x - b) / 4.0f)); - }; - - // For every pixel luminance, the sum of the gaussian masks - float w_sum = 0.f; - - for (int i = 0; i < 12; ++i) { - w_sum += gauss(centers[i], 0.f); - } - - const auto process_pixel = - [&](float y) -> float { - // convert to log space - const float luma = rtengine::max(log2(rtengine::max(y, 0.f)), -18.0f); - - // build the correction as the sum of the contribution of each - // luminance channel to current pixel - float correction = 0.0f; - - for (int c = 0; c < 12; ++c) - { - correction += gauss(centers[c], luma) * factors[c]; - } - - correction /= w_sum; - - return correction; - }; - - LUTf lut(65536); - - for (int i = 0; i < 65536; ++i) { - float y = float(i) / 65535.f; - float c = process_pixel(y); - lut[i] = c; - } - - -#ifdef __SSE2__ - vfloat vfactors[12]; - vfloat vcenters[12]; - - for (int i = 0; i < 12; ++i) { - vfactors[i] = F2V(factors[i]); - vcenters[i] = F2V(centers[i]); - } - - const auto vgauss = - [](vfloat b, vfloat x) -> vfloat { - static const vfloat fourv = F2V(4.f); - return xexpf((-SQR(x - b) / fourv)); - }; - - vfloat zerov = F2V(0.f); - vfloat vw_sum = F2V(w_sum); - - const vfloat noisev = F2V(-18.f); - const vfloat xlog2v = F2V(xlogf(2.f)); - - const auto vprocess_pixel = - [&](vfloat y) -> vfloat { - const vfloat luma = vmaxf(xlogf(vmaxf(y, zerov)) / xlog2v, noisev); - - vfloat correction = zerov; - - for (int c = 0; c < 12; ++c) - { - correction += vgauss(vcenters[c], luma) * vfactors[c]; - } - - correction /= vw_sum; - - return correction; - }; - - - vfloat v1 = F2V(1.f); - vfloat v65535 = F2V(65535.f); -#endif // __SSE2__ - - -#ifdef _OPENMP - #pragma omp parallel for if (multithread) -#endif - for (int y = 0; y < H; ++y) { - int x = 0; - - -#ifdef __SSE2__ - - for (; x < W - 3; x += 4) { - vfloat cY = LVFU(Y[y][x]); - vmask m = vmaskf_gt(cY, v1); - vfloat corr; - - if (_mm_movemask_ps((vfloat)m)) { - corr = vprocess_pixel(cY); - } else { - corr = lut[cY * v65535]; - } - - STVF(R[y][x], LVF(R[y][x]) * corr); - STVF(G[y][x], LVF(G[y][x]) * corr); - STVF(B[y][x], LVF(B[y][x]) * corr); - } - -#endif // __SSE2__ - - for (; x < W; ++x) { - float cY = Y[y][x]; - float corr = cY > 1.f ? process_pixel(cY) : lut[cY * 65535.f]; - R[y][x] *= corr; - G[y][x] *= corr; - B[y][x] *= corr; - } - } - + ToneEqualizerParams params; + params.enabled = true; + params.regularization = lp.detailsh; + params.pivot = lp.tePivot; + std::copy(lp.mullocsh, lp.mullocsh + params.bands.size(), params.bands.begin()); + ipf->toneEqualizer(rgb, params, workingProfile, scale, multithread); } void ImProcFunctions::loccont(int bfw, int bfh, LabImage* tmp1, float rad, float stren, int sk) { @@ -7806,12 +7591,7 @@ void ImProcFunctions::InverseColorLight_Local(bool tonequ, bool tonecurv, int sp } if (tonequ) { - tmpImage->normalizeFloatTo1(); - array2D Rtemp(GW, GH, tmpImage->r.ptrs, ARRAY2D_BYREFERENCE); - array2D Gtemp(GW, GH, tmpImage->g.ptrs, ARRAY2D_BYREFERENCE); - array2D Btemp(GW, GH, tmpImage->b.ptrs, ARRAY2D_BYREFERENCE); - tone_eq(Rtemp, Gtemp, Btemp, lp, params->icm.workingProfile, sk, multiThread); - tmpImage->normalizeFloatTo65535(); + tone_eq(this, tmpImage.get(), lp, params->icm.workingProfile, sk, multiThread); } rgb2lab(*tmpImage, *temp, params->icm.workingProfile); @@ -10863,7 +10643,8 @@ void ImProcFunctions::fftw_denoise(int sk, int GW, int GH, int max_numblox_W, in } -void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili) +void ImProcFunctions::DeNoise(int call, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, + int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili, float& highresi, float& nresi, float& highresi46, float& nresi46, float& Lhighresi, float& Lnresi, float& Lhighresi46, float& Lnresi46) { BENCHFUN //local denoise @@ -10934,7 +10715,6 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } - // if (call == 1 && GW >= mDEN && GH >= mDEN) { if (call == 1 && ((GW >= mDEN && GH >= mDEN && isnois) || lp.quamet == 2)) { @@ -10956,6 +10736,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl tmp1.a[ir][jr] = original->a[ir][jr]; tmp1.b[ir][jr] = original->b[ir][jr]; } + if(lp.nlstr > 0) { + NLMeans(tmp1.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad, lp.nlgam, GW, GH, float (sk), multiThread); + } float gamma = lp.noisegam; rtengine::GammaValues g_a; //gamma parameters @@ -10994,14 +10777,13 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!Ldecomp.memory_allocation_failed()) { #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic) collapse(2) if (multiThread) + // #pragma omp parallel for schedule(dynamic) collapse(2) if (multiThread) #endif for (int lvl = 0; lvl < levred; lvl++) { for (int dir = 1; dir < 4; dir++) { int Wlvl_L = Ldecomp.level_W(lvl); int Hlvl_L = Ldecomp.level_H(lvl); const float* const* WavCoeffs_L = Ldecomp.level_coeffs(lvl); - madL[lvl][dir - 1] = SQR(Mad(WavCoeffs_L[dir], Wlvl_L * Hlvl_L)); } } @@ -11010,67 +10792,36 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float mxsl = 0.f; // float mxsfl = 0.f; - if (aut == 0) { - if (levred == 7) { - edge = 2; - vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); - vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); - vari[2] = 0.8f * SQR((lp.noiself2 / 125.f) * (1.f + lp.noiself2 / 25.f)); + edge = 2; + vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); + vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); + vari[2] = 0.8f * SQR((lp.noiself2 / 125.f) * (1.f + lp.noiself2 / 25.f)); - vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); - vari[4] = 0.8f * SQR((lp.noiselc4 / 125.f) * (1.f + lp.noiselc4 / 25.f)); - vari[5] = 0.8f * SQR((lp.noiselc5 / 125.f) * (1.f + lp.noiselc5 / 25.f)); - vari[6] = 0.8f * SQR((lp.noiselc6 / 125.f) * (1.f + lp.noiselc6 / 25.f)); - } else if (levred == 4) { - edge = 3; - vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); - vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); - vari[2] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); - vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); - - } - } else if (aut == 1 || aut == 2) { - edge = 2; - vari[0] = SQR(slidL[0]); - vari[1] = SQR(slidL[1]); - vari[2] = SQR(slidL[2]); - vari[3] = SQR(slidL[3]); - vari[4] = SQR(slidL[4]); - vari[5] = SQR(slidL[5]); - vari[6] = SQR(slidL[6]); - float mxslid34 = rtengine::max(slidL[3], slidL[4]); - float mxslid56 = rtengine::max(slidL[5], slidL[6]); - mxsl = rtengine::max(mxslid34, mxslid56); - - } + vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); + vari[4] = 1.f * SQR((lp.noiselc4 / 125.f) * (1.f + lp.noiselc4 / 25.f)); + vari[5] = 1.5f * SQR((lp.noiselc5 / 125.f) * (1.f + lp.noiselc5 / 25.f)); + vari[6] = 2.5f * SQR((lp.noiselc6 / 125.f) * (1.f + lp.noiselc6 / 25.f)); { float kr3 = 0.f; - if (aut == 0 || aut == 1) { - if ((lp.noiselc < 30.f && aut == 0) || (mxsl < 30.f && aut == 1)) { + if (lp.noiselc < 30.f) { kr3 = 0.f; - } else if ((lp.noiselc < 50.f && aut == 0) || (mxsl < 50.f && aut == 1)) { + } else if (lp.noiselc < 50.f) { kr3 = 0.5f; - } else if ((lp.noiselc < 70.f && aut == 0) || (mxsl < 70.f && aut == 1)) { + } else if (lp.noiselc < 70.f) { kr3 = 0.7f; } else { kr3 = 1.f; } - } else if (aut == 2) { - kr3 = 1.f; - } vari[0] = rtengine::max(0.000001f, vari[0]); vari[1] = rtengine::max(0.000001f, vari[1]); vari[2] = rtengine::max(0.000001f, vari[2]); vari[3] = rtengine::max(0.000001f, kr3 * vari[3]); - - if (levred == 7) { - vari[4] = rtengine::max(0.000001f, vari[4]); - vari[5] = rtengine::max(0.000001f, vari[5]); - vari[6] = rtengine::max(0.000001f, vari[6]); - } + vari[4] = rtengine::max(0.000001f, vari[4]); + vari[5] = rtengine::max(0.000001f, vari[5]); + vari[6] = rtengine::max(0.000001f, vari[6]); float* noisevarlum = new float[GH * GW]; float* noisevarhue = new float[GH * GW]; @@ -11209,75 +10960,25 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } if (!adecomp.memory_allocation_failed() && !bdecomp.memory_allocation_failed()) { - float maxcfine = 0.f; float maxccoarse = 0.f; - if (aut == 0) { - if (levred == 7) { - edge = 2; - variC[0] = SQR(noisecfr); - variC[1] = SQR(noisecfr); - variC[2] = SQR(noisecfr); + edge = 2; + variC[0] = SQR(noisecfr); + variC[1] = SQR(noisecfr); + variC[2] = SQR(noisecfr); + variC[3] = SQR(1.2f * noisecfr); + variC[4] = SQR(noisecfr); + variC[5] = SQR(1.2f * noiseccr); + variC[6] = SQR(1.5f * noiseccr); - variC[3] = SQR(noisecfr); - variC[4] = SQR(noisecfr); - variC[5] = SQR(noiseccr); - variC[6] = SQR(noiseccr); + variCb[0] = SQR(noisecfb); + variCb[1] = SQR(noisecfb); + variCb[2] = SQR(noisecfb); + variCb[3] = SQR(noisecfb); + variCb[4] = SQR(noisecfb); + variCb[5] = SQR(1.2f * noiseccb); + variCb[6] = SQR(1.5f * noiseccb); - variCb[0] = SQR(noisecfb); - variCb[1] = SQR(noisecfb); - variCb[2] = SQR(noisecfb); - - variCb[3] = SQR(noisecfb); - variCb[4] = SQR(noisecfb); - variCb[5] = SQR(noiseccb); - variCb[6] = SQR(noiseccb); - - } else if (levred == 4) { - edge = 3; - variC[0] = SQR(lp.noisecf / 10.f); - variC[1] = SQR(lp.noisecf / 10.f); - variC[2] = SQR(lp.noisecf / 10.f); - variC[3] = SQR(lp.noisecf / 10.f); - - variCb[0] = SQR(lp.noisecf / 10.f); - variCb[1] = SQR(lp.noisecf / 10.f); - variCb[2] = SQR(lp.noisecf / 10.f); - variCb[3] = SQR(lp.noisecf / 10.f); - - } - } else if (aut == 1 || aut == 2) { - edge = 2; - variC[0] = SQR(slida[0]); - variC[1] = SQR(slida[1]); - variC[2] = SQR(slida[2]); - variC[3] = SQR(slida[3]); - variC[4] = SQR(slida[4]); - variC[5] = SQR(slida[5]); - variC[6] = SQR(slida[6]); - float maxc01 = rtengine::max(slida[0], slida[1]); - float maxc23 = rtengine::max(slida[2], slida[3]); - float max03 = rtengine::max(maxc01, maxc23); - float maxrf = rtengine::max(max03, slida[4]); - float maxrc = rtengine::max(slida[5], slida[6]); - - variCb[0] = SQR(slidb[0]); - variCb[1] = SQR(slidb[1]); - variCb[2] = SQR(slidb[2]); - variCb[3] = SQR(slidb[3]); - variCb[4] = SQR(slidb[4]); - variCb[5] = SQR(slidb[5]); - variCb[6] = SQR(slidb[6]); - float maxb01 = rtengine::max(slidb[0], slidb[1]); - float maxb23 = rtengine::max(slidb[2], slidb[3]); - float maxb03 = rtengine::max(maxb01, maxb23); - float maxbf = rtengine::max(maxb03, slidb[4]); - maxcfine = rtengine::max(maxrf, maxbf); - - float maxbc = rtengine::max(slidb[5], slidb[6]); - maxccoarse = rtengine::max(maxrc, maxbc); - - } { float minic = 0.000001f; @@ -11290,52 +10991,51 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float k2 = 0.f; float k3 = 0.f; - if (aut == 0 || aut == 1) { - if ((lp.noisecf < 0.2f && aut == 0) || (maxcfine < 0.2f && aut == 1)) { + if (lp.noisecf < 0.2f) { k1 = 0.05f; k2 = 0.f; k3 = 0.f; - } else if ((lp.noisecf < 0.3f && aut == 0) || (maxcfine < 0.3f && aut == 1)) { + } else if (lp.noisecf < 0.3f) { k1 = 0.1f; k2 = 0.0f; k3 = 0.f; - } else if ((lp.noisecf < 0.5f && aut == 0) || (maxcfine < 0.5f && aut == 1)) { + } else if (lp.noisecf < 0.5f) { k1 = 0.2f; k2 = 0.1f; k3 = 0.f; - } else if ((lp.noisecf < 0.8f && aut == 0) || (maxcfine < 0.8f && aut == 1)) { + } else if (lp.noisecf < 0.8f) { k1 = 0.3f; k2 = 0.25f; k3 = 0.f; - } else if ((lp.noisecf < 1.f && aut == 0) || (maxcfine < 1.f && aut == 1)) { + } else if (lp.noisecf < 1.f) { k1 = 0.4f; k2 = 0.25f; k3 = 0.1f; - } else if ((lp.noisecf < 2.f && aut == 0) || (maxcfine < 2.f && aut == 1)) { + } else if (lp.noisecf < 2.f) { k1 = 0.5f; k2 = 0.3f; k3 = 0.15f; - } else if ((lp.noisecf < 3.f && aut == 0) || (maxcfine < 3.f && aut == 1)) { + } else if (lp.noisecf < 3.f) { k1 = 0.6f; k2 = 0.45f; k3 = 0.3f; - } else if ((lp.noisecf < 4.f && aut == 0) || (maxcfine < 4.f && aut == 1)) { + } else if (lp.noisecf < 4.f) { k1 = 0.7f; k2 = 0.5f; k3 = 0.4f; - } else if ((lp.noisecf < 5.f && aut == 0) || (maxcfine < 5.f && aut == 1)) { + } else if (lp.noisecf < 5.f) { k1 = 0.8f; k2 = 0.6f; k3 = 0.5f; - } else if ((lp.noisecf < 6.f && aut == 0) || (maxcfine < 10.f && aut == 1)) { + } else if (lp.noisecf < 6.f) { k1 = 0.85f; k2 = 0.7f; k3 = 0.6f; - } else if ((lp.noisecf < 8.f && aut == 0) || (maxcfine < 20.f && aut == 1)) { + } else if (lp.noisecf < 8.f) { k1 = 0.9f; k2 = 0.8f; k3 = 0.7f; - } else if ((lp.noisecf < 10.f && aut == 0) || (maxcfine < 50.f && aut == 1)) { + } else if (lp.noisecf < 10.f) { k1 = 1.f; k2 = 1.f; k3 = 0.9f; @@ -11343,14 +11043,8 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } else { k1 = 1.f; k2 = 1.f; - k3 = 1.f; + k3 = 1.5f; } - } else if (aut == 2) { - k1 = 1.f; - k2 = 1.f; - k3 = 1.f; - } - variC[0] = rtengine::max(minic, variC[0]); variC[1] = rtengine::max(minic, k1 * variC[1]); @@ -11362,27 +11056,26 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl variCb[2] = rtengine::max(minic, k2 * variCb[2]); variCb[3] = rtengine::max(minic, k3 * variCb[3]); - if (levred == 7) { float k4 = 0.f; float k5 = 0.f; float k6 = 0.f; - if ((lp.noisecc < 0.2f && aut == 0) || (maxccoarse < 0.2f && aut == 1)) { + if (lp.noisecc < 0.2f) { k4 = 0.1f; k5 = 0.02f; - } else if ((lp.noisecc < 0.5f && aut == 0) || (maxccoarse < 0.5f && aut == 1)) { + } else if (lp.noisecc < 0.5f) { k4 = 0.15f; k5 = 0.05f; - } else if ((lp.noisecc < 1.f && aut == 0) || (maxccoarse < 1.f && aut == 1)) { + } else if (lp.noisecc < 1.f) { k4 = 0.15f; k5 = 0.1f; - } else if ((lp.noisecc < 3.f && aut == 0) || (maxccoarse < 3.f && aut == 1)) { + } else if (lp.noisecc < 3.f) { k4 = 0.3f; k5 = 0.15f; - } else if ((lp.noisecc < 4.f && aut == 0) || (maxccoarse < 5.f && aut == 1)) { + } else if (lp.noisecc < 4.f) { k4 = 0.6f; k5 = 0.4f; - } else if ((lp.noisecc < 6.f && aut == 0) || (maxccoarse < 6.f && aut == 1)) { + } else if (lp.noisecc < 6.f) { k4 = 0.8f; k5 = 0.6f; } else { @@ -11395,11 +11088,11 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl variCb[4] = rtengine::max(0.000001f, k4 * variCb[4]); variCb[5] = rtengine::max(0.000001f, k5 * variCb[5]); - if ((lp.noisecc < 4.f && aut == 0) || (maxccoarse < 4.f && aut == 1)) { + if (lp.noisecc < 4.f) { k6 = 0.f; - } else if ((lp.noisecc < 5.f && aut == 0) || (maxccoarse < 5.f && aut == 1)) { + } else if (lp.noisecc < 5.f) { k6 = 0.4f; - } else if ((lp.noisecc < 6.f && aut == 0) || (maxccoarse < 6.f && aut == 1)) { + } else if (lp.noisecc < 6.f) { k6 = 0.7f; } else { k6 = 1.f; @@ -11408,7 +11101,6 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl variC[6] = rtengine::max(0.00001f, k6 * variC[6]); variCb[6] = rtengine::max(0.00001f, k6 * variCb[6]); - } float* noisevarchrom = new float[GH * GW]; //noisevarchrom in function chroma @@ -11416,7 +11108,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float nvch = 0.6f;//high value float nvcl = 0.1f;//low value - if ((lp.noisecf > 100.f && aut == 0) || (maxcfine > 100.f && (aut == 1 || aut == 2))) { + if (lp.noisecf > 100.f) { nvch = 0.8f; nvcl = 0.4f; } @@ -11525,7 +11217,6 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } - if(gamma > 1.f) { #ifdef _OPENMP # pragma omp parallel for schedule(dynamic,16) if (multiThread) @@ -11543,10 +11234,6 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } - if(lp.nlstr > 0) { - NLMeans(tmp1.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad, lp.nlgam, GW, GH, float (sk), multiThread); - } - if(lp.smasktyp != 0) { if(lp.enablMask && lp.recothrd != 1.f) { LabImage tmp3(GW, GH); @@ -11625,7 +11312,82 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl masklum.free(); masklumch.free(); } - DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); + +// re read wavelet decomposition to calaculate noise residual + float chresid = 0.f; + float chresidtemp = 0.f; + float chmaxresid = 0.f; + float chmaxresidtemp = 0.f; + float chresid46 = 0.f; + float chresidtemp46 = 0.f; + float chmaxresid46 = 0.f; + float chmaxresidtemp46 = 0.f; + float Lresid = 0.f; + float Lmaxresid = 0.f; + float Lresid46 = 0.f; + float Lmaxresid46 = 0.f; + + +//calculate and display residual noise luma and chroma +// various coefficient from 1 to 5 - tries to take into account the difference between calculate Noise and percepted noise + wavelet_decomposition Ldecompinf(tmp1.L[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, lp.daubLen); + wavelet_decomposition adecompinf(tmp1.a[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, lp.daubLen); + wavelet_decomposition bdecompinf(tmp1.b[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, lp.daubLen); + + Noise_residualAB(adecompinf, chresid, chmaxresid, false, 0, 3); + chresidtemp = chresid; + chmaxresidtemp = chmaxresid; + Noise_residualAB(bdecompinf, chresid, chmaxresid, false, 0, 3); + chresid += chresidtemp; + chmaxresid += chmaxresidtemp; + int nbmaddir = 4; + chresid = sqrt(chresid / ( 3 * nbmaddir * 2)); + highresi = chresid + 0.5f * (sqrt(chmaxresid) - chresid); //evaluate sigma + nresi = chresid; + highresi /= 1.4f;//arbitrary coefficient + nresi /= 1.4f; + + // printf("nresi03=%f highresi=%f \n", (double) nresi, (double) highresi); + + + Noise_residualAB(adecompinf, chresid46, chmaxresid46, false, 4, 6); + nbmaddir = 3; + chresidtemp46 = chresid46; + chmaxresidtemp46 = chmaxresid46; + Noise_residualAB(bdecompinf, chresid46, chmaxresid46, false, 4, 6); + chresid46 += chresidtemp46; + chmaxresid46 += chmaxresidtemp46; + chresid46 = sqrt(chresid46 / ( 3 * nbmaddir * 2)); + highresi46 = chresid46 + 0.5f * (sqrt(chmaxresid46) - chresid46); //evaluate sigma + nresi46 = chresid46; + highresi46 /= 2.f;//arbitrary coefficient + nresi46 /= 2.f; + + // printf("nresi46=%f highresi=%f \n", (double) nresi46, (double) highresi46); + + + Noise_residualAB(Ldecompinf, Lresid, Lmaxresid, false, 0, 3); + nbmaddir = 4; + Lresid = sqrt(Lresid / (3 * nbmaddir)); + Lhighresi = Lresid + 0.5f * (sqrt(Lmaxresid) - Lresid); //evaluate sigma + Lnresi = Lresid; + Lnresi /= 2.f;//arbitrary coefficient + Lhighresi /= 2.f; + // printf("Lresi03=%f Lhighresi=%f levwavL=%i\n", (double) Lnresi, (double) Lhighresi, levwavL); + + Noise_residualAB(Ldecompinf, Lresid46, Lmaxresid46, false, 4, 6); + nbmaddir = 3; + Lresid46 = sqrt(Lresid46 / (3 * nbmaddir)); + Lhighresi46 = Lresid46 + 0.5f * (sqrt(Lmaxresid46) - Lresid46); //evaluate sigma + Lnresi46 = Lresid46; + Lhighresi46 /= 5.f;//arbitrary coefficient + Lnresi46 /= 5.f; + // printf("Lresi46=%f Lhighresi=%f levwavL=%i\n", (double) Lnresi46, (double) Lhighresi46, levwavL); + +// end calculate + + DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); + } else { DeNoise_Local(call, lp, original, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); } @@ -11722,69 +11484,40 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float vari[levred]; float mxsl = 0.f; - // float mxsfl = 0.f; - if (aut == 0) { - if (levred == 7) { + { edge = 2; vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); vari[2] = 0.8f * SQR((lp.noiself2 / 125.f) * (1.f + lp.noiself2 / 25.f)); - vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); - vari[4] = 0.8f * SQR((lp.noiselc4 / 125.f) * (1.f + lp.noiselc4 / 25.f)); - vari[5] = 0.8f * SQR((lp.noiselc5 / 125.f) * (1.f + lp.noiselc5 / 25.f)); - vari[6] = 0.8f * SQR((lp.noiselc6 / 125.f) * (1.f + lp.noiselc6 / 25.f)); - } else if (levred == 4) { - edge = 3; - vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); - vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); - vari[2] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); - vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); - - } - } else if (aut == 1 || aut == 2) { - edge = 2; - vari[0] = SQR(slidL[0]); - vari[1] = SQR(slidL[1]); - vari[2] = SQR(slidL[2]); - vari[3] = SQR(slidL[3]); - vari[4] = SQR(slidL[4]); - vari[5] = SQR(slidL[5]); - vari[6] = SQR(slidL[6]); - float mxslid34 = rtengine::max(slidL[3], slidL[4]); - float mxslid56 = rtengine::max(slidL[5], slidL[6]); - mxsl = rtengine::max(mxslid34, mxslid56); - - } + vari[4] = 1.f * SQR((lp.noiselc4 / 125.f) * (1.f + lp.noiselc4 / 25.f)); + vari[5] = 1.5f * SQR((lp.noiselc5 / 125.f) * (1.f + lp.noiselc5 / 25.f)); + vari[6] = 2.5f * SQR((lp.noiselc6 / 125.f) * (1.f + lp.noiselc6 / 25.f)); + } { float kr3 = 0.f; - if (aut == 0 || aut == 1) { - if ((lp.noiselc < 30.f && aut == 0) || (mxsl < 30.f && aut == 1)) { + { + if (lp.noiselc < 30.f) { kr3 = 0.f; - } else if ((lp.noiselc < 50.f && aut == 0) || (mxsl < 50.f && aut == 1)) { + } else if (lp.noiselc < 50.f) { kr3 = 0.5f; - } else if ((lp.noiselc < 70.f && aut == 0) || (mxsl < 70.f && aut == 1)) { + } else if (lp.noiselc < 70.f) { kr3 = 0.7f; } else { kr3 = 1.f; } - } else if (aut == 2) { - kr3 = 1.f; - } + } vari[0] = rtengine::max(0.000001f, vari[0]); vari[1] = rtengine::max(0.000001f, vari[1]); vari[2] = rtengine::max(0.000001f, vari[2]); vari[3] = rtengine::max(0.000001f, kr3 * vari[3]); - - if (levred == 7) { - vari[4] = rtengine::max(0.000001f, vari[4]); - vari[5] = rtengine::max(0.000001f, vari[5]); - vari[6] = rtengine::max(0.000001f, vari[6]); - } + vari[4] = rtengine::max(0.000001f, vari[4]); + vari[5] = rtengine::max(0.000001f, vari[5]); + vari[6] = rtengine::max(0.000001f, vari[6]); // float* noisevarlum = nullptr; // we need a dummy to pass it to WaveletDenoiseAllL float* noisevarlum = new float[bfh * bfw]; @@ -11921,77 +11654,28 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!adecomp.memory_allocation_failed() && !bdecomp.memory_allocation_failed()) { - float maxcfine = 0.f; float maxccoarse = 0.f; - if (aut == 0) { - if (levred == 7) { + { edge = 2; variC[0] = SQR(noisecfr); variC[1] = SQR(noisecfr); variC[2] = SQR(noisecfr); - - variC[3] = SQR(noisecfr); + variC[3] = SQR(1.2f * noisecfr); variC[4] = SQR(noisecfr); - variC[5] = SQR(noiseccr); - variC[6] = SQR(noiseccr); + variC[5] = SQR(1.2f * noiseccr); + variC[6] = SQR(1.5f * noiseccr); variCb[0] = SQR(noisecfb); variCb[1] = SQR(noisecfb); variCb[2] = SQR(noisecfb); - variCb[3] = SQR(noisecfb); variCb[4] = SQR(noisecfb); - variCb[5] = SQR(noiseccb); - variCb[6] = SQR(noiseccb); + variCb[5] = SQR(1.2f * noiseccb); + variCb[6] = SQR(1.5f * noiseccb); - } else if (levred == 4) { - edge = 3; - variC[0] = SQR(lp.noisecf / 10.f); - variC[1] = SQR(lp.noisecf / 10.f); - variC[2] = SQR(lp.noisecf / 10.f); - variC[3] = SQR(lp.noisecf / 10.f); - - variCb[0] = SQR(lp.noisecf / 10.f); - variCb[1] = SQR(lp.noisecf / 10.f); - variCb[2] = SQR(lp.noisecf / 10.f); - variCb[3] = SQR(lp.noisecf / 10.f); - - - } - } else if (aut == 1 || aut == 2) { - edge = 2; - variC[0] = SQR(slida[0]); - variC[1] = SQR(slida[1]); - variC[2] = SQR(slida[2]); - variC[3] = SQR(slida[3]); - variC[4] = SQR(slida[4]); - variC[5] = SQR(slida[5]); - variC[6] = SQR(slida[6]); - float maxc01 = rtengine::max(slida[0], slida[1]); - float maxc23 = rtengine::max(slida[2], slida[3]); - float max03 = rtengine::max(maxc01, maxc23); - float maxrf = rtengine::max(max03, slida[4]); - float maxrc = rtengine::max(slida[5], slida[6]); - - variCb[0] = SQR(slidb[0]); - variCb[1] = SQR(slidb[1]); - variCb[2] = SQR(slidb[2]); - variCb[3] = SQR(slidb[3]); - variCb[4] = SQR(slidb[4]); - variCb[5] = SQR(slidb[5]); - variCb[6] = SQR(slidb[6]); - float maxb01 = rtengine::max(slidb[0], slidb[1]); - float maxb23 = rtengine::max(slidb[2], slidb[3]); - float maxb03 = rtengine::max(maxb01, maxb23); - float maxbf = rtengine::max(maxb03, slidb[4]); - maxcfine = rtengine::max(maxrf, maxbf); - - float maxbc = rtengine::max(slidb[5], slidb[6]); - maxccoarse = rtengine::max(maxrc, maxbc); - - } + } { float minic = 0.000001f; @@ -12004,52 +11688,51 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float k2 = 0.f; float k3 = 0.f; - if (aut == 0 || aut == 1) { - if ((lp.noisecf < 0.2f && aut == 0) || (maxcfine < 0.2f && aut == 1)) { + if (lp.noisecf < 0.2f) { k1 = 0.05f; k2 = 0.f; k3 = 0.f; - } else if ((lp.noisecf < 0.3f && aut == 0) || (maxcfine < 0.3f && aut == 1)) { + } else if (lp.noisecf < 0.3f) { k1 = 0.1f; k2 = 0.0f; k3 = 0.f; - } else if ((lp.noisecf < 0.5f && aut == 0) || (maxcfine < 0.5f && aut == 1)) { + } else if (lp.noisecf < 0.5f) { k1 = 0.2f; k2 = 0.1f; k3 = 0.f; - } else if ((lp.noisecf < 0.8f && aut == 0) || (maxcfine < 0.8f && aut == 1)) { + } else if (lp.noisecf < 0.8f) { k1 = 0.3f; k2 = 0.25f; k3 = 0.f; - } else if ((lp.noisecf < 1.f && aut == 0) || (maxcfine < 1.f && aut == 1)) { + } else if (lp.noisecf < 1.f) { k1 = 0.4f; k2 = 0.25f; k3 = 0.1f; - } else if ((lp.noisecf < 2.f && aut == 0) || (maxcfine < 2.f && aut == 1)) { + } else if (lp.noisecf < 2.f) { k1 = 0.5f; k2 = 0.3f; k3 = 0.15f; - } else if ((lp.noisecf < 3.f && aut == 0) || (maxcfine < 3.f && aut == 1)) { + } else if (lp.noisecf < 3.f) { k1 = 0.6f; k2 = 0.45f; k3 = 0.3f; - } else if ((lp.noisecf < 4.f && aut == 0) || (maxcfine < 4.f && aut == 1)) { + } else if (lp.noisecf < 4.f) { k1 = 0.7f; k2 = 0.5f; k3 = 0.4f; - } else if ((lp.noisecf < 5.f && aut == 0) || (maxcfine < 5.f && aut == 1)) { + } else if (lp.noisecf < 5.f) { k1 = 0.8f; k2 = 0.6f; k3 = 0.5f; - } else if ((lp.noisecf < 6.f && aut == 0) || (maxcfine < 10.f && aut == 1)) { + } else if (lp.noisecf < 6.f) { k1 = 0.85f; k2 = 0.7f; k3 = 0.6f; - } else if ((lp.noisecf < 8.f && aut == 0) || (maxcfine < 20.f && aut == 1)) { + } else if (lp.noisecf < 8.f) { k1 = 0.9f; k2 = 0.8f; k3 = 0.7f; - } else if ((lp.noisecf < 10.f && aut == 0) || (maxcfine < 50.f && aut == 1)) { + } else if (lp.noisecf < 10.f) { k1 = 1.f; k2 = 1.f; k3 = 0.9f; @@ -12057,13 +11740,8 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } else { k1 = 1.f; k2 = 1.f; - k3 = 1.f; + k3 = 1.5f; } - } else if (aut == 2) { - k1 = 1.f; - k2 = 1.f; - k3 = 1.f; - } variC[0] = rtengine::max(minic, variC[0]); variC[1] = rtengine::max(minic, k1 * variC[1]); @@ -12075,27 +11753,27 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl variCb[2] = rtengine::max(minic, k2 * variCb[2]); variCb[3] = rtengine::max(minic, k3 * variCb[3]); - if (levred == 7) { + { float k4 = 0.f; float k5 = 0.f; float k6 = 0.f; - if ((lp.noisecc < 0.2f && aut == 0) || (maxccoarse < 0.2f && aut == 1)) { + if (lp.noisecc < 0.2f) { k4 = 0.1f; k5 = 0.02f; - } else if ((lp.noisecc < 0.5f && aut == 0) || (maxccoarse < 0.5f && aut == 1)) { + } else if (lp.noisecc < 0.5f) { k4 = 0.15f; k5 = 0.05f; - } else if ((lp.noisecc < 1.f && aut == 0) || (maxccoarse < 1.f && aut == 1)) { + } else if (lp.noisecc < 1.f) { k4 = 0.15f; k5 = 0.1f; - } else if ((lp.noisecc < 3.f && aut == 0) || (maxccoarse < 3.f && aut == 1)) { + } else if (lp.noisecc < 3.f) { k4 = 0.3f; k5 = 0.15f; - } else if ((lp.noisecc < 4.f && aut == 0) || (maxccoarse < 5.f && aut == 1)) { + } else if (lp.noisecc < 4.f) { k4 = 0.6f; k5 = 0.4f; - } else if ((lp.noisecc < 6.f && aut == 0) || (maxccoarse < 6.f && aut == 1)) { + } else if (lp.noisecc < 6.f) { k4 = 0.8f; k5 = 0.6f; } else { @@ -12109,11 +11787,11 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl variCb[4] = rtengine::max(0.000001f, k4 * variCb[4]); variCb[5] = rtengine::max(0.000001f, k5 * variCb[5]); - if ((lp.noisecc < 4.f && aut == 0) || (maxccoarse < 4.f && aut == 1)) { + if (lp.noisecc < 4.f) { k6 = 0.f; - } else if ((lp.noisecc < 5.f && aut == 0) || (maxccoarse < 5.f && aut == 1)) { + } else if (lp.noisecc < 5.f) { k6 = 0.4f; - } else if ((lp.noisecc < 6.f && aut == 0) || (maxccoarse < 6.f && aut == 1)) { + } else if (lp.noisecc < 6.f) { k6 = 0.7f; } else { k6 = 1.f; @@ -12128,7 +11806,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float nvch = 0.6f;//high value float nvcl = 0.1f;//low value - if ((lp.noisecf > 30.f && aut == 0) || (maxcfine > 100.f && (aut == 1 || aut == 2))) { + if (lp.noisecf > 30.f) { nvch = 0.8f; nvcl = 0.4f; } @@ -12368,6 +12046,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } } + } } @@ -13354,7 +13033,9 @@ void ImProcFunctions::Lab_Local( double& huerefblur, double& chromarefblur, double& lumarefblur, double& hueref, double& chromaref, double& lumaref, double& sobelref, int &lastsav, bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, int llcieMask, float& minCD, float& maxCD, float& mini, float& maxi, float& Tmean, float& Tsigma, float& Tmin, float& Tmax, - float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab + float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab, + float& highresi, float& nresi, float& highresi46, float& nresi46, float& Lhighresi, float& Lnresi, float& Lhighresi46, float& Lnresi46 + ) { //general call of others functions : important return hueref, chromaref, lumaref @@ -14401,12 +14082,9 @@ void ImProcFunctions::Lab_Local( //local denoise if (lp.activspot && lp.denoiena && (lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.wavcurvedenoi ||lp.nlstr > 0 || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f )) {//disable denoise if not used - float slidL[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; - float slida[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; - float slidb[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; constexpr int aut = 0; - DeNoise(call, slidL, slida, slidb, aut, noiscfactiv, lp, originalmaskbl.get(), bufmaskblurbl.get(), levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk, locwavCurvehue, locwavhueutili); - + DeNoise(call, aut, noiscfactiv, lp, originalmaskbl.get(), bufmaskblurbl.get(), levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk, locwavCurvehue, locwavhueutili, + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); if (lp.recur) { original->CopyFrom(transformed, multiThread); float avge; @@ -16112,12 +15790,7 @@ void ImProcFunctions::Lab_Local( } if (tonequ) { - tmpImage->normalizeFloatTo1(); - array2D Rtemp(bfw, bfh, tmpImage->r.ptrs, ARRAY2D_BYREFERENCE); - array2D Gtemp(bfw, bfh, tmpImage->g.ptrs, ARRAY2D_BYREFERENCE); - array2D Btemp(bfw, bfh, tmpImage->b.ptrs, ARRAY2D_BYREFERENCE); - tone_eq(Rtemp, Gtemp, Btemp, lp, params->icm.workingProfile, scal, multiThread); - tmpImage->normalizeFloatTo65535(); + tone_eq(this, tmpImage, lp, params->icm.workingProfile, scal, multiThread); } rgb2lab(*tmpImage, *bufexpfin, params->icm.workingProfile); @@ -18563,9 +18236,9 @@ void ImProcFunctions::Lab_Local( #endif for (int y = 0; y < bfh ; y++) { for (int x = 0; x < bfw; x++) { - tmpImageorig->r(y, x) = intp(lp.opacol, screen(tmpImageorig->r(y, x), tmpImagereserv->r(y, x), maxR), tmpImageorig->r(y, x)); - tmpImageorig->g(y, x) = intp(lp.opacol, screen(tmpImageorig->g(y, x), tmpImagereserv->g(y, x), maxG), tmpImageorig->g(y, x)); - tmpImageorig->b(y, x) = intp(lp.opacol, screen(tmpImageorig->b(y, x), tmpImagereserv->b(y, x), maxB), tmpImageorig->b(y, x)); + tmpImageorig->r(y, x) = intp(lp.opacol, screen(tmpImageorig->r(y, x), tmpImagereserv->r(y, x), 1.f), tmpImageorig->r(y, x)); + tmpImageorig->g(y, x) = intp(lp.opacol, screen(tmpImageorig->g(y, x), tmpImagereserv->g(y, x), 1.f), tmpImageorig->g(y, x)); + tmpImageorig->b(y, x) = intp(lp.opacol, screen(tmpImageorig->b(y, x), tmpImagereserv->b(y, x), 1.f), tmpImageorig->b(y, x)); } } } else if (lp.mergecolMethod == 12) { //darken only @@ -19266,6 +18939,7 @@ void ImProcFunctions::Lab_Local( calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } + } diff --git a/rtengine/iptoneequalizer.cc b/rtengine/iptoneequalizer.cc new file mode 100644 index 000000000..7fb6c791f --- /dev/null +++ b/rtengine/iptoneequalizer.cc @@ -0,0 +1,373 @@ +#include "color.h" +#include "guidedfilter.h" +#include "iccstore.h" +#include "imagefloat.h" +#include "improcfun.h" +#include "sleef.h" +#include "StopWatch.h" + + +namespace +{ + +const std::vector> colormap = { + {0.5f, 0.f, 0.5f}, + {0.5f, 0.f, 0.5f}, + {0.5f, 0.f, 0.5f}, + {0.5f, 0.f, 0.5f}, + {0.5f, 0.f, 0.5f}, // blacks + {0.f, 0.f, 1.f}, // shadows + {0.5f, 0.5f, 0.5f}, // midtones + {1.f, 1.f, 0.f}, // highlights + {1.f, 0.f, 0.f}, // whites + {1.f, 0.f, 0.f}, + {1.f, 0.f, 0.f}, + {1.f, 0.f, 0.f} +}; + + +void toneEqualizer( + array2D &R, array2D &G, array2D &B, + const rtengine::ToneEqualizerParams ¶ms, + const Glib::ustring &workingProfile, + double scale, + bool multithread) +// adapted from the tone equalizer of darktable +/* + Copyright 2019 Alberto Griggio + Small adaptation to Local Adjustment 10 2019 Jacques Desmis + This file is part of darktable, + copyright (c) 2018 Aurelien Pierre. + + darktable is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + darktable is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with darktable. If not, see . +*/ + +{ + // BENCHFUN + + const int W = R.getWidth(); + const int H = R.getHeight(); + array2D Y(W, H); + + const auto log2 = + [](float x) -> float { + static const float l2 = xlogf(2); + return xlogf(x) / l2; + }; + + const auto exp2 = + [](float x) -> float { + return pow_F(2.f, x); + }; + // Build the luma channels: band-pass filters with gaussian windows of + // std 2 EV, spaced by 2 EV + const float centers[12] = { + -16.0f, -14.0f, -12.0f, -10.0f, -8.0f, -6.0f, + -4.0f, -2.0f, 0.0f, 2.0f, 4.0f, 6.0f + }; + + const auto conv = [&](int v, float lo, float hi) -> float { + const float f = v < 0 ? lo : hi; + return exp2(float(v) / 100.f * f); + }; + const float factors[12] = { + conv(params.bands[0], 2.f, 3.f), // -16 EV + conv(params.bands[0], 2.f, 3.f), // -14 EV + conv(params.bands[0], 2.f, 3.f), // -12 EV + conv(params.bands[0], 2.f, 3.f), // -10 EV + conv(params.bands[0], 2.f, 3.f), // -8 EV + conv(params.bands[1], 2.f, 3.f), // -6 EV + conv(params.bands[2], 2.5f, 2.5f), // -4 EV + conv(params.bands[3], 3.f, 2.f), // -2 EV + conv(params.bands[4], 3.f, 2.f), // 0 EV + conv(params.bands[4], 3.f, 2.f), // 2 EV + conv(params.bands[4], 3.f, 2.f), // 4 EV + conv(params.bands[4], 3.f, 2.f) // 6 EV + }; + + rtengine::TMatrix ws = rtengine::ICCStore::getInstance()->workingSpaceMatrix(workingProfile); + +#ifdef _OPENMP + #pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < H; ++y) { + for (int x = 0; x < W; ++x) { + Y[y][x] = rtengine::Color::rgbLuminance(R[y][x], G[y][x], B[y][x], ws); + } + } + + int detail = rtengine::LIM(params.regularization + 5, 0, 5); + int radius = detail / scale + 0.5; + float epsilon2 = 0.01f + 0.002f * rtengine::max(detail - 3, 0); + + if (radius > 0) { + rtengine::guidedFilterLog(10.f, Y, radius, epsilon2, multithread); + } + + if (params.regularization > 0) { + array2D Y2(W, H); + constexpr float base_epsilon = 0.02f; + constexpr float base_posterization = 5.f; + +#ifdef _OPENMP + #pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < H; ++y) { + for (int x = 0; x < W; ++x) { + float l = rtengine::LIM(log2(rtengine::max(Y[y][x], 1e-9f)), centers[0], centers[11]); + float ll = round(l * base_posterization) / base_posterization; + Y2[y][x] = Y[y][x]; + Y[y][x] = exp2(ll); + } + } + + radius = 350.0 / scale; + epsilon2 = base_epsilon / float(6 - rtengine::min(params.regularization, 5)); + rtengine::guidedFilter(Y2, Y, Y, radius, epsilon2, multithread); + } + + const auto gauss = + [](float b, float x) -> float { + return xexpf((-rtengine::SQR(x - b) / 4.0f)); + }; + + // For every pixel luminance, the sum of the gaussian masks + float w_sum = 0.f; + + for (int i = 0; i < 12; ++i) { + w_sum += gauss(centers[i], 0.f); + } + + constexpr float luma_lo = -14.f; + constexpr float luma_hi = 4.f; + + const auto process_pixel = + [&](float y) -> float { + // convert to log space + const float luma = rtengine::LIM(log2(rtengine::max(y, 0.f)), luma_lo, luma_hi); + + // build the correction as the sum of the contribution of each + // luminance channel to current pixel + float correction = 0.0f; + + for (int c = 0; c < 12; ++c) + { + correction += gauss(centers[c], luma) * factors[c]; + } + + correction /= w_sum; + + return correction; + }; + + std::vector> cur_colormap; + if (params.show_colormap) { + rtengine::lcmsMutex->lock(); + cmsHPROFILE in = rtengine::ICCStore::getInstance()->getsRGBProfile(); + cmsHPROFILE out = rtengine::ICCStore::getInstance()->workingSpace(workingProfile); + cmsHTRANSFORM xform = cmsCreateTransform(in, TYPE_RGB_FLT, out, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE); + rtengine::lcmsMutex->unlock(); + + for (auto &c : colormap) { + cur_colormap.push_back(c); + auto &cc = cur_colormap.back(); + cmsDoTransform(xform, &cc[0], &cc[0], 1); + } + + cmsDeleteTransform(xform); + } + + const auto process_colormap = + [&](float y) -> std::array + { + std::array ret = { 0.f, 0.f, 0.f }; + + // convert to log space + const float luma = rtengine::LIM(log2(rtengine::max(y, 0.f)), luma_lo, luma_hi); + + // build the correction as the sum of the contribution of each + // luminance channel to current pixel + for (int c = 0; c < 12; ++c) { + float w = gauss(centers[c], luma); + for (int i = 0; i < 3; ++i) { + ret[i] += w * cur_colormap[c][i]; + } + } + for (int i = 0; i < 3; ++i) { + ret[i] = rtengine::LIM01(ret[i] / w_sum); + } + + return ret; + }; + + +#ifdef __SSE2__ + vfloat vfactors[12]; + vfloat vcenters[12]; + + for (int i = 0; i < 12; ++i) { + vfactors[i] = F2V(factors[i]); + vcenters[i] = F2V(centers[i]); + } + + const auto vgauss = + [](vfloat b, vfloat x) -> vfloat { + static const vfloat fourv = F2V(4.f); + return xexpf((-rtengine::SQR(x - b) / fourv)); + }; + + vfloat zerov = F2V(0.f); + vfloat vw_sum = F2V(w_sum); + + const vfloat vluma_lo = F2V(luma_lo); + const vfloat vluma_hi = F2V(luma_hi); + const vfloat xlog2v = F2V(xlogf(2.f)); + + const auto vprocess_pixel = + [&](vfloat y) -> vfloat { + const vfloat luma = vminf(vmaxf(xlogf(vmaxf(y, zerov)) / xlog2v, vluma_lo), vluma_hi); + + vfloat correction = zerov; + + for (int c = 0; c < 12; ++c) + { + correction += vgauss(vcenters[c], luma) * vfactors[c]; + } + + correction /= vw_sum; + + return correction; + }; + + + vfloat v1 = F2V(1.f); + vfloat v65535 = F2V(65535.f); +#endif // __SSE2__ + + + if (params.show_colormap) { + LUTf lut_r(65537), lut_g(65537), lut_b(65537); + for (int i = 0; i < 65536; ++i) { + float y = float(i)/65535.f; + auto rgb = process_colormap(y); + lut_r[i] = rgb[0]; + lut_g[i] = rgb[1]; + lut_b[i] = rgb[2]; + } + lut_r[65536] = cur_colormap.back()[0]; + lut_g[65536] = cur_colormap.back()[1]; + lut_b[65536] = cur_colormap.back()[2]; + +#ifdef _OPENMP +# pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < H; ++y) { + for (int x = 0; x < W; ++x) { + float cY = Y[y][x] * 65535.f; + R[y][x] = lut_r[cY]; + G[y][x] = lut_g[cY]; + B[y][x] = lut_b[cY]; + } + } + return; + } + + + LUTf lut(65536); + + for (int i = 0; i < 65536; ++i) { + float y = float(i) / 65535.f; + float c = process_pixel(y); + lut[i] = c; + } + +#ifdef _OPENMP + #pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < H; ++y) { + int x = 0; + + +#ifdef __SSE2__ + + for (; x < W - 3; x += 4) { + vfloat cY = LVFU(Y[y][x]); + vmask m = vmaskf_gt(cY, v1); + vfloat corr; + + if (_mm_movemask_ps((vfloat)m)) { + corr = vprocess_pixel(cY); + } else { + corr = lut[cY * v65535]; + } + + STVF(R[y][x], LVF(R[y][x]) * corr); + STVF(G[y][x], LVF(G[y][x]) * corr); + STVF(B[y][x], LVF(B[y][x]) * corr); + } + +#endif // __SSE2__ + + for (; x < W; ++x) { + float cY = Y[y][x]; + float corr = cY > 1.f ? process_pixel(cY) : lut[cY * 65535.f]; + R[y][x] *= corr; + G[y][x] *= corr; + B[y][x] *= corr; + } + } + +} + +} + + +namespace rtengine +{ + +void ImProcFunctions::toneEqualizer( + Imagefloat *rgb, + const ToneEqualizerParams ¶ms, + const Glib::ustring &workingProfile, + double scale, + bool multiThread) +{ + if (!params.enabled) { + return; + } + + BENCHFUN + + const float gain = 1.f / 65535.f * std::pow(2.f, -params.pivot); + + rgb->multiply(gain, multiThread); + + const int W = rgb->getWidth(); + const int H = rgb->getHeight(); + + array2D R(W, H, rgb->r.ptrs, ARRAY2D_BYREFERENCE); + array2D G(W, H, rgb->g.ptrs, ARRAY2D_BYREFERENCE); + array2D B(W, H, rgb->b.ptrs, ARRAY2D_BYREFERENCE); + + ::toneEqualizer(R, G, B, params, workingProfile, scale, multiThread); + + rgb->multiply(params.show_colormap ? 65535.f : 1.f/gain, multiThread); +} + +void ImProcFunctions::toneEqualizer(Imagefloat *rgb) +{ + toneEqualizer(rgb, params->toneEqualizer, params->icm.workingProfile, scale, multiThread); +} + +} diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 18ee72b80..e5e90a77f 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -2270,7 +2270,7 @@ void ImProcFunctions::Aver(const float* RESTRICT DataList, int datalen, float &a int countP = 0, countN = 0; double averaP = 0.0, averaN = 0.0; // use double precision for large summations - constexpr float thres = 32.7f;//different fom zero to take into account only data large enough 32.7 = 0.1 in range 0..100 very low value + constexpr float thres = 32.7f;//different from zero to take into account only data large enough 32.7 = 0.1 in range 0..100 very low value max = 0.f; min = RT_INFINITY_F; #ifdef _OPENMP @@ -2322,7 +2322,7 @@ void ImProcFunctions::Sigma(const float* RESTRICT DataList, int datalen, float a { int countP = 0, countN = 0; double variP = 0.0, variN = 0.0; // use double precision for large summations - float thres = 32.7f;//different fom zero to take into account only data large enough 32.7 = 0.1 in range 0..100 + float thres = 32.7f;//different from zero to take into account only data large enough 32.7 = 0.1 in range 0..100 #ifdef _OPENMP #pragma omp parallel for reduction(+:variP,variN,countP,countN) num_threads(numThreads) if (numThreads>1) diff --git a/rtengine/pdaflinesfilter.cc b/rtengine/pdaflinesfilter.cc index b5c72f7f4..60f2abcb6 100644 --- a/rtengine/pdaflinesfilter.cc +++ b/rtengine/pdaflinesfilter.cc @@ -275,7 +275,11 @@ int PDAFLinesFilter::mark(const array2D &rawData, PixelsMap &bpMap) for (int y = 1; y < H_-1; ++y) { int yy = pattern_[idx] + off; if (y == yy) { - int n = markLine(rawData, bpMap, y) + markLine(rawData, bpMap, y-1) + markLine(rawData, bpMap, y+1); + int n = 0; + n += markLine(rawData, bpMap, y); + n += (y-1 <= 0 ) ? 0 : markLine(rawData, bpMap, y-1); + n += (y+1 >= H_-1) ? 0 : markLine(rawData, bpMap, y+1); + if (n) { found += n; if (settings->verbose) { diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f6831a6bf..2aee557df 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1410,16 +1410,12 @@ WBParams::WBParams() : equal(1.0), tempBias(0.0), observer(ColorTemp::DEFAULT_OBSERVER), - itcwb_thres(34), - itcwb_precis(3), - itcwb_size(3), - itcwb_delta(2), - itcwb_fgreen(5), - itcwb_rgreen(1), - itcwb_nopurple(true), - itcwb_sorted(false), - itcwb_forceextra(false), - itcwb_sampling(false) + itcwb_green(0.),//slider + itcwb_rgreen(1),//keep for settings + itcwb_nopurple(false),//keep for settings + itcwb_alg(false),//checkbox + itcwb_prim("beta"),//combobox + itcwb_sampling(false)//keep for 5.9 and for settings { } @@ -1441,6 +1437,10 @@ bool WBParams::isPanningRelatedChange(const WBParams& other) const && equal == other.equal && tempBias == other.tempBias && observer == other.observer + && itcwb_green == other.itcwb_green + && itcwb_prim == other.itcwb_prim + && itcwb_alg == other.itcwb_alg + ) ) ); @@ -1456,15 +1456,11 @@ bool WBParams::operator ==(const WBParams& other) const && equal == other.equal && tempBias == other.tempBias && observer == other.observer - && itcwb_thres == other.itcwb_thres - && itcwb_precis == other.itcwb_precis - && itcwb_size == other.itcwb_size - && itcwb_delta == other.itcwb_delta - && itcwb_fgreen == other.itcwb_fgreen + && itcwb_green == other.itcwb_green && itcwb_rgreen == other.itcwb_rgreen && itcwb_nopurple == other.itcwb_nopurple - && itcwb_sorted == other.itcwb_sorted - && itcwb_forceextra == other.itcwb_forceextra + && itcwb_alg == other.itcwb_alg + && itcwb_prim == other.itcwb_prim && itcwb_sampling == other.itcwb_sampling; } @@ -1889,6 +1885,30 @@ bool SHParams::operator !=(const SHParams& other) const return !(*this == other); } +ToneEqualizerParams::ToneEqualizerParams() : + enabled(false), + bands{0, 0, 0, 0, 0}, + regularization(0), + show_colormap(false), + pivot(0) +{ +} + +bool ToneEqualizerParams::operator ==(const ToneEqualizerParams &other) const +{ + return + enabled == other.enabled + && bands == other.bands + && regularization == other.regularization + && show_colormap == other.show_colormap + && pivot == other.pivot; +} + +bool ToneEqualizerParams::operator !=(const ToneEqualizerParams &other) const +{ + return !(*this == other); +} + CropParams::CropParams() : enabled(false), x(-1), @@ -3404,6 +3424,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : slomaskSH(0.0), lapmaskSH(0.0), detailSH(0), + tePivot(0.), reparsh(100.), LmaskSHcurve{ static_cast(DCT_NURBS), @@ -4848,6 +4869,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && slomaskSH == other.slomaskSH && lapmaskSH == other.lapmaskSH && detailSH == other.detailSH + && tePivot == other.tePivot && reparsh == other.reparsh && LmaskSHcurve == other.LmaskSHcurve && fatamountSH == other.fatamountSH @@ -5994,6 +6016,8 @@ void ProcParams::setDefaults() sh = {}; + toneEqualizer = {}; + crop = {}; coarse = {}; @@ -6288,15 +6312,11 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->wb.equal, "White Balance", "Equal", wb.equal, keyFile); saveToKeyfile(!pedited || pedited->wb.tempBias, "White Balance", "TemperatureBias", wb.tempBias, keyFile); saveToKeyfile(!pedited || pedited->wb.observer, "White Balance", "StandardObserver", Glib::ustring(wb.observer == StandardObserver::TWO_DEGREES ? "TWO_DEGREES" : "TEN_DEGREES"), keyFile); - saveToKeyfile(!pedited || pedited->wb.itcwb_thres, "White Balance", "Itcwb_thres", wb.itcwb_thres, keyFile); - saveToKeyfile(!pedited || pedited->wb.itcwb_precis, "White Balance", "Itcwb_precis", wb.itcwb_precis, keyFile); - saveToKeyfile(!pedited || pedited->wb.itcwb_size, "White Balance", "Itcwb_size", wb.itcwb_size, keyFile); - saveToKeyfile(!pedited || pedited->wb.itcwb_delta, "White Balance", "Itcwb_delta", wb.itcwb_delta, keyFile); - saveToKeyfile(!pedited || pedited->wb.itcwb_fgreen, "White Balance", "Itcwb_findgreen", wb.itcwb_fgreen, keyFile); + saveToKeyfile(!pedited || pedited->wb.itcwb_green, "White Balance", "Itcwb_green", wb.itcwb_green, keyFile); saveToKeyfile(!pedited || pedited->wb.itcwb_rgreen, "White Balance", "Itcwb_rangegreen", wb.itcwb_rgreen, keyFile); saveToKeyfile(!pedited || pedited->wb.itcwb_nopurple, "White Balance", "Itcwb_nopurple", wb.itcwb_nopurple, keyFile); - saveToKeyfile(!pedited || pedited->wb.itcwb_sorted, "White Balance", "Itcwb_sorted", wb.itcwb_sorted, keyFile); - saveToKeyfile(!pedited || pedited->wb.itcwb_forceextra, "White Balance", "Itcwb_forceextra", wb.itcwb_forceextra, keyFile); + saveToKeyfile(!pedited || pedited->wb.itcwb_alg, "White Balance", "Itcwb_alg", wb.itcwb_alg, keyFile); + saveToKeyfile(!pedited || pedited->wb.itcwb_prim, "White Balance", "Itcwb_prim", wb.itcwb_prim, keyFile); saveToKeyfile(!pedited || pedited->wb.itcwb_sampling, "White Balance", "Itcwb_sampling", wb.itcwb_sampling, keyFile); // Colorappearance @@ -6434,6 +6454,14 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->sh.radius, "Shadows & Highlights", "Radius", sh.radius, keyFile); saveToKeyfile(!pedited || pedited->sh.lab, "Shadows & Highlights", "Lab", sh.lab, keyFile); +// Tone equalizer + saveToKeyfile(!pedited || pedited->toneEqualizer.enabled, "ToneEqualizer", "Enabled", toneEqualizer.enabled, keyFile); + for (size_t i = 0; i < toneEqualizer.bands.size(); ++i) { + saveToKeyfile(!pedited || pedited->toneEqualizer.bands[i], "ToneEqualizer", "Band" + std::to_string(i), toneEqualizer.bands[i], keyFile); + } + saveToKeyfile(!pedited || pedited->toneEqualizer.regularization, "ToneEqualizer", "Regularization", toneEqualizer.regularization, keyFile); + saveToKeyfile(!pedited || pedited->toneEqualizer.pivot, "ToneEqualizer", "Pivot", toneEqualizer.pivot, keyFile); + // Crop saveToKeyfile(!pedited || pedited->crop.enabled, "Crop", "Enabled", crop.enabled, keyFile); saveToKeyfile(!pedited || pedited->crop.x, "Crop", "X", crop.x, keyFile); @@ -6720,6 +6748,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->gammaskSH, "Locallab", "GammaskSH_" + index_str, spot.gammaskSH, keyFile); saveToKeyfile(!pedited || spot_edited->slomaskSH, "Locallab", "SlomaskSH_" + index_str, spot.slomaskSH, keyFile); saveToKeyfile(!pedited || spot_edited->detailSH, "Locallab", "DetailSH_" + index_str, spot.detailSH, keyFile); + saveToKeyfile(!pedited || spot_edited->tePivot, "Locallab", "TePivot_" + index_str, spot.tePivot, keyFile); saveToKeyfile(!pedited || spot_edited->reparsh, "Locallab", "Reparsh_" + index_str, spot.reparsh, keyFile); saveToKeyfile(!pedited || spot_edited->LmaskSHcurve, "Locallab", "LmaskSHCurve_" + index_str, spot.LmaskSHcurve, keyFile); saveToKeyfile(!pedited || spot_edited->fatamountSH, "Locallab", "FatamountSH_" + index_str, spot.fatamountSH, keyFile); @@ -7356,6 +7385,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo {ColorManagementParams::Primaries::ACES_P1, "aces"}, {ColorManagementParams::Primaries::WIDE_GAMUT, "wid"}, {ColorManagementParams::Primaries::ACES_P0, "ac0"}, + {ColorManagementParams::Primaries::JDC_MAX, "jdcmax"}, {ColorManagementParams::Primaries::BRUCE_RGB, "bru"}, {ColorManagementParams::Primaries::BETA_RGB, "bet"}, {ColorManagementParams::Primaries::BEST_RGB, "bst"}, @@ -8272,15 +8302,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } else if (standard_observer == "TWO_DEGREES") { wb.observer = StandardObserver::TWO_DEGREES; } - assignFromKeyfile(keyFile, "White Balance", "Itcwb_thres", pedited, wb.itcwb_thres, pedited->wb.itcwb_thres); - assignFromKeyfile(keyFile, "White Balance", "Itcwb_precis", pedited, wb.itcwb_precis, pedited->wb.itcwb_precis); - assignFromKeyfile(keyFile, "White Balance", "Itcwb_size", pedited, wb.itcwb_size, pedited->wb.itcwb_size); - assignFromKeyfile(keyFile, "White Balance", "Itcwb_delta", pedited, wb.itcwb_delta, pedited->wb.itcwb_delta); - assignFromKeyfile(keyFile, "White Balance", "Itcwb_findgreen", pedited, wb.itcwb_fgreen, pedited->wb.itcwb_fgreen); + assignFromKeyfile(keyFile, "White Balance", "Itcwb_green", pedited, wb.itcwb_green, pedited->wb.itcwb_green); assignFromKeyfile(keyFile, "White Balance", "Itcwb_rangegreen", pedited, wb.itcwb_rgreen, pedited->wb.itcwb_rgreen); assignFromKeyfile(keyFile, "White Balance", "Itcwb_nopurple", pedited, wb.itcwb_nopurple, pedited->wb.itcwb_nopurple); - assignFromKeyfile(keyFile, "White Balance", "Itcwb_sorted", pedited, wb.itcwb_sorted, pedited->wb.itcwb_sorted); - assignFromKeyfile(keyFile, "White Balance", "Itcwb_forceextra", pedited, wb.itcwb_forceextra, pedited->wb.itcwb_forceextra); + assignFromKeyfile(keyFile, "White Balance", "Itcwb_alg", pedited, wb.itcwb_alg, pedited->wb.itcwb_alg); + assignFromKeyfile(keyFile, "White Balance", "Itcwb_prim", pedited, wb.itcwb_prim, pedited->wb.itcwb_prim); if (ppVersion <= 349) { // 5.9 and earlier. wb.itcwb_sampling = true; if (pedited) { @@ -8487,6 +8513,15 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } + if (keyFile.has_group("ToneEqualizer")) { + assignFromKeyfile(keyFile, "ToneEqualizer", "Enabled", pedited, toneEqualizer.enabled, pedited->toneEqualizer.enabled); + for (size_t i = 0; i < toneEqualizer.bands.size(); ++i) { + assignFromKeyfile(keyFile, "ToneEqualizer", "Band" + std::to_string(i), pedited, toneEqualizer.bands[i], pedited->toneEqualizer.bands[i]); + } + assignFromKeyfile(keyFile, "ToneEqualizer", "Regularization", pedited, toneEqualizer.regularization, pedited->toneEqualizer.regularization); + assignFromKeyfile(keyFile, "ToneEqualizer", "Pivot", pedited, toneEqualizer.pivot, pedited->toneEqualizer.pivot); + } + if (keyFile.has_group("Crop")) { assignFromKeyfile(keyFile, "Crop", "Enabled", pedited, crop.enabled, pedited->crop.enabled); assignFromKeyfile(keyFile, "Crop", "X", pedited, crop.x, pedited->crop.x); @@ -8894,6 +8929,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "SlomaskSH_" + index_str, pedited, spot.slomaskSH, spotEdited.slomaskSH); assignFromKeyfile(keyFile, "Locallab", "LapmaskSH_" + index_str, pedited, spot.lapmaskSH, spotEdited.lapmaskSH); assignFromKeyfile(keyFile, "Locallab", "DetailSH_" + index_str, pedited, spot.detailSH, spotEdited.detailSH); + assignFromKeyfile(keyFile, "Locallab", "TePivot_" + index_str, pedited, spot.tePivot, spotEdited.tePivot); assignFromKeyfile(keyFile, "Locallab", "Reparsh_" + index_str, pedited, spot.reparsh, spotEdited.reparsh); assignFromKeyfile(keyFile, "Locallab", "LmaskSHCurve_" + index_str, pedited, spot.LmaskSHcurve, spotEdited.LmaskSHcurve); assignFromKeyfile(keyFile, "Locallab", "FatamountSH_" + index_str, pedited, spot.fatamountSH, spotEdited.fatamountSH); @@ -9698,6 +9734,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) {"aces", ColorManagementParams::Primaries::ACES_P1}, {"wid", ColorManagementParams::Primaries::WIDE_GAMUT}, {"ac0", ColorManagementParams::Primaries::ACES_P0}, + {"jdcmax", ColorManagementParams::Primaries::JDC_MAX}, {"bru", ColorManagementParams::Primaries::BRUCE_RGB}, {"bet", ColorManagementParams::Primaries::BETA_RGB}, {"bst", ColorManagementParams::Primaries::BEST_RGB}, @@ -10741,6 +10778,7 @@ bool ProcParams::operator ==(const ProcParams& other) const && fattal == other.fattal && defringe == other.defringe && sh == other.sh + && toneEqualizer == other.toneEqualizer && crop == other.crop && coarse == other.coarse && rotate == other.rotate diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 22ec54856..7390ddc1e 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -18,6 +18,7 @@ */ #pragma once +#include #include #include #include @@ -642,15 +643,11 @@ struct WBParams { double equal; double tempBias; StandardObserver observer; - int itcwb_thres; - int itcwb_precis; - int itcwb_size; - int itcwb_delta; - int itcwb_fgreen; + double itcwb_green; int itcwb_rgreen; bool itcwb_nopurple; - bool itcwb_sorted; - bool itcwb_forceextra; + bool itcwb_alg; + Glib::ustring itcwb_prim; bool itcwb_sampling; WBParams(); @@ -840,6 +837,22 @@ struct SHParams { bool operator !=(const SHParams& other) const; }; +/** + * Tone equalizer parameters. + */ +struct ToneEqualizerParams { + bool enabled; + std::array bands; + int regularization; + bool show_colormap; + double pivot; + + ToneEqualizerParams(); + + bool operator ==(const ToneEqualizerParams &other) const; + bool operator !=(const ToneEqualizerParams &other) const; +}; + /** * Parameters of the cropping */ @@ -1210,6 +1223,7 @@ struct LocallabParams { double slomaskSH; double lapmaskSH; int detailSH; + double tePivot; double reparsh; std::vector LmaskSHcurve; double fatamountSH; @@ -1922,6 +1936,7 @@ struct ColorManagementParams { ACES_P1, WIDE_GAMUT, ACES_P0, + JDC_MAX, BRUCE_RGB, BETA_RGB, BEST_RGB, @@ -2591,6 +2606,7 @@ public: EPDParams epd; ///< Edge Preserving Decomposition parameters FattalToneMappingParams fattal; ///< Fattal02 tone mapping SHParams sh; ///< Shadow/highlight enhancement parameters + ToneEqualizerParams toneEqualizer; ///< Tone equalizer parameters CropParams crop; ///< Crop parameters CoarseTransformParams coarse; ///< Coarse transformation (90, 180, 270 deg rotation, h/v flipping) parameters CommonTransformParams commonTrans; ///< Common transformation parameters (autofill) diff --git a/rtengine/profilestore.cc b/rtengine/profilestore.cc index f83ddd385..5cc039187 100644 --- a/rtengine/profilestore.cc +++ b/rtengine/profilestore.cc @@ -17,6 +17,9 @@ * along with RawTherapee. If not, see . */ +#include +#include + #include #include diff --git a/rtengine/profilestore.h b/rtengine/profilestore.h index e8e48c17f..d65c01751 100644 --- a/rtengine/profilestore.h +++ b/rtengine/profilestore.h @@ -18,6 +18,7 @@ */ #pragma once +#include #include #include diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 06bebafa6..1eab1dac3 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -43,7 +43,6 @@ #include "rt_math.h" #include "rtengine.h" #include "rtlensfun.h" - #include "../rtgui/options.h" #define BENCHMARK @@ -58,9 +57,9 @@ namespace { -void rotateLine (const float* const line, rtengine::PlanarPtr &channel, const int tran, const int i, const int w, const int h) +void rotateLine(const float* const line, rtengine::PlanarPtr &channel, const int tran, const int i, const int w, const int h) { - switch(tran & TR_ROT) { + switch (tran & TR_ROT) { case TR_R180: for (int j = 0; j < w; j++) { channel(h - 1 - i, w - 1 - j) = line[j]; @@ -90,15 +89,15 @@ void rotateLine (const float* const line, rtengine::PlanarPtr &channel, c } } -void transLineStandard (const float* const red, const float* const green, const float* const blue, const int i, rtengine::Imagefloat* const image, const int tran, const int imwidth, const int imheight) +void transLineStandard(const float* const red, const float* const green, const float* const blue, const int i, rtengine::Imagefloat* const image, const int tran, const int imwidth, const int imheight) { // conventional CCD coarse rotation - rotateLine (red, image->r, tran, i, imwidth, imheight); - rotateLine (green, image->g, tran, i, imwidth, imheight); - rotateLine (blue, image->b, tran, i, imwidth, imheight); + rotateLine(red, image->r, tran, i, imwidth, imheight); + rotateLine(green, image->g, tran, i, imwidth, imheight); + rotateLine(blue, image->b, tran, i, imwidth, imheight); } -void transLineFuji (const float* const red, const float* const green, const float* const blue, const int i, rtengine::Imagefloat* const image, const int tran, const int imheight, const int fw) +void transLineFuji(const float* const red, const float* const green, const float* const blue, const int i, rtengine::Imagefloat* const image, const int tran, const int imheight, const int fw) { // Fuji SuperCCD rotation + coarse rotation @@ -107,7 +106,7 @@ void transLineFuji (const float* const red, const float* const green, const floa int h = (imheight - fw) * 2 + 1; int end = min(h + fw - i, w - fw + i); - switch(tran & TR_ROT) { + switch (tran & TR_ROT) { case TR_R180: for (int j = start; j < end; j++) { int y = i + j - fw; @@ -165,14 +164,14 @@ void transLineFuji (const float* const red, const float* const green, const floa } } -void transLineD1x (const float* const red, const float* const green, const float* const blue, const int i, rtengine::Imagefloat* const image, const int tran, const int imwidth, const int imheight, const bool oddHeight, const bool clip) +void transLineD1x(const float* const red, const float* const green, const float* const blue, const int i, rtengine::Imagefloat* const image, const int tran, const int imwidth, const int imheight, const bool oddHeight, const bool clip) { // Nikon D1X has an uncommon sensor with 4028 x 1324 sensels. // Vertical sensel size is 2x horizontal sensel size // We have to do vertical interpolation for the 'missing' rows // We do that in combination with coarse rotation - switch(tran & TR_ROT) { + switch (tran & TR_ROT) { case TR_R180: // rotate 180 degree for (int j = 0; j < imwidth; j++) { image->r(2 * (imheight - 1 - i), imwidth - 1 - j) = red[j]; @@ -370,9 +369,9 @@ void transLineD1x (const float* const red, const float* const green, const float case TR_NONE: // no coarse rotation default: - rotateLine (red, image->r, tran, 2 * i, imwidth, imheight); - rotateLine (green, image->g, tran, 2 * i, imwidth, imheight); - rotateLine (blue, image->b, tran, 2 * i, imwidth, imheight); + rotateLine(red, image->r, tran, 2 * i, imwidth, imheight); + rotateLine(green, image->g, tran, 2 * i, imwidth, imheight); + rotateLine(blue, image->b, tran, 2 * i, imwidth, imheight); if (i == 1 || i == 2) { // linear interpolation for (int j = 0; j < imwidth; j++) { @@ -426,7 +425,7 @@ void transLineD1x (const float* const red, const float* const green, const float namespace rtengine { -RawImageSource::RawImageSource () +RawImageSource::RawImageSource() : ImageSource() , W(0), H(0) , plistener(nullptr) @@ -476,7 +475,7 @@ RawImageSource::RawImageSource () //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -RawImageSource::~RawImageSource () +RawImageSource::~RawImageSource() { delete idata; @@ -493,11 +492,11 @@ RawImageSource::~RawImageSource () } if (camProfile) { - cmsCloseProfile (camProfile); + cmsCloseProfile(camProfile); } if (embProfile) { - cmsCloseProfile (embProfile); + cmsCloseProfile(embProfile); } } @@ -506,7 +505,7 @@ unsigned RawImageSource::FC(int row, int col) const return ri->FC(row, col); } -eSensorType RawImageSource::getSensorType () const +eSensorType RawImageSource::getSensorType() const { return ri != nullptr ? ri->getSensorType() : ST_NONE; } @@ -523,7 +522,7 @@ int RawImageSource::getRotateDegree() const //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::transformRect (const PreviewProps &pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw) +void RawImageSource::transformRect(const PreviewProps &pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw) { int pp_x = pp.getX() + border; int pp_y = pp.getY() + border; @@ -674,7 +673,7 @@ void RawImageSource::wbCamera2Mul(double &rm, double &gm, double &bm) double r = ri->get_pre_mul(0) / rm; double g = ri->get_pre_mul(1) / gm; double b = ri->get_pre_mul(2) / bm; - + if (imatrices) { double rr = imatrices->rgb_cam[0][0] * r + imatrices->rgb_cam[0][1] * g + imatrices->rgb_cam[0][2] * b; double gg = imatrices->rgb_cam[1][0] * r + imatrices->rgb_cam[1][1] * g + imatrices->rgb_cam[1][2] * b; @@ -692,7 +691,7 @@ void RawImageSource::wbCamera2Mul(double &rm, double &gm, double &bm) -void RawImageSource::getWBMults (const ColorTemp &ctemp, const RAWParams &raw, std::array& out_scale_mul, float &autoGainComp, float &rm, float &gm, float &bm) const +void RawImageSource::getWBMults(const ColorTemp &ctemp, const RAWParams &raw, std::array& out_scale_mul, float &autoGainComp, float &rm, float &gm, float &bm) const { // compute channel multipliers double r, g, b; @@ -704,7 +703,7 @@ void RawImageSource::getWBMults (const ColorTemp &ctemp, const RAWParams &raw, s gm = ri->get_pre_mul(1); bm = ri->get_pre_mul(2); } else { - ctemp.getMultipliers (r, g, b); + ctemp.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; @@ -715,9 +714,10 @@ void RawImageSource::getWBMults (const ColorTemp &ctemp, const RAWParams &raw, s 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)); + || (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO)); float c_white[4]; + for (int i = 0; i < 4; ++i) { c_white[i] = (ri->get_white(i) - cblacksom[i]) / static_cast(raw.expos) + cblacksom[i]; } @@ -741,8 +741,9 @@ void RawImageSource::getWBMults (const ColorTemp &ctemp, const RAWParams &raw, s autoGainComp = camInitialGain / initialGain; } -void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw, int opposed) -{// added int opposed to force getimage to use inpaint-opposed if enable, only once +void RawImageSource::getImage(const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw, int opposed) +{ + // added int opposed to force getimage to use inpaint-opposed if enable, only once MyMutex::MyLock lock(getImageMutex); tran = defTransform(ri, tran); @@ -757,9 +758,9 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima gm = ri->get_pre_mul(1); bm = ri->get_pre_mul(2); } else { - // ctemp.getMultipliers (r, g, b); - r = g = b = 1; - wbCamera2Mul(r, g, b); + // ctemp.getMultipliers (r, g, b); + r = g = b = 1; + wbCamera2Mul(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; @@ -803,7 +804,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima defGain = 0.0; // compute image area to render in order to provide the requested part of the image int sx1, sy1, imwidth, imheight, fw, d1xHeightOdd = 0; - transformRect (pp, tran, sx1, sy1, imwidth, imheight, fw); + transformRect(pp, tran, sx1, sy1, imwidth, imheight, fw); // check possible overflows int maximwidth, maximheight; @@ -847,20 +848,24 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima bool iscolor = (hrp.method == "Color" || hrp.method == "Coloropp"); const bool doClip = (chmax[0] >= clmax[0] || chmax[1] >= clmax[1] || chmax[2] >= clmax[2]) && !hrp.hrenabled && hrp.clampOOG; bool doHr = (hrp.hrenabled && !iscolor); + if (hrp.hrenabled && iscolor) { - if(hrp.method == "Coloropp" && opposed == 1) {//force Inpaint opposed if WB change, and opposed limited tne number to 1 + if(hrp.method == "Coloropp" && opposed == 1) {//force Inpaint opposed if WB change, and opposed limited the number to 1 rgbSourceModified = false; } + if (!rgbSourceModified) { - if(hrp.method == "Color") { + if (hrp.method == "Color") { if (settings->verbose) { - printf ("Applying Highlight Recovery: Color propagation.\n"); + printf("Applying Highlight Recovery: Color propagation.\n"); } - HLRecovery_inpaint (red, green, blue, hrp.hlbl); - } else if(hrp.method == "Coloropp" && ctemp.getTemp() >= 0) { + + HLRecovery_inpaint(red, green, blue, hrp.hlbl); + } else if (hrp.method == "Coloropp" && ctemp.getTemp() >= 0) { float s[3] = { rm, gm, bm }; highlight_recovery_opposed(s, ctemp, hrp.hlth); } + rgbSourceModified = true; } } @@ -875,6 +880,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima gm *= g; bm *= b; } + hlmax[0] = clmax[0] * rm; hlmax[1] = clmax[1] * gm; hlmax[2] = clmax[2] * bm; @@ -888,8 +894,8 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima rm /= area; gm /= area; bm /= area; - - + + #ifdef _OPENMP #pragma omp parallel if(!d1x) // omp disabled for D1x to avoid race conditions (see Issue 1088 http://code.google.com/p/rawtherapee/issues/detail?id=1088) { @@ -974,15 +980,15 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima //process all highlight recovery other than "Color" if (doHr) { - hlRecovery (hrp.method, line_red, line_grn, line_blue, imwidth, hlmax); + hlRecovery(hrp.method, line_red, line_grn, line_blue, imwidth, hlmax); } if (d1x) { - transLineD1x (line_red, line_grn, line_blue, ix, image, tran, imwidth, imheight, d1xHeightOdd, doClip); + transLineD1x(line_red, line_grn, line_blue, ix, image, tran, imwidth, imheight, d1xHeightOdd, doClip); } else if (fuji) { - transLineFuji (line_red, line_grn, line_blue, ix, image, tran, imheight, fw); + transLineFuji(line_red, line_grn, line_blue, ix, image, tran, imheight, fw); } else { - transLineStandard (line_red, line_grn, line_blue, ix, image, tran, imwidth, imheight); + transLineStandard(line_red, line_grn, line_blue, ix, image, tran, imwidth, imheight); } } @@ -1041,22 +1047,22 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima // Flip if needed if (tran & TR_HFLIP) { - hflip (image); + hflip(image); } if (tran & TR_VFLIP) { - vflip (image); + vflip(image); } // Colour correction (only when running on full resolution) if (pp.getSkip() == 1) { - switch(ri->getSensorType()) { + switch (ri->getSensorType()) { case ST_BAYER: - processFalseColorCorrection (image, raw.bayersensor.ccSteps); + processFalseColorCorrection(image, raw.bayersensor.ccSteps); break; case ST_FUJI_XTRANS: - processFalseColorCorrection (image, raw.xtranssensor.ccSteps); + processFalseColorCorrection(image, raw.xtranssensor.ccSteps); break; case ST_FOVEON: @@ -1080,6 +1086,7 @@ DCPProfile *RawImageSource::getDCP(const ColorManagementParams &cmp, DCPProfileA if (settings->verbose) { printf("Can't load DCP profile '%s'!\n", cmp.inputProfile.c_str()); } + return nullptr; } @@ -1090,7 +1097,7 @@ DCPProfile *RawImageSource::getDCP(const ColorManagementParams &cmp, DCPProfileA void RawImageSource::convertColorSpace(Imagefloat* image, const ColorManagementParams &cmp, const ColorTemp &wb) { double pre_mul[3] = { ri->get_pre_mul(0), ri->get_pre_mul(1), ri->get_pre_mul(2) }; - colorSpaceConversion (image, cmp, wb, pre_mul, embProfile, camProfile, imatrices.xyz_cam, (static_cast(getMetaData()))->getCamera()); + colorSpaceConversion(image, cmp, wb, pre_mul, embProfile, camProfile, imatrices.xyz_cam, (static_cast(getMetaData()))->getCamera()); } void RawImageSource::getFullSize(int& w, int& h, int tr) @@ -1135,7 +1142,7 @@ void RawImageSource::computeFullSize(const RawImage *ri, int tr, int &w, int &h, //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::getSize (const PreviewProps &pp, int& w, int& h) +void RawImageSource::getSize(const PreviewProps &pp, int& w, int& h) { w = pp.getWidth() / pp.getSkip() + (pp.getWidth() % pp.getSkip() > 0); h = pp.getHeight() / pp.getSkip() + (pp.getHeight() % pp.getSkip() > 0); @@ -1143,14 +1150,14 @@ void RawImageSource::getSize (const PreviewProps &pp, int& w, int& h) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::hflip (Imagefloat* image) +void RawImageSource::hflip(Imagefloat* image) { image->hflip(); } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::vflip (Imagefloat* image) +void RawImageSource::vflip(Imagefloat* image) { image->vflip(); } @@ -1158,7 +1165,7 @@ void RawImageSource::vflip (Imagefloat* image) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) +int RawImageSource::load(const Glib::ustring &fname, bool firstFrameOnly) { MyTime t1, t2; @@ -1166,15 +1173,17 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) fileName = fname; if (plistener) { - plistener->setProgressStr ("PROGRESSBAR_DECODING"); - plistener->setProgress (0.0); + plistener->setProgressStr("PROGRESSBAR_DECODING"); + plistener->setProgress(0.0); } + ri = new RawImage(fname); - int errCode = ri->loadRaw (false, 0, false); + int errCode = ri->loadRaw(false, 0, false); if (errCode) { return errCode; } + numFrames = firstFrameOnly ? (numFrames < 7 ? 1 : ri->getFrameCount()) : ri->getFrameCount(); errCode = 0; @@ -1187,6 +1196,7 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) } else { numFrames = 6; } + #ifdef _OPENMP #pragma omp parallel #endif @@ -1195,15 +1205,17 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) #ifdef _OPENMP #pragma omp for nowait #endif + for (unsigned int i = 0; i < numFrames; ++i) { if (i == 0) { riFrames[i] = ri; - errCodeThr = riFrames[i]->loadRaw (true, i + 1, true, plistener, 0.8); + errCodeThr = riFrames[i]->loadRaw(true, i + 1, true, plistener, 0.8); } else { riFrames[i] = new RawImage(fname); - errCodeThr = riFrames[i]->loadRaw (true, i + 1); + errCodeThr = riFrames[i]->loadRaw(true, i + 1); } } + #ifdef _OPENMP #pragma omp critical #endif @@ -1220,15 +1232,18 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) #ifdef _OPENMP #pragma omp for nowait #endif - for (unsigned int i = 0; i < numFrames; ++i) { + + for (unsigned int i = 0; i < numFrames; ++i) + { if (i == 0) { riFrames[i] = ri; - errCodeThr = riFrames[i]->loadRaw (true, i, true, plistener, 0.8); + errCodeThr = riFrames[i]->loadRaw(true, i, true, plistener, 0.8); } else { riFrames[i] = new RawImage(fname); - errCodeThr = riFrames[i]->loadRaw (true, i); + errCodeThr = riFrames[i]->loadRaw(true, i); } } + #ifdef _OPENMP #pragma omp critical #endif @@ -1238,7 +1253,7 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) } } else { riFrames[0] = ri; - errCode = riFrames[0]->loadRaw (true, 0, true, plistener, 0.8); + errCode = riFrames[0]->loadRaw(true, 0, true, plistener, 0.8); } if (!errCode) { @@ -1256,7 +1271,7 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) } if (plistener) { - plistener->setProgress (0.9); + plistener->setProgress(0.9); } /***** Copy once constant data extracted from raw *******/ @@ -1271,7 +1286,7 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) // compute inverse of the color transformation matrix // first arg is matrix, second arg is inverse - inverse33 (imatrices.rgb_cam, imatrices.cam_rgb); + inverse33(imatrices.rgb_cam, imatrices.cam_rgb); d1x = ! ri->get_model().compare("D1X"); @@ -1284,11 +1299,11 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) } if (ri->get_profile()) { - embProfile = cmsOpenProfileFromMem (ri->get_profile(), ri->get_profileLen()); + embProfile = cmsOpenProfileFromMem(ri->get_profile(), ri->get_profileLen()); } // create profile - memset (imatrices.xyz_cam, 0, sizeof(imatrices.xyz_cam)); + memset(imatrices.xyz_cam, 0, sizeof(imatrices.xyz_cam)); for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) @@ -1296,8 +1311,8 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) imatrices.xyz_cam[i][j] += xyz_sRGB[i][k] * imatrices.rgb_cam[k][j]; } - camProfile = ICCStore::getInstance()->createFromMatrix (imatrices.xyz_cam, false, "Camera"); - inverse33 (imatrices.xyz_cam, imatrices.cam_xyz); + camProfile = ICCStore::getInstance()->createFromMatrix(imatrices.xyz_cam, false, "Camera"); + inverse33(imatrices.xyz_cam, imatrices.cam_xyz); // First we get the "as shot" ("Camera") white balance and store it float pre_mul[4]; @@ -1311,7 +1326,7 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) double cam_r = imatrices.rgb_cam[0][0] * camwb_red + imatrices.rgb_cam[0][1] * camwb_green + imatrices.rgb_cam[0][2] * camwb_blue; double cam_g = imatrices.rgb_cam[1][0] * camwb_red + imatrices.rgb_cam[1][1] * camwb_green + imatrices.rgb_cam[1][2] * camwb_blue; double cam_b = imatrices.rgb_cam[2][0] * camwb_red + imatrices.rgb_cam[2][1] * camwb_green + imatrices.rgb_cam[2][2] * camwb_blue; - camera_wb = ColorTemp (cam_r, cam_g, cam_b, 1., ColorTemp::DEFAULT_OBSERVER); // as shot WB + camera_wb = ColorTemp(cam_r, cam_g, cam_b, 1., ColorTemp::DEFAULT_OBSERVER); // as shot WB if (settings->verbose) { printf("Raw As Shot White balance: temp %f, tint %f\n", camera_wb.getTemp(), camera_wb.getGreen()); @@ -1347,14 +1362,14 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) initialGain = 1.0 / min(pre_mul[0], pre_mul[1], pre_mul[2]); }*/ - for (unsigned int i = 0;i < numFrames; ++i) { + for (unsigned int i = 0; i < numFrames; ++i) { riFrames[i]->set_prefilters(); } // Load complete Exif information idata = new FramesData(fname); // TODO: std::unique_ptr<> - idata->setDCRawFrameCount (numFrames); + idata->setDCRawFrameCount(numFrames); { int ww, hh; getFullSize(ww, hh); @@ -1367,7 +1382,7 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) //hpmap = allocArray(W, H); if (plistener) { - plistener->setProgress (1.0); + plistener->setProgress(1.0); } plistener = nullptr; // This must be reset, because only load() is called through progressConnector @@ -1382,7 +1397,7 @@ int RawImageSource::load (const Glib::ustring &fname, bool firstFrameOnly) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &lensProf, const CoarseTransformParams& coarse, bool prepareDenoise) +void RawImageSource::preprocess(const RAWParams &raw, const LensProfParams &lensProf, const CoarseTransformParams& coarse, bool prepareDenoise) { // BENCHFUN MyTime t1, t2; @@ -1392,7 +1407,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le // Recalculate the scaling coefficients, using auto WB if selected in the Preprocess WB param. // Auto WB gives us better demosaicing and CA auto-correct performance for strange white balance settings (such as UniWB) float dummy_cblk[4] = { 0.f }; // Avoid overwriting c_black, see issue #5676 - ri->get_colorsCoeff( ref_pre_mul, scale_mul, dummy_cblk, raw.preprocessWB.mode == RAWParams::PreprocessWB::Mode::AUTO); + ri->get_colorsCoeff(ref_pre_mul, scale_mul, dummy_cblk, raw.preprocessWB.mode == RAWParams::PreprocessWB::Mode::AUTO); refwb_red = ri->get_pre_mul(0) / ref_pre_mul[0]; refwb_green = ri->get_pre_mul(1) / ref_pre_mul[1]; @@ -1402,7 +1417,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le const double ref_r = imatrices.rgb_cam[0][0] * refwb_red + imatrices.rgb_cam[0][1] * refwb_green + imatrices.rgb_cam[0][2] * refwb_blue; const double ref_g = imatrices.rgb_cam[1][0] * refwb_red + imatrices.rgb_cam[1][1] * refwb_green + imatrices.rgb_cam[1][2] * refwb_blue; const double ref_b = imatrices.rgb_cam[2][0] * refwb_red + imatrices.rgb_cam[2][1] * refwb_green + imatrices.rgb_cam[2][2] * refwb_blue; - const ColorTemp ReferenceWB = ColorTemp (ref_r, ref_g, ref_b, 1., ColorTemp::DEFAULT_OBSERVER); + const ColorTemp ReferenceWB = ColorTemp(ref_r, ref_g, ref_b, 1., ColorTemp::DEFAULT_OBSERVER); if (settings->verbose) { printf("Raw Reference white balance: temp %f, tint %f, multipliers [%f %f %f | %f %f %f]\n", ReferenceWB.getTemp(), ReferenceWB.getGreen(), ref_r, ref_g, ref_b, refwb_red, refwb_blue, refwb_green); @@ -1457,14 +1472,16 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if (numFrames == 4) { int bufferNumber = 0; - for (unsigned int i=0; i<4; ++i) { - if (i==currFrame) { + + for (unsigned int i = 0; i < 4; ++i) { + if (i == currFrame) { copyOriginalPixels(raw, ri, rid, rif, rawData); rawDataFrames[i] = &rawData; } else { if (!rawDataBuffer[bufferNumber]) { rawDataBuffer[bufferNumber] = new array2D; } + rawDataFrames[i] = rawDataBuffer[bufferNumber]; ++bufferNumber; copyOriginalPixels(raw, riFrames[i], rid, rif, *rawDataFrames[i]); @@ -1474,6 +1491,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if (!rawDataBuffer[0]) { rawDataBuffer[0] = new array2D; } + rawDataFrames[1] = rawDataBuffer[0]; copyOriginalPixels(raw, riFrames[1], rid, rif, *rawDataFrames[1]); copyOriginalPixels(raw, ri, rid, rif, rawData); @@ -1486,6 +1504,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } else { copyOriginalPixels(raw, ri, rid, rif, rawData); } + //FLATFIELD end if (raw.ff_FromMetaData && isGainMapSupported()) { @@ -1529,7 +1548,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } if (numFrames == 4) { - for (int i=0; i<4; ++i) { + for (int i = 0; i < 4; ++i) { scaleColors(0, 0, W, H, raw, *rawDataFrames[i]); } } else { @@ -1539,6 +1558,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le // Correct vignetting of lens profile if (!hasFlatField && lensProf.useVign && lensProf.lcMode != LensProfParams::LcMode::NONE) { std::unique_ptr pmap; + if (lensProf.useLensfun()) { pmap = LFDatabase::getInstance()->findModifier(lensProf, idata, W, H, coarse, -1); } else { @@ -1551,6 +1571,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if (pmap) { LensCorrection &map = *pmap; + if (ri->getSensorType() == ST_BAYER || ri->getSensorType() == ST_FUJI_XTRANS || ri->get_colors() == 1) { if (numFrames == 4) { for (int i = 0; i < 4; ++i) { @@ -1569,8 +1590,8 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if (ri->getSensorType() == ST_BAYER && (raw.hotPixelFilter > 0 || raw.deadPixelFilter > 0)) { if (plistener) { - plistener->setProgressStr ("PROGRESSBAR_HOTDEADPIXELFILTER"); - plistener->setProgress (0.0); + plistener->setProgressStr("PROGRESSBAR_HOTDEADPIXELFILTER"); + plistener->setProgress(0.0); } if (!bitmapBads) { @@ -1591,16 +1612,17 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if (!bitmapBads) { bitmapBads.reset(new PixelsMap(W, H)); } - + int n = f.mark(rawData, *bitmapBads); totBP += n; if (n > 0) { if (settings->verbose) { - printf("Marked %d hot pixels from PDAF lines\n", n); + printf("Marked %d hot pixels from PDAF lines\n", n); } - auto &thresh = f.greenEqThreshold(); + auto &thresh = f.greenEqThreshold(); + if (numFrames == 4) { for (int i = 0; i < 4; ++i) { green_equilibrate(thresh, *rawDataFrames[i]); @@ -1613,17 +1635,17 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le // check if green equilibration is needed. If yes, compute G channel pre-compensation factors const auto globalGreenEq = - [&]() -> bool - { - CameraConstantsStore *ccs = CameraConstantsStore::getInstance(); - const CameraConst *cc = ccs->get(ri->get_maker().c_str(), ri->get_model().c_str()); - return cc && cc->get_globalGreenEquilibration(); - }; - + [&]() -> bool { + CameraConstantsStore *ccs = CameraConstantsStore::getInstance(); + const CameraConst *cc = ccs->get(ri->get_maker().c_str(), ri->get_model().c_str()); + return cc && cc->get_globalGreenEquilibration(); + }; + if (ri->getSensorType() == ST_BAYER && (raw.bayersensor.greenthresh || (globalGreenEq() && raw.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::VNG4)))) { if (settings->verbose) { printf("Performing global green equilibration...\n"); } + // global correction if (numFrames == 4) { for (int i = 0; i < 4; ++i) { @@ -1636,8 +1658,8 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if (ri->getSensorType() == ST_BAYER && raw.bayersensor.greenthresh > 0) { if (plistener) { - plistener->setProgressStr ("PROGRESSBAR_GREENEQUIL"); - plistener->setProgress (0.0); + plistener->setProgressStr("PROGRESSBAR_GREENEQUIL"); + plistener->setProgress(0.0); } GreenEqulibrateThreshold thresh(0.01 * raw.bayersensor.greenthresh); @@ -1670,11 +1692,12 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if (ri->getSensorType() == ST_BAYER && raw.bayersensor.linenoise > 0) { if (plistener) { - plistener->setProgressStr ("PROGRESSBAR_LINEDENOISE"); - plistener->setProgress (0.0); + plistener->setProgressStr("PROGRESSBAR_LINEDENOISE"); + plistener->setProgress(0.0); } std::unique_ptr line_denoise_rowblender; + if (raw.bayersensor.linenoiseDirection == RAWParams::BayerSensor::LineNoiseDirection::PDAF_LINES) { PDAFLinesFilter f(ri); line_denoise_rowblender = f.lineDenoiseRowBlender(); @@ -1687,15 +1710,18 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if ((raw.ca_autocorrect || std::fabs(raw.cared) > 0.001 || std::fabs(raw.cablue) > 0.001) && ri->getSensorType() == ST_BAYER) { // Auto CA correction disabled for X-Trans, for now... if (plistener) { - plistener->setProgressStr ("PROGRESSBAR_RAWCACORR"); - plistener->setProgress (0.0); + plistener->setProgressStr("PROGRESSBAR_RAWCACORR"); + plistener->setProgress(0.0); } + if (numFrames == 4) { double fitParams[64]; float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false, options.chunkSizeCA, options.measure); + for (int i = 1; i < 3; ++i) { CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false, options.chunkSizeCA, options.measure); } + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true, options.chunkSizeCA, options.measure); } else { CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true, options.chunkSizeCA, options.measure); @@ -1707,8 +1733,8 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le int aehistcompr; double clip = 0; int brightness, contrast, black, hlcompr, hlcomprthresh; - getAutoExpHistogram (aehist, aehistcompr); - ImProcFunctions::getAutoExp (aehist, aehistcompr, clip, dirpyrdenoiseExpComp, brightness, contrast, black, hlcompr, hlcomprthresh); + getAutoExpHistogram(aehist, aehistcompr); + ImProcFunctions::getAutoExp(aehist, aehistcompr, clip, dirpyrdenoiseExpComp, brightness, contrast, black, hlcompr, hlcomprthresh); } t2.set(); @@ -1729,13 +1755,13 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c if (ri->getSensorType() == ST_BAYER) { if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::HPHD)) { - hphd_demosaic (); + hphd_demosaic(); } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::VNG4)) { - vng4_demosaic (rawData, red, green, blue); + vng4_demosaic(rawData, red, green, blue); } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AHD)) { - ahd_demosaic (); + ahd_demosaic(); } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZE)) { - amaze_demosaic_RT (0, 0, W, H, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure); + amaze_demosaic_RT(0, 0, W, H, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure); } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEBILINEAR) || raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCBBILINEAR) @@ -1744,16 +1770,16 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c || raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::RCDVNG4)) { if (!autoContrast) { double threshold = raw.bayersensor.dualDemosaicContrast; - dual_demosaic_RT (true, raw, W, H, rawData, red, green, blue, threshold, false); + dual_demosaic_RT(true, raw, W, H, rawData, red, green, blue, threshold, false); } else { - dual_demosaic_RT (true, raw, W, H, rawData, red, green, blue, contrastThreshold, true); + dual_demosaic_RT(true, raw, W, H, rawData, red, green, blue, contrastThreshold, true); } } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)) { pixelshift(0, 0, W, H, raw, currFrame, ri->get_maker(), ri->get_model(), raw.expos); } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCB)) { dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance); } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::EAHD)) { - eahd_demosaic (); + eahd_demosaic(); } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::IGV)) { igv_interpolate(W, H); } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::LMMSE)) { @@ -1777,9 +1803,9 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c } else if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FOUR_PASS) || raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::TWO_PASS)) { if (!autoContrast) { double threshold = raw.xtranssensor.dualDemosaicContrast; - dual_demosaic_RT (false, raw, W, H, rawData, red, green, blue, threshold, false); + dual_demosaic_RT(false, raw, W, H, rawData, red, green, blue, threshold, false); } else { - dual_demosaic_RT (false, raw, W, H, rawData, red, green, blue, contrastThreshold, true); + dual_demosaic_RT(false, raw, W, H, rawData, red, green, blue, contrastThreshold, true); } } else if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO)) { nodemosaic(true); @@ -1798,12 +1824,14 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c rgbSourceModified = false; + if (cache) { if (!redCache) { redCache = new array2D(W, H); greenCache = new array2D(W, H); blueCache = new array2D(W, H); } + #ifdef _OPENMP #pragma omp parallel sections #endif @@ -1811,22 +1839,27 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c #ifdef _OPENMP #pragma omp section #endif + for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { (*redCache)[i][j] = red[i][j]; } } + #ifdef _OPENMP #pragma omp section #endif + for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { (*greenCache)[i][j] = green[i][j]; } } + #ifdef _OPENMP #pragma omp section #endif + for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { (*blueCache)[i][j] = blue[i][j]; @@ -1841,6 +1874,7 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c delete blueCache; blueCache = nullptr; } + if (settings->verbose) { if (getSensorType() == ST_BAYER) { printf("Demosaicing Bayer data: %s - %d usec\n", raw.bayersensor.method.c_str(), t2.etime(t1)); @@ -1855,10 +1889,10 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c void RawImageSource::retinexPrepareBuffers(const ColorManagementParams& cmp, const RetinexParams &retinexParams, multi_array2D &conversionBuffer, LUTu &lhist16RETI) { bool useHsl = (retinexParams.retinexcolorspace == "HSLLOG" || retinexParams.retinexcolorspace == "HSLLIN"); - conversionBuffer[0] (W - 2 * border, H - 2 * border); - conversionBuffer[1] (W - 2 * border, H - 2 * border); - conversionBuffer[2] (W - 2 * border, H - 2 * border); - conversionBuffer[3] (W - 2 * border, H - 2 * border); + conversionBuffer[0](W - 2 * border, H - 2 * border); + conversionBuffer[1](W - 2 * border, H - 2 * border); + conversionBuffer[2](W - 2 * border, H - 2 * border); + conversionBuffer[3](W - 2 * border, H - 2 * border); LUTf *retinexgamtab = nullptr;//gamma before and after Retinex to restore tones LUTf lutTonereti; @@ -1902,9 +1936,9 @@ void RawImageSource::retinexPrepareBuffers(const ColorManagementParams& cmp, con double x; if (gamm2 < 1.) { - x = Color::igammareti (val, gamm, start, ts, mul , add); + x = Color::igammareti(val, gamm, start, ts, mul, add); } else { - x = Color::gammareti (val, gamm, start, ts, mul , add); + x = Color::gammareti(val, gamm, start, ts, mul, add); } lutTonereti[i] = CLIP(x * 65535.);// CLIP avoid in some case extra values @@ -2043,7 +2077,7 @@ void RawImageSource::retinexPrepareBuffers(const ColorManagementParams& cmp, con } } else { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (cmp.workingProfile); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(cmp.workingProfile); const float wp[3][3] = { {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, {static_cast(wprof[1][0]), static_cast(wprof[1][1]), static_cast(wprof[1][2])}, @@ -2125,7 +2159,7 @@ void RawImageSource::retinex(const ColorManagementParams& cmp, const RetinexPara t4.set(); if (settings->verbose) { - printf ("Applying Retinex\n"); + printf("Applying Retinex\n"); } LUTf lutToneireti; @@ -2170,9 +2204,9 @@ void RawImageSource::retinex(const ColorManagementParams& cmp, const RetinexPara double x; if (gamm2 < 1.) { - x = Color::gammareti (val, gamm, start, ts, mul , add); + x = Color::gammareti(val, gamm, start, ts, mul, add); } else { - x = Color::igammareti (val, gamm, start, ts, mul , add); + x = Color::igammareti(val, gamm, start, ts, mul, add); } lutToneireti[i] = CLIP(x * 65535.); @@ -2186,7 +2220,7 @@ void RawImageSource::retinex(const ColorManagementParams& cmp, const RetinexPara const int HNew = H - 2 * border; const int WNew = W - 2 * border; - array2D LBuffer (WNew, HNew); + array2D LBuffer(WNew, HNew); float **temp = conversionBuffer[2]; // one less dereference LUTf dLcurve; LUTu hist16RET; @@ -2241,8 +2275,7 @@ void RawImageSource::retinex(const ColorManagementParams& cmp, const RetinexPara int pos = LBuffer[i][j]; hist16RETThr[pos]++; //histogram in Curve } - } - else + } else for (int j = 0; j < W - 2 * border; j++) { LBuffer[i][j] = temp[i][j]; } @@ -2319,7 +2352,7 @@ void RawImageSource::retinex(const ColorManagementParams& cmp, const RetinexPara } } else { - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(cmp.workingProfile); double wip[3][3] = { {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, @@ -2514,6 +2547,7 @@ void RawImageSource::flush() if (rawData) { rawData(0, 0); } + if (green) { green(0, 0); } @@ -2541,16 +2575,16 @@ void RawImageSource::flush() void RawImageSource::HLRecovery_Global(const ToneCurveParams &hrp) { - // if (hrp.hrenabled && hrp.method == "Color") { - // if (!rgbSourceModified) { - // if (settings->verbose) { - // printf ("Applying Highlight Recovery: Color propagation...\n"); - // } +// if (hrp.hrenabled && hrp.method == "Color") { +// if (!rgbSourceModified) { +// if (settings->verbose) { +// printf ("Applying Highlight Recovery: Color propagation...\n"); +// } +// +// HLRecovery_inpaint (red, green, blue, hrp.hlbl); // - // HLRecovery_inpaint (red, green, blue, hrp.hlbl); -// // rgbSourceModified = true; - // } +// } // } } @@ -2576,16 +2610,19 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, con #ifdef _OPENMP #pragma omp parallel for #endif + for (int row = 0; row < H; row++) { const int c0 = FC(row, 0); const float black0 = black[(c0 == 1 && !(row & 1)) ? 3 : c0]; const int c1 = FC(row, 1); const float black1 = black[(c1 == 1 && !(row & 1)) ? 3 : c1]; int col; + for (col = 0; col < W - 1; col += 2) { rawData[row][col] = max(src->data[row][col] + black0 - riDark->data[row][col], 0.0f); rawData[row][col + 1] = max(src->data[row][col + 1] + black1 - riDark->data[row][col + 1], 0.0f); } + if (col < W) { rawData[row][col] = max(src->data[row][col] + black0 - riDark->data[row][col], 0.0f); } @@ -2626,6 +2663,7 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, con } } } + if (riFlatFile && W == riFlatFile->get_width() && H == riFlatFile->get_height()) { processFlatField(raw, riFlatFile, rawData, black); } // flatfield @@ -2868,7 +2906,7 @@ int RawImageSource::defTransform(const RawImage *ri, int tran) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // Thread called part -void RawImageSource::processFalseColorCorrectionThread (Imagefloat* im, array2D &rbconv_Y, array2D &rbconv_I, array2D &rbconv_Q, array2D &rbout_I, array2D &rbout_Q, const int row_from, const int row_to) +void RawImageSource::processFalseColorCorrectionThread(Imagefloat* im, array2D &rbconv_Y, array2D &rbconv_I, array2D &rbconv_Q, array2D &rbout_I, array2D &rbout_Q, const int row_from, const int row_to) { const int W = im->getWidth(); @@ -2890,8 +2928,8 @@ void RawImageSource::processFalseColorCorrectionThread (Imagefloat* im, array2D int px = (row_from - 1) % 3, cx = row_from % 3, nx = 0; - convert_row_to_YIQ (im->r(row_from - 1), im->g(row_from - 1), im->b(row_from - 1), rbconv_Y[px], rbconv_I[px], rbconv_Q[px], W); - convert_row_to_YIQ (im->r(row_from), im->g(row_from), im->b(row_from), rbconv_Y[cx], rbconv_I[cx], rbconv_Q[cx], W); + convert_row_to_YIQ(im->r(row_from - 1), im->g(row_from - 1), im->b(row_from - 1), rbconv_Y[px], rbconv_I[px], rbconv_Q[px], W); + convert_row_to_YIQ(im->r(row_from), im->g(row_from), im->b(row_from), rbconv_Y[cx], rbconv_I[cx], rbconv_Q[cx], W); for (int j = 0; j < W; j++) { rbout_I[px][j] = rbconv_I[px][j]; @@ -2904,11 +2942,11 @@ void RawImageSource::processFalseColorCorrectionThread (Imagefloat* im, array2D cx = i % 3; nx = (i + 1) % 3; - convert_row_to_YIQ (im->r(i + 1), im->g(i + 1), im->b(i + 1), rbconv_Y[nx], rbconv_I[nx], rbconv_Q[nx], W); + convert_row_to_YIQ(im->r(i + 1), im->g(i + 1), im->b(i + 1), rbconv_Y[nx], rbconv_I[nx], rbconv_Q[nx], W); #ifdef __SSE2__ - pre1[0] = _mm_setr_ps(rbconv_I[px][0], rbconv_Q[px][0], 0, 0) , pre1[1] = _mm_setr_ps(rbconv_I[cx][0], rbconv_Q[cx][0], 0, 0), pre1[2] = _mm_setr_ps(rbconv_I[nx][0], rbconv_Q[nx][0], 0, 0); - pre2[0] = _mm_setr_ps(rbconv_I[px][1], rbconv_Q[px][1], 0, 0) , pre2[1] = _mm_setr_ps(rbconv_I[cx][1], rbconv_Q[cx][1], 0, 0), pre2[2] = _mm_setr_ps(rbconv_I[nx][1], rbconv_Q[nx][1], 0, 0); + pre1[0] = _mm_setr_ps(rbconv_I[px][0], rbconv_Q[px][0], 0, 0), pre1[1] = _mm_setr_ps(rbconv_I[cx][0], rbconv_Q[cx][0], 0, 0), pre1[2] = _mm_setr_ps(rbconv_I[nx][0], rbconv_Q[nx][0], 0, 0); + pre2[0] = _mm_setr_ps(rbconv_I[px][1], rbconv_Q[px][1], 0, 0), pre2[1] = _mm_setr_ps(rbconv_I[cx][1], rbconv_Q[cx][1], 0, 0), pre2[2] = _mm_setr_ps(rbconv_I[nx][1], rbconv_Q[nx][1], 0, 0); // fill first element in rbout_I and rbout_Q rbout_I[cx][0] = rbconv_I[cx][0]; @@ -2981,7 +3019,7 @@ void RawImageSource::processFalseColorCorrectionThread (Imagefloat* im, array2D // blur i-1th row if (i > row_from) { - convert_to_RGB (im->r(i - 1, 0), im->g(i - 1, 0), im->b(i - 1, 0), rbconv_Y[px][0], rbout_I[px][0], rbout_Q[px][0]); + convert_to_RGB(im->r(i - 1, 0), im->g(i - 1, 0), im->b(i - 1, 0), rbconv_Y[px][0], rbout_I[px][0], rbout_Q[px][0]); #ifdef _OPENMP #pragma omp simd @@ -2990,15 +3028,15 @@ void RawImageSource::processFalseColorCorrectionThread (Imagefloat* im, array2D for (int j = 1; j < W - 1; j++) { float I = (rbout_I[px][j - 1] + rbout_I[px][j] + rbout_I[px][j + 1] + rbout_I[cx][j - 1] + rbout_I[cx][j] + rbout_I[cx][j + 1] + rbout_I[nx][j - 1] + rbout_I[nx][j] + rbout_I[nx][j + 1]) * onebynine; float Q = (rbout_Q[px][j - 1] + rbout_Q[px][j] + rbout_Q[px][j + 1] + rbout_Q[cx][j - 1] + rbout_Q[cx][j] + rbout_Q[cx][j + 1] + rbout_Q[nx][j - 1] + rbout_Q[nx][j] + rbout_Q[nx][j + 1]) * onebynine; - convert_to_RGB (im->r(i - 1, j), im->g(i - 1, j), im->b(i - 1, j), rbconv_Y[px][j], I, Q); + convert_to_RGB(im->r(i - 1, j), im->g(i - 1, j), im->b(i - 1, j), rbconv_Y[px][j], I, Q); } - convert_to_RGB (im->r(i - 1, W - 1), im->g(i - 1, W - 1), im->b(i - 1, W - 1), rbconv_Y[px][W - 1], rbout_I[px][W - 1], rbout_Q[px][W - 1]); + convert_to_RGB(im->r(i - 1, W - 1), im->g(i - 1, W - 1), im->b(i - 1, W - 1), rbconv_Y[px][W - 1], rbout_I[px][W - 1], rbout_Q[px][W - 1]); } } // blur last 3 row and finalize H-1th row - convert_to_RGB (im->r(row_to - 1, 0), im->g(row_to - 1, 0), im->b(row_to - 1, 0), rbconv_Y[cx][0], rbout_I[cx][0], rbout_Q[cx][0]); + convert_to_RGB(im->r(row_to - 1, 0), im->g(row_to - 1, 0), im->b(row_to - 1, 0), rbconv_Y[cx][0], rbout_I[cx][0], rbout_Q[cx][0]); #ifdef _OPENMP #pragma omp simd #endif @@ -3006,16 +3044,16 @@ void RawImageSource::processFalseColorCorrectionThread (Imagefloat* im, array2D for (int j = 1; j < W - 1; j++) { float I = (rbout_I[px][j - 1] + rbout_I[px][j] + rbout_I[px][j + 1] + rbout_I[cx][j - 1] + rbout_I[cx][j] + rbout_I[cx][j + 1] + rbconv_I[nx][j - 1] + rbconv_I[nx][j] + rbconv_I[nx][j + 1]) * onebynine; float Q = (rbout_Q[px][j - 1] + rbout_Q[px][j] + rbout_Q[px][j + 1] + rbout_Q[cx][j - 1] + rbout_Q[cx][j] + rbout_Q[cx][j + 1] + rbconv_Q[nx][j - 1] + rbconv_Q[nx][j] + rbconv_Q[nx][j + 1]) * onebynine; - convert_to_RGB (im->r(row_to - 1, j), im->g(row_to - 1, j), im->b(row_to - 1, j), rbconv_Y[cx][j], I, Q); + convert_to_RGB(im->r(row_to - 1, j), im->g(row_to - 1, j), im->b(row_to - 1, j), rbconv_Y[cx][j], I, Q); } - convert_to_RGB (im->r(row_to - 1, W - 1), im->g(row_to - 1, W - 1), im->b(row_to - 1, W - 1), rbconv_Y[cx][W - 1], rbout_I[cx][W - 1], rbout_Q[cx][W - 1]); + convert_to_RGB(im->r(row_to - 1, W - 1), im->g(row_to - 1, W - 1), im->b(row_to - 1, W - 1), rbconv_Y[cx][W - 1], rbout_I[cx][W - 1], rbout_Q[cx][W - 1]); } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // correction_YIQ_LQ -void RawImageSource::processFalseColorCorrection (Imagefloat* im, const int steps) +void RawImageSource::processFalseColorCorrection(Imagefloat* im, const int steps) { if (im->getHeight() < 4 || steps < 1) { @@ -3025,7 +3063,7 @@ void RawImageSource::processFalseColorCorrection (Imagefloat* im, const int ste #ifdef _OPENMP #pragma omp parallel { - multi_array2D buffer (W, 3); + multi_array2D buffer(W, 3); int tid = omp_get_thread_num(); int nthreads = omp_get_num_threads(); int blk = (im->getHeight() - 2) / nthreads; @@ -3033,19 +3071,19 @@ void RawImageSource::processFalseColorCorrection (Imagefloat* im, const int ste for (int t = 0; t < steps; t++) { if (tid < nthreads - 1) { - processFalseColorCorrectionThread (im, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], 1 + tid * blk, 1 + (tid + 1)*blk); + processFalseColorCorrectionThread(im, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], 1 + tid * blk, 1 + (tid + 1)*blk); } else { - processFalseColorCorrectionThread (im, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], 1 + tid * blk, im->getHeight() - 1); + processFalseColorCorrectionThread(im, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], 1 + tid * blk, im->getHeight() - 1); } #pragma omp barrier } } #else - multi_array2D buffer (W, 3); + multi_array2D buffer(W, 3); for (int t = 0; t < steps; t++) { - processFalseColorCorrectionThread (im, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], 1 , im->getHeight() - 1); + processFalseColorCorrectionThread(im, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], 1, im->getHeight() - 1); } #endif @@ -3119,7 +3157,7 @@ lab2ProphotoRgbD50(float L, float A, float B, float& r, float& g, float& b) } // Converts raw image including ICC input profile to working space - floating point version -void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagementParams& cmp, const ColorTemp &wb, double pre_mul[3], cmsHPROFILE embedded, cmsHPROFILE camprofile, double camMatrix[3][3], const std::string &camName) +void RawImageSource::colorSpaceConversion_(Imagefloat* im, const ColorManagementParams& cmp, const ColorTemp &wb, double pre_mul[3], cmsHPROFILE embedded, cmsHPROFILE camprofile, double camMatrix[3][3], const std::string &camName) { // MyTime t1, t2, t3; @@ -3153,7 +3191,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen // in this case we avoid using the slllllooooooowwww lcms // Calculate matrix for direct conversion raw>working space - TMatrix work = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile); + TMatrix work = ICCStore::getInstance()->workingSpaceInverseMatrix(cmp.workingProfile); double mat[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; for (int i = 0; i < 3; i++) @@ -3254,6 +3292,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen TMatrix toxyz = ICCStore::getInstance()->workingSpaceMatrix(cmp.workingProfile); TMatrix torgb = ICCStore::getInstance()->workingSpaceInverseMatrix("ProPhoto"); float rgb[3] = {0.f, 0.f, 0.f}; + for (int i = 0; i < 2 && !working_space_is_prophoto; ++i) { rgb[i] = 1.f; float x, y, z; @@ -3265,17 +3304,20 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen if (rgb[j] < 0.f || rgb[j] > 1.f) { working_space_is_prophoto = true; prophoto = ICCStore::getInstance()->workingSpace(cmp.workingProfile); + if (settings->verbose) { std::cout << "colorSpaceConversion_: converting directly to " << cmp.workingProfile << " instead of passing through ProPhoto" << std::endl; } + break; } + rgb[j] = 0.f; } } } - - lcmsMutex->lock (); + + lcmsMutex->lock(); switch (camera_icc_type) { case CAMERA_ICC_TYPE_PHASE_ONE: @@ -3284,7 +3326,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen transform_via_pcs_lab = true; separate_pcs_lab_highlights = true; // We transform to Lab because we can and that we avoid getting an unnecessary unmatched gamma conversion which we would need to revert. - hTransform = cmsCreateTransform (in, TYPE_RGB_FLT, nullptr, TYPE_Lab_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE); + hTransform = cmsCreateTransform(in, TYPE_RGB_FLT, nullptr, TYPE_Lab_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { @@ -3302,24 +3344,24 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen case CAMERA_ICC_TYPE_NIKON: case CAMERA_ICC_TYPE_GENERIC: default: - hTransform = cmsCreateTransform (in, TYPE_RGB_FLT, prophoto, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE); // NOCACHE is important for thread safety + hTransform = cmsCreateTransform(in, TYPE_RGB_FLT, prophoto, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE); // NOCACHE is important for thread safety break; } - lcmsMutex->unlock (); + lcmsMutex->unlock(); if (hTransform == nullptr) { // Fallback: create transform from camera profile. Should not happen normally. - lcmsMutex->lock (); - hTransform = cmsCreateTransform (camprofile, TYPE_RGB_FLT, prophoto, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE); - lcmsMutex->unlock (); + lcmsMutex->lock(); + hTransform = cmsCreateTransform(camprofile, TYPE_RGB_FLT, prophoto, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE); + lcmsMutex->unlock(); } TMatrix toxyz = {}, torgb = {}; if (!working_space_is_prophoto) { - toxyz = ICCStore::getInstance()->workingSpaceMatrix ("ProPhoto"); - torgb = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile); //sRGB .. Adobe...Wide... + toxyz = ICCStore::getInstance()->workingSpaceMatrix("ProPhoto"); + torgb = ICCStore::getInstance()->workingSpaceInverseMatrix(cmp.workingProfile); //sRGB .. Adobe...Wide... } #ifdef _OPENMP @@ -3408,10 +3450,10 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen } // Run icc transform - cmsDoTransform (hTransform, buffer.data, buffer.data, im->getWidth()); + cmsDoTransform(hTransform, buffer.data, buffer.data, im->getWidth()); if (separate_pcs_lab_highlights) { - cmsDoTransform (hTransform, hl_buffer.data, hl_buffer.data, im->getWidth()); + cmsDoTransform(hTransform, hl_buffer.data, hl_buffer.data, im->getWidth()); } // Apply post-processing @@ -3537,7 +3579,7 @@ bool RawImageSource::findInputProfile(Glib::ustring inProfile, cmsHPROFILE embed } else if (inProfile != "(camera)" && !inProfile.empty()) { Glib::ustring normalName = inProfile; - if (!inProfile.compare (0, 5, "file:")) { + if (!inProfile.compare(0, 5, "file:")) { normalName = inProfile.substr(5); } @@ -3546,7 +3588,7 @@ bool RawImageSource::findInputProfile(Glib::ustring inProfile, cmsHPROFILE embed } if (*dcpProf == nullptr) { - in = ICCStore::getInstance()->getProfile (inProfile); + in = ICCStore::getInstance()->getProfile(inProfile); } } @@ -3577,6 +3619,7 @@ void RawImageSource::HLRecovery_blend(float* rin, float* gin, float* bin, int wi const float satthresh = 0.5; float clip[3]; + for (int c = 0; c < ColorCount; ++c) { clip[c] = rtengine::min(maxave, hlmax[c]); } @@ -3620,8 +3663,7 @@ void RawImageSource::HLRecovery_blend(float* rin, float* gin, float* bin, int wi for (int c = 0; c < ColorCount; ++c) { lab[i][c] = 0; - for (int j = 0; j < ColorCount; j++) - { + for (int j = 0; j < ColorCount; j++) { lab[i][c] += trans[c][j] * cam[i][j]; } } @@ -3644,11 +3686,11 @@ void RawImageSource::HLRecovery_blend(float* rin, float* gin, float* bin, int wi for (int c = 0; c < ColorCount; ++c) { cam[0][c] = 0; - for (int j = 0; j < ColorCount; j++) - { + for (int j = 0; j < ColorCount; j++) { cam[0][c] += itrans[c][j] * lab[0][j]; } } + for (int c = 0; c < ColorCount; ++c) { rgb[c] = cam[0][c] / ColorCount; } @@ -3688,7 +3730,7 @@ void RawImageSource::HLRecovery_blend(float* rin, float* gin, float* bin, int wi } } -void RawImageSource::HLRecovery_Luminance (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval) +void RawImageSource::HLRecovery_Luminance(float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval) { for (int i = 0; i < width; i++) { @@ -3705,7 +3747,7 @@ void RawImageSource::HLRecovery_Luminance (float* rin, float* gin, float* bin, f double Ho = 2 * bo - ro - go; if (r != g && g != b) { - double ratio = std::sqrt ((Co * Co + Ho * Ho) / (C * C + H * H)); + double ratio = std::sqrt((Co * Co + Ho * Ho) / (C * C + H * H)); C *= ratio; H *= ratio; } @@ -3726,8 +3768,8 @@ void RawImageSource::HLRecovery_Luminance (float* rin, float* gin, float* bin, f //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::HLRecovery_CIELab (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, - int width, float maxval, double xyz_cam[3][3], double cam_xyz[3][3]) +void RawImageSource::HLRecovery_CIELab(float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, + int width, float maxval, double xyz_cam[3][3], double cam_xyz[3][3]) { //static bool crTableReady = false; @@ -3783,16 +3825,15 @@ void RawImageSource::HLRecovery_CIELab (float* rin, float* gin, float* bin, floa //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::hlRecovery (const std::string &method, float* red, float* green, float* blue, int width, float* hlmax) +void RawImageSource::hlRecovery(const std::string &method, float* red, float* green, float* blue, int width, float* hlmax) { -// BENCHFUN +// BENCHFUN if (method == "Luminance") { - HLRecovery_Luminance (red, green, blue, red, green, blue, width, 65535.0); + HLRecovery_Luminance(red, green, blue, red, green, blue, width, 65535.0); } else if (method == "CIELab blending") { - HLRecovery_CIELab (red, green, blue, red, green, blue, width, 65535.0, imatrices.xyz_cam, imatrices.cam_xyz); - } - else if (method == "Blend") { // derived from Dcraw + HLRecovery_CIELab(red, green, blue, red, green, blue, width, 65535.0, imatrices.xyz_cam, imatrices.cam_xyz); + } else if (method == "Blend") { // derived from Dcraw HLRecovery_blend(red, green, blue, width, 65535.0, hlmax); } @@ -3800,7 +3841,7 @@ void RawImageSource::hlRecovery (const std::string &method, float* red, float* g //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) +void RawImageSource::getAutoExpHistogram(LUTu & histogram, int& histcompr) { // BENCHFUN histcompr = 3; @@ -3821,7 +3862,7 @@ void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) for (int i = border; i < H - border; i++) { int start, end; - getRowStartEnd (i, start, end); + getRowStartEnd(i, start, end); if (ri->getSensorType() == ST_BAYER) { // precalculate factors to avoid expensive per pixel calculations @@ -3882,7 +3923,7 @@ void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) } // Histogram MUST be 256 in size; gamma is applied, blackpoint and gain also -void RawImageSource::getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw) +void RawImageSource::getRAWHistogram(LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw) { // BENCHFUN histRedRaw.clear(); @@ -3949,7 +3990,7 @@ void RawImageSource::getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LU for (int i = border; i < H - border; i++) { int start, end; - getRowStartEnd (i, start, end); + getRowStartEnd(i, start, end); if (ri->getSensorType() == ST_BAYER) { int j; @@ -4002,11 +4043,10 @@ void RawImageSource::getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LU } // end of parallel region const auto getidx = - [&](int c, int i) -> int - { - float f = mult[c] * std::max(0.f, i - cblacksom[c]); - return f > 0.f ? (f < 1.f ? 1 : std::min(int(f), 255)) : 0; - }; + [&](int c, int i) -> int { + float f = mult[c] * std::max(0.f, i - cblacksom[c]); + return f > 0.f ? (f < 1.f ? 1 : std::min(int(f), 255)) : 0; + }; for (int i = 0; i < histoSize; i++) { int idx = getidx(0, i); @@ -4029,12 +4069,10 @@ void RawImageSource::getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LU if (ri->getSensorType() == ST_BAYER) // since there are twice as many greens, correct for it for (int i = 0; i < 256; i++) { histGreenRaw[i] >>= 1; - } - else if (ri->getSensorType() == ST_FUJI_XTRANS) // since Xtrans has 2.5 as many greens, correct for it + } else if (ri->getSensorType() == ST_FUJI_XTRANS) // since Xtrans has 2.5 as many greens, correct for it for (int i = 0; i < 256; i++) { histGreenRaw[i] = (histGreenRaw[i] * 2) / 5; - } - else if (ri->get_colors() == 1) { // monochrome sensor => set all histograms equal + } else if (ri->get_colors() == 1) { // monochrome sensor => set all histograms equal histGreenRaw += histRedRaw; histBlueRaw += histRedRaw; } @@ -4043,7 +4081,7 @@ void RawImageSource::getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LU //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::getRowStartEnd (int x, int &start, int &end) +void RawImageSource::getRowStartEnd(int x, int &start, int &end) { if (fuji) { int fw = ri->get_FujiWidth(); @@ -4076,9 +4114,12 @@ static void histoxyY_low(int bfhitc, int bfwitc, const array2D & xc, cons #ifdef _OPENMP #pragma omp for schedule(dynamic, 4) nowait #endif - for (int y = 0; y < bfhitc ; y++) { + + for (int y = 0; y < bfhitc ; y++) + { for (int x = 0; x < bfwitc ; x++) { int nh = -1; + if (xc[y][x] < 0.12f && xc[y][x] > 0.03f && yc[y][x] > 0.1f) { // near Prophoto if (yc[y][x] < 0.2f) { nh = 0; @@ -4501,6 +4542,7 @@ static void histoxyY_low(int bfhitc, int bfwitc, const array2D & xc, cons } else if (xc[y][x] < 0.75f && yc[y][x] > 0.1f) { nh = 191; } + if (nh >= 0) { histxythr[nh]++; xxxthr[nh] += xc[y][x]; @@ -4509,6 +4551,7 @@ static void histoxyY_low(int bfhitc, int bfwitc, const array2D & xc, cons } } } + #ifdef _OPENMP #pragma omp critical #endif @@ -4522,16 +4565,21 @@ static void histoxyY_low(int bfhitc, int bfwitc, const array2D & xc, cons } +//enable display cells +//int cellxy[80][90] ; -static void histoxyY(int bfhitc, int bfwitc, const array2D & xc, const array2D & yc, const array2D & Yc, LUTf &xxx, LUTf &yyy, LUTf &YYY, LUTu &histxy, bool purp) +static void histoxyY(int bfhitc, int bfwitc, const array2D & xc, const array2D & yc, const array2D & Yc, LUTf &xxx, LUTf &yyy, LUTf &YYY, LUTu &histxy, bool purpe) { // calculate histogram x y in a range of 236 colors // this "choice" are guided by generally colors who are in nature skin, sky, etc. in those cases "steps" are small // of course we can change to be more precise // purp enable or not purple color in xyY - approximation... +//enable display cells +// int totalpixels = 0; + #ifdef _OPENMP - #pragma omp parallel + #pragma omp parallel // disabled if enable display cells #endif { LUTu histxythr(histxy.getSize()); @@ -4542,9 +4590,21 @@ static void histoxyY(int bfhitc, int bfwitc, const array2D & xc, const ar yyythr.clear(); LUTf YYYthr(YYY.getSize()); YYYthr.clear(); - // bool purp = false; + bool purp = true; + float Ypurp = 0.5f; + float Ypurpmax = 1.f; + //enable display cells + /* + // clear + for (int i = 0; i < 80; ++i) { + for (int j = 0 ; j < 90; ++j) { + cellxy[i][j] = 0; + } + } + */ #ifdef _OPENMP - #pragma omp for schedule(dynamic, 4) nowait + #pragma omp for schedule(dynamic, 4) nowait //disable if enable display cells + #endif for (int y = 0; y < bfhitc ; y++) @@ -4552,6 +4612,12 @@ static void histoxyY(int bfhitc, int bfwitc, const array2D & xc, const ar for (int x = 0; x < bfwitc ; x++) { int nh = -1; + if (!purpe) { + purp = (Yc[y][x] < Ypurp);//cut values with Y > Ypurp + } else { + purp = (Yc[y][x] < Ypurpmax);// + } + if (xc[y][x] < 0.12f && xc[y][x] > 0.03f && yc[y][x] > 0.1f) { // near Prophoto if (yc[y][x] < 0.2f) { nh = 0; @@ -5070,11 +5136,23 @@ static void histoxyY(int bfhitc, int bfwitc, const array2D & xc, const ar yyythr[nh] += yc[y][x]; YYYthr[nh] += Yc[y][x]; } + +//enable display cells + /* + // update + int x1 = (int)(100.0 * (xc[y][x])); + int y1 = (int)(100.0 * (yc[y][x])); + + if (x1 >= 0 && x1 < 80 && y1 >= 0 && y1 < 90) { + cellxy[x1][y1]++; + totalpixels++; + } + */ } } #ifdef _OPENMP - #pragma omp critical + #pragma omp critical //disable if enable display cells #endif { histxy += histxythr; @@ -5138,10 +5216,10 @@ float static studentXY(const array2D & YYcurr, const array2D & ref -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, const ToneCurveParams &hrp) +void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, 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, const ToneCurveParams &hrp) { /* - Copyright (c) Jacques Desmis 6 - 2018 jdesmis@gmail.com, update 2 - 2023 + Copyright (c) Jacques Desmis 6 - 2018 jdesmis@gmail.com, update 6 - 2023 Copyright (c) Ingo Weyrich 3 - 2020 (heckflosse67@gmx.de) This algorithm try to find temperature correlation between 20 to 80 colors between 201 spectral color and about 20 to 55 color found in the image between 236, 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. @@ -5149,17 +5227,17 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double I have test many many algorithms to find the first one that work :) Probably (sure) there are improvement to do... - I have create a table temperature with temp and white point with 118 values between 2000K and 12000K we can obviously change these values, more...with different steps + I have create a table temperature with temp and white point with 191 values between 2000K and 15000K we can obviously change these values, more...with different steps I have create a table for tint (green)with 134 values between 0.4 to 4. - I have create or recuparate and transformed 201 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 large enough. - I think this value of 201 is now complete: I tested correlation with 60, 90, 100, 120, 155...better student increase with number of color, but now it seems stabilized + I have create or recuparate and transformed 406 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 large enough. + I think this value of 265 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 current 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 201 spectral data - 4) then I create for the image an "histogram", but for xyY (CIE 1931 color space or CIE 1964 (default)) - 5) for each pixel (in fact to accelerate only 1/5 for and 1/5 for y), I determine for each couple xy, the number of occurrences, can be change by Itcwb_precis to 3 or 9 + 3) for this temp, I calculated XYZ values for the 406 spectral data + 4) then I create for the image an "histogram", but for xyY (CIE 1931 color space or CIE 1964) + 5) for each pixel (in fact to accelerate only 1/3 for and 1/3 for y), I determine for each couple xy, the number of occurrences 6) I sort this result in ascending order 7) in option we can sort in another manner to take into account chroma : chromax = x - white point x, chromay = y - white point y 8) then I compare this result, with spectral data found above in 3) with deltaE (limited to chroma) @@ -5174,13 +5252,13 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double 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) between these green limits, we make slightly vary temp (settings in options) and recalculated RGB multipliers + 19) we make vary green between 2 limits + 20) between these green limits, we make slightly vary temp 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) then find all Student correlation for each couple green / temp 24) sort these Student values, and choose the minimum - 25) then for the 5 better couple "temp / green" choose the one where green is nearest from 1. + 25) then for the 3 better couple "temp / green" choose the one where green is nearest 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 @@ -5192,916 +5270,2139 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double 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 parameters in White Balance - Frame adapted to Itcwb - Itcwb_thres : 34 by default ==> number of color used in final algorithm - between 10 and max 55 - Itcwb_sorted : true by default, can improve algorithm 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_greendelta : 1 - delta temp in green iterate loop for "extra" - between 0 to 4 - Itcwb_forceextra : false by default - Use all Ciexy diagram instead of sRGB - //Itcwb_sizereference : repalce by int maxnb 3 by default, can be set to 5 ==> size of reference color compare to size of histogram real color - itcwb_delta : 1 by default can be set between 0 to 5 ==> delta temp to build histogram xy - if camera temp is not probably good - //itcwb_precis : replace by int precision = 3 by default - can be set to 3 or 9 - 3 best sampling but more time...9 "old" settings - but low differences in times with 3 instead of 9 about twice time 160ms instead of 80ms for a big raw file - itcwb_nopurple : true default - allow to bypass highlight recovery and inpait opposed when need flowers and not purple due to highlights... - itcwb_fgreen : 5 by default - between 3 to 6 - find the compromise student / green to reach green near of 1 - - In file options. - use standard observer 10°, false = standard observer 2° + Itcwb_rgreen : 1 amplitude of green variation - between 0 to 2 + Itcwb_prim : sRGB, Beta rgb (default), XYZcam, JDCmax = Use near Ciexy diagram instead of sRGB + itcwb_delta : 4 by default can be set between 0 to 5 ==> delta temp to build histogram xy - if camera temp is not probably good + itcwb_nopurple : false default - allow to bypass highlight recovery and inpait opposed when need flowers and not purple due to highlights... + itcwb_green - adjust green refinement */ - // BENCHFUN + BENCHFUN + MyTime t1, t2, t3, t4, t5, t6, t7, t8; + t1.set(); - Glib::ustring profuse; - profuse = "sRGB";//or "Adobe RGB" - if( wbpar.itcwb_forceextra && wbpar.itcwb_sampling == false) {//Adobe RGB - profuse = "ACESp0";//cover all CIE xy diagram - } - - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(profuse); //ACESp0 or sRGB - const float wp[3][3] = { - {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, - {static_cast(wprof[1][0]), static_cast(wprof[1][1]), static_cast(wprof[1][2])}, - {static_cast(wprof[2][0]), static_cast(wprof[2][1]), static_cast(wprof[2][2])} + bool itciterate = true; + bool lastitc = true; + + typedef struct Wboptim {//store config Itcwb + float stud; + float minc; + double titc; + double gritc; + double tempre; + double greenre; + int drea; + int kmi; + float minhis; + float maxhis; + double avg_r; + double avg_g; + double avg_b; + float delt; + + } Wboptim; + + Wboptim optitc[2] = { + {0.f, 0.f, 5000., 1., 5000., 1., 1, 1, 10.f, 100.f, 1., 1., 1., 0.f}, + {0.f, 0.f, 5000., 1., 5000., 1., 1, 1, 10.f, 100.f, 1., 1., 1., 0.f} }; + int nbitc = 0; + int choiceitc = 0; + bool oldsampling = wbpar.itcwb_sampling; - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(profuse);//ACESp0 or sRGB - //inverse matrix user select - const float wip[3][3] = { - {static_cast(wiprof[0][0]), static_cast(wiprof[0][1]), static_cast(wiprof[0][2])}, - {static_cast(wiprof[1][0]), static_cast(wiprof[1][1]), static_cast(wiprof[1][2])}, - {static_cast(wiprof[2][0]), static_cast(wiprof[2][1]), static_cast(wiprof[2][2])} - }; + while (itciterate) {//loop to find best mix minchrom and studgood and deltaE patch + Glib::ustring profuse; + profuse = "JDCmax"; - const int bfwitc = bfw; - const int bfhitc = bfh; + int limx = 0.05f; + int limy = 0.04f; - typedef struct WbGreen { - double green; - float snedecor;//1. actually but put in case of confiance interval - } WbGreen; - //green (tint) values between 0.4 to 4.0 - constexpr WbGreen gree[134] = {//symmetric coefficient between 0.717 and 1.40 - {0.400, 1.f}, - {0.420, 1.f}, - {0.440, 1.f}, - {0.460, 1.f}, - {0.480, 1.f}, - {0.500, 1.f}, - {0.520, 1.f}, - {0.540, 1.f}, - {0.550, 1.f}, - {0.560, 1.f}, - {0.570, 1.f}, - {0.580, 1.f}, - {0.590, 1.f}, - {0.600, 1.f}, - {0.610, 1.f}, - {0.620, 1.f},//extended range - {0.630, 1.f}, - {0.640, 1.f}, - {0.650, 1.f}, - {0.660, 1.f}, - {0.670, 1.f}, - {0.680, 1.f}, - {0.690, 1.f}, - {0.700, 1.f}, - {0.714, 1.f},//usual 2 range - {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},//usual range - {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},//55 reference - {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},// usual range - {1.275, 1.f}, - {1.300, 1.f}, - {1.325, 1.f}, - {1.350, 1.f}, - {1.375, 1.f}, - {1.400, 1.f},//usual 2 range - {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},//extended range - {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} - }; - const int N_g = sizeof(gree) / sizeof(gree[0]); //number of green - - typedef struct RangeGreen { - int begin; - int end; - } RangeGreen; - - constexpr RangeGreen Rangestandard = {33, 80};//usual green range - constexpr RangeGreen Rangestandard2 = {24, 86};//usual 2 green range - constexpr RangeGreen Rangeextended = {15, 93}; - const RangeGreen Rangemax = {0, N_g}; - - RangeGreen Rangegreenused; - - if (wbpar.itcwb_rgreen == 0) { - Rangegreenused = Rangestandard; - } else if (wbpar.itcwb_rgreen == 1) { - Rangegreenused = Rangestandard2; - } else if (wbpar.itcwb_rgreen == 2) { - Rangegreenused = Rangeextended; - } else { - Rangegreenused = Rangemax; - } - if(wbpar.itcwb_sampling == true) { - Rangegreenused = Rangestandard2; - } - 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 ! - // X and Z values calculate for each temp between 2000K to 12000K, so no result after 12000K ! - //of course we can change the step between each temp if need - constexpr WbTxyz Txyz[118] = {//temperature Xwb Zwb 118 values x wb and y wb are calculated after, Xwb and Ywb calculated with a spreadsheet - {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},//57 reference - {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} - }; - const int N_t = sizeof(Txyz) / sizeof(Txyz[0]); //number of temperature White point - constexpr int Nc = 201 + 1;//201 number of reference spectral colors, I think it is enough to retrieve good values - array2D Tx(N_t, Nc); - array2D Ty(N_t, Nc); - array2D Tz(N_t, Nc); - array2D Ta(N_t, Nc); - array2D Tb(N_t, Nc); - array2D TL(N_t, Nc); - double TX[Nc]; - double TY[Nc]; - double TZ[Nc]; - std::vector good_spectral(Nc, false); - - float rmm[N_t]; - float gmm[N_t]; - float bmm[N_t]; - - int siza = 237; //192 untill 01/2023 size of histogram - if(wbpar.itcwb_sampling == true) { - siza = 192;//old sampling 5.9 and before... - } - // tempref and greenref are camera wb values. - // I used them by default to select good spectral values !! but they are changed after - tempref = rtengine::min(tempref, 12000.0); - - 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 - const 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)); - 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", wbpar.observer); - 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]; - const 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] = 1.f; - bmm[tt] = bm / gm; - //return rmm, gmm, bmm in function of temp - } - - struct hiss { - int histnum; - int index; - bool operator()(const hiss& lhis, const hiss& rhis) - { - return lhis.histnum < rhis.histnum; + if (wbpar.itcwb_prim == "srgb") { + profuse = "sRGB"; + limx = 0.12f; + limy = 0.06f; + } else if (wbpar.itcwb_prim == "beta") { + profuse = "Beta RGB"; + limx = 0.1f; + limy = 0.05f; + } else if (wbpar.itcwb_prim == "XYZcam") { + profuse = "XYZcam"; + limx = 0.05f; + limy = 0.04f; + } else if (wbpar.itcwb_prim == "jdcmax") { + profuse = "JDCmax"; + limx = 0.05f; + limy = 0.04f; } - } ; - //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; + if (oldsampling) { + profuse = "sRGB"; } - } ; + float wb[3][3], iwb[3][3]; + double wb2[3][3]; - LUTu histxy(siza); //number of values for each pair xy + if (profuse == "XYZcam") {//thanks to Reffort - histxy.clear(); + // get a copy of the camera matrices + for (int r = 0; r < 3; ++r) { + for (int c = 0; c < 3; ++c) { + wb[r][c] = imatrices.xyz_cam[r][c]; + wb2[r][c] = imatrices.xyz_cam[r][c]; + iwb[r][c] = imatrices.cam_xyz[r][c]; + } + } + } else if ((cmp.inputProfile == "(camera)")) {//when no input profile found or if user select Camera standard + if (settings->verbose) { + printf("Use Camera Dcraw-Matrix and modify rgbloc\n"); + } - LUTf xxx(siza);//for color references calculated ==> max in images "like histogram" + //improvment with new values for redloc, greenloc, blueloc when Camera Dcraw is used + TMatrix iwork = ICCStore::getInstance()->workingSpaceInverseMatrix(profuse); + TMatrix workn = ICCStore::getInstance()->workingSpaceMatrix(profuse); + double mat[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - xxx.clear(); + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) { + mat[i][j] += iwork[i][k] * imatrices.xyz_cam[k][j]; // rgb_xyz * imatrices.xyz_cam + } - LUTf yyy(siza); - - yyy.clear(); - - LUTf YYY(siza);//not used directly, but necessary to keep good range - - YYY.clear(); - - bool separated = true; - - int w = -1; - - array2D reff_spect_yy_camera(N_t, 2 * Nc + 2); - - array2D reff_spect_xx_camera(N_t, 2 * Nc + 2); - - //here we select the good spectral color inside the 113 values - //call tempxy to calculate for 201 color references Temp and XYZ with cat02 - - ColorTemp::tempxy(separated, repref, Tx, Ty, Tz, Ta, Tb, TL, TX, TY, TZ, wbpar); //calculate chroma xy (xyY) for Z known colors on under 200 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 - } - - array2D xc(bfwitc, bfhitc); - array2D yc(bfwitc, bfhitc); - array2D Yc(bfwitc, bfhitc); - - const int deltarepref = 1; //settings->itcwb_delta; - - for (int nn = 0, drep = -deltarepref; nn <= 2; ++nn, drep += deltarepref) { - //three loop to refine color if temp camera is probably not very good - const int rep = rtengine::LIM(repref + drep, 0, N_t); - - //initialize calculation of xy current for tempref #ifdef _OPENMP - #pragma omp parallel for + #pragma omp parallel for #endif - for (int y = 0; y < bfh ; ++y) { - for (int x = 0; x < bfw ; ++x) { - const float RR = rmm[rep] * redloc[y][x]; - const float GG = gmm[rep] * greenloc[y][x]; - const float BB = bmm[rep] * blueloc[y][x]; - Color::rgbxyY(RR, GG, BB, xc[y][x], yc[y][x], Yc[y][x], wp);//use sRGB or ACESp0 + for (int y = 0; y < bfh; y++) + for (int x = 0; x < bfw; x++) { + + float newred = mat[0][0] * redloc[y][x] + mat[0][1] * greenloc[y][x] + mat[0][2] * blueloc[y][x]; + float newgreen = mat[1][0] * redloc[y][x] + mat[1][1] * greenloc[y][x] + mat[1][2] * blueloc[y][x]; + float newblue = mat[2][0] * redloc[y][x] + mat[2][1] * greenloc[y][x] + mat[2][2] * blueloc[y][x]; + + redloc[y][x] = newred;//new values for redloc + greenloc[y][x] = newgreen; + blueloc[y][x] = newblue; + + } + + for (int r = 0; r < 3; ++r) { + for (int c = 0; c < 3; ++c) { + wb[r][c] = workn[r][c]; + wb2[r][c] = workn[r][c]; + iwb[r][c] = iwork[r][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 - - bool purp = true;//if inpaint-opposed or something else enable purp - - // if (hrp.hrenabled && hrp.method == "Coloropp" && settings->itcwb_nopurple == true) {//we disabled (user) with settings if image are naturally with purple (flowers...) - if (hrp.hrenabled && hrp.method == "Coloropp" && wbpar.itcwb_nopurple == true) {//we disabled (user) with settings if image are naturally with purple (flowers...) - purp = false; - } - if(wbpar.itcwb_sampling == false) { - //printf("Use high smapling\n"); - histoxyY(bfhitc, bfwitc, xc, yc, Yc, xxx, yyy, YYY, histxy, purp);//purp enable, enable purple color in WB - //return histogram x and y for each temp and in a range of 235 colors (siza) } else { - //printf("Use low smapling - 5.9\n"); - histoxyY_low(bfhitc, bfwitc, xc, yc, Yc, xxx, yyy, YYY, histxy);//low scaling - } - } - // free some memory - xc.free(); - yc.free(); - Yc.free(); - //calculate x y Y - const int sizcurrref = siza;//choice of number of correlate colors in image - array2D histcurrref(N_t, sizcurrref); - array2D xx_curref(N_t, sizcurrref); - array2D yy_curref(N_t, sizcurrref); - array2D YY_curref(N_t, sizcurrref); - array2D xx_curref_reduc(N_t, sizcurrref); - array2D yy_curref_reduc(N_t, sizcurrref); - array2D YY_curref_reduc(N_t, sizcurrref); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(profuse); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(profuse); - hiss Wbhis[siza]; - - for (int nh = 0; nh < siza; nh++) { - Wbhis[nh].histnum = histxy[nh]; - Wbhis[nh].index = nh; - } - - //sort in ascending order - std::sort(Wbhis, Wbhis + siza, Wbhis[0]); - - int n1 = 0; - int n4 = 0; - int n15 = 0; - int n30 = 0; - - //part to improve - //determined the number of colors who be used after - for (int nh = 0; nh < siza; nh++) { - if (Wbhis[nh].histnum < 30) { - n30++; //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 < 4) { - n4++; //keep only existing color but avoid to small - - if (Wbhis[nh].histnum < 1) { - n1++; //keep only existing color but avoid to small - } + for (int r = 0; r < 3; ++r) { + for (int c = 0; c < 3; ++c) { + wb[r][c] = wprof[r][c]; + wb2[r][c] = wprof[r][c]; + iwb[r][c] = wiprof[r][c]; } } } - } - - int 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; - const int sizcu30 = sizcurrref - n30; - int nbm = 77;//number max of color used = 1.4 * 55 in case all CIExy diagram - if(profuse == "sRGB" || wbpar.itcwb_sampling == true) { - nbm = 55; - } - const int sizcu4 = rtengine::min(sizcu30, nbm);//size of chroma values - - if (settings->verbose) { - printf("ntr=%i sizcurr2ref=%i sizcu30=%i sizcu4=%i\n", ntr, sizcurr2ref, sizcu30, sizcu4); - } - - chrom wbchro[sizcu4]; - const float swpr = Txyz[repref].XX + Txyz[repref].ZZ + 1.f; - const float xwpr = Txyz[repref].XX / swpr;//white point for tt in xy coordinates - const float ywpr = 1.f / swpr; - - for (int i = 0; i < sizcu4; ++i) { //take the max values - histcurrref[i][repref] = Wbhis[siza - (i + 1)].histnum; - xx_curref[i][repref] = xxx[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; - yy_curref[i][repref] = yyy[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; - YY_curref[i][repref] = YYY[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; - } - - float estimchrom = 0.f; - - //estimate chromaticity for references - for (int nh = 0; nh < sizcu4; ++nh) { - const float chxy = std::sqrt(SQR(xx_curref[nh][repref] - xwpr) + SQR(yy_curref[nh][repref] - ywpr)); - wbchro[nh].chroxy_number = chxy * std::sqrt(histcurrref[nh][repref]); - wbchro[nh].chroxy = std::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; - - if (settings->verbose) { - printf("estimchrom=%f\n", estimchrom); - } - bool issorted = wbpar.itcwb_sorted; - - if(wbpar.itcwb_sampling == true) { - issorted = false; - } - - - if (issorted) { //sort in ascending with chroma values - std::sort(wbchro, wbchro + sizcu4, wbchro[0]); - } - - int maxval = rtengine::LIM(wbpar.itcwb_thres, 10, 55);//max values of color to find correlation - if(wbpar.itcwb_sampling == true) { - maxval = 34; - } - - sizcurr2ref = rtengine::min(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; - } - } - - //calculate deltaE xx to find best values of spectrals data - limited to chroma values - // int maxnb = rtengine::LIM(settings->itcwb_sizereference, 1, 5); - // int maxnb = rtengine::LIM(wbpar.itcwb_size, 1, 5); - int maxnb = 3; - //wbpar.itcwb_size to verify if this setting is usefull...diificulties with High gamut and limited patch spectral colors. - - if (wbpar.itcwb_thres > 55) {//normally never used - maxnb = 201 / wbpar.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;//we can change this value... - int kN = 0; - - for (int j = 0; j < Nc ; j++) { - if (!good_spectral[j]) { - const 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] = true;//good spectral are spectral color that match color histogram xy - } - } - - // reuse some buffers - array2D& R_curref_reduc = xx_curref_reduc; - array2D& G_curref_reduc = yy_curref_reduc; - array2D& B_curref_reduc = YY_curref_reduc; - - //reconvert to RGB for "reduction" - for (int i = 0; i < w; i++) { - const float X = 65535.f * xx_curref_reduc[i][repref] * YY_curref_reduc[i][repref] / yy_curref_reduc[i][repref]; - const float Y = 65535.f * YY_curref_reduc[i][repref]; - const 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_curref_reduc[i][repref] = r / rmm[repref]; - G_curref_reduc[i][repref] = g / gmm[repref]; - B_curref_reduc[i][repref] = b / bmm[repref]; - - } - -//end first part - - //Now begin real calculations - separated = false; - //recalculate histogram with good values and not estimated - 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 - //calculate x y Y - int sizcurr = siza;//choice of number of correlate colors in image - array2D xxyycurr_reduc(N_t, 2 * sizcurr); - array2D reff_spect_xxyy(N_t, 2 * Nc + 2); - array2D reff_spect_xxyy_prov(N_t, 2 * Nc + 2); - - float minstud = 100000.f; - int goodref = 1; - -//calculate x y z for each pixel with multiplier rmm gmm bmm - - for (int tt = 0; tt < N_t; ++tt) {//N_t - for (int i = 0; i < w; ++i) { - float unused; - - const float RR = rmm[tt] * R_curref_reduc[i][repref]; - const float GG = gmm[tt] * G_curref_reduc[i][repref]; - const float BB = bmm[tt] * B_curref_reduc[i][repref]; - Color::rgbxyY(RR, GG, BB, xxyycurr_reduc[2 * i][tt], xxyycurr_reduc[2 * i + 1][tt], unused, wp); - } - - 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 - } - - int kk = -1; - - for (int i = 0; i < Nc ; ++i) { - if (good_spectral[i]) { - kk++; - //we calculate now absolute chroma for each spectral color - 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]; - } - } - - const float abstud = std::fabs(studentXY(xxyycurr_reduc, reff_spect_xxyy, 2 * w, 2 * kk, tt)); - - if (abstud < minstud) { // find the minimum Student - minstud = abstud; - goodref = tt; - } - } - - if (extra) {//always used if extra = true because I made this choice, brings better results - 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;//5002K position in the list - Tgstud[i].greenref = 55;// 1.f position in the list - } - - int dgoodref = rtengine::LIM(wbpar.itcwb_delta,1, 4); - if(wbpar.itcwb_sampling == true) { - dgoodref = 2; - } - const int scantempbeg = rtengine::max(goodref - (dgoodref + 1), 1); - const int scantempend = rtengine::min(goodref + dgoodref, N_t - 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; - ColorTemp WBiter(Txyz[tt].Tem, gree[gr].green, 1.f, "Custom", wbpar.observer); - WBiter.getMultipliers(r, g, b); - float rm = imatrices.cam_rgb[0][0] * r + imatrices.cam_rgb[0][1] * g + imatrices.cam_rgb[0][2] * b; - float gm = imatrices.cam_rgb[1][0] * r + imatrices.cam_rgb[1][1] * g + imatrices.cam_rgb[1][2] * b; - float bm = imatrices.cam_rgb[2][0] * r + imatrices.cam_rgb[2][1] * g + imatrices.cam_rgb[2][2] * b; - //recalculate Multipliers now with good range of temp and green - - 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]; - const 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] = 1.f; - bmm[tt] = bm / gm; - } - - - for (int tt = scantempbeg; tt < scantempend; ++tt) {//N_t - for (int i = 0; i < w; ++i) { - float unused; - - const float RR = rmm[tt] * R_curref_reduc[i][repref]; - const float GG = gmm[tt] * G_curref_reduc[i][repref]; - const float BB = bmm[tt] * B_curref_reduc[i][repref]; - Color::rgbxyY(RR, GG, BB, xxyycurr_reduc[2 * i][tt], xxyycurr_reduc[2 * i + 1][tt], unused, wp); - } - - //recalculate xy spectral now with good range of temp and green - - 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 - } - - int kkg = -1; - - for (int i = 0; i < Nc ; ++i) { - if (good_spectral[i]) { - 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]; - } - } - - //now we have good spectral data - //calculate student correlation - const float abstudgr = std::fabs(studentXY(xxyycurr_reduc, reff_spect_xxyy, 2 * w, 2 * kkg, tt)); - - if (abstudgr < minstudgr) { // find the minimum Student - minstudgr = abstudgr; - goodrefgr = tt; - } - - //found the values - Tgstud[gr].tempref = goodrefgr; - Tgstud[gr].greenref = gr; - Tgstud[gr].student = minstudgr; - - } - } - - std::sort(Tgstud, Tgstud + N_g, Tgstud[0]); - - // now search the value of green the nearest of 1 with a good student value, I think it is a good choice, perhaps no... - // I take the 5 first values - // I admit a symetrie in green coefiicient for rgb multiplier...probably not exactly true - // perhaps we can used a Snedecor test ? but why...at least we have confidence interval > 90% - int greengood = 55; - - int maxkgood = wbpar.itcwb_fgreen;//we can change ...to test 3, 4, 5. High values perhaps less good student, but it is a compromise... - maxkgood = rtengine::LIM(maxkgood, 3, 6); - if(wbpar.itcwb_sampling == true) { - maxkgood = 3; // force to 3 with old low sampling - } - - int mingood = std::min(std::fabs(Tgstud[0].greenref - 55), std::fabs(Tgstud[1].greenref - 55)); - - for (int k = 2; k < maxkgood; ++k) { - mingood = std::min(std::fabs(mingood), std::fabs(Tgstud[k].greenref - 55)); - } - - for (int k = 0; k < maxkgood ; ++k) { - if (mingood == fabs(Tgstud[k].greenref - 55)) { - greengood = Tgstud[k].greenref ; - goodref = Tgstud[k].tempref; - studgood = Tgstud[k].student;; - } - } if (settings->verbose) { - printf("Student_0=%f Student_k= %f\n", Tgstud[0].student, Tgstud[maxkgood - 1].student); - printf("mingood=%i greeng=%i goodref=%i stud=%f\n", mingood, greengood, goodref, (double) studgood); + printf("Sampling=%s \n", profuse.c_str()); + printf("wp = %f %f %f\n", wb[0][0], wb[0][1], wb[0][2]); + printf(" %f %f %f\n", wb[1][0], wb[1][1], wb[1][2]); + printf(" %f %f %f\n", wb[2][0], wb[2][1], wb[2][2]); } - tempitc = Txyz[goodref].Tem; - greenitc = gree[greengood].green; + const int bfwitc = bfw; + const int bfhitc = bfh; - if (estimchrom < 0.025f) { - float ac = -2.40f * estimchrom + 0.06f;//small empirical correction, maximum 0.06 if chroma=0 for all image, currently for very low chroma +0.02 - greenitc += ac; + typedef struct WbGreen { + double green; + float snedecor;//1. actually but put in case of confiance interval + } WbGreen; + //green (tint) values between 0.4 to 4.0 + constexpr WbGreen gree[134] = {//symmetric coefficient between 0.717 and 1.40 + {0.400, 1.f}, + {0.420, 1.f}, + {0.440, 1.f}, + {0.460, 1.f}, + {0.480, 1.f}, + {0.500, 1.f}, + {0.520, 1.f}, + {0.540, 1.f}, + {0.550, 1.f}, + {0.560, 1.f}, + {0.570, 1.f}, + {0.580, 1.f}, + {0.590, 1.f}, + {0.600, 1.f}, + {0.610, 1.f}, + {0.620, 1.f},//extended range + {0.630, 1.f}, + {0.640, 1.f}, + {0.650, 1.f}, + {0.660, 1.f}, + {0.670, 1.f}, + {0.680, 1.f}, + {0.690, 1.f}, + {0.700, 1.f}, + {0.714, 1.f},//usual 2 range + {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},//usual range + {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},//49 limit low normal + {0.952, 1.f}, + {0.962, 1.f}, + {0.971, 1.f}, + {0.980, 1.f}, + {0.990, 1.f}, + {1.000, 1.f},//55 reference + {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},// usual range + {1.275, 1.f}, + {1.300, 1.f}, + {1.325, 1.f}, + {1.350, 1.f}, + {1.375, 1.f}, + {1.400, 1.f},//usual 2 range + {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},//extended range + {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} + }; + const int N_g = sizeof(gree) / sizeof(gree[0]); //number of green + + typedef struct RangeGreen { + int begin; + int end; + } RangeGreen; + + int greenrefo = 55; + double origgreen = greenitc; + + for (int gg = 0; gg < N_g; gg++) { + if (gree[gg].green > origgreen) { + greenrefo = gg;//show the green + break; + } + } + + constexpr RangeGreen Rangestandard = {33, 80};//usual green range + constexpr RangeGreen Rangestandard2 = {24, 86};//usual 2 green range + constexpr RangeGreen Rangeextended = {15, 93}; + const RangeGreen Rangemax = {0, N_g}; + + RangeGreen Rangegreenused; + + if (wbpar.itcwb_rgreen == 0) { + Rangegreenused = Rangestandard; + } else if (wbpar.itcwb_rgreen == 1) { + Rangegreenused = Rangestandard2; + } else if (wbpar.itcwb_rgreen == 2) { + Rangegreenused = Rangeextended; + } else { + Rangegreenused = Rangemax; + } + + + if (wbpar.itcwb_rgreen == 0) {//new way to set green + Rangegreenused.begin = std::max(greenrefo - 13, 0); + Rangegreenused.end = std::min(greenrefo + 13, N_g); + } + + if (wbpar.itcwb_rgreen == 1) {//new way to set green + Rangegreenused.begin = std::max(greenrefo - 17, 0); + Rangegreenused.end = std::min(greenrefo + 17, N_g); + } + + if (oldsampling == true) { + Rangegreenused = Rangestandard2; + } + + 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 ! + // X and Z values calculate for each temp between 2000K to 15000K, so no result after 15000K ! + //of course we can change the step between each temp if need + + constexpr WbTxyz Txyz[191] = {//temperature Xwb Zwb 191 values x wb and y wb are calculated after, Xwb and Ywb calculated with a spreadsheet + {2001., 1.273842, 0.145295}, + {2051., 1.258802, 0.156066}, + {2101., 1.244008, 0.167533}, + {2151., 1.230570, 0.178778}, + {2201., 1.217338, 0.190697}, + {2251., 1.205305, 0.202338}, + {2301., 1.193444, 0.214632}, + {2351., 1.182648, 0.226598}, + {2401., 1.171996, 0.239195}, + {2451., 1.162290, 0.251421}, + {2501., 1.152883, 0.264539}, + {2551., 1.143965, 0.276682}, + {2605., 1.134667, 0.290722}, + {2655., 1.126659, 0.303556}, + {2705., 1.119049, 0.316446}, + {2755., 1.111814, 0.329381}, + {2790., 1.106961, 0.338455}, + {2803., 1.105381, 0.342193}, + {2825., 1.102275, 0.347542}, + {2856., 1.098258, 0.355599}, + {2880., 1.095233, 0.361840}, + {2910., 1.091550, 0.369645}, + {2930., 1.089155, 0.374849}, + {2960., 1.085649, 0.382655}, + {2980., 1.083369, 0.387858}, + {3003., 1.080982, 0.394258}, + {3025., 1.078397, 0.399561}, + {3050., 1.075727, 0.406057}, + {3075., 1.073122, 0.412550}, + {3103., 1.070277, 0.419815}, + {3128., 1.067801, 0.426296}, + {3153., 1.065384, 0.432769}, + {3175., 1.063305, 0.438459}, + {3203., 1.060906, 0.446161}, + {3225., 1.058738, 0.451367}, + {3250., 1.056535, 0.457806}, + {3280., 1.053960, 0.465519}, + {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}, + {4914., 0.965682, 0.806658}, + {4927., 0.965414, 0.809229}, + {4940., 0.965149, 0.811937}, + {4952., 0.964908, 0.814366}, + {4965., 0.964650, 0.816993}, + {4977., 0.964415, 0.819412}, + {4990., 0.964163, 0.822028}, + {5002., 0.963934, 0.824438},//80 + {5015., 0.963689, 0.827044}, + {5027., 0.963465, 0.829444}, + {5040., 0.963226, 0.832039}, + {5051., 0.963008, 0.834429}, + {5065., 0.963226, 0.832039}, + {5077., 0.962563, 0.839395}, + {5090., 0.962336, 0.841968}, + {5102., 0.962129, 0.844339}, + {5115., 0.961907, 0.846902}, + {5127., 0.961706, 0.849263}, + {5140., 0.961490, 0.851815}, + {5151., 0.961294, 0.854166}, + {5177., 0.960893, 0.859049}, + {5202., 0.960501, 0.863911}, + {5253., 0.959749, 0.873572}, + {5302., 0.959313, 0.883815}, + {5351., 0.958361, 0.892644}, + {5402., 0.957903, 0.902793}, + {5452., 0.957116, 0.911379}, + {5502., 0.956639, 0.921431}, + {5553., 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}, + {6380., 0.950576, 1.069386}, + {6402., 0.950143, 1.074055}, + {6425., 0.950428, 1.076341}, + {6452., 0.950345, 1.080484}, + {6475., 0.950277, 1.083996}, + {6502., 0.950201, 1.088097}, + {6525., 0.950139, 1.091573}, + {6552., 0.950070, 1.095633}, + {6575., 0.950014, 1.099075}, + {6602., 0.949952, 1.103094}, + {6625., 0.949902, 1.106501}, + {6652., 0.949846, 1.110479}, + {6675., 0.949801, 1.113852}, + {6702., 0.949752, 1.119138}, + {6725., 0.949712, 1.121128}, + {6752., 0.949668, 1.125027}, + {6802., 0.949596, 1.132190}, + {6852., 0.949533, 1.139281}, + {6902., 0.949033, 1.147691}, + {6952., 0.949437, 1.153246}, + {7002., 0.949402, 1.160129}, + {7052., 0.949376, 1.166966}, + {7102., 0.949358, 1.173732}, + {7152., 0.949348, 1.180429}, + {7202., 0.949346, 1.187058}, + {7252., 0.949350, 1.193619}, + {7301., 0.948896, 1.201432}, + {7352., 0.949380, 1.206541}, + {7402., 0.949405, 1.212904}, + {7451., 0.949434, 1.219076}, + {7501., 0.949471, 1.225312}, + {7551., 0.949512, 1.231485}, + {7601., 0.949099, 1.239061}, + {7675., 0.949638, 1.246525}, + {7751., 0.949729, 1.255559}, + {7825., 0.949828, 1.264225}, + {7901., 0.949498, 1.274460}, + {7952., 0.950018, 1.278800}, + {8025., 0.950137, 1.287013}, + {8095., 0.950259, 1.294777}, + {8151., 0.950361, 1.300912}, + {8225., 0.950501, 1.308915}, + {8301., 0.950253, 1.318464}, + {8375., 0.950804, 1.324786}, + {8451., 0.950966, 1.332651}, + {8525., 0.951129, 1.340199}, + {8601., 0.950941, 1.349261}, + {8701., 0.951533, 1.357724}, + {8801., 0.951772, 1.367421}, + {8901., 0.952018, 1.376935}, + {9001., 0.951969, 1.387639}, + {9201., 0.952784, 1.404422}, + {9401., 0.953081, 1.423213},//since 5 2023 I increased the number of temp references above 12000K + {9651., 0.953993, 1.442883}, + {9901., 0.954537, 1.464134}, + {10201., 0.955520, 1.485825}, + {10501., 0.956321, 1.508623}, + {10751., 0.957057, 1.524806}, + {11001., 0.957747, 1.541281}, + {11251., 0.958436, 1.557207}, + {11501., 0.959112, 1.572366}, + {11751., 0.959784, 1.587037}, + {12001., 0.960440, 1.601019},//since 5 2023 I increased the number of temp refrences above 12000K + {12251., 0.961090, 1.614566}, + {12501., 0.963963, 1.627492}, + {12751., 0.962350, 1.640031}, + {13001., 0.962962, 1.652055}, + {13251., 0.963561, 1.663638}, + {13501., 0.964147, 1.674804}, + {13751., 0.964720, 1.685571}, + {14001., 0.965279, 1.695919}, + {14251., 0.965827, 1.705950}, + {14501., 0.966363, 1.715637}, + {14751., 0.966886, 1.724998}, + {15001., 0.967397, 1.734047} + }; + //compatibility 5.9 + constexpr WbTxyz Txyzs[118] = {//temperature Xwb Zwb 118 values - same table as in Rawimagesource.cc 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} + }; + bool purp = true;//if inpaint-opposed or something else enable purp + + int N_t = sizeof(Txyz) / sizeof(Txyz[0]); //number of temperature White point + + if (oldsampling) { + N_t = sizeof(Txyzs) / sizeof(Txyzs[0]); //number of temperature White point + } + + // constexpr int Nc = 428 + 1; //429 number of reference spectral colors + int Ncr = 429; + + if (wbpar.itcwb_prim == "srgb") { + Ncr = 429; + } else if (wbpar.itcwb_prim == "adob") { + Ncr = 429; + } else if (wbpar.itcwb_prim == "XYZcam") { + Ncr = 429; + } else if (wbpar.itcwb_prim == "jdcmax") { + Ncr = 429; + } + + if (oldsampling) { //low sampling 5.9 with less spectral datas 201 + Ncr = 202; + } + + array2D Tx(N_t, Ncr); + array2D Ty(N_t, Ncr); + array2D Tz(N_t, Ncr); + array2D Ta(N_t, Ncr); + array2D Tb(N_t, Ncr); + array2D TL(N_t, Ncr); + + double TX[Ncr]; + double TY[Ncr]; + double TZ[Ncr]; + + std::vector good_spectral(Ncr, false); + std::vector good_size(Ncr, false); + + double WPX[N_t]; + double WPZ[N_t]; + + float rmm[N_t]; + float gmm[N_t]; + float bmm[N_t]; + + int siza = 237; //192 untill 01/2023 size of histogram + + if (oldsampling == true) { + siza = 192;//old sampling 5.9 and before... + } + + // tempref and greenref are camera wb values. + // I used them by default to select good spectral values !! but they are changed after + tempref = rtengine::min(tempref, 15000.0); + int repref = 0; + + for (int tt = 0; tt < N_t; tt++) { + if (Txyz[tt].Tem > tempref) { + repref = tt;//show the select temp + break; + } + } + + if (oldsampling) { + for (int tt = 0; tt < N_t; tt++) { + if (Txyzs[tt].Tem > tempref) { + repref = tt;//show the select temp + break; + } + } + } + + if (repref >= N_t - 1) { + repref = N_t - 2; + } + + //calculate R G B multiplier in function illuminant and temperature + const 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)); + greenitc += wbpar.itcwb_green; + double keepgreen = greenitc; + + for (int tt = 0; tt < N_t; ++tt) { + double r, g, b; + float rm, gm, bm; + + if (!oldsampling) { + ColorTemp(Txyz[tt].Tem, greenitc, 1., "Custom", wbpar.observer).getMultipliers(r, g, b); + } else { + ColorTemp(Txyzs[tt].Tem, greenitc, 1., "Custom", wbpar.observer).getMultipliers(r, g, b);//brings differences with old version 5.9, maybe Observer in 5.9, I did not find a solution + } + + 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]; + const 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] = 1.f; + bmm[tt] = bm / gm; + //return rmm, gmm, bmm in function of temp + } + + t2.set(); + + if (settings->verbose) { + printf("First: up calculate multipliers: %d nsec\n", t2.etime(t1)); + } + + struct hiss {//histogram + int histnum; + int index; + bool operator()(const hiss& lhis, const hiss& rhis) + { + return lhis.histnum < rhis.histnum; + } + + } ; + + //intermediate structure + struct chrom {//chroma image + float chroxy_number; + float number; + float hue; + 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; + } + + } ; + + struct Temppatch {//patch characterictics + float minchroma; + float delt_E; + float minhi; + float maxhi; + bool operator()(const Temppatch& ltp, const Temppatch& rtp) + { + return ltp.minchroma < rtp.minchroma; + } + }; + + Temppatch Tppat[N_t]; + + LUTu histxy(siza); //number of values for each pair xy + + histxy.clear(); + + LUTf xxx(siza);//for color references calculated ==> max in images "like histogram" + + xxx.clear(); + + LUTf yyy(siza); + + yyy.clear(); + + LUTf YYY(siza);//not used directly, but necessary to keep good range + + YYY.clear(); + + bool separated = true;//true + + int w = -1; + + array2D reff_spect_yy_camera(N_t, 2 * Ncr + 2); + + array2D reff_spect_xx_camera(N_t, 2 * Ncr + 2); + + array2D reff_spect_Y_camera(N_t, 2 * Ncr + 2); + + int ttbeg = 0; + + int ttend = N_t; + + //call tempxy to calculate for 406 or 201 color references Temp and XYZ with cat02 + double wpx = 0.; + + double wpz = 0.; + + ColorTemp::tempxy(separated, repref, Tx, Ty, Tz, Ta, Tb, TL, TX, TY, TZ, wbpar, ttbeg, ttend, wpx, wpz, WPX, WPZ); //calculate chroma xy (xyY) for Z known colors on under 200 illuminants + + //find the good spectral values + //calculate xy reference spectral for tempref + for (int j = 0; j < Ncr ; j++) { + float xxx = std::max(TX[j] / (TX[j] + TY[j] + TZ[j]), 0.01); // x from xyY + float yyy = std::max(TY[j] / (TX[j] + TY[j] + TZ[j]), 0.01); // y from xyY + float YY = TY[j]; + reff_spect_xx_camera[j][repref] = xxx; + reff_spect_yy_camera[j][repref] = yyy; + reff_spect_Y_camera[j][repref] = YY; + /* + //display spectral datas + float xr = reff_spect_xx_camera[j][repref]; + float yr = reff_spect_yy_camera[j][repref]; + float Yr = reff_spect_Y_camera[j][repref]; + float X_r = (65535.f * (xr * Yr)) / yr; + float Z_r = (65535.f * (1.f - xr - yr) * Yr) / yr; + float Y_r = 65535.f * Yr; + float Lr, ar, br; + Color::XYZ2Lab(X_r, Y_r, Z_r, Lr, ar, br);//it make sense, because known spectral color + + + printf("Nc=%i repref=%i xxx=%f yyy=%f YY=%f Lr=%f a=%f b=%f\n", j, repref, (double) xxx, (double) yyy, (double) YY, (double) Lr/327.68f, (double) ar/327.68f, (double) br/327.68f); + */ + } + + array2D xc(bfwitc, bfhitc); + array2D yc(bfwitc, bfhitc); + array2D zc(bfwitc, bfhitc); + array2D Yc(bfwitc, bfhitc); + + // int rep = rtengine::LIM(repref + 1, 0, N_t); + + //initialize calculation of xy current for tempref + if (oldsampling == false) { + + //small denoise with median 3x3 strong + float** tmL; + int wid = bfw; + int hei = bfh; + tmL = new float*[hei]; + + for (int i = 0; i < hei; ++i) { + tmL[i] = new float[wid]; + } + + typedef ImProcFunctions::Median Median; + Median medianTypeL = Median::TYPE_3X3_STRONG;//x2 + int pas = 2; + ImProcFunctions::Median_Denoise(redloc, redloc, bfw, bfh, medianTypeL, pas, false, tmL); + ImProcFunctions::Median_Denoise(greenloc, greenloc, bfw, bfh, medianTypeL, pas, false, tmL); + ImProcFunctions::Median_Denoise(blueloc, blueloc, bfw, bfh, medianTypeL, pas, false, tmL); + + for (int i = 0; i < hei; ++i) { + delete[] tmL[i]; + } + + delete[] tmL; + } + + t3.set(); + + if (settings->verbose) { + printf("Second: from first to up median 3x3: %d nsec\n", t3.etime(t2)); + } + + if (oldsampling == false) { +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int y = 0; y < bfh ; ++y) { + for (int x = 0; x < bfw ; ++x) { + const float RR = rmm[repref] * redloc[y][x]; + const float GG = gmm[repref] * greenloc[y][x]; + const float BB = bmm[repref] * blueloc[y][x]; + + Color::rgbxyz(RR, GG, BB, xc[y][x], yc[y][x], zc[y][x], wb2);//use sRGB Adobe Rec2020 ACESp0 + float X_r = xc[y][x]; + float Y_r = yc[y][x]; + float Z_r = zc[y][x]; + + if (oldsampling == false) { + Color::gamutmap(X_r, Y_r, Z_r, wb2);//gamut control + } + + const float som = X_r + Y_r + Z_r; + xc[y][x] = X_r / som; + yc[y][x] = Y_r / som; + Yc[y][x] = Y_r / 65535.f; + } + } + + //histogram xy depend of temp...but in most cases D45 ..D65.. + // these values change with temp + //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 + + + if (wbpar.itcwb_nopurple == true) {//since 21 april - change to filter magenta + purp = false; + } + + histoxyY(bfhitc, bfwitc, xc, yc, Yc, xxx, yyy, YYY, histxy, purp);//purp enable, enable purple color in WB + //return histogram x and y for each temp and in a range of 235 colors (siza) + + } else { + const int deltarepref = 1; + + for (int nn = 0, drep = -deltarepref; nn <= 2; ++nn, drep += deltarepref) { + //three loop to refine color if temp camera is probably not very good + const int rep = rtengine::LIM(repref + drep, 0, N_t); + + //initialize calculation of xy current for tempref +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int y = 0; y < bfh ; ++y) { + for (int x = 0; x < bfw ; ++x) { + const float RR = rmm[rep] * redloc[y][x]; + const float GG = gmm[rep] * greenloc[y][x]; + const float BB = bmm[rep] * blueloc[y][x]; + Color::rgbxyY(RR, GG, BB, xc[y][x], yc[y][x], Yc[y][x], wb); + } + } + + + histoxyY_low(bfhitc, bfwitc, xc, yc, Yc, xxx, yyy, YYY, histxy); + //return histogram x and y for each temp and in a range of 158 colors (siza) + } + + } + +//enable display cells + /* + printf ("xc\tyc\tcount\n") ; + printf ("--\t--\t-----\n") ; + for (int x1 = 0 ; x1 < 80; ++x1) { + for (int y1 = 0; y1 < 90; ++y1) { + if (cellxy[x1][y1] > 0) { + printf ("%d\t%d\t%d\n", x1, y1, cellxy[x1][y1]); + } + } + } + */ + + // free some memory + xc.free(); + yc.free(); + Yc.free(); + //calculate x y Y + const int sizcurrref = siza;//choice of number of correlate colors in image + array2D histcurrref(N_t, sizcurrref); + array2D xx_curref(N_t, sizcurrref); + array2D yy_curref(N_t, sizcurrref); + array2D YY_curref(N_t, sizcurrref); + array2D xx_curref_reduc(N_t, sizcurrref); + array2D yy_curref_reduc(N_t, sizcurrref); + array2D YY_curref_reduc(N_t, sizcurrref); + array2D nn_curref_reduc(N_t, sizcurrref);//new array to improve patch + array2D chronum_curref_reduc(N_t, sizcurrref);//new array to improve patch + array2D hue_curref_reduc(N_t, sizcurrref);//new array to improve patch + array2D chro_curref_reduc(N_t, sizcurrref);//new array to improve patch + array2D estim_hue(N_t, sizcurrref);//new array to improve patch + + hiss Wbhis[siza]; + + for (int nh = 0; nh < siza; nh++) { + Wbhis[nh].histnum = histxy[nh]; + Wbhis[nh].index = nh; + } + + //sort in ascending order + std::sort(Wbhis, Wbhis + siza, Wbhis[0]); + int n1 = 0; + int n4 = 0; + int n15 = 0; + int n30 = 0; + + //part to improve + //determined the number of colors who be used after + int ntot = 0; + + for (int nh = 0; nh < siza; nh++) { + if (Wbhis[nh].histnum > 0) { + ntot++; + } + } + + dread = ntot;//read colors + + for (int nh = 0; nh < siza; nh++) { + if (Wbhis[nh].histnum < 30) { + n30++; //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 < 4) { + n4++; //keep only existing color but avoid to small + + if (Wbhis[nh].histnum < 1) { + n1++; //keep only existing color but avoid to small + } + } + } + } + } + + int 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; + const int sizcu30 = sizcurrref - n30; + int maxsiz = 70; + maxsiz = LIM(maxsiz, 50, 80); + int nbm = maxsiz; + int sizcu4 = maxsiz; + + if (oldsampling == true) { + nbm = 55; + sizcu4 = rtengine::min(sizcu30, nbm);//size of chroma values + } + + Tppat[repref].maxhi = Wbhis[siza - 1].histnum; + Tppat[repref].minhi = Wbhis[siza - nbm].histnum; + + if (settings->verbose) { + printf("number total datas read=%i\n", ntot); + printf("Others datas - ntr=%i sizcurr2ref=%i sizcu4=%i sizcu30=%i\n", ntr, sizcurr2ref, sizcu4, sizcu30); + printf("Number max of data samples in last patch=%i\n", (int) Tppat[repref].maxhi); + printf("Number of data samples in beginning patch =%i\n", (int) Tppat[repref].minhi); + } + + chrom wbchro[sizcu4]; + float swpr = wpx + wpz + 1.f; + float xwpr = wpx / swpr;//white point for tt in xy coordinates + float ywpr = 1.f / swpr; + + if (oldsampling == true) { + swpr = Txyz[repref].XX + Txyz[repref].ZZ + 1.f; + xwpr = Txyz[repref].XX / swpr;//white point for tt in xy coordinates + ywpr = 1.f / swpr; + } + + if (settings->verbose) { + printf("White Point XYZ x=%f y=%f z=%f\n", wpx, 1., wpz); + printf("White Point xyY x=%f y=%f\n", xwpr, ywpr); + } + + float estimchrom = 0.f; + + if (oldsampling == true) { + for (int i = 0; i < sizcu4; ++i) { //take the max values + histcurrref[i][repref] = Wbhis[siza - (i + 1)].histnum; + xx_curref[i][repref] = xxx[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; + yy_curref[i][repref] = yyy[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; + YY_curref[i][repref] = YYY[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; + } + if (settings->verbose) { + printf("Sizcu4=%i\n", sizcu4); + } + + //estimate chromaticity for references + for (int nh = 0; nh < sizcu4; ++nh) { + const float chxy = std::sqrt(SQR(xx_curref[nh][repref] - xwpr) + SQR(yy_curref[nh][repref] - ywpr)); + wbchro[nh].chroxy_number = chxy * std::sqrt(histcurrref[nh][repref]); + wbchro[nh].chroxy = std::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; + + if (settings->verbose) { + printf("estimchrom=%f\n", estimchrom); + } + + const int maxval = 34; + + sizcurr2ref = rtengine::min(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; + nn_curref_reduc[w][repref] = wbchro[sizcu4 - (i + 1)].number; + } + } + + //calculate deltaE xx to find best values of spectrals data - limited to chroma values + int maxnb = 3; + + + float dEmean = 0.f; + int ndEmean = 0; + float maxhist = -1000.f; + float minhist = 100000000.f; + + for (int nb = 1; nb <= maxnb; ++nb) { + for (int i = 0; i < w; ++i) { + float mindeltaE = 100000.f; + int kN = 0; + + for (int j = 0; j < Ncr ; j++) { + if (!good_spectral[j]) { + const 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; + } + } + } + + {//display in console for 5.9 + float spectlimit = settings->itcwb_deltaspec; + float dE = sqrt(SQR(xx_curref_reduc[i][repref] - reff_spect_xx_camera[kN][repref]) + SQR(yy_curref_reduc[i][repref] - reff_spect_yy_camera[kN][repref])); + dEmean += dE; + ndEmean++; + + if (nn_curref_reduc[i][repref] < minhist) { + minhist = nn_curref_reduc[i][repref]; + } + + if (nn_curref_reduc[i][repref] > maxhist) { + maxhist = nn_curref_reduc[i][repref]; + } + + if (settings->verbose) { + float xr = reff_spect_xx_camera[kN][repref]; + float yr = reff_spect_yy_camera[kN][repref]; + float Yr = reff_spect_Y_camera[kN][repref]; + float X_r = (65535.f * (xr * Yr)) / yr; + float Z_r = (65535.f * (1.f - xr - yr) * Yr) / yr; + float Y_r = 65535.f * Yr; + float Lr, ar, br; + Color::XYZ2Lab(X_r, Y_r, Z_r, Lr, ar, br);//it make sense, because known spectral color + + if (dE > spectlimit) { + printf("i=%i kn=%i REFLAB for info not used - not relevant Lr=%3.2f ar=%3.2f br=%3.2f \n", i, kN, (double)(Lr / 327.68f), (double)(ar / 327.68f), (double)(br / 327.68f)); + printf("IMAGE: kn=%i hist=%7.0f chro_num=%5.1f hue=%2.2f chro=%2.3f xx=%f yy=%f YY=%f\n", kN, (double) nn_curref_reduc[i][repref], (double) chronum_curref_reduc[i][repref], (double) hue_curref_reduc[i][repref], (double) chro_curref_reduc[i][repref], (double) xx_curref_reduc[i][repref], (double) yy_curref_reduc[i][repref], (double) YY_curref_reduc[i][repref]); + printf("kn=%i REfxy xxr=%f yyr=%f YYr=%f\n", kN, (double) reff_spect_xx_camera[kN][repref], (double) reff_spect_yy_camera[kN][repref], (double) reff_spect_Y_camera[kN][repref]); + printf("kn=%i DELTA delt=%f\n", kN, dE); + printf(".... \n"); + } + } + + } + + good_spectral[kN] = true;//good spectral are spectral color that match color histogram xy + } + } + } else { + + for (int i = 0; i < sizcu4; ++i) { //take the max values + histcurrref[i][repref] = Wbhis[siza - (i + 1)].histnum; + xx_curref[i][repref] = xxx[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; + yy_curref[i][repref] = yyy[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; + YY_curref[i][repref] = YYY[Wbhis[siza - (i + 1)].index] / histcurrref[i][repref]; + } + + int minsize = 20; + int maxsize = maxsiz; + bool isponderate = true; //to build patch ponderate + + bool isponder = true;//with true moving average + float powponder = settings->itcwb_powponder;//not used today... + powponder = LIM(powponder, 0.01f, 0.2f); + float estimchrom = 0.f; + + for (int j = minsize; j < maxsize; ++j) {//20 empirical minimal value default to ensure a correlation + if (!good_size[j]) { + float countchxynum = 0.f; + estimchrom = 0.f; + float xh = 0.f; + float yh = 0.f; + wbchro[j].hue = 0.f; + wbchro[j].chroxy_number = 0.f; + wbchro[j].number = 0.f; + wbchro[j].chroxy = 0.f; + wbchro[j].chrox = 0.f; + wbchro[j].chroy = 0.f; + wbchro[j].Y = 0.f; + wbchro[j].index = 0; + int ind1 = 1; + int ind2 = -1; + float chxy1 = 0.f; + float chxy2 = 0.f; + float chxynum1 = 0.f; + float chxynum2 = 0.f; + + for (int nh = 0; nh < j; ++nh) { + ind1++; + ind2++; + + if (ind1 < j && !isponderate) { + chxy1 = std::sqrt(SQR(xx_curref[ind1][repref] - xwpr) + SQR(yy_curref[ind1][repref] - ywpr)); + } + + if (ind2 <= 0 && !isponderate) { + chxy2 = std::sqrt(SQR(xx_curref[ind2][repref] - xwpr) + SQR(yy_curref[ind2][repref] - ywpr)); + } + + const float chxy = std::sqrt(SQR(xx_curref[nh][repref] - xwpr) + SQR(yy_curref[nh][repref] - ywpr)); + xh += xx_curref[nh][repref] - xwpr; + yh += yy_curref[nh][repref] - ywpr; + wbchro[nh].hue = fmodf(xatan2f(yy_curref[nh][repref] - ywpr, xx_curref[nh][repref] - xwpr), 2.f * RT_PI_F); + const float chxynum = wbchro[nh].chroxy_number = chxy * pow((double) histcurrref[nh][repref], 0.05);//sqrt was too big no convergence + + //We can replace 0.05 by powponder + if (ind1 < j && isponderate) { //with issorted ponderate chroma + chxynum1 = chxy1 * pow((double) histcurrref[ind1][repref], 0.05);//0.05 to 0.1 allows convergence, near 1.5 betwween max and min value + }//We can replace 0.05 by powponder + + if (ind2 < 0 && isponderate) { + chxynum2 = chxy2 * pow((double) histcurrref[ind2][repref], 0.05);//We can replace 0.05 by powponder + } + + wbchro[nh].number = histcurrref[nh][repref]; + wbchro[nh].chroxy = std::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; + + if (!isponderate) { + estimchrom += chxy; + + if (isponder && !isponderate) { + estimchrom += chxy1; + estimchrom += chxy2; + } + } + + if (isponderate) { + estimchrom += chxynum; + + if (isponder) { + estimchrom += chxynum1; + estimchrom += chxynum2; + } + + countchxynum += pow((double)histcurrref[nh][repref], 0.05);//no error, to take into account mean value //We can replace 0.05 by powponder + } + } + + estim_hue[j][repref] = xatan2f(yh, xh); + + if (isponder) { + estimchrom /= (j + 2 * (j - 1)); //extrem not taken + } else { + estimchrom /= j; + } + + if (estimchrom < minchrom) { + minchrom = estimchrom; + Tppat[repref].minchroma = minchrom; + kmin = j; + } + + Tppat[repref].minchroma = minchrom; + } + + good_size[kmin] = true; + } + + sizcu4 = kmin; + + int maxval = maxsiz; + sizcurr2ref = rtengine::min(sizcurr2ref, maxval); //keep about the biggest values, + int index1 = 0; + int index2 = sizcu4; + int indn = index1; + + + for (int i = index1; i < index2; ++i) { + if (wbchro[sizcu4 - (i + 1)].number < 400.f) { //remove too low numbers datas about an area 60*60 pixels or reparted + indn++; + } + } + + Tppat[repref].minhi = (float) rtengine::max((int) wbchro[sizcu4 - (indn + 1)].number, (int) Tppat[repref].minhi); + + if (settings->verbose) { + printf("Index1=%i index2=%i \n", indn, index2); + } + + if (settings->verbose) { + printf("Info2 - patch estimation of wp displacement (before):j=%i repref=%i real=%i Tppat=%f chrom=%f hue=%f\n", kmin, repref, index2 - indn, (double) Tppat[repref].minchroma, (double) minchrom, (double) estim_hue[kmin][repref]); + }; + + float limexclu = 0.96f;//to avoid highlight in some rare cases (sky...) + + + for (int i = indn; i < index2; ++i) { + //improvment to limit high Y values wbchro[sizcu4 - (i + 1)].Y < 0.96 0.96 arbitrary high value, maybe 0.9 or 0.98...or 1.0 + if (wbchro[sizcu4 - (i + 1)].chrox > limx && wbchro[sizcu4 - (i + 1)].chroy > limy && wbchro[sizcu4 - (i + 1)].Y < limexclu) { //remove value too far from reference spectral + w++;// w number of real tests + 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; + chronum_curref_reduc[w][repref] = wbchro[sizcu4 - (i + 1)].chroxy_number; + nn_curref_reduc[w][repref] = wbchro[sizcu4 - (i + 1)].number; + hue_curref_reduc[w][repref] = wbchro[sizcu4 - (i + 1)].hue; + chro_curref_reduc[w][repref] = wbchro[sizcu4 - (i + 1)].chroxy; + } + } + + if (settings->verbose) { + printf("Number of real tests=%i\n", w); + } + + int maxnb = 1; //since 8 april 2023 + + + float dEmean = 0.f; + int ndEmean = 0; + maxhist = -1000.f; + minhist = 100000000.f; + + for (int nb = 1; nb <= maxnb; ++nb) { //1 is good, but 2 3 or 4 help to find more spectral values + for (int i = 0; i < w; ++i) { + float mindeltaE = 100000.f; + int kN = 0; + + for (int j = 0; j < Ncr ; j++) { + if (!good_spectral[j]) { + const 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; + } + } + } + //display in console + float spectlimit = settings->itcwb_deltaspec; + float dE = sqrt(SQR(xx_curref_reduc[i][repref] - reff_spect_xx_camera[kN][repref]) + SQR(yy_curref_reduc[i][repref] - reff_spect_yy_camera[kN][repref])); + dEmean += dE; + ndEmean++; + + if (nn_curref_reduc[i][repref] < minhist) { + minhist = nn_curref_reduc[i][repref]; + } + + if (nn_curref_reduc[i][repref] > maxhist) { + maxhist = nn_curref_reduc[i][repref]; + } + + if (settings->verbose) { + float xr = reff_spect_xx_camera[kN][repref]; + float yr = reff_spect_yy_camera[kN][repref]; + float Yr = reff_spect_Y_camera[kN][repref]; + float X_r = (65535.f * (xr * Yr)) / yr; + float Z_r = (65535.f * (1.f - xr - yr) * Yr) / yr; + float Y_r = 65535.f * Yr; + float Lr, ar, br; + Color::XYZ2Lab(X_r, Y_r, Z_r, Lr, ar, br);//it make sense, because known spectral color + + if (dE > spectlimit) { + printf("i=%i kn=%i REFLAB for info not used - not relevant Lr=%3.2f ar=%3.2f br=%3.2f \n", i, kN, (double)(Lr / 327.68f), (double)(ar / 327.68f), (double)(br / 327.68f)); + printf("IMAGE: kn=%i hist=%7.0f chro_num=%5.1f hue=%2.2f chro=%2.3f xx=%f yy=%f YY=%f\n", kN, (double) nn_curref_reduc[i][repref], (double) chronum_curref_reduc[i][repref], (double) hue_curref_reduc[i][repref], (double) chro_curref_reduc[i][repref], (double) xx_curref_reduc[i][repref], (double) yy_curref_reduc[i][repref], (double) YY_curref_reduc[i][repref]); + printf("kn=%i REfxy xxr=%f yyr=%f YYr=%f\n", kN, (double) reff_spect_xx_camera[kN][repref], (double) reff_spect_yy_camera[kN][repref], (double) reff_spect_Y_camera[kN][repref]); + printf("kn=%i DELTA delt=%f\n", kN, dE); + printf(".... \n"); + } + } + + + good_spectral[kN] = true;//good spectral are spectral color that match color histogram xy + } + + if (ndEmean == 0) { + ndEmean = 2; + } + + Tppat[repref].delt_E = dEmean / ndEmean; + delta = Tppat[repref].delt_E; + Tppat[repref].maxhi = maxhist; + Tppat[repref].minhi = minhist; + + if (settings->verbose && !oldsampling) { + printf("Patch Mean - Repref=%i deltaE=%f minhisto=%6.0f maxhisto=%7.0f \n", repref, (double) dEmean / ndEmean, (double) minhist, (double) maxhist); + } + } + } + + // reuse some buffers + array2D& R_curref_reduc = xx_curref_reduc; + array2D& G_curref_reduc = yy_curref_reduc; + array2D& B_curref_reduc = YY_curref_reduc; + + //reconvert to RGB for "reduction" + for (int i = 0; i < w; i++) { + const float X = 65535.f * xx_curref_reduc[i][repref] * YY_curref_reduc[i][repref] / yy_curref_reduc[i][repref]; + const float Y = 65535.f * YY_curref_reduc[i][repref]; + const 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, iwb); + R_curref_reduc[i][repref] = r / rmm[repref]; + G_curref_reduc[i][repref] = g / gmm[repref]; + B_curref_reduc[i][repref] = b / bmm[repref]; + } + + t4.set(); + + if (settings->verbose) { + printf("Third: from second to find patch: %d nsec\n", t4.etime(t3)); + } + + +//end first part + + //Now begin real calculations + separated = false; + ttbeg = 0; + ttend = N_t; + + ttbeg = std::max(repref - 11, 0);//enough in all cases > dgoodref + ttend = std::min(repref + 11, N_t); + + if (oldsampling == true) { + ttbeg = 0; + ttend = N_t; + } + + //recalculate histogram with good values and not estimated + double wpx1 = 0.; + double wpz1 = 0.; + + ColorTemp::tempxy(separated, repref, Tx, Ty, Tz, Ta, Tb, TL, TX, TY, TZ, wbpar, ttbeg, ttend, wpx1, wpz1, WPX, WPZ); //calculate chroma xy (xyY) for Z known colors on under 90 illuminants + //calculate x y Y + int sizcurr = siza;//choice of number of correlate colors in image + array2D xxyycurr_reduc(N_t, 2 * sizcurr); + array2D reff_spect_xxyy(N_t, 2 * Ncr + 2); + array2D reff_spect_xxyy_prov(N_t, 2 * Ncr + 2); + t5.set(); + + if (settings->verbose) { + printf("Fourth: from third recalculate spectral: %d nsec\n", t5.etime(t4)); + } + + float minstud = 100000.f; + int goodref = 1; + +//calculate x y z for each pixel with multiplier rmm gmm bmm + + for (int tt = ttbeg; tt < ttend; ++tt) {//N_t + for (int i = 0; i < w; ++i) { + float unused; + + const float RR = rmm[tt] * R_curref_reduc[i][repref]; + const float GG = gmm[tt] * G_curref_reduc[i][repref]; + const float BB = bmm[tt] * B_curref_reduc[i][repref]; + Color::rgbxyY(RR, GG, BB, xxyycurr_reduc[2 * i][tt], xxyycurr_reduc[2 * i + 1][tt], unused, wb); + } + + for (int j = 0; j < Ncr ; ++j) { + reff_spect_xxyy_prov[2 * j][tt] = std::max(Tx[j][tt] / (Tx[j][tt] + Ty[j][tt] + Tz[j][tt]), 0.01f); // x from xyY + reff_spect_xxyy_prov[2 * j + 1][tt] = std::max(Ty[j][tt] / (Tx[j][tt] + Ty[j][tt] + Tz[j][tt]), 0.01f); // y from xyY + } + + int kk = -1; + + for (int i = 0; i < Ncr ; ++i) { + if (good_spectral[i]) { + kk++; + //we calculate now absolute chroma for each spectral color + 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]; + } + } + + const float abstud = std::fabs(studentXY(xxyycurr_reduc, reff_spect_xxyy, 2 * w, 2 * (kk + 1), tt)); + + if (abstud < minstud) { // find the minimum Student + minstud = abstud; + goodref = tt; + } + } + + t6.set(); + + if (settings->verbose) { + printf("Fifth: from fourth to find first correlation: %d nsec\n", t6.etime(t5)); + } + + { + //always used if extra = true because I made this choice, brings better results + 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 + + if (!oldsampling) { + Tgstud[i].tempref = 80;//5002K position in the list + } else { + Tgstud[i].tempref = 57;//5002K position in the list + } + + Tgstud[i].greenref = 55;// 1.f position in the list + } + + int newdelta = 1.8f * 4; // wbpar.itcwb_delta - default = 4; + int dgoodref = rtengine::LIM(newdelta, 1, 10); // 1.8 increase delta temp scan + + if (oldsampling == true) { + dgoodref = 2; + } + + const int scantempbeg = rtengine::max(goodref - (dgoodref + 1), 1); + const int scantempend = rtengine::min(goodref + dgoodref, N_t - 1); + int goodrefgr = 1; + + for (int gr = Rangegreenused.begin; gr < Rangegreenused.end; ++gr) { + float minstudgr = 100000.f; + goodrefgr = 1; + + for (int tt = scantempbeg; tt < scantempend; ++tt) { + double r, g, b; + + if (!oldsampling) { + ColorTemp(Txyz[tt].Tem, gree[gr].green, 1., "Custom", wbpar.observer).getMultipliers(r, g, b); + } else { + ColorTemp(Txyzs[tt].Tem, gree[gr].green, 1., "Custom", wbpar.observer).getMultipliers(r, g, b); + } + + float rm = imatrices.cam_rgb[0][0] * r + imatrices.cam_rgb[0][1] * g + imatrices.cam_rgb[0][2] * b; + float gm = imatrices.cam_rgb[1][0] * r + imatrices.cam_rgb[1][1] * g + imatrices.cam_rgb[1][2] * b; + float bm = imatrices.cam_rgb[2][0] * r + imatrices.cam_rgb[2][1] * g + imatrices.cam_rgb[2][2] * b; + //recalculate Multipliers now with good range of temp and green + + 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]; + const 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] = 1.f; + bmm[tt] = bm / gm; + } + + + for (int tt = scantempbeg; tt < scantempend; ++tt) {//N_t + for (int i = 0; i < w; ++i) { + float unused; + + const float RR = rmm[tt] * R_curref_reduc[i][repref]; + const float GG = gmm[tt] * G_curref_reduc[i][repref]; + const float BB = bmm[tt] * B_curref_reduc[i][repref]; + Color::rgbxyY(RR, GG, BB, xxyycurr_reduc[2 * i][tt], xxyycurr_reduc[2 * i + 1][tt], unused, wb); + } + + //recalculate xy spectral now with good range of temp and green + + for (int j = 0; j < Ncr ; ++j) { + reff_spect_xxyy_prov[2 * j][tt] = std::max(Tx[j][tt] / (Tx[j][tt] + Ty[j][tt] + Tz[j][tt]), 0.01f); // x from xyY + reff_spect_xxyy_prov[2 * j + 1][tt] = std::max(Ty[j][tt] / (Tx[j][tt] + Ty[j][tt] + Tz[j][tt]), 0.01f); // y from xyY + } + + int kkg = -1; + + for (int i = 0; i < Ncr ; ++i) { + if (good_spectral[i]) { + 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]; + } + } + + //now we have good spectral data + //calculate student correlation + const float abstudgr = std::fabs(studentXY(xxyycurr_reduc, reff_spect_xxyy, 2 * w, 2 * (kkg + 1), tt)); + + if (abstudgr < minstudgr) { // find the minimum Student + minstudgr = abstudgr; + goodrefgr = tt; + } + + //found the values + Tgstud[gr].tempref = goodrefgr; + Tgstud[gr].greenref = gr; + Tgstud[gr].student = minstudgr; + + } + } + + t7.set(); + + if (settings->verbose) { + printf("Sixth: from fifth to find patch in extra mode: %d nsec\n", t7.etime(t6)); + } + + float estimchromf = 0.f; + float estimhuef = 0.f; + float xhf = 0.f; + float yhf = 0.f; + + const float swprf = WPX[goodrefgr] + WPZ[goodrefgr] + 1.f; + const float xwprf = WPX[goodrefgr] / swpr;//white point for tt in xy coordinates + + const float ywprf = 1.f / swprf; + + for (int nh = 0; nh < w; ++nh) { + const float chxy = std::sqrt(SQR(xxyycurr_reduc[2 * nh][goodrefgr] - xwprf) + SQR(xxyycurr_reduc[2 * nh + 1][goodrefgr] - ywprf)); + xhf += xxyycurr_reduc[2 * nh][goodrefgr] - xwprf; + yhf += xxyycurr_reduc[2 * nh + 1][goodrefgr] - ywprf; + estimchromf += chxy; + } + + estimhuef = xatan2f(yhf, xhf); + estimchromf /= w; + + if (settings->verbose) { + printf("New white point calculated patch for information : xwprf=%f ywprf=%f\n", (double) xwprf, (double) ywprf); + printf("Info - patch estimation of white-point displacement: chrom=%f hue=%f\n", (double) estimchromf, (double) estimhuef); + } + + + std::sort(Tgstud, Tgstud + N_g, Tgstud[0]); + + if (!oldsampling) { + + // now search the value of green the nearest of 1 with a good student value, I think it is a good choice, perhaps no... + // I take the first values + // I admit a symetrie in green coefiicient for rgb multiplier...probably not exactly true + // perhaps we can used a Snedecor test ? but why...at least we have confidence interval > 90% + int greengood = 55; + + int maxkgood = 3;//default 3 - we can change ...to test 2, 4, 5, 6. High values perhaps less good student, but it is a compromise... + maxkgood = rtengine::LIM(maxkgood, 1, 6);// 2 6 + + if (oldsampling == true) { + maxkgood = 3; // force to 3 with old low sampling + } + + int mingood = std::min(std::fabs(Tgstud[0].greenref - 55), std::fabs(Tgstud[1].greenref - 55)); + + for (int k = 0; k < maxkgood; ++k) { + mingood = std::min(std::fabs(mingood), std::fabs(Tgstud[k].greenref - 55)); + } + + for (int k = 0; k < maxkgood ; ++k) { + if (mingood == fabs(Tgstud[k].greenref - 55)) { + greengood = Tgstud[k].greenref ; + goodref = Tgstud[k].tempref; + studgood = Tgstud[k].student; + } + } + + if (settings->verbose) { + printf("Green comparison=%f\n", keepgreen); + printf("Rangegreen begin=%i Rangegreen end=%i\n", Rangegreenused.begin, Rangegreenused.end); + printf("scantemp begin=%i scantemp end=%i\n", scantempbeg, scantempend); + printf("Student_0=%f Student_k= %f\n", Tgstud[0].student, Tgstud[maxkgood - 1].student); + printf("mingood=%i greeng=%i goodref=%i stud=%f\n", mingood, greengood, goodref, (double) studgood); + } + + tempitc = Txyz[goodref].Tem; + + greenitc = gree[greengood].green; + + int greencam = 55; + + for (int gg = 0; gg < N_g; gg++) { + if (gree[gg].green > keepgreen) { + greencam = gg;//show the green + break; + } + } + + bool greenex = false; + + if ((keepgreen > 0.92 && keepgreen < 1.23)) { + if (abs(greengood - greencam) > 5) { + double ag = 0.; + double gcal = gree[greengood].green; + ag = 0.89 * (gcal - keepgreen); + greenitc = gcal - ag; + greenex = true; + + if (settings->verbose) { + printf("green correction_1=%f \n", ag); + } + } else { + double ag = 0.; + double gcal = gree[greengood].green; + + if (keepgreen > 1.09) { + ag = 0.10 * (gcal - keepgreen) * abs(greengood - greencam); + } else { + ag = 0.16 * (gcal - keepgreen) * abs(greengood - greencam); + } + + greenitc = gcal - ag; + greenex = true; + + if (settings->verbose) { + printf("green correction_0=%f \n", ag); + } + + } + } + + if (((keepgreen >= 0.952 && keepgreen < 1.25) && greengood > 55) && !greenex) { + double ag = 0.; + double gcal = gree[greengood].green;//empirical correction when green suspicious + ag = 0.96 * (gcal - keepgreen); + greenitc = gcal - ag; + greenex = true; + + if (settings->verbose) { + printf("green correction_2=%f \n", ag); + } + } + + if (((greengood > 41 && keepgreen < 0.7) || (greengood > 46 && keepgreen < 0.952)) && !greenex) { + double ag = 0.; + double gcal = gree[greengood].green; + ag = 0.95 * (gcal - keepgreen);//empirical correction when green low - to improve + + if (purp == false) { + ag -= 0.12; + } + + if (settings->verbose) { + printf("green correction_3=%f \n", ag); + } + + greenitc = gcal - ag; + } + } else {//oldsampling + int greengood; + int greengoodprov; + int goodrefprov; + float studprov; + const int goodref0 = Tgstud[0].tempref; + const int greengood0 = Tgstud[0].greenref - 55;//55 green = 1 + const float stud0 = Tgstud[0].student; + const int goodref1 = Tgstud[1].tempref; + const float stud1 = Tgstud[1].student; + const int greengood1 = Tgstud[1].greenref - 55; + const int goodref2 = Tgstud[2].tempref; + const int greengood2 = Tgstud[2].greenref - 55; + const float stud2 = Tgstud[2].student; + + if (std::fabs(greengood2) < std::fabs(greengood1)) { + greengoodprov = greengood2; + goodrefprov = goodref2; + studprov = stud2; + } else { + greengoodprov = greengood1; + goodrefprov = goodref1; + studprov = stud1; + + } + + if (std::fabs(greengoodprov) < std::fabs(greengood0)) { + goodref = goodrefprov; + greengood = greengoodprov + 55; + studgood = studprov; + + } else { + goodref = goodref0; + greengood = greengood0 + 55; + studgood = stud0; + } + + tempitc = Txyz[goodref].Tem; + greenitc = gree[greengood].green; + + if (estimchrom < 0.025f) { + float ac = -2.40f * estimchrom + 0.06f;//small empirical correction, maximum 0.06 if chroma=0 for all image, currently for very low chroma +0.02 + greenitc += ac; + } + + itciterate = false; + + } + } + + avg_rm = 10000.f * rmm[goodref]; + avg_gm = 10000.f * gmm[goodref]; + avg_bm = 10000.f * bmm[goodref]; + + //now we have temp green and student + if (!oldsampling) { + if (lastitc && nocam == 0 && wbpar.itcwb_alg == false) { //try to find if another tempref + if ((tempitc < 4000.f || tempitc > 6000.f) || extra == true) { + optitc[nbitc].stud = studgood; + optitc[nbitc].minc = Tppat[repref].minchroma; + optitc[nbitc].titc = tempitc; + optitc[nbitc].gritc = greenitc; + optitc[nbitc].tempre = tempref; + optitc[nbitc].greenre = greenref; + optitc[nbitc].drea = dread; + optitc[nbitc].kmi = kmin; + optitc[nbitc].minhis = Tppat[repref].minhi; + optitc[nbitc].maxhis = Tppat[repref].maxhi; + optitc[nbitc].avg_r = avg_rm; + optitc[nbitc].avg_g = avg_gm; + optitc[nbitc].avg_b = avg_bm; + optitc[nbitc].delt = Tppat[repref].delt_E; + + nbitc++; + + if (tempitc < 4000.f) {//change the second temp to be near of the first one + if (tempitc < 2800.f && kcam == 1) { + tempitc += 151.f; + } else if (tempitc >= 2800.f && kcam == 1) { + tempitc -= 149.f; + } else { + tempitc += 201.f; + } + } else { + if (tempitc < 8000.f) { + tempitc = 4197.f + 0.1255f * tempitc; + } else { + tempitc = 5200.f * (1.f * (tempitc / 8000.f)); + } + } + + tempref = tempitc * (1. + wbpar.tempBias); + + optitc[nbitc].stud = studgood; + optitc[nbitc].minc = Tppat[repref].minchroma; + optitc[nbitc].titc = tempitc; + optitc[nbitc].gritc = greenitc; + optitc[nbitc].tempre = tempref; + optitc[nbitc].greenre = greenref; + optitc[nbitc].drea = dread; + optitc[nbitc].kmi = kmin; + optitc[nbitc].minhis = Tppat[repref].minhi; + optitc[nbitc].maxhis = Tppat[repref].maxhi; + optitc[nbitc].avg_r = avg_rm; + optitc[nbitc].avg_g = avg_gm; + optitc[nbitc].avg_b = avg_bm; + optitc[nbitc].delt = Tppat[repref].delt_E; + lastitc = false; + + } else if ((tempitc >= 4000.f && tempitc <= 6000.f) || extra == true) { + optitc[nbitc].stud = studgood; + optitc[nbitc].minc = Tppat[repref].minchroma; + optitc[nbitc].titc = tempitc; + optitc[nbitc].gritc = greenitc; + optitc[nbitc].tempre = tempref; + optitc[nbitc].greenre = greenref; + optitc[nbitc].drea = dread; + optitc[nbitc].kmi = kmin; + optitc[nbitc].minhis = Tppat[repref].minhi; + optitc[nbitc].maxhis = Tppat[repref].maxhi; + optitc[nbitc].avg_r = avg_rm; + optitc[nbitc].avg_g = avg_gm; + optitc[nbitc].avg_b = avg_bm; + optitc[nbitc].delt = Tppat[repref].delt_E; + + nbitc++; + + if (tempitc < 5000.f) {//change the second temp to be near of the first one + tempitc += 105.f; + } else { + tempitc -= 105.f; + } + + tempref = tempitc * (1. + wbpar.tempBias); + + optitc[nbitc].stud = studgood; + optitc[nbitc].minc = Tppat[repref].minchroma; + optitc[nbitc].titc = tempitc; + optitc[nbitc].gritc = greenitc; + optitc[nbitc].tempre = tempref; + optitc[nbitc].greenre = greenref; + optitc[nbitc].drea = dread; + optitc[nbitc].kmi = kmin; + optitc[nbitc].minhis = Tppat[repref].minhi; + optitc[nbitc].maxhis = Tppat[repref].maxhi; + optitc[nbitc].avg_r = avg_rm; + optitc[nbitc].avg_g = avg_gm; + optitc[nbitc].avg_b = avg_bm; + optitc[nbitc].delt = Tppat[repref].delt_E; + lastitc = false; + + } + } else if (nocam > 0 && wbpar.itcwb_alg == false) { + optitc[nbitc].stud = studgood; + optitc[nbitc].minc = Tppat[repref].minchroma; + optitc[nbitc].titc = tempitc; + optitc[nbitc].gritc = greenitc; + optitc[nbitc].tempre = tempref; + optitc[nbitc].greenre = greenref; + optitc[nbitc].drea = dread; + optitc[nbitc].kmi = kmin; + optitc[nbitc].minhis = Tppat[repref].minhi; + optitc[nbitc].maxhis = Tppat[repref].maxhi; + optitc[nbitc].avg_r = avg_rm; + optitc[nbitc].avg_g = avg_gm; + optitc[nbitc].avg_b = avg_bm; + optitc[nbitc].delt = Tppat[repref].delt_E; + + nbitc++; + + if (nocam == 1) { //new tempitc empirical values to refine + tempitc -= 199.f; + } else if (nocam == 2) { + tempitc += 201.f; + } else if (nocam == 3) { + tempitc -= 199.f; + } else if (nocam == 4) { + tempitc += 201.f; + } else if (nocam == 5) { + tempitc += 299.f; + } else if (nocam == 6) { + tempitc += 201.f; + } else if (nocam == 7) { + tempitc += 299.f; + } else if (nocam == 8) { + tempitc += 500.f; + } else if (nocam == 9) { + tempitc += 199.f; + } else if (nocam == 10) { + tempitc += 199.f; + } + + nocam = 0; + tempref = tempitc * (1. + wbpar.tempBias); + + optitc[nbitc].stud = studgood; + optitc[nbitc].minc = Tppat[repref].minchroma; + optitc[nbitc].titc = tempitc; + optitc[nbitc].gritc = greenitc; + optitc[nbitc].tempre = tempref; + optitc[nbitc].greenre = greenref; + optitc[nbitc].drea = dread; + optitc[nbitc].kmi = kmin; + optitc[nbitc].minhis = Tppat[repref].minhi; + optitc[nbitc].maxhis = Tppat[repref].maxhi; + optitc[nbitc].avg_r = avg_rm; + optitc[nbitc].avg_g = avg_gm; + optitc[nbitc].avg_b = avg_bm; + optitc[nbitc].delt = Tppat[repref].delt_E; + lastitc = false; + } else { + optitc[nbitc].stud = studgood; + optitc[nbitc].minc = Tppat[repref].minchroma; + optitc[nbitc].titc = tempitc; + optitc[nbitc].gritc = greenitc; + optitc[nbitc].tempre = tempref; + optitc[nbitc].greenre = greenref; + optitc[nbitc].drea = dread; + optitc[nbitc].kmi = kmin; + optitc[nbitc].minhis = Tppat[repref].minhi; + optitc[nbitc].maxhis = Tppat[repref].maxhi; + optitc[nbitc].avg_r = avg_rm; + optitc[nbitc].avg_g = avg_gm; + optitc[nbitc].avg_b = avg_bm; + optitc[nbitc].delt = Tppat[repref].delt_E; + + lastitc = false; + itciterate = false; + } + + + if (optitc[1].minc > 0.f) { + choiceitc = 1; + temp0 = optitc[0].titc; + } else { + choiceitc = 0; + temp0 = 0.f; + } + }//end loop + + if (!oldsampling) { + + if (settings->verbose) { + for (int d = 0; d < 2; d++) { + printf("n=%i nbitc=%i stu=%f minc=%f tempitc=%f greenitc=%f deltaE=%f choiceitc=%i\n", d, nbitc, (double) optitc[d].stud, (double) optitc[d].minc, (double) optitc[d].titc, (double) optitc[d].gritc, (double) optitc[d].delt, choiceitc); + } + } + + if ((nbitc == 1 && choiceitc == 1) && wbpar.itcwb_alg == false && oldsampling == false) { + bia = 2; + + if ((std::max(optitc[1].stud, 0.0004f) * optitc[1].delt < std::max(optitc[0].stud, 0.0004f) * optitc[0].delt) && wbpar.itcwb_alg == false) { + bia = 3; + } else { + bia = 2; + } + + studgood = optitc[choiceitc].stud; + minchrom = optitc[choiceitc].minc; + tempitc = optitc[choiceitc].titc; + greenitc = optitc[choiceitc].gritc; + tempref = optitc[choiceitc].tempre; + greenref = optitc[choiceitc].greenre; + dread = optitc[choiceitc].drea; + kmin = optitc[choiceitc].kmi; + minhist = optitc[choiceitc].minhis; + maxhist = optitc[choiceitc].maxhis; + avg_rm = optitc[choiceitc].avg_r; + avg_gm = optitc[choiceitc].avg_g; + avg_bm = optitc[choiceitc].avg_b; + } else if (!oldsampling) { + studgood = optitc[0].stud; + minchrom = optitc[0].minc; + tempitc = optitc[0].titc; + greenitc = optitc[0].gritc; + tempref = optitc[0].tempre; + greenref = optitc[0].greenre; + dread = optitc[0].drea; + kmin = optitc[0].kmi; + minhist = optitc[0].minhis; + maxhist = optitc[0].maxhis; + avg_rm = optitc[0].avg_r; + avg_gm = optitc[0].avg_g; + avg_bm = optitc[0].avg_b; + } } } - avg_rm = 10000.f * rmm[goodref]; - avg_gm = 10000.f * gmm[goodref]; - avg_bm = 10000.f * bmm[goodref]; + t8.set(); - if (!extra) { - tempitc = Txyz[goodref].Tem; - } - - //now we have temp green and student if (settings->verbose) { - printf("ITCWB tempitc=%f gritc=%f stud=%f \n", tempitc, greenitc, studgood); + printf("Seventh: from sixth to end: %d nsec\n", t8.etime(t7)); } + } -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, const ToneCurveParams &hrp) +void RawImageSource::WBauto(bool extra, 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 &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float & studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool & twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams & cmp, const RAWParams & raw, const ToneCurveParams &hrp) { // BENCHFUN //auto white balance //put green (tint) in reasonable limits for an Daylight illuminant // avoid too bi or too low values if (wbpar.method == "autitcgreen") { - bool extra = true; + // bool extra = true; if (greenref > 0.5 && greenref < 1.3) {// 0.5 and 1.3 arbitraties values greenitc = greenref; } else { greenitc = 1.; - extra = true; + // extra = true; } tempitc = 5000.; - ItcWB(extra, tempref, greenref, tempitc, greenitc, studgood, redloc, greenloc, blueloc, bfw, bfh, avg_rm, avg_gm, avg_bm, cmp, raw, wbpar, hrp); + ItcWB(extra, tempref, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, redloc, greenloc, blueloc, bfw, bfh, avg_rm, avg_gm, avg_bm, cmp, raw, wbpar, hrp); } } @@ -6111,7 +7412,9 @@ void RawImageSource::getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int //used by auto WB local to calculate red, green, blue in local region int precision = 3;//must be 3 5 or 9 - if(wbpar.itcwb_sampling == true) { + bool oldsampling = wbpar.itcwb_sampling; + + if (oldsampling == true) { precision = 5; } @@ -6182,7 +7485,7 @@ void RawImageSource::getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int } } -void RawImageSource::getAutoWBMultipliersitc(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, const ToneCurveParams &hrp) +void RawImageSource::getAutoWBMultipliersitc(bool extra, double & tempref, double & greenref, double & tempitc, double & greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, 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, const ToneCurveParams &hrp) { // BENCHFUN constexpr double clipHigh = 64000.0; @@ -6375,21 +7678,24 @@ void RawImageSource::getAutoWBMultipliersitc(double & tempref, double & greenref if (wbpar.method == "autitcgreen") { bool twotimes = false; int precision = 3;//must be 3 5 or 9 - if(wbpar.itcwb_sampling == true) { + bool oldsampling = wbpar.itcwb_sampling; + + if (oldsampling == true) { precision = 5; } + // bool extra = true; const int bfw = W / precision + ((W % precision) > 0 ? 1 : 0);// 5 arbitrary value can be change to 3 or 9 ; const int bfh = H / precision + ((H % precision) > 0 ? 1 : 0); - 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, hrp); + WBauto(extra, tempref, greenref, redloc, greenloc, blueloc, bfw, bfh, avg_rm, avg_gm, avg_bm, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, twotimes, wbpar, begx, begy, yEn, xEn, cx, cy, cmp, raw, hrp); } 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)); + if (settings->verbose && wbpar.method != "autitcgreen") { + printf("RGB grey AVG: %g %g %g\n", avg_r / std::max(1, rn), avg_g / std::max(1, gn), avg_b / std::max(1, bn)); } if (wbpar.method == "autitcgreen") { @@ -6624,7 +7930,7 @@ void RawImageSource::getAutoWBMultipliers(double &rm, double &gm, double &bm) blueAWBMul = bm = imatrices.rgb_cam[2][0] * reds + imatrices.rgb_cam[2][1] * greens + imatrices.rgb_cam[2][2] * blues; } -ColorTemp RawImageSource::getSpotWB (std::vector &red, std::vector &green, std::vector &blue, int tran, double equal, StandardObserver observer) +ColorTemp RawImageSource::getSpotWB(std::vector &red, std::vector &green, std::vector &blue, int tran, double equal, StandardObserver observer) { int x; @@ -6637,7 +7943,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector &red, std::vector &red, std::vector 52500 || + if (initialGain * (rawData[yr][3 * xr]) > 52500 || initialGain * (rawData[yg][3 * xg + 1]) > 52500 || initialGain * (rawData[yb][3 * xb + 2]) > 52500) { continue; @@ -6696,7 +8002,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector &red, std::vector= 0 && ymin >= 0 && xmax < W && ymax < H) { - reds += (rawData[yr][3 * xr] ); + reds += (rawData[yr][3 * xr]); greens += (rawData[yg][3 * xg + 1]); blues += (rawData[yb][3 * xb + 2]); rn++; @@ -6709,7 +8015,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector &red, std::vector &red, std::vector &red, std::vector &red, std::vector &red, std::vectorget_rotateDegree(); rotate %= 360; + if (rotate == 90) { - std::swap(xnew,ynew); + std::swap(xnew, ynew); ynew = H - 1 - ynew; } else if (rotate == 180) { xnew = W - 1 - xnew; ynew = H - 1 - ynew; } else if (rotate == 270) { - std::swap(xnew,ynew); + std::swap(xnew, ynew); xnew = W - 1 - xnew; } xnew = LIM(xnew, 0, W - 1); ynew = LIM(ynew, 0, H - 1); - int c = ri->getSensorType() == ST_FUJI_XTRANS ? ri->XTRANSFC(ynew,xnew) : ri->FC(ynew,xnew); + int c = ri->getSensorType() == ST_FUJI_XTRANS ? ri->XTRANSFC(ynew, xnew) : ri->FC(ynew, xnew); int val = round(rawData[ynew][xnew] / scale_mul[c]); + if (c == 0) { - R = val; G = 0; B = 0; + R = val; + G = 0; + B = 0; } else if (c == 2) { - R = 0; G = 0; B = val; + R = 0; + G = 0; + B = val; } else { - R = 0; G = val; B = 0; + R = 0; + G = val; + B = 0; } } -bool RawImageSource::isGainMapSupported() const { +bool RawImageSource::isGainMapSupported() const +{ return ri->isGainMapSupported(); } -void RawImageSource::applyDngGainMap(const float black[4], const std::vector &gainMaps) { +void RawImageSource::applyDngGainMap(const float black[4], const std::vector &gainMaps) +{ // now we can apply each gain map to raw_data array2D mvals[2][2]; + for (auto &m : gainMaps) { mvals[m.Top & 1][m.Left & 1](m.MapPointsH, m.MapPointsV, m.MapGain.data()); } // now we assume, col_scale and row scale is the same for all maps - const float col_scale = float(gainMaps[0].MapPointsH-1) / float(W); - const float row_scale = float(gainMaps[0].MapPointsV-1) / float(H); + const float col_scale = float(gainMaps[0].MapPointsH - 1) / float(W); + const float row_scale = float(gainMaps[0].MapPointsV - 1) / float(H); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 16) #endif + for (std::size_t y = 0; y < static_cast(H); ++y) { - const float rowBlack[2] = {black[FC(y,0)], black[FC(y,1)]}; + const float rowBlack[2] = {black[FC(y, 0)], black[FC(y, 1)]}; const float ys = y * row_scale; float xs = 0.f; + for (std::size_t x = 0; x < static_cast(W); ++x, xs += col_scale) { const float f = getBilinearValue(mvals[y & 1][x & 1], xs, ys); const float b = rowBlack[x & 1]; @@ -7027,7 +8347,7 @@ void RawImageSource::applyDngGainMap(const float black[4], const std::vector &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::WBParams & wbpar, const procparams::ToneCurveParams &hrp); + void ItcWB(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::WBParams & wbpar, const procparams::ToneCurveParams &hrp); unsigned FC(int row, int col) const; inline void getRowStartEnd (int x, int &start, int &end); @@ -141,8 +141,8 @@ public: void processFlatField(const procparams::RAWParams &raw, const RawImage *riFlatFile, array2D &rawData, const float black[4]); void copyOriginalPixels(const procparams::RAWParams &raw, RawImage *ri, const RawImage *riDark, RawImage *riFlatFile, array2D &rawData ); void scaleColors (int winx, int winy, int winw, int winh, const procparams::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 procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override; - void getAutoWBMultipliersitc(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, const procparams::ToneCurveParams &hrp) override; + void WBauto(bool extra, 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 &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override; + void getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, 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, const procparams::ToneCurveParams &hrp) override; void getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, const procparams::WBParams & wbpar) override; void getWBMults (const ColorTemp &ctemp, const procparams::RAWParams &raw, std::array& scale_mul, float &autoGainComp, float &rm, float &gm, float &bm) const override; diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index f7a998a71..ba4d2ed60 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -413,9 +413,21 @@ public: double Tmax; }; + struct locallabDenoiseLC { + double highres; + double nres; + double highres46; + double nres46; + double Lhighres; + double Lnres; + double Lhighres46; + double Lnres46; + }; + virtual ~LocallabListener() = default; // virtual void refChanged(const std::vector &ref, int selspot) = 0; virtual void minmaxChanged(const std::vector &minmax, int selspot) = 0; + virtual void denChanged(const std::vector &denlc, int selspot) = 0; virtual void logencodChanged(const float blackev, const float whiteev, const float sourceg, const float sourceab, const float targetg, const bool autocomput, const bool autocie, const float jz1) = 0; virtual void refChanged2(float *huerefp, float *chromarefp, float *lumarefp, float *fabrefp, int selspot) = 0; }; @@ -447,7 +459,7 @@ class AutoWBListener { public: virtual ~AutoWBListener() = default; - virtual void WBChanged(double temp, double green, double rw, double gw, double bw, float studgood) = 0; + virtual void WBChanged(int met, double temp, double green, double rw, double gw, double bw, float temp0, float delta, int bia, int dread, float studgood, float minchrom, int kmin, float histmin, float histmax) = 0; }; class FrameCountListener diff --git a/rtengine/settings.h b/rtengine/settings.h index 30704b947..fbbb51bbb 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -9,7 +9,7 @@ * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * RawTherapee is distributed in the hope that it will be useful, -itcw * + * * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -61,6 +61,7 @@ public: Glib::ustring srgb; // filename of sRGB profile (default to the bundled one) Glib::ustring rec2020; // filename of Rec2020 profile (default to the bundled one) Glib::ustring ACESp0; // filename of ACES P0 profile (default to the bundled one) + Glib::ustring JDCmax; // filename of JDCmax profile (default to the bundled one) Glib::ustring ACESp1; // filename of ACES P1 profile (default to the bundled one) Glib::ustring DCIP3; // filename of DCIP3 profile (default to the bundled one) @@ -96,6 +97,9 @@ public: double cbdlsensi; // bool showtooltip; bool itcwb_enable; + double itcwb_deltaspec; + double itcwb_powponder; + //wavelet levels double edghi; double edglo; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index dc4f057d0..cc9756919 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1176,6 +1176,14 @@ private: float Tsigma; float Tmin; float Tmax; + float highresi = 0.f; + float nresi = 0.f; + float highresi46 =0.f; + float nresi46 = 0.f; + float Lhighresi = 0.f; + float Lnresi = 0.f; + float Lhighresi46 = 0.f; + float Lnresi46 = 0.f; // No Locallab mask is shown in exported picture ipf.Lab_Local(2, sp, shbuffer, labView, labView, reservView.get(), savenormtmView.get(), savenormretiView.get(), lastorigView.get(), fw, fh, 0, 0, fw, fh, 1, locRETgainCurve, locRETtransCurve, @@ -1230,7 +1238,8 @@ private: LHutili, HHutili, CHutili, HHutilijz, CHutilijz, LHutilijz, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, - meantme, stdtme, meanretie, stdretie, fab + meantme, stdtme, meanretie, stdretie, fab, + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46 ); if (sp + 1u < params.locallab.spots.size()) { diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 411b1de32..2375d7cfd 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -311,11 +311,11 @@ 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, const ToneCurveParams &hrp) +void StdImageSource::WBauto(bool extra, 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 &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool &twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams &cmp, const RAWParams &raw, const ToneCurveParams &hrp) { } -void StdImageSource::getAutoWBMultipliersitc(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, const ToneCurveParams &hrp) +void StdImageSource::getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, 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, const ToneCurveParams &hrp) { if (redAWBMul != -1.) { rm = redAWBMul; @@ -324,7 +324,7 @@ void StdImageSource::getAutoWBMultipliersitc(double &tempref, double &greenref, return; } - img->getAutoWBMultipliersitc(tempref, greenref, tempitc, greenitc,studgood, begx, begy, yEn, xEn, cx, cy, bf_h, bf_w, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve); + img->getAutoWBMultipliersitc(extra, tempref, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, begx, begy, yEn, xEn, cx, cy, bf_h, bf_w, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve); redAWBMul = rm; greenAWBMul = gm; diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index 33a5a3667..866e90b99 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -66,8 +66,8 @@ public: } void getAutoWBMultipliers (double &rm, double &gm, double &bm) override; ColorTemp getSpotWB (std::vector &red, std::vector &green, std::vector &blue, int tran, double equal, StandardObserver observer) 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 procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override; - void getAutoWBMultipliersitc(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, const procparams::ToneCurveParams &hrp) override; + void WBauto(bool extra, 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 &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override; + void getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, 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, const procparams::ToneCurveParams &hrp) override; eSensorType getSensorType() const override {return ST_NONE;} bool isMono() const override {return false;} diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index cb5126631..fb4acbe42 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -161,6 +161,7 @@ set(NONCLISOURCEFILES thumbimageupdater.cc thumbnail.cc tonecurve.cc + toneequalizer.cc toolbar.cc toollocationpref.cc toolpanel.cc diff --git a/rtgui/addsetids.h b/rtgui/addsetids.h index 31097931a..d0d24fa76 100644 --- a/rtgui/addsetids.h +++ b/rtgui/addsetids.h @@ -10,6 +10,9 @@ enum { ADDSET_SH_HIGHLIGHTS, ADDSET_SH_SHADOWS, ADDSET_SH_LOCALCONTRAST, // not used anymore + ADDSET_TONE_EQUALIZER_BANDS, + ADDSET_TONE_EQUALIZER_PIVOT, + ADDSET_TONE_EQUALIZER_REGULARIZATION, ADDSET_LC_BRIGHTNESS, ADDSET_LC_CONTRAST, ADDSET_SHARP_AMOUNT, diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index 2beb429a8..49a5ed21b 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -51,6 +51,7 @@ Adjuster::Adjuster( grid(nullptr), label(nullptr), imageIcon1(imgIcon1), + imageIcon2(imgIcon2), automatic(nullptr), adjusterListener(nullptr), spinChange(options.adjusterMinDelay, options.adjusterMaxDelay), @@ -76,8 +77,8 @@ Adjuster::Adjuster( setExpandAlignProperties(imageIcon1, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); } - if (imgIcon2) { - setExpandAlignProperties(imgIcon2, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); + if (imageIcon2) { + setExpandAlignProperties(imageIcon2, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); } set_column_spacing(0); @@ -120,9 +121,9 @@ Adjuster::Adjuster( attach_next_to(*imageIcon1, *slider, Gtk::POS_LEFT, 1, 1); } - if (imgIcon2) { - attach_next_to(*imgIcon2, *slider, Gtk::POS_RIGHT, 1, 1); - attach_next_to(*spin, *imgIcon2, Gtk::POS_RIGHT, 1, 1); + if (imageIcon2) { + attach_next_to(*imageIcon2, *slider, Gtk::POS_RIGHT, 1, 1); + attach_next_to(*spin, *imageIcon2, Gtk::POS_RIGHT, 1, 1); } else { attach_next_to(*spin, *slider, Gtk::POS_RIGHT, 1, 1); } @@ -140,9 +141,9 @@ Adjuster::Adjuster( grid->attach_next_to(*imageIcon1, *slider, Gtk::POS_LEFT, 1, 1); } - if (imgIcon2) { - grid->attach_next_to(*imgIcon2, Gtk::POS_RIGHT, 1, 1); - grid->attach_next_to(*reset, *imgIcon2, Gtk::POS_RIGHT, 1, 1); + if (imageIcon2) { + grid->attach_next_to(*imageIcon2, Gtk::POS_RIGHT, 1, 1); + grid->attach_next_to(*reset, *imageIcon2, Gtk::POS_RIGHT, 1, 1); } else { grid->attach_next_to(*reset, *slider, Gtk::POS_RIGHT, 1, 1); } @@ -683,3 +684,15 @@ void Adjuster::setDelay(unsigned int min_delay_ms, unsigned int max_delay_ms) spinChange.setDelay(min_delay_ms, max_delay_ms); sliderChange.setDelay(min_delay_ms, max_delay_ms); } + +void Adjuster::showIcons(bool yes) +{ + if (imageIcon1) { + imageIcon1->set_visible(yes); + imageIcon1->set_no_show_all(!yes); + } + if (imageIcon2) { + imageIcon2->set_visible(yes); + imageIcon2->set_no_show_all(!yes); + } +} diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index abafbd730..76b46b094 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -41,6 +41,7 @@ protected: Gtk::Grid* grid; Gtk::Label* label; Gtk::Image *imageIcon1; + Gtk::Image *imageIcon2; MyHScale* slider; MySpinButton* spin; Gtk::Button* reset; @@ -133,4 +134,5 @@ public: void trimValue (int &val) const; void setLogScale(double base, double pivot, bool anchorMiddle = false); void setDelay(unsigned int min_delay_ms, unsigned int max_delay_ms = 0); + void showIcons(bool yes); }; diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 297608896..4383ccb74 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -219,6 +219,7 @@ void BatchToolPanelCoordinator::initSession () chmixer->setAdjusterBehavior (options.baBehav[ADDSET_CHMIXER] ); blackwhite->setAdjusterBehavior (options.baBehav[ADDSET_BLACKWHITE_HUES], options.baBehav[ADDSET_BLACKWHITE_GAMMA]); shadowshighlights->setAdjusterBehavior (options.baBehav[ADDSET_SH_HIGHLIGHTS], options.baBehav[ADDSET_SH_SHADOWS]); + toneEqualizer->setAdjusterBehavior(options.baBehav[ADDSET_TONE_EQUALIZER_BANDS], options.baBehav[ADDSET_TONE_EQUALIZER_REGULARIZATION], options.baBehav[ADDSET_TONE_EQUALIZER_PIVOT]); dirpyrequalizer->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYREQ], options.baBehav[ADDSET_DIRPYREQ_THRESHOLD], options.baBehav[ADDSET_DIRPYREQ_SKINPROTECT]); wavelet->setAdjusterBehavior (options.baBehav[ADDSET_WA], options.baBehav[ADDSET_WA_THRESHOLD], options.baBehav[ADDSET_WA_THRESHOLD2], options.baBehav[ADDSET_WA_THRES], options.baBehav[ADDSET_WA_CHRO], options.baBehav[ADDSET_WA_CHROMA], options.baBehav[ADDSET_WA_CONTRAST], options.baBehav[ADDSET_WA_SKINPROTECT], options.baBehav[ADDSET_WA_RESCHRO], options.baBehav[ADDSET_WA_TMRS], options.baBehav[ADDSET_WA_EDGS], options.baBehav[ADDSET_WA_SCALE], options.baBehav[ADDSET_WA_RESCON], options.baBehav[ADDSET_WA_RESCONH], options.baBehav[ADDSET_WA_THRR], options.baBehav[ADDSET_WA_THRRH], options.baBehav[ADDSET_WA_RADIUS], options.baBehav[ADDSET_WA_SKYPROTECT], options.baBehav[ADDSET_WA_EDGRAD], options.baBehav[ADDSET_WA_EDGVAL], options.baBehav[ADDSET_WA_STRENGTH], options.baBehav[ADDSET_WA_GAMMA], options.baBehav[ADDSET_WA_EDGEDETECT], options.baBehav[ADDSET_WA_EDGEDETECTTHR], options.baBehav[ADDSET_WA_EDGEDETECTTHR2]); dirpyrdenoise->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYRDN_LUMA], options.baBehav[ADDSET_DIRPYRDN_LUMDET], options.baBehav[ADDSET_DIRPYRDN_CHROMA], options.baBehav[ADDSET_DIRPYRDN_CHROMARED], options.baBehav[ADDSET_DIRPYRDN_CHROMABLUE], options.baBehav[ADDSET_DIRPYRDN_GAMMA], options.baBehav[ADDSET_DIRPYRDN_PASSES]); @@ -242,6 +243,9 @@ void BatchToolPanelCoordinator::initSession () if (options.baBehav[ADDSET_TC_SATURATION]) { pparams.toneCurve.saturation = 0;} if (options.baBehav[ADDSET_SH_HIGHLIGHTS]) { pparams.sh.highlights = 0; } if (options.baBehav[ADDSET_SH_SHADOWS]) { pparams.sh.shadows = 0; } + if (options.baBehav[ADDSET_TONE_EQUALIZER_BANDS]) { pparams.toneEqualizer.bands = {}; } + if (options.baBehav[ADDSET_TONE_EQUALIZER_PIVOT]) { pparams.toneEqualizer.pivot = 0; } + if (options.baBehav[ADDSET_TONE_EQUALIZER_REGULARIZATION]) { pparams.toneEqualizer.regularization = 0; } if (options.baBehav[ADDSET_LC_BRIGHTNESS]) { pparams.labCurve.brightness = 0; } if (options.baBehav[ADDSET_LC_CONTRAST]) { pparams.labCurve.contrast = 0; } if (options.baBehav[ADDSET_LC_CHROMATICITY]) { pparams.labCurve.chromaticity = 0; } diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index c7d7348b3..0cd6f3f6c 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -403,7 +403,7 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y) // Add a new Color Picker rtengine::Coord imgPos; screenCoordToImage(x, y, imgPos.x, imgPos.y); - LockableColorPicker *newPicker = new LockableColorPicker(this, &cropHandler.colorParams->outputProfile, &cropHandler.colorParams->workingProfile); + LockableColorPicker *newPicker = new LockableColorPicker(this, cropHandler.colorParams.get()); colorPickers.push_back(newPicker); hoveredPicker = newPicker; updateHoveredPicker(&imgPos); @@ -1095,10 +1095,10 @@ void CropWindow::pointerMoved (int bstate, int x, int y) printf("Using \"%s\" output\n", outputProfile.c_str()); if(outputProfile==options.rtSettings.srgb) printf("OK SRGB2"); */ - pmlistener->pointerMoved (false, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, -1, -1, -1); + pmlistener->pointerMoved (false, *cropHandler.colorParams, mx, my, -1, -1, -1); if (pmhlistener) { - pmhlistener->pointerMoved (false, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, -1, -1, -1); + pmhlistener->pointerMoved (false, *cropHandler.colorParams, mx, my, -1, -1, -1); } } else { @@ -1145,11 +1145,11 @@ void CropWindow::pointerMoved (int bstate, int x, int y) // Updates the Navigator // TODO: possible double color conversion if rval, gval, bval come from cropHandler.cropPixbuftrue ? see issue #4583 - pmlistener->pointerMoved (true, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, rval, gval, bval, isRaw); + pmlistener->pointerMoved (true, *cropHandler.colorParams, mx, my, rval, gval, bval, isRaw); if (pmhlistener) { // Updates the HistogramRGBArea - pmhlistener->pointerMoved (true, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, rval, gval, bval); + pmhlistener->pointerMoved (true, *cropHandler.colorParams, mx, my, rval, gval, bval); } } } diff --git a/rtgui/editcallbacks.h b/rtgui/editcallbacks.h index 134ea6477..61d392de5 100644 --- a/rtgui/editcallbacks.h +++ b/rtgui/editcallbacks.h @@ -18,6 +18,8 @@ */ #pragma once +#include + #include "editid.h" #include "cursormanager.h" #include "../rtengine/coord.h" diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index b89fe340d..7df29dd92 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -37,7 +37,6 @@ //extern Glib::Threads::Thread* mainThread; -bool FileBrowserEntry::iconsLoaded(false); Glib::RefPtr FileBrowserEntry::editedIcon; Glib::RefPtr FileBrowserEntry::recentlySavedIcon; Glib::RefPtr FileBrowserEntry::enqueuedIcon; @@ -58,15 +57,6 @@ FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname) scale = 1; - if (!iconsLoaded) { - editedIcon = RTImage::createPixbufFromFile ("tick-small.png"); - recentlySavedIcon = RTImage::createPixbufFromFile ("save-small.png"); - enqueuedIcon = RTImage::createPixbufFromFile ("gears-small.png"); - hdr = RTImage::createPixbufFromFile ("filetype-hdr.png"); - ps = RTImage::createPixbufFromFile ("filetype-ps.png"); - iconsLoaded = true; - } - thumbnail->addThumbnailListener (this); } @@ -90,6 +80,15 @@ FileBrowserEntry::~FileBrowserEntry () } } +void FileBrowserEntry::init () +{ + editedIcon = RTImage::createPixbufFromFile ("tick-small.png"); + recentlySavedIcon = RTImage::createPixbufFromFile ("save-small.png"); + enqueuedIcon = RTImage::createPixbufFromFile ("gears-small.png"); + hdr = RTImage::createPixbufFromFile ("filetype-hdr.png"); + ps = RTImage::createPixbufFromFile ("filetype-ps.png"); +} + void FileBrowserEntry::refreshThumbnailImage () { diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h index 67b953514..f8fca4db1 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -50,7 +50,6 @@ class FileBrowserEntry final : public ThumbBrowserEntryBase, { double scale; - static bool iconsLoaded; bool wasInside; ImageAreaToolListener* iatlistener; int press_x, press_y, action_x, action_y; @@ -80,6 +79,7 @@ public: FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname); ~FileBrowserEntry () override; + static void init (); void draw (Cairo::RefPtr cc) override; void setImageAreaToolListener (ImageAreaToolListener* l) diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 18b82fe36..8e039400e 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -82,59 +82,6 @@ void IdleRegister::destroy() mutex.unlock(); } -/* -gboolean giveMeAGo(void* data) { - GThreadLock *threadMutex = static_cast(data); - printf("A\n"); - Glib::Threads::Mutex::Lock GUILock(threadMutex->GUI); - printf("B\n"); - { - Glib::Threads::Mutex::Lock operationLock(threadMutex->operation); - printf("C\n"); - - threadMutex->operationCond.signal(); - printf("D\n"); - operationLock.release(); // because we're not sure that "lock" destructor happens here... - } - threadMutex->GUICond.wait(threadMutex->GUI); - printf("E\n"); - - GUILock.release(); - - return false; -} - -GThreadLock::GThreadLock() : sameThread(false) { - if (Glib::Threads::Thread::self() == mainThread) { - sameThread = true; - return; - } - - printf("10\n"); - { - Glib::Threads::Mutex::Lock operationLock(operation); - - printf("20\n"); - gdk_threads_add_idle(giveMeAGo, this); - - printf("30\n"); - operationCond.wait(operation); - printf("40\n"); - operationLock.release(); - } -} - -GThreadLock::~GThreadLock() { - if (!sameThread) { - printf("50\n"); - Glib::Threads::Mutex::Lock lock(GUI); - printf("60\n"); - GUICond.signal(); - printf("Fin\n"); - } -} -*/ - Glib::ustring escapeHtmlChars(const Glib::ustring &src) { diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 6bda0812e..b804218f5 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -22,10 +22,11 @@ #include "options.h" #include #include -#include "../rtengine/array2D.h" -#include "../rtengine/LUT.h" #include "rtimage.h" +#include "../rtengine/array2D.h" #include "../rtengine/color.h" +#include "../rtengine/improcfun.h" +#include "../rtengine/LUT.h" using namespace rtengine; @@ -34,12 +35,20 @@ constexpr float HistogramArea::MIN_BRIGHT; using ScopeType = Options::ScopeType; + +namespace +{ + +const rtengine::procparams::ColorManagementParams DEFAULT_CMP; + +} + // // // HistogramPanel HistogramPanel::HistogramPanel () : pointer_moved_delayed_call( - [this](bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int r, int g, int b) + [this](bool validPos, const rtengine::procparams::ColorManagementParams *cmp, int r, int g, int b) { bool update_hist_area; @@ -52,9 +61,9 @@ HistogramPanel::HistogramPanel () : } else { // do something to show vertical bars if (histogramRGBArea) { - histogramRGBArea->updateBackBuffer(r, g, b, profile, profileW); + histogramRGBArea->updateBackBuffer(r, g, b, cmp); } - update_hist_area = histogramArea->updatePointer(r, g, b, profile, profileW); + update_hist_area = histogramArea->updatePointer(r, g, b, cmp); } if (histogramRGBArea) { histogramRGBArea->queue_draw(); @@ -623,9 +632,9 @@ void HistogramPanel::setHistRGBInvalid () histogramRGBArea->queue_draw (); } -void HistogramPanel::pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw) +void HistogramPanel::pointerMoved(bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool isRaw) { - pointer_moved_delayed_call(validPos, profile, profileW, r, g, b); + pointer_moved_delayed_call(validPos, &cmp, r, g, b); } /* @@ -797,7 +806,7 @@ void HistogramRGBArea::setShow(bool show) showMode = show; } -void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustring &profile, const Glib::ustring &profileW) +void HistogramRGBArea::updateBackBuffer(int r, int g, int b, const rtengine::procparams::ColorManagementParams *cmp) { if (!get_realized () || !showMode || !( options.histogramScopeType == ScopeType::HISTOGRAM @@ -856,19 +865,25 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin || options.histogramScopeType == ScopeType::WAVEFORM) ) { float Lab_L, Lab_a, Lab_b; - rtengine::Color::rgb2lab01(profile, profileW, r / 255.f, g / 255.f, b / 255.f, Lab_L, Lab_a, Lab_b, options.rtSettings.HistogramWorking); + ImProcFunctions::rgb2lab( + static_cast(r), + static_cast(g), + static_cast(b), + Lab_L, Lab_a, Lab_b, + cmp != nullptr ? *cmp : DEFAULT_CMP, + true); if (needLuma) { // Luma cc->set_source_rgb(1.0, 1.0, 1.0); - drawBar(cc, Lab_L, 100.0, winw, winh, s); + drawBar(cc, Lab_L, 32768., winw, winh, s); } if (needChroma && options.histogramScopeType == ScopeType::HISTOGRAM) { // Chroma - double chromaval = sqrt(Lab_a * Lab_a + Lab_b * Lab_b) / 1.8; + double chromaval = sqrt(Lab_a * Lab_a + Lab_b * Lab_b) / (255. * 188); cc->set_source_rgb(0.9, 0.9, 0.0); - drawBar(cc, chromaval, 100.0, winw, winh, s); + drawBar(cc, chromaval, 1.0, winw, winh, s); } } } @@ -1182,7 +1197,7 @@ void HistogramArea::update( break; case ScopeType::PARADE: case ScopeType::WAVEFORM: { - MyWriterLock wave_lock(wave_mutex); + MYWRITERLOCK(wave_lock, wave_mutex) waveform_scale = waveformScale; rwave = waveformRed; gwave = waveformGreen; @@ -1315,7 +1330,7 @@ void HistogramArea::updateBackBuffer () cr->unset_dash(); - MyReaderLock wave_lock(wave_mutex); + MYREADERLOCK(wave_lock, wave_mutex) if (valid && (scopeType == ScopeType::HISTOGRAM || scopeType == ScopeType::HISTOGRAM_RAW)) { bool rawMode = scopeType == ScopeType::HISTOGRAM_RAW; @@ -1432,7 +1447,7 @@ void HistogramArea::updateBackBuffer () } else if (scopeType == ScopeType::VECTORSCOPE_HC || scopeType == ScopeType::VECTORSCOPE_HS) { drawVectorscope(cr, w, h); } - wave_lock.release(); + MYREADERLOCK_RELEASE(wave_lock); // Draw the frame's border style->render_frame(cr, 0, 0, surface->get_width(), surface->get_height()); @@ -1443,7 +1458,7 @@ void HistogramArea::updateBackBuffer () setDirty(false); } -bool HistogramArea::updatePointer(int r, int g, int b, const Glib::ustring &profile, const Glib::ustring &profileW) +bool HistogramArea::updatePointer(int r, int g, int b, const rtengine::procparams::ColorManagementParams *cmp) { if (!needPointer || !(scopeType == ScopeType::VECTORSCOPE_HC || scopeType == ScopeType::VECTORSCOPE_HS)) { return false; @@ -1456,7 +1471,16 @@ bool HistogramArea::updatePointer(int r, int g, int b, const Glib::ustring &prof pointer_red = r; pointer_green = g; pointer_blue = b; - Color::rgb2lab01(profile, profileW, r / 255.f, g / 255.f, b / 255.f, L, pointer_a, pointer_b, options.rtSettings.HistogramWorking); + ImProcFunctions::rgb2lab( + static_cast(r), + static_cast(g), + static_cast(b), + L, pointer_a, pointer_b, + cmp != nullptr ? *cmp : DEFAULT_CMP, + true); + L /= 327.68f; + pointer_a /= 327.68f; + pointer_b /= 327.68f; updateBackBuffer(); return true; } diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 26b744546..7f165bb15 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -99,7 +99,7 @@ public: HistogramRGBArea(); ~HistogramRGBArea() override; - void updateBackBuffer (int r, int g, int b, const Glib::ustring &profile = "", const Glib::ustring &profileW = ""); + void updateBackBuffer(int r, int g, int b, const rtengine::procparams::ColorManagementParams *cmp = nullptr); bool getShow (); void setShow(bool show); void setParent (Gtk::Grid* p) @@ -206,7 +206,7 @@ public: void updateBackBuffer (); /// Update pointer values. Returns true if widget needs redrawing. - bool updatePointer(int r, int g, int b, const Glib::ustring &profile = "", const Glib::ustring &profileW = ""); + bool updatePointer(int r, int g, int b, const rtengine::procparams::ColorManagementParams *cmp = nullptr); void update( const LUTu& histRed, const LUTu& histGreen, @@ -260,7 +260,7 @@ public: class HistogramPanel final : public Gtk::Grid, public PointerMotionListener, public DrawModeListener, public rtengine::NonCopyable { private: - DelayedCall pointer_moved_delayed_call; + DelayedCall pointer_moved_delayed_call; protected: @@ -343,7 +343,7 @@ public: histogramArea->update(histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw, vectorscopeScale, vectorscopeHC, vectorscopeHS, waveformScale, waveformRed, waveformGreen, waveformBlue, waveformLuma); } // pointermotionlistener interface - void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false) override; + void pointerMoved (bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool isRaw = false) override; // TODO should be protected void setHistRGBInvalid (); diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 57f12fd7e..5606452e3 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -204,10 +204,13 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu wFrame->add(*wProfVBox); //-----------------gamma TRC working - Gtk::Frame *trcFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_TRCFRAME"))); - trcFrame->set_label_align(0.025, 0.5); +// Gtk::Frame *trcFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_TRCFRAME"))); + trcExp = Gtk::manage(new MyExpander(false, M("TP_ICM_TRCFRAME"))); + setExpandAlignProperties(trcExp, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); +// trcFrame->set_label_align(0.025, 0.5); Gtk::Box *trcProfVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); - trcFrame->set_tooltip_text(M("TP_ICM_TRCFRAME_TOOLTIP")); + trcExp->set_tooltip_text(M("TP_ICM_TRCFRAME_TOOLTIP")); + trcExp->signal_button_release_event().connect_notify ( sigc::bind ( sigc::mem_fun (this, &ICMPanel::foldAllButMe), trcExp) ); wTRCBox = Gtk::manage(new Gtk::Box()); @@ -268,7 +271,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu fbw->set_active(true); gamut = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_GAMUT")))); gamut->set_active(false); - + trcProfVBox->pack_start(*wprimBox, Gtk::PACK_EXPAND_WIDGET); trcProfVBox->pack_start(*fbw, Gtk::PACK_EXPAND_WIDGET); trcProfVBox->pack_start(*gamut, Gtk::PACK_EXPAND_WIDGET); @@ -292,6 +295,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu wprim->append(M("TP_ICM_WORKING_PRIM_ACE")); wprim->append(M("TP_ICM_WORKING_PRIM_WID")); wprim->append(M("TP_ICM_WORKING_PRIM_AC0")); + wprim->append(M("TP_ICM_WORKING_PRIM_JDCMAX")); wprim->append(M("TP_ICM_WORKING_PRIM_BRU")); wprim->append(M("TP_ICM_WORKING_PRIM_BET")); wprim->append(M("TP_ICM_WORKING_PRIM_BST")); @@ -381,11 +385,13 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu aRendIntent->show(); riaHBox->pack_start(*aRendIntent->buttonGroup, Gtk::PACK_EXPAND_PADDING); - trcFrame->add(*trcProfVBox); pack_start(*wFrame, Gtk::PACK_EXPAND_WIDGET); - pack_start(*trcFrame, Gtk::PACK_EXPAND_WIDGET); - pack_start(*redFrame, Gtk::PACK_EXPAND_WIDGET); + trcProfVBox->pack_start(*redFrame, Gtk::PACK_EXPAND_WIDGET); + trcExp->add(*trcProfVBox, false); + trcExp->setLevel (2); + pack_start(*trcExp, Gtk::PACK_EXPAND_WIDGET); + trcExp->set_expanded(false); // ---------------------------- Output profile @@ -493,6 +499,14 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu show_all(); } +void ICMPanel::foldAllButMe (GdkEventButton* event, MyExpander *expander) +{ + if (event->button == 3) { + trcExp->set_expanded (trcExp == expander); + } +} + + void ICMPanel::neutral_pressed () { //find working profile and set the same destination proile if (wProfNames->get_active_text() == "Rec2020") { @@ -509,6 +523,8 @@ void ICMPanel::neutral_pressed () wprim->set_active(toUnderlying(ColorManagementParams::Primaries::WIDE_GAMUT)); } else if (wProfNames->get_active_text() == "ACESp0") { wprim->set_active(toUnderlying(ColorManagementParams::Primaries::ACES_P0)); + } else if (wProfNames->get_active_text() == "JDCmax") { + wprim->set_active(toUnderlying(ColorManagementParams::Primaries::JDC_MAX)); } else if (wProfNames->get_active_text() == "BruceRGB") { wprim->set_active(toUnderlying(ColorManagementParams::Primaries::BRUCE_RGB)); } else if (wProfNames->get_active_text() == "Beta RGB") { @@ -788,6 +804,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) ConnectionBlocker wtrcconn_(wtrcconn); ConnectionBlocker willconn_(willconn); ConnectionBlocker wprimconn_(wprimconn); + trcExp->set_expanded(false); if (pp->icm.inputProfile.substr(0, 5) != "file:") { ipDialog->set_filename(" "); @@ -1082,6 +1099,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) case ColorManagementParams::Primaries::ACES_P1: case ColorManagementParams::Primaries::WIDE_GAMUT: case ColorManagementParams::Primaries::ACES_P0: + case ColorManagementParams::Primaries::JDC_MAX: case ColorManagementParams::Primaries::BRUCE_RGB: case ColorManagementParams::Primaries::BETA_RGB: case ColorManagementParams::Primaries::BEST_RGB: { @@ -1475,6 +1493,7 @@ void ICMPanel::wtrcinChanged() case ColorManagementParams::Primaries::ACES_P1: case ColorManagementParams::Primaries::WIDE_GAMUT: case ColorManagementParams::Primaries::ACES_P0: + case ColorManagementParams::Primaries::JDC_MAX: case ColorManagementParams::Primaries::BRUCE_RGB: case ColorManagementParams::Primaries::BETA_RGB: case ColorManagementParams::Primaries::BEST_RGB: { @@ -1507,7 +1526,7 @@ void ICMPanel::wtrcinChanged() void ICMPanel::willChanged() { - switch (ColorManagementParams::Primaries(wprim->get_active_row_number())) { + switch (ColorManagementParams::Primaries(wprim->get_active_row_number() )) { case ColorManagementParams::Primaries::DEFAULT: case ColorManagementParams::Primaries::SRGB: case ColorManagementParams::Primaries::ADOBE_RGB: @@ -1516,6 +1535,7 @@ void ICMPanel::willChanged() case ColorManagementParams::Primaries::ACES_P1: case ColorManagementParams::Primaries::WIDE_GAMUT: case ColorManagementParams::Primaries::ACES_P0: + case ColorManagementParams::Primaries::JDC_MAX: case ColorManagementParams::Primaries::BRUCE_RGB: case ColorManagementParams::Primaries::BETA_RGB: case ColorManagementParams::Primaries::BEST_RGB: { @@ -1630,6 +1650,17 @@ void ICMPanel::wprimChanged() break; } + case ColorManagementParams::Primaries::JDC_MAX: { + redx->setValue(0.734702); + redy->setValue(0.265302); + grex->setValue(0.021908); + grey->setValue(0.930288); + blux->setValue(0.120593); + bluy->setValue(0.001583); + will->set_active(toUnderlying(ColorManagementParams::Illuminant::D50)); + break; + } + case ColorManagementParams::Primaries::BRUCE_RGB: { redx->setValue(0.64); redy->setValue(0.33); @@ -1722,6 +1753,14 @@ void ICMPanel::wprimChanged() blux->setValue(0.0001); bluy->setValue(-0.077); will->set_active(toUnderlying(ColorManagementParams::Illuminant::D60)); + } else if (wProfNames->get_active_text() == "JDCmax") { + redx->setValue(0.734702); + redy->setValue(0.265302); + grex->setValue(0.021908); + grey->setValue(0.930288); + blux->setValue(0.120593); + bluy->setValue(0.001583); + will->set_active(toUnderlying(ColorManagementParams::Illuminant::D50)); } else if (wProfNames->get_active_text() == "BruceRGB") { redx->setValue(0.64); redy->setValue(0.33); @@ -1729,7 +1768,7 @@ void ICMPanel::wprimChanged() grey->setValue(0.65); blux->setValue(0.15); bluy->setValue(0.06); - will->set_active(toUnderlying(ColorManagementParams::Illuminant::D65)); + will->set_active(toUnderlying(ColorManagementParams::Illuminant::D65)); } else if (wProfNames->get_active_text() == "Beta RGB") { redx->setValue(0.6888); redy->setValue(0.3112); diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index 6c670c5e6..f41e17b7b 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -49,6 +49,7 @@ protected: Gtk::Frame* dcpFrame; Gtk::Frame* coipFrame; Gtk::Frame* redFrame; + MyExpander* trcExp; Adjuster* wGamma; Adjuster* wSlope; @@ -168,6 +169,7 @@ private: Glib::ustring camName; void updateDCP(int dcpIlluminant, Glib::ustring dcp_name); void updateRenderingIntent(const Glib::ustring &profile); + void foldAllButMe (GdkEventButton* event, MyExpander *expander); float nextrx; float nextry; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 8e8e999d3..e7725a005 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -703,6 +703,19 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited expreti.updateMinMax(cdma, cdmin, mini, maxi, Tmean, Tsigma, Tmin, Tmax); } + // Update Locallab Denoise tool lum/chro + if (pp->locallab.selspot < (int) denoiselc.size()) { + const double highres = denoiselc.at(pp->locallab.selspot).highres; + const double nres = denoiselc.at(pp->locallab.selspot).nres; + const double highres46 = denoiselc.at(pp->locallab.selspot).highres46; + const double nres46 = denoiselc.at(pp->locallab.selspot).nres46; + const double Lhighres = denoiselc.at(pp->locallab.selspot).Lhighres; + const double Lnres = denoiselc.at(pp->locallab.selspot).Lnres; + const double Lhighres46 = denoiselc.at(pp->locallab.selspot).Lhighres46; + const double Lnres46 = denoiselc.at(pp->locallab.selspot).Lnres46; + + expblur.updatedenlc(highres, nres, highres46, nres46, Lhighres, Lnres, Lhighres46, Lnres46); + } // Update default values according to selected spot setDefaults(pp, pedited); @@ -1094,6 +1107,28 @@ void Locallab::minmaxChanged(const std::vector &minmax, int } } +void Locallab::denChanged(const std::vector &denlc, int selspot) +{ + // Saving transmitted min/max data + denoiselc = denlc; + + //Update Locallab Denoise tool lum chro + if (selspot < (int) denoiselc.size()) { + const double highres = denoiselc.at(selspot).highres; + const double nres = denoiselc.at(selspot).nres; + const double highres46 = denoiselc.at(selspot).highres46; + const double nres46 = denoiselc.at(selspot).nres46; + const double Lhighres = denoiselc.at(selspot).Lhighres; + const double Lnres = denoiselc.at(selspot).Lnres; + const double Lhighres46 = denoiselc.at(selspot).Lhighres46; + const double Lnres46 = denoiselc.at(selspot).Lnres46; + + expblur.updatedenlc(highres, nres, highres46, nres46, Lhighres, Lnres, Lhighres46, Lnres46); + } + +} + + void Locallab::logencodChanged(const float blackev, const float whiteev, const float sourceg, const float sourceab, const float targetg, const bool autocomput, const bool autocie, const float jz1) { // Update Locallab Log Encoding and Ciecam accordingly diff --git a/rtgui/locallab.h b/rtgui/locallab.h index b0030bbe6..e39f213cc 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -123,6 +123,9 @@ private: // Locallab tools mask background management data std::vector retiMinMax; + // Locallab tools mask background management data + std::vector denoiselc; + // Locallab tools mask background management data std::vector maskBackRef; @@ -145,6 +148,10 @@ public: // Locallab Retinex tool min/man management function void minmaxChanged(const std::vector &minmax, int selspot) override; + //Locallab denoise + // Locallab Retinex tool min/man management function + void denChanged(const std::vector &denlc, int selspot) override; + // Locallab Log Encoding autocompute function void logencodChanged(const float blackev, const float whiteev, const float sourceg, const float sourceab, const float targetg, const bool autocomput, const bool autocie, const float jz1) override; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index c59dd233a..8bf88724c 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -3977,6 +3977,7 @@ LocallabShadow::LocallabShadow(): } ()), detailSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAILSH"), -5, 5, 1, 0))), + tePivot(Gtk::manage(new Adjuster(M("TP_LOCALLAB_TE_PIVOT"), -12, 12, 0.05, 0))), highlights(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), 0, 100, 1, 0))), h_tonalwidth(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_HLTONALW"), 10, 100, 1, 70))), shadows(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_SHADOWS"), 0, 100, 1, 0))), @@ -4017,7 +4018,8 @@ LocallabShadow::LocallabShadow(): LmaskSHshape(static_cast(mask2SHCurveEditorG->addCurve(CT_Diagonal, "L(L)"))), fatSHFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATSHFRA")))), fatamountSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATAMOUNT"), 1., 100., 1., 1.))), - fatanchorSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATANCHOR"), 1., 100., 1., 50., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))) + fatanchorSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATANCHOR"), 1., 100., 1., 50., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), + EvlocallabTePivot(ProcEventMapper::getInstance()->newEvent(AUTOEXP, "HISTORY_MSG_LOCALLAB_TE_PIVOT")) { set_orientation(Gtk::ORIENTATION_VERTICAL); @@ -4034,6 +4036,7 @@ LocallabShadow::LocallabShadow(): } detailSH->setAdjusterListener(this); + tePivot->setAdjusterListener(this); reparsh->setAdjusterListener(this); highlights->setAdjusterListener(this); @@ -4144,6 +4147,7 @@ LocallabShadow::LocallabShadow(): } pack_start(*detailSH); + pack_start(*tePivot); pack_start(*highlights); pack_start(*h_tonalwidth); pack_start(*shadows); @@ -4364,6 +4368,7 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para decays->setValue((double)spot.decays); detailSH->setValue((double)spot.detailSH); + tePivot->setValue(spot.tePivot); reparsh->setValue(spot.reparsh); highlights->setValue((double)spot.highlights); h_tonalwidth->setValue((double)spot.h_tonalwidth); @@ -4429,6 +4434,7 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p } spot.detailSH = detailSH->getIntValue(); + spot.tePivot = tePivot->getValue(); spot.reparsh = reparsh->getValue(); spot.highlights = highlights->getIntValue(); spot.h_tonalwidth = h_tonalwidth->getIntValue(); @@ -4477,6 +4483,7 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara } detailSH->setDefault((double)defSpot.detailSH); + tePivot->setDefault(defSpot.tePivot); reparsh->setDefault(defSpot.reparsh); highlights->setDefault((double)defSpot.highlights); h_tonalwidth->setDefault((double)defSpot.h_tonalwidth); @@ -4528,6 +4535,13 @@ void LocallabShadow::adjusterChanged(Adjuster* a, double newval) } } + if (a == tePivot) { + if (listener) { + listener->panelChanged(EvlocallabTePivot, + tePivot->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); + } + } + if (a == reparsh) { if (listener) { listener->panelChanged(Evlocallabreparsh, @@ -5044,6 +5058,7 @@ void LocallabShadow::updateShadowGUI2() gamFrame->hide(); detailSH->hide(); + tePivot->hide(); highlights->show(); h_tonalwidth->show(); shadows->show(); @@ -5059,6 +5074,7 @@ void LocallabShadow::updateShadowGUI2() } detailSH->show(); + tePivot->show(); highlights->hide(); h_tonalwidth->hide(); shadows->hide(); @@ -6477,8 +6493,17 @@ LocallabBlur::LocallabBlur(): activlum(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIV")))), expdenoise(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI_EXP")))), quamethod(Gtk::manage(new MyComboBoxText())), + expdenoisenl(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_NLFRA")))), + expdenoiselum(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOIWAVLUM")))), + expdenoisech(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOIWAVCH")))), LocalcurveEditorwavden(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVDEN"))), wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), + // lCLabels(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_LCLABELS")))), + lCLabels(Gtk::manage(new Gtk::Label("-----------------"))), + lumLabels(Gtk::manage(new Gtk::Label("---"))), + lum46Labels(Gtk::manage(new Gtk::Label("---"))), + chroLabels(Gtk::manage(new Gtk::Label("---"))), + chro46Labels(Gtk::manage(new Gtk::Label("---"))), expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), maskusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), maskunusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), @@ -6514,7 +6539,7 @@ LocallabBlur::LocallabBlur(): decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), invmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), - nlFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_NLFRA")))), + prevFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LCLABELS")))), nlstr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLLUM"), 0, 100, 1, 0))), nldet(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLDET"), 0, 100, 1, 50))), nlpat(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLPAT"), 1, 5, 1, 2))), @@ -6640,12 +6665,23 @@ LocallabBlur::LocallabBlur(): Gtk::Label* const quaLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DENQUA") + ":")); quaHBox->pack_start(*quaLabel, Gtk::PACK_SHRINK, 4); quaHBox->pack_start(*quamethod); + setExpandAlignProperties(expdenoisenl, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + setExpandAlignProperties(expdenoiselum, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + setExpandAlignProperties(expdenoisech, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); LocalcurveEditorwavden->setCurveListener(this); wavshapeden->setIdentityValue(0.); wavshapeden->setResetCurve(FlatCurveType(defSpot.locwavcurveden.at(0)), defSpot.locwavcurveden); + setExpandAlignProperties(lCLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + setExpandAlignProperties(lumLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + setExpandAlignProperties(lum46Labels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + + setExpandAlignProperties(chroLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + setExpandAlignProperties(chro46Labels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + + LocalcurveEditorwavden->curveListComplete(); setExpandAlignProperties(expdenoise1, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); @@ -6701,7 +6737,7 @@ LocallabBlur::LocallabBlur(): decayd->setAdjusterListener(this); bilateral->setAdjusterListener(this); - nlFrame->set_label_align(0.025, 0.5); + prevFrame->set_label_align(0.025, 0.5); nlstr->setAdjusterListener(this); nldet->setAdjusterListener(this); @@ -6838,15 +6874,39 @@ LocallabBlur::LocallabBlur(): Gtk::Frame* const wavFrame = Gtk::manage(new Gtk::Frame()); ToolParamBlock* const wavBox = Gtk::manage(new ToolParamBlock()); wavBox->pack_start(*quaHBox); - wavBox->pack_start(*LocalcurveEditorwavden, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + wavBox->pack_start(*sensiden); + wavBox->pack_start(*reparden); + ToolParamBlock* const prevBox = Gtk::manage(new ToolParamBlock()); + prevBox->pack_start(*lumLabels); + prevBox->pack_start(*lum46Labels); + prevBox->pack_start(*lCLabels); + prevBox->pack_start(*chroLabels); + prevBox->pack_start(*chro46Labels); + prevFrame->add(*prevBox); + wavBox->pack_start(*prevFrame); + + ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock()); + nlbox->pack_start(*nlstr); + nlbox->pack_start(*nldet); + nlbox->pack_start(*nlgam); + nlbox->pack_start(*nlpat); + nlbox->pack_start(*nlrad); + expdenoisenl->add(*nlbox); + + wavBox->pack_start(*expdenoisenl); + + // wavBox->pack_start(*noiselumf0); // wavBox->pack_start(*noiselumf); // wavBox->pack_start(*noiselumf2); // wavBox->pack_start(*noiselumc);//unused here, but used for normalize_mean_dt - wavBox->pack_start(*noiselumdetail); - wavBox->pack_start(*noiselequal); - wavBox->pack_start(*noisegam); - wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4); + ToolParamBlock* const wchBox = Gtk::manage(new ToolParamBlock()); + + wchBox->pack_start(*LocalcurveEditorwavden, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + wchBox->pack_start(*noiselumdetail); + wchBox->pack_start(*noiselequal); + wchBox->pack_start(*noisegam); + wchBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4); ToolParamBlock* const wavBox1 = Gtk::manage(new ToolParamBlock()); wavBox1->pack_start(*maskusable, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*maskunusable, Gtk::PACK_SHRINK, 0); @@ -6854,28 +6914,24 @@ LocallabBlur::LocallabBlur(): wavBox1->pack_start(*levelthrlow, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*levelthr, Gtk::PACK_SHRINK, 0); expdenoise1->add(*wavBox1, false); - wavBox->pack_start(*expdenoise1); + wchBox->pack_start(*expdenoise1); + expdenoiselum->add(*wchBox); + wavBox->pack_start(*expdenoiselum); + ToolParamBlock* const chBox = Gtk::manage(new ToolParamBlock()); + + chBox->pack_start(*noisechrof); + chBox->pack_start(*noisechroc); + chBox->pack_start(*noisechrodetail); + chBox->pack_start(*adjblur); + expdenoisech->add(*chBox); + wavBox->pack_start(*expdenoisech); + ToolParamBlock* const detailBox = Gtk::manage(new ToolParamBlock()); detailBox->pack_start(*detailthr); detailBox->pack_start(*usemask, Gtk::PACK_SHRINK, 0); detailFrame->add(*detailBox); wavBox->pack_start(*detailFrame); - denoisebox->pack_start(*sensiden); - denoisebox->pack_start(*reparden); - - ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock()); - nlbox->pack_start(*nlstr); - nlbox->pack_start(*nldet); - nlbox->pack_start(*nlgam); - nlbox->pack_start(*nlpat); - nlbox->pack_start(*nlrad); - nlFrame->add(*nlbox); - wavBox->pack_start(*nlFrame); - - wavBox->pack_start(*noisechrof); - wavBox->pack_start(*noisechroc); - wavBox->pack_start(*noisechrodetail); - wavBox->pack_start(*adjblur); + wavFrame->add(*wavBox); denoisebox->pack_start(*wavFrame); @@ -6978,6 +7034,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) expdenoise1->set_tooltip_markup(M("TP_LOCALLAB_MASKLC_TOOLTIP")); expdenoise2->set_tooltip_markup(M("TP_LOCALLAB_MASKGF_TOOLTIP")); expdenoise3->set_tooltip_markup(M("TP_LOCALLAB_MASKDE_TOOLTIP")); + expdenoisenl->set_tooltip_markup(M("TP_LOCALLAB_NLFRAME_TOOLTIP")); invmask->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP")); invmaskd->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP")); LocalcurveEditorwavden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); @@ -6990,7 +7047,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) detailthr->set_tooltip_text(M("TP_LOCALLAB_DENOITHR_TOOLTIP")); adjblur->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP")); bilateral->set_tooltip_text(M("TP_LOCALLAB_DENOIBILAT_TOOLTIP")); - nlFrame->set_tooltip_text(M("TP_LOCALLAB_NLFRAME_TOOLTIP")); + prevFrame->set_tooltip_text(M("TP_LOCALLAB_LCLABELS_TOOLTIP")); nlstr->set_tooltip_text(M("TP_LOCALLAB_NLDENOISE_TOOLTIP")); nldet->set_tooltip_text(M("TP_LOCALLAB_NLDENOISE_TOOLTIP")); nlpat->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP")); @@ -7025,6 +7082,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) higthresd->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP")); higthres->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRES_TOOLTIP")); decayd->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lCLabels->set_tooltip_text(M("TP_LOCALLAB_LCLABELS_TOOLTIP")); } else { expblnoise->set_tooltip_markup(""); @@ -7057,7 +7115,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) detailthr->set_tooltip_text(""); adjblur->set_tooltip_text(""); bilateral->set_tooltip_text(""); - nlFrame->set_tooltip_text(""); + prevFrame->set_tooltip_text(""); nlstr->set_tooltip_text(""); nldet->set_tooltip_text(""); nlpat->set_tooltip_text(""); @@ -7094,6 +7152,8 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) higthres->set_tooltip_text(""); // midthresd->set_tooltip_text(""); decayd->set_tooltip_text(""); + lCLabels->set_tooltip_text(""); + expdenoisenl->set_tooltip_markup(""); } } @@ -7138,7 +7198,36 @@ void LocallabBlur::neutral_pressed () } +void LocallabBlur::updatedenlc(const double highres, const double nres, const double highres46, const double nres46, const double Lhighres, const double Lnres, const double Lhighres46, const double Lnres46) +{ + idle_register.add( + [this, highres, nres, highres46, nres46, Lhighres, Lnres, Lhighres46, Lnres46]() -> bool { + GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected + lumLabels->set_text( + Glib::ustring::compose(M("TP_LOCALLAB_LUMLABEL"), + Glib::ustring::format(std::fixed, std::setprecision(0), Lnres), + Glib::ustring::format(std::fixed, std::setprecision(0), Lhighres)) + ); + lum46Labels->set_text( + Glib::ustring::compose(M("TP_LOCALLAB_LUM46LABEL"), + Glib::ustring::format(std::fixed, std::setprecision(0), Lnres46 ), + Glib::ustring::format(std::fixed, std::setprecision(0), Lhighres46)) + ); + chroLabels->set_text( + Glib::ustring::compose(M("TP_LOCALLAB_CHROLABEL"), + Glib::ustring::format(std::fixed, std::setprecision(0), nres), + Glib::ustring::format(std::fixed, std::setprecision(0), highres)) + ); + chro46Labels->set_text( + Glib::ustring::compose(M("TP_LOCALLAB_CHRO46LABEL"), + Glib::ustring::format(std::fixed, std::setprecision(0), nres46), + Glib::ustring::format(std::fixed, std::setprecision(0), highres46)) + ); + return false; + } + ); +} void LocallabBlur::setDefaultExpanderVisibility() { expblnoise->set_expanded(false); @@ -7147,6 +7236,9 @@ void LocallabBlur::setDefaultExpanderVisibility() expdenoise2->set_expanded(false); expdenoise3->set_expanded(false); expmaskbl->set_expanded(false); + expdenoisenl->set_expanded(false); + expdenoiselum->set_expanded(false); + expdenoisech->set_expanded(false); } void LocallabBlur::disableListener() diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index c4e54ca61..1664d1839 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -451,6 +451,7 @@ private: Adjuster* const reparsh; const std::array multipliersh; Adjuster* const detailSH; + Adjuster* const tePivot; Adjuster* const highlights; Adjuster* const h_tonalwidth; Adjuster* const shadows; @@ -492,6 +493,8 @@ private: Adjuster* const fatamountSH; Adjuster* const fatanchorSH; + rtengine::ProcEvent EvlocallabTePivot; + sigc::connection shMethodConn, inversshConn, showmaskSHMethodConn, showmaskSHMethodConninv, enaSHMaskConn; public: @@ -707,8 +710,17 @@ private: Gtk::CheckButton* const activlum; MyExpander* const expdenoise; MyComboBoxText* const quamethod; + MyExpander* const expdenoisenl; + MyExpander* const expdenoiselum; + MyExpander* const expdenoisech; CurveEditorGroup* const LocalcurveEditorwavden; FlatCurveEditor* const wavshapeden; + Gtk::Label* const lCLabels; + Gtk::Label* const lumLabels; + Gtk::Label* const lum46Labels; + Gtk::Label* const chroLabels; + Gtk::Label* const chro46Labels; + MyExpander* const expdenoise1; Gtk::Label* const maskusable; Gtk::Label* const maskunusable; @@ -746,7 +758,7 @@ private: Gtk::CheckButton* const invmaskd; Gtk::CheckButton* const invmask; - Gtk::Frame* const nlFrame; + Gtk::Frame* const prevFrame; Adjuster* const nlstr; Adjuster* const nldet; Adjuster* const nlpat; @@ -788,6 +800,8 @@ private: public: LocallabBlur(); ~LocallabBlur(); + void updatedenlc(const double highres, const double nres, const double highres46, const double nres46, const double Lhighres, const double Lnres, const double Lhighres46, const double Lnres46); + bool isMaskViewActive() override; void resetMaskView() override; diff --git a/rtgui/lockablecolorpicker.cc b/rtgui/lockablecolorpicker.cc index 0a08bb945..c87239b9c 100644 --- a/rtgui/lockablecolorpicker.cc +++ b/rtgui/lockablecolorpicker.cc @@ -20,15 +20,23 @@ #include "lockablecolorpicker.h" #include "options.h" #include "../rtengine/color.h" +#include "../rtengine/improcfun.h" #include "../rtengine/rt_math.h" #include "../rtengine/utils.h" #include "imagearea.h" #include "multilangmgr.h" #include "navigator.h" -LockableColorPicker::LockableColorPicker (CropWindow* cropWindow, Glib::ustring *oProfile, Glib::ustring *wProfile) +namespace +{ + +const rtengine::procparams::ColorManagementParams DEFAULT_CMP; + +} + +LockableColorPicker::LockableColorPicker (CropWindow* cropWindow, rtengine::procparams::ColorManagementParams *color_management_params) : cropWindow(cropWindow), displayedValues(ColorPickerType::RGB), position(0, 0), size(Size::S15), - outputProfile(oProfile), workingProfile(wProfile), validity(Validity::OUTSIDE), + color_management_params(color_management_params), validity(Validity::OUTSIDE), r(0.f), g(0.f), b(0.f), rpreview(0.f), gpreview(0.f), bpreview(0.f), hue(0.f), sat(0.f), val(0.f), L(0.f), a(0.f), bb(0.f) {} @@ -277,7 +285,16 @@ void LockableColorPicker::setRGB (const float R, const float G, const float B, c bpreview = previewB; rtengine::Color::rgb2hsv01(r, g, b, hue, sat, val); - rtengine::Color::rgb2lab01(*outputProfile, *workingProfile, r, g, b, L, a, bb, options.rtSettings.HistogramWorking); // TODO: Really sure this function works? + rtengine::ImProcFunctions::rgb2lab( + static_cast(255 * r), + static_cast(255 * g), + static_cast(255 * b), + L, a, bb, + color_management_params != nullptr ? *color_management_params : DEFAULT_CMP, + true); + L /= 327.68f; + a /= 327.68f; + bb /= 327.68f; if (validity != Validity::OUTSIDE) { setDirty(true); diff --git a/rtgui/lockablecolorpicker.h b/rtgui/lockablecolorpicker.h index baeea41ef..b18a56028 100644 --- a/rtgui/lockablecolorpicker.h +++ b/rtgui/lockablecolorpicker.h @@ -24,6 +24,18 @@ class CropWindow; +namespace rtengine +{ + +namespace procparams +{ + +class ColorManagementParams; + +} + +} + class LockablePickerToolListener { public: @@ -60,8 +72,7 @@ private: rtengine::Coord position; // Coordinate in image space rtengine::Coord anchorOffset; Size size; - Glib::ustring *outputProfile; - Glib::ustring *workingProfile; + rtengine::procparams::ColorManagementParams *color_management_params; Validity validity; float r, g, b; // red green blue in [0;1] range float rpreview, gpreview, bpreview; @@ -72,7 +83,7 @@ private: public: - LockableColorPicker (CropWindow* cropWindow, Glib::ustring *oProfile, Glib::ustring *wProfile); + LockableColorPicker (CropWindow* cropWindow, rtengine::procparams::ColorManagementParams *color_management_params); void draw (const Cairo::RefPtr &cr); diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 42f605fa2..042f57a00 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -21,18 +21,26 @@ #include "previewwindow.h" #include "toolpanel.h" #include "../rtengine/color.h" +#include "../rtengine/improcfun.h" #include "../rtengine/rt_math.h" #include "options.h" using namespace rtengine; +namespace +{ + +const rtengine::procparams::ColorManagementParams DEFAULT_CMP; + +} + Navigator::Navigator() : pointer_moved_delayed_call(50, 100), currentRGBUnit(options.navRGBUnit), currentHSVUnit(options.navHSVUnit) { pointer_moved_delayed_call.setFunction( - [this](bool validPos, Glib::ustring profile, Glib::ustring profileW, int x, int y, int r, int g, int b, bool isRaw) + [this](bool validPos, const rtengine::procparams::ColorManagementParams *cmp, int x, int y, int r, int g, int b, bool isRaw) { if (!validPos) { setInvalid (x, y); @@ -61,7 +69,16 @@ Navigator::Navigator() : S->set_text (s2); V->set_text (s3); - Color::rgb2lab01(profile, profileW, r / 255.f, g / 255.f, b / 255.f, LAB_l, LAB_a, LAB_b, options.rtSettings.HistogramWorking); // TODO: Really sure this function works? + ImProcFunctions::rgb2lab( + static_cast(r), + static_cast(g), + static_cast(b), + LAB_l, LAB_a, LAB_b, + cmp != nullptr ? *cmp : DEFAULT_CMP, + true); + LAB_l /= 327.68f; + LAB_a /= 327.68f; + LAB_b /= 327.68f; getLABText (LAB_l, LAB_a, LAB_b, s1, s2, s3); LAB_L->set_text (s1); LAB_A->set_text (s2); @@ -328,9 +345,9 @@ void Navigator::getLABText (float l, float a, float b, Glib::ustring &sL, Glib:: } // if !validPos then x/y contain the full image size -void Navigator::pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw) +void Navigator::pointerMoved (bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool isRaw) { - pointer_moved_delayed_call(validPos, profile, profileW, x, y, r, g, b, isRaw); + pointer_moved_delayed_call(validPos, &cmp, x, y, r, g, b, isRaw); } void Navigator::cycleUnitsRGB (GdkEventButton *event) { diff --git a/rtgui/navigator.h b/rtgui/navigator.h index 4c2a3fd32..c16bf7ac7 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -34,7 +34,7 @@ class Navigator final : typedef const double (*TMatrix)[3]; private: - DelayedCall pointer_moved_delayed_call; + DelayedCall pointer_moved_delayed_call; Options::NavigatorUnit currentRGBUnit; Options::NavigatorUnit currentHSVUnit; @@ -61,7 +61,7 @@ public: // pointermotionlistener interface // void pointerMoved (bool validPos, int x, int y, int r, int g, int b); - void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool raw = false) override; + void pointerMoved(bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool raw = false) override; void setInvalid (int fullWidth = -1, int fullHeight = -1); void getRGBText (int r, int g, int b, Glib::ustring &sR, Glib::ustring &sG, Glib::ustring &sB, bool isRaw = false) override; diff --git a/rtgui/options.cc b/rtgui/options.cc index a6eef90c8..dba790869 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -19,7 +19,11 @@ #include "options.h" #include #include +#include +#include #include +#include +#include #include #include #include "multilangmgr.h" @@ -627,7 +631,8 @@ void Options::setDefaults() rtSettings.fftwsigma = true; //choice between sigma^2 or empirical formula // end locallab rtSettings.itcwb_enable = true; - + rtSettings.itcwb_deltaspec = 0.075; + rtSettings.itcwb_powponder = 0.15;//max 0.2 //wavelet rtSettings.edghi = 3.0;//1.1 and 5. rtSettings.edglo = 0.5;//0.1 and 0.95 @@ -1818,6 +1823,16 @@ void Options::readFromFile(Glib::ustring fname) } + if (keyFile.has_key("Color Management", "Itcwb_deltaspec")) { + rtSettings.itcwb_deltaspec = keyFile.get_double("Color Management", "Itcwb_deltaspec"); + } + + + if (keyFile.has_key("Color Management", "Itcwb_powponder")) { + rtSettings.itcwb_powponder = keyFile.get_double("Color Management", "Itcwb_powponder"); + } + + //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"); @@ -2616,6 +2631,8 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_double("Color Management", "CBDLlevel0", rtSettings.level0_cbdl); keyFile.set_double("Color Management", "CBDLlevel123", rtSettings.level123_cbdl); keyFile.set_boolean("Color Management", "Itcwb_enable", rtSettings.itcwb_enable); + keyFile.set_double("Color Management", "Itcwb_deltaspec", rtSettings.itcwb_deltaspec); + keyFile.set_double("Color Management", "Itcwb_powponder", rtSettings.itcwb_powponder); //keyFile.set_double ("Color Management", "Colortoningab", rtSettings.colortoningab); //keyFile.set_double ("Color Management", "Decaction", rtSettings.decaction); diff --git a/rtgui/options.h b/rtgui/options.h index 78059357e..db44a5876 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -327,7 +327,7 @@ public: bool internalThumbIfUntouched; bool overwriteOutputFile; int complexity; - bool inspectorWindow; // open inspector in spearate window + bool inspectorWindow; // open inspector in separate window bool zoomOnScroll; // translate scroll events to zoom std::vector thumbnailZoomRatios; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6dc6ccaf4..7516d9a4a 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -267,15 +267,11 @@ void ParamsEdited::set(bool v) wb.equal = v; wb.tempBias = v; wb.observer = v; - wb.itcwb_thres = v; - wb.itcwb_precis = v; - wb.itcwb_size = v; - wb.itcwb_delta = v; - wb.itcwb_fgreen = v; + wb.itcwb_green = v; wb.itcwb_rgreen = v; wb.itcwb_nopurple = v; - wb.itcwb_sorted = v; - wb.itcwb_forceextra = v; + wb.itcwb_alg = v; + wb.itcwb_prim = v; wb.itcwb_sampling = v; //colorShift.a = v; //colorShift.b = v; @@ -328,6 +324,11 @@ void ParamsEdited::set(bool v) sh.stonalwidth = v; sh.radius = v; sh.lab = v; + toneEqualizer.enabled = v; + toneEqualizer.bands.fill(v); + toneEqualizer.regularization = v; + toneEqualizer.show_colormap = v; + toneEqualizer.pivot = v; crop.enabled = v; crop.x = v; crop.y = v; @@ -980,15 +981,11 @@ void ParamsEdited::initFrom(const std::vector& wb.temperature = wb.temperature && p.wb.temperature == other.wb.temperature; wb.tempBias = wb.tempBias && p.wb.tempBias == other.wb.tempBias; wb.observer = wb.observer && p.wb.observer == other.wb.observer; - wb.itcwb_thres = wb.itcwb_thres && p.wb.itcwb_thres == other.wb.itcwb_thres; - wb.itcwb_precis = wb.itcwb_precis && p.wb.itcwb_precis == other.wb.itcwb_precis; - wb.itcwb_size = wb.itcwb_size && p.wb.itcwb_size == other.wb.itcwb_size; - wb.itcwb_delta = wb.itcwb_delta && p.wb.itcwb_delta == other.wb.itcwb_delta; - wb.itcwb_fgreen = wb.itcwb_fgreen && p.wb.itcwb_fgreen == other.wb.itcwb_fgreen; + wb.itcwb_green = wb.itcwb_green && p.wb.itcwb_green == other.wb.itcwb_green; wb.itcwb_rgreen = wb.itcwb_rgreen && p.wb.itcwb_rgreen == other.wb.itcwb_rgreen; wb.itcwb_nopurple = wb.itcwb_nopurple && p.wb.itcwb_nopurple == other.wb.itcwb_nopurple; - wb.itcwb_sorted = wb.itcwb_sorted && p.wb.itcwb_sorted == other.wb.itcwb_sorted; - wb.itcwb_forceextra = wb.itcwb_forceextra && p.wb.itcwb_forceextra == other.wb.itcwb_forceextra; + wb.itcwb_alg = wb.itcwb_alg && p.wb.itcwb_alg == other.wb.itcwb_alg; + wb.itcwb_prim = wb.itcwb_prim && p.wb.itcwb_prim == other.wb.itcwb_prim; wb.itcwb_sampling = wb.itcwb_sampling && p.wb.itcwb_sampling == other.wb.itcwb_sampling; //colorShift.a = colorShift.a && p.colorShift.a == other.colorShift.a; //colorShift.b = colorShift.b && p.colorShift.b == other.colorShift.b; @@ -1055,6 +1052,13 @@ void ParamsEdited::initFrom(const std::vector& crop.ratio = crop.ratio && p.crop.ratio == other.crop.ratio; crop.orientation = crop.orientation && p.crop.orientation == other.crop.orientation; crop.guide = crop.guide && p.crop.guide == other.crop.guide; + toneEqualizer.enabled = toneEqualizer.enabled && p.toneEqualizer.enabled == other.toneEqualizer.enabled; + for (size_t i = 0; i < toneEqualizer.bands.size(); ++i) { + toneEqualizer.bands[i] = toneEqualizer.bands[i] && p.toneEqualizer.bands[i] == other.toneEqualizer.bands[i]; + } + toneEqualizer.regularization = toneEqualizer.regularization && p.toneEqualizer.regularization == other.toneEqualizer.regularization; + toneEqualizer.show_colormap = toneEqualizer.show_colormap && p.toneEqualizer.show_colormap == other.toneEqualizer.show_colormap; + toneEqualizer.pivot = toneEqualizer.pivot && p.toneEqualizer.pivot == other.toneEqualizer.pivot; coarse.rotate = coarse.rotate && p.coarse.rotate == other.coarse.rotate; coarse.hflip = coarse.hflip && p.coarse.hflip == other.coarse.hflip; coarse.vflip = coarse.vflip && p.coarse.vflip == other.coarse.vflip; @@ -1294,6 +1298,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).slomaskSH = locallab.spots.at(j).slomaskSH && pSpot.slomaskSH == otherSpot.slomaskSH; locallab.spots.at(j).lapmaskSH = locallab.spots.at(j).lapmaskSH && pSpot.lapmaskSH == otherSpot.lapmaskSH; locallab.spots.at(j).detailSH = locallab.spots.at(j).detailSH && pSpot.detailSH == otherSpot.detailSH; + locallab.spots.at(j).tePivot = locallab.spots.at(j).tePivot && pSpot.tePivot == otherSpot.tePivot; locallab.spots.at(j).reparsh = locallab.spots.at(j).reparsh && pSpot.reparsh == otherSpot.reparsh; locallab.spots.at(j).LmaskSHcurve = locallab.spots.at(j).LmaskSHcurve && pSpot.LmaskSHcurve == otherSpot.LmaskSHcurve; locallab.spots.at(j).fatamountSH = locallab.spots.at(j).fatamountSH && pSpot.fatamountSH == otherSpot.fatamountSH; @@ -2857,24 +2862,8 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.wb.observer = mods.wb.observer; } - if (wb.itcwb_thres) { - toEdit.wb.itcwb_thres = mods.wb.itcwb_thres; - } - - if (wb.itcwb_precis) { - toEdit.wb.itcwb_precis = mods.wb.itcwb_precis; - } - - if (wb.itcwb_size) { - toEdit.wb.itcwb_size = mods.wb.itcwb_size; - } - - if (wb.itcwb_delta) { - toEdit.wb.itcwb_delta = mods.wb.itcwb_delta; - } - - if (wb.itcwb_fgreen) { - toEdit.wb.itcwb_fgreen = mods.wb.itcwb_fgreen; + if (wb.itcwb_green) { + toEdit.wb.itcwb_green = mods.wb.itcwb_green; } if (wb.itcwb_rgreen) { @@ -2885,12 +2874,12 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.wb.itcwb_nopurple = mods.wb.itcwb_nopurple; } - if (wb.itcwb_sorted) { - toEdit.wb.itcwb_sorted = mods.wb.itcwb_sorted; + if (wb.itcwb_alg) { + toEdit.wb.itcwb_alg = mods.wb.itcwb_alg; } - if (wb.itcwb_forceextra) { - toEdit.wb.itcwb_forceextra = mods.wb.itcwb_forceextra; + if (wb.itcwb_prim) { + toEdit.wb.itcwb_prim = mods.wb.itcwb_prim; } if (wb.itcwb_sampling) { @@ -3265,6 +3254,37 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.sh.lab = mods.sh.lab; } + if (toneEqualizer.enabled) { + toEdit.toneEqualizer.enabled = mods.toneEqualizer.enabled; + } + + for (size_t i = 0; i < toneEqualizer.bands.size(); ++i) { + if (toneEqualizer.bands[i]) { + toEdit.toneEqualizer.bands[i] = + dontforceSet && options.baBehav[ADDSET_TONE_EQUALIZER_BANDS] + ? toEdit.toneEqualizer.bands[i] + mods.toneEqualizer.bands[i] + : mods.toneEqualizer.bands[i]; + } + } + + if (toneEqualizer.regularization) { + toEdit.toneEqualizer.regularization = + dontforceSet && options.baBehav[ADDSET_TONE_EQUALIZER_REGULARIZATION] + ? toEdit.toneEqualizer.regularization + mods.toneEqualizer.regularization + : mods.toneEqualizer.regularization; + } + + if (toneEqualizer.show_colormap) { + toEdit.toneEqualizer.show_colormap = mods.toneEqualizer.show_colormap; + } + + if (toneEqualizer.pivot) { + toEdit.toneEqualizer.pivot = + dontforceSet && options.baBehav[ADDSET_TONE_EQUALIZER_PIVOT] + ? toEdit.toneEqualizer.pivot + mods.toneEqualizer.pivot + : mods.toneEqualizer.pivot; + } + if (crop.enabled) { toEdit.crop.enabled = mods.crop.enabled; } @@ -4207,6 +4227,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).detailSH = mods.locallab.spots.at(i).detailSH; } + if (locallab.spots.at(i).tePivot) { + toEdit.locallab.spots.at(i).tePivot = mods.locallab.spots.at(i).tePivot; + } + if (locallab.spots.at(i).reparsh) { toEdit.locallab.spots.at(i).reparsh = mods.locallab.spots.at(i).reparsh; } @@ -7660,6 +7684,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : slomaskSH(v), lapmaskSH(v), detailSH(v), + tePivot(v), reparsh(v), LmaskSHcurve(v), fatamountSH(v), @@ -8355,6 +8380,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) slomaskSH = v; lapmaskSH = v; detailSH = v; + tePivot = v; reparsh = v; LmaskSHcurve = v; fatamountSH = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 4df838194..7013da788 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -18,6 +18,7 @@ */ #pragma once +#include #include namespace rtengine @@ -248,16 +249,12 @@ struct WBParamsEdited { bool equal; bool observer; bool tempBias; - bool itcwb_thres; - bool itcwb_precis; - bool itcwb_size; - bool itcwb_delta; - bool itcwb_fgreen; bool itcwb_rgreen; bool itcwb_nopurple; - bool itcwb_sorted; - bool itcwb_forceextra; + bool itcwb_alg; + bool itcwb_prim; bool itcwb_sampling; + bool itcwb_green; }; @@ -370,6 +367,14 @@ struct SHParamsEdited { bool lab; }; +struct ToneEqualizerParamsEdited { + bool enabled; + std::array bands; + bool regularization; + bool show_colormap; + bool pivot; +}; + struct CropParamsEdited { bool enabled; bool x; @@ -591,6 +596,7 @@ public: bool slomaskSH; bool lapmaskSH; bool detailSH; + bool tePivot; bool reparsh; bool LmaskSHcurve; bool fatamountSH; @@ -1559,6 +1565,7 @@ struct ParamsEdited { FattalToneMappingParamsEdited fattal; ImpulseDenoiseParamsEdited impulseDenoise; SHParamsEdited sh; + ToneEqualizerParamsEdited toneEqualizer; CropParamsEdited crop; CoarseTransformParamsEdited coarse; CommonTransformParamsEdited commonTrans; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 81847adc0..3f03d81f6 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -219,6 +219,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren wb = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_WHITEBALANCE"))); exposure = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EXPOSURE"))); sh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHADOWSHIGHLIGHTS"))); + toneEqualizer = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_TONE_EQUALIZER"))); epd = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EPD"))); fattal = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_TM_FATTAL"))); pcvignette = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PCVIGNETTE"))); @@ -332,6 +333,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren vboxes[0]->pack_start (*wb, Gtk::PACK_SHRINK, 2); vboxes[0]->pack_start (*exposure, Gtk::PACK_SHRINK, 2); vboxes[0]->pack_start (*sh, Gtk::PACK_SHRINK, 2); + vboxes[0]->pack_start (*toneEqualizer, Gtk::PACK_SHRINK, 2); vboxes[0]->pack_start (*epd, Gtk::PACK_SHRINK, 2); vboxes[0]->pack_start (*fattal, Gtk::PACK_SHRINK, 2); vboxes[0]->pack_start (*pcvignette, Gtk::PACK_SHRINK, 2); @@ -498,6 +500,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren wbConn = wb->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); exposureConn = exposure->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); shConn = sh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); + toneEqualizerConn = toneEqualizer->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); epdConn = epd->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); fattalConn = fattal->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); pcvignetteConn = pcvignette->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); @@ -706,6 +709,7 @@ void PartialPasteDlg::basicToggled () ConnectionBlocker wbBlocker(wbConn); ConnectionBlocker exposureBlocker(exposureConn); ConnectionBlocker shBlocker(shConn); + ConnectionBlocker toneEqualizerBlocker(toneEqualizerConn); ConnectionBlocker epdBlocker(epdConn); ConnectionBlocker fattalBlocker(fattalConn); ConnectionBlocker pcvignetteBlocker(pcvignetteConn); @@ -717,6 +721,7 @@ void PartialPasteDlg::basicToggled () wb->set_active (basic->get_active ()); exposure->set_active (basic->get_active ()); sh->set_active (basic->get_active ()); + toneEqualizer->set_active (basic->get_active ()); epd->set_active (basic->get_active ()); fattal->set_active (basic->get_active ()); pcvignette->set_active (basic->get_active ()); @@ -894,6 +899,10 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param filterPE.sh = falsePE.sh; } + if (!toneEqualizer->get_active ()) { + filterPE.toneEqualizer = falsePE.toneEqualizer; + } + if (!epd->get_active ()) { filterPE.epd = falsePE.epd; } diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index dcf44bb72..1dee55a6e 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -133,6 +133,7 @@ public: Gtk::CheckButton* exposure; Gtk::CheckButton* localcontrast; Gtk::CheckButton* sh; + Gtk::CheckButton* toneEqualizer; Gtk::CheckButton* epd; Gtk::CheckButton* fattal; Gtk::CheckButton* retinex; @@ -226,6 +227,7 @@ public: sigc::connection everythingConn, basicConn, detailConn, colorConn, lensConn, compositionConn, metaConn, rawConn, advancedConn; sigc::connection locallabConn; sigc::connection wbConn, exposureConn, localcontrastConn, shConn, pcvignetteConn, gradientConn, labcurveConn, colorappearanceConn; + sigc::connection toneEqualizerConn; sigc::connection spotConn, sharpenConn, gradsharpenConn, microcontrastConn, impdenConn, dirpyrdenConn, defringeConn, epdConn, fattalConn, dirpyreqConn, waveletConn, retinexConn, dehazeConn; sigc::connection vibranceConn, chmixerConn, hsveqConn, rgbcurvesConn, chmixerbwConn, colortoningConn, filmSimulationConn, softlightConn; sigc::connection distortionConn, cacorrConn, vignettingConn, lcpConn; diff --git a/rtgui/pointermotionlistener.h b/rtgui/pointermotionlistener.h index 26ca994b0..f9fda419c 100644 --- a/rtgui/pointermotionlistener.h +++ b/rtgui/pointermotionlistener.h @@ -18,6 +18,23 @@ */ #pragma once +#include +#include + + +namespace rtengine +{ + +namespace procparams +{ + +class ColorManagementParams; + +} + +} + + class PointerMotionListener { protected: @@ -26,7 +43,7 @@ protected: public: virtual ~PointerMotionListener() = default; - virtual void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false) = 0; + virtual void pointerMoved(bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool isRaw = false) = 0; virtual void getRGBText (int r, int g, int b, Glib::ustring &sR, Glib::ustring &sG, Glib::ustring &sB, bool isRaw = false) { sR = "--"; sG = "--"; sB = "--"; } virtual void getHSVText (float h, float s, float v, Glib::ustring &sH, Glib::ustring &sS, Glib::ustring &sV) { sH = "--"; sS = "--"; sV = "--"; } virtual void getLABText (float l, float a, float b, Glib::ustring &sL, Glib::ustring &sA, Glib::ustring &sB) { sL = "--"; sA = "--"; sB = "--"; } diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 34fd69da8..8fc3dcb74 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -232,6 +232,12 @@ Gtk::Widget* Preferences::getBatchProcPanel() appendBehavList(mi, M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), ADDSET_SH_HIGHLIGHTS, false); appendBehavList(mi, M("TP_SHADOWSHLIGHTS_SHADOWS"), ADDSET_SH_SHADOWS, false); + mi = behModel->append(); + mi->set_value(behavColumns.label, M("TP_TONE_EQUALIZER_LABEL")); + appendBehavList(mi, M("TP_TONE_EQUALIZER_BANDS"), ADDSET_TONE_EQUALIZER_BANDS, false); + appendBehavList(mi, M("TP_TONE_EQUALIZER_PIVOT"), ADDSET_TONE_EQUALIZER_PIVOT, false); + appendBehavList(mi, M("TP_TONE_EQUALIZER_DETAIL"), ADDSET_TONE_EQUALIZER_REGULARIZATION, false); + mi = behModel->append(); mi->set_value(behavColumns.label, M("TP_LABCURVE_LABEL")); appendBehavList(mi, M("TP_LABCURVE_BRIGHTNESS"), ADDSET_LC_BRIGHTNESS, false); @@ -980,6 +986,23 @@ Gtk::Widget* Preferences::getColorManPanel () vbColorMan->pack_start (*fcie, Gtk::PACK_SHRINK); + //------------White-Balance auto temperature correlation + + Gtk::Frame* fwbacorr = Gtk::manage(new Gtk::Frame(M("PREFERENCES_WBACORR"))); + fwbacorr->set_tooltip_text(M("PREFERENCES_WBACORR_TOOLTIP")); + fwbacorr->set_label_align(0.025, 0.5); + Gtk::Box* wbaVB = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); + Gtk::Box* wbah = Gtk::manage ( new Gtk::Box () ); + wbah->set_spacing (4); + + mwbaena = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_WBAENA"))); + setExpandAlignProperties(mwbaena, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + mwbaena->set_active(true); + wbah->pack_start(*mwbaena, Gtk::PACK_SHRINK, 0); + wbaVB->add(*wbah); + + fwbacorr->add (*wbaVB); + vbColorMan->pack_start (*fwbacorr, Gtk::PACK_SHRINK); //------------- swColorMan->add(*vbColorMan); @@ -1850,6 +1873,7 @@ void Preferences::storePreferences() moptions.rtSettings.monitorBPC = monBPC->get_active(); moptions.rtSettings.autoMonitorProfile = cbAutoMonProfile->get_active(); moptions.rtSettings.autocielab = mcie->get_active(); + moptions.rtSettings.itcwb_enable = mwbaena->get_active(); #endif @@ -2012,6 +2036,7 @@ void Preferences::fillPreferences() monBPC->set_active(moptions.rtSettings.monitorBPC); mcie->set_active(moptions.rtSettings.autocielab); + mwbaena->set_active(moptions.rtSettings.itcwb_enable); cbAutoMonProfile->set_active(moptions.rtSettings.autoMonitorProfile); #endif diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 2ed7889ab..ea930bfef 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -137,9 +137,11 @@ class Preferences final : Gtk::CheckButton* cbdaubech; Gtk::SpinButton* hlThresh; Gtk::SpinButton* shThresh; -// Gtk::CheckButton* mwbacorr; + Gtk::CheckButton* mwbacorr; // Gtk::CheckButton* mwbaforc; // Gtk::CheckButton* mwbanopurp; + Gtk::CheckButton* mwbaena; +// Gtk::CheckButton* mwbaenacustom; // Gtk::CheckButton* mwbasort; // Gtk::SpinButton* wbacorrnb; diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 8ce9055d0..1acf23649 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -288,6 +288,12 @@ void ProfilePanel::save_clicked (GdkEventButton* event) toSave = entry ? ProfileStore::getInstance()->getProfile(entry) : nullptr; } + // If no entry has been selected or anything unpredictable happened, toSave + // can be nullptr. + if (toSave == nullptr) { + return; + } + // If it's a partial profile, it's more intuitive to first allow the user // to choose which parameters to save before showing the Save As dialog // #5491 @@ -336,50 +342,70 @@ void ProfilePanel::save_clicked (GdkEventButton* event) filter_any->add_pattern("*"); dialog.add_filter(filter_any); - bool done = true; + while (true) { - do { - if (dialog.run() == Gtk::RESPONSE_OK) { + // Run the saving dialog and let the user select a path and filename. + const auto response = dialog.run(); - std::string fname = dialog.get_filename(); + if (response != Gtk::RESPONSE_OK) { + // Just exit the loop, cause the user cancels the dialog. + + break; + } else { + // Go on with saving the the profile. + + auto fname = dialog.get_filename(); if (("." + getExtension(fname)) != paramFileExtension) { fname += paramFileExtension; } if (!confirmOverwrite(dialog, fname)) { + + // The user doesn't want to override the existing file. So, just restart the loop, + // so the user can select a different path or file name. continue; } lastFilename = Glib::path_get_basename(fname); - if (toSave) { - int retCode; + auto retCode = -1; - if (isPartial) { - // Build partial profile - PartialProfile ppTemp(true); - partialProfileDlg->applyPaste(ppTemp.pparams, ppTemp.pedited, toSave->pparams, nullptr); - // Save partial profile - retCode = ppTemp.pparams->save(fname, "", true, ppTemp.pedited); - // Cleanup - ppTemp.deleteInstance(); - } else { - // Save full profile - retCode = toSave->pparams->save(fname); - } + if (isPartial) { + // Build partial profile + PartialProfile ppTemp(true); + partialProfileDlg->applyPaste(ppTemp.pparams, ppTemp.pedited, toSave->pparams, nullptr); + + // Save partial profile + retCode = ppTemp.pparams->save(fname, "", true, ppTemp.pedited); + + // Cleanup + ppTemp.deleteInstance(); + } else { + // Save full profile + retCode = toSave->pparams->save(fname); + } - if (!retCode) { - const auto ccPrevState = changeconn.block(true); - ProfileStore::getInstance()->parseProfiles(); - changeconn.block(ccPrevState); - } else { - done = false; - writeFailed(dialog, fname); - } + if (retCode == 0) { + // Saving the profile was successfull. + + const auto ccPrevState = changeconn.block(true); + ProfileStore::getInstance()->parseProfiles(); + changeconn.block(ccPrevState); + + // Because saving has been successfull, just leave the loop; + break; + } else { + // Saving the profile was not successfull. + + writeFailed(dialog, fname); + + // In case the saving process was not successfull (missing permissions, ...) + // reopen the dialog and try again. + continue; } } - } while (!done); + } } /* diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index d588d6aa5..dcfc2f05c 100755 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -241,6 +241,7 @@ RTWindow::RTWindow () RTImage::init(); WhiteBalance::init(); MyExpander::init(); + FileBrowserEntry::init(); #ifndef WIN32 const std::vector> appIcons = { diff --git a/rtgui/threadutils.cc b/rtgui/threadutils.cc index 025abf300..9bc9cf35d 100644 --- a/rtgui/threadutils.cc +++ b/rtgui/threadutils.cc @@ -27,6 +27,8 @@ #if STRICT_MUTEX && !NDEBUG +MyMutex::MyMutex() : locked(false) {} + void MyMutex::checkLock () { if (locked) { @@ -61,13 +63,18 @@ void MyMutex::checkUnlock () #if !TRACE_MYRWMUTEX +MyRWMutex::MyRWMutex() : + writerCount(0), + readerCount(0) +{} + void MyReaderLock::acquire () { if (locked) { return; } - Glib::Threads::Mutex::Lock lock (mutex.mutex); + std::unique_lock lock (mutex.mutex); if (mutex.writerCount == 0) { // There's no writer operating, we can increment the writer count which will lock writers. @@ -76,7 +83,7 @@ void MyReaderLock::acquire () // The writer count is non null, but a reader can be the owner of the writer lock, // which will be the case if the reader count is not zero too. while (mutex.writerCount != 0) { - mutex.cond.wait(mutex.mutex); + mutex.cond.wait (lock); } // Then, we can increment the writer count. @@ -95,7 +102,7 @@ void MyReaderLock::release () return; } - Glib::Threads::Mutex::Lock lock (mutex.mutex); + std::unique_lock lock (mutex.mutex); // decrement the writer number first... --mutex.readerCount; @@ -105,7 +112,7 @@ void MyReaderLock::release () --mutex.writerCount; // ...and signal the next waiting reader/writer that it's free - mutex.cond.broadcast (); + mutex.cond.notify_all (); } locked = false; @@ -117,11 +124,11 @@ void MyWriterLock::acquire () return; } - Glib::Threads::Mutex::Lock lock (mutex.mutex); + std::unique_lock lock (mutex.mutex); // The writer count is not zero, so we have to wait for it to be zero again... while (mutex.writerCount != 0) { - mutex.cond.wait (mutex.mutex); + mutex.cond.wait (lock); } // ...then we can increment the writer count. @@ -136,12 +143,12 @@ void MyWriterLock::release () return; } - Glib::Threads::Mutex::Lock lock (mutex.mutex); + std::unique_lock lock (mutex.mutex); // Decrement the writer number first... if (--mutex.writerCount == 0) { - // ...and if the writer count is zero again, we can wake up the next writer or reader. - mutex.cond.broadcast (); + // ...and if the writer count is zero again, we wake up all of the waiting writer or reader. + mutex.cond.notify_all (); } locked = false; @@ -154,13 +161,20 @@ namespace std::ostream& trace (const char* file, int line) { - const auto currentThread = Glib::Threads::Thread::self (); + const auto currentThread = std::this_thread::get_id(); return std::cout << currentThread << ":" << file << ":" << line << ": "; } } +MyRWMutex::MyRWMutex() : + lastWriterFile(nullptr), + lastWriterLine(0), + writerCount(0), + readerCount(0) +{} + void MyReaderLock::acquire (const char* file, int line) { if (locked) { @@ -170,7 +184,7 @@ void MyReaderLock::acquire (const char* file, int line) trace (file, line) << "Acquiring MyReaderLock..." << std::endl; - Glib::Threads::Mutex::Lock lock (mutex.mutex); + std::unique_lock lock (mutex.mutex); if (mutex.writerCount == 0) { // There's no writer operating, we can increment the writer count which will lock writers. @@ -184,13 +198,13 @@ void MyReaderLock::acquire (const char* file, int line) << "\tLast writer file: " << mutex.lastWriterFile << std::endl << "\tLast writer line: " << mutex.lastWriterLine << std::endl; - mutex.cond.wait(mutex.mutex); + mutex.cond.wait (lock); } // Then, we can increment the writer count. ++mutex.writerCount; - mutex.ownerThread = Glib::Threads::Thread::self (); + mutex.ownerThread = std::this_thread::get_id (); mutex.lastWriterFile = file; mutex.lastWriterLine = line; } @@ -211,7 +225,7 @@ void MyReaderLock::release (const char* file, int line) trace (file, line) << "Releasing MyReaderLock..." << std::endl; - Glib::Threads::Mutex::Lock lock (mutex.mutex); + std::unique_lock lock (mutex.mutex); // decrement the writer number first... --mutex.readerCount; @@ -221,9 +235,9 @@ void MyReaderLock::release (const char* file, int line) --mutex.writerCount; // ...and signal the next waiting reader/writer that it's free - mutex.cond.broadcast (); + mutex.cond.notify_all (); - mutex.ownerThread = nullptr; + mutex.ownerThread = std::thread::id(); mutex.lastWriterFile = ""; mutex.lastWriterLine = 0; } @@ -241,7 +255,7 @@ void MyWriterLock::acquire (const char* file, int line) trace (file, line) << "Acquiring MyWriterLock..." << std::endl; - Glib::Threads::Mutex::Lock lock (mutex.mutex); + std::unique_lock lock (mutex.mutex); // The writer count is not zero, so we have to wait for it to be zero again... while (mutex.writerCount != 0) { @@ -250,13 +264,13 @@ void MyWriterLock::acquire (const char* file, int line) << "\tLast writer file: " << mutex.lastWriterFile << std::endl << "\tLast writer line: " << mutex.lastWriterLine << std::endl; - mutex.cond.wait (mutex.mutex); + mutex.cond.wait (lock); } // ...then we can increment the writer count. ++mutex.writerCount; - mutex.ownerThread = Glib::Threads::Thread::self (); + mutex.ownerThread = std::this_thread::get_id (); mutex.lastWriterFile = file; mutex.lastWriterLine = line; @@ -273,14 +287,14 @@ void MyWriterLock::release (const char* file, int line) trace (file, line) << "Releasing MyWriterLock..." << std::endl; - Glib::Threads::Mutex::Lock lock (mutex.mutex); + std::unique_lock lock (mutex.mutex); // Decrement the writer number first... if (--mutex.writerCount == 0) { - // ...and if the writer count is zero again, we can wake up the next writer or reader. - mutex.cond.broadcast (); + // ...and if the writer count is zero again, we wake up all of the waiting writer or reader. + mutex.cond.notify_all (); - mutex.ownerThread = nullptr; + mutex.ownerThread = std::thread::id(); mutex.lastWriterFile = ""; mutex.lastWriterLine = 0; } diff --git a/rtgui/threadutils.h b/rtgui/threadutils.h index eae4a9ad2..401660b93 100644 --- a/rtgui/threadutils.h +++ b/rtgui/threadutils.h @@ -24,14 +24,15 @@ //#undef STRICT_MUTEX //#define STRICT_MUTEX 1 -#include - +#include +#include +#include #include "../rtengine/noncopyable.h" #if STRICT_MUTEX && NDEBUG -using MyMutexBase = Glib::Threads::Mutex; +using MyMutexBase = std::mutex; #else -using MyMutexBase = Glib::Threads::RecMutex; +using MyMutexBase = std::recursive_mutex; #endif /** @@ -54,8 +55,10 @@ public: void unlock (); #if STRICT_MUTEX && !NDEBUG + MyMutex(); + private: - bool locked = false; + bool locked; void checkLock (); void checkUnlock (); #endif @@ -66,8 +69,6 @@ class MyMutex::MyLock : { public: explicit MyLock (MyMutex& mutex); - MyLock (MyMutex& mutex, Glib::Threads::NotLock); - MyLock (MyMutex& mutex, Glib::Threads::TryLock); ~MyLock (); @@ -90,18 +91,20 @@ public: friend class MyReaderLock; friend class MyWriterLock; + MyRWMutex(); + private: - Glib::Threads::Mutex mutex; - Glib::Threads::Cond cond; - - std::size_t writerCount = 0; - std::size_t readerCount = 0; - #if TRACE_MYRWMUTEX - Glib::Threads::Thread* ownerThread = nullptr; - const char* lastWriterFile = ""; - int lastWriterLine = 0; + std::thread::id ownerThread; + const char* lastWriterFile; + int lastWriterLine; #endif + + std::mutex mutex; + std::condition_variable cond; + + std::size_t writerCount; + std::size_t readerCount; }; /** @@ -167,7 +170,7 @@ inline void MyMutex::lock () inline bool MyMutex::trylock () { - if (MyMutexBase::trylock ()) { + if (MyMutexBase::try_lock ()) { #if STRICT_MUTEX && !NDEBUG checkLock (); #endif @@ -194,18 +197,6 @@ inline MyMutex::MyLock::MyLock (MyMutex& mutex) mutex.lock(); } -inline MyMutex::MyLock::MyLock (MyMutex& mutex, Glib::Threads::NotLock) - : mutex (mutex) - , locked (false) -{ -} - -inline MyMutex::MyLock::MyLock (MyMutex& mutex, Glib::Threads::TryLock) - : mutex (mutex) - , locked (mutex.trylock ()) -{ -} - inline MyMutex::MyLock::~MyLock () { if (locked) { diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index 8f3499c2a..f697d6648 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -781,6 +781,11 @@ void ThumbBrowserBase::arrangeFiles(ThumbBrowserEntryBase* entry) for (int i = 0; ct < fd.size() && i < numOfCols; ++i, ++ct) { for (; ct < fd.size() && fd[ct]->filtered; ++ct) { + // Thumbs that are not going be drawn should also have a minimum height and width. Cause + // the properties might be used in other parts of the code. The position is just set to be + // zero as a default. + fd[ct]->setPosition(0, 0, colWidths[i], rowHeight); + fd[ct]->drawable = false; } diff --git a/rtgui/thumbimageupdater.cc b/rtgui/thumbimageupdater.cc index 540ad625e..d196fdca5 100644 --- a/rtgui/thumbimageupdater.cc +++ b/rtgui/thumbimageupdater.cc @@ -85,9 +85,9 @@ public: Glib::ThreadPool* threadPool_; - // Need to be a Glib::Threads::Mutex because used in a Glib::Threads::Cond object... + // Need to be a std::mutex because used in a std::condition_variable object... // This is the only exceptions along with GThreadMutex (guiutils.cc), MyMutex is used everywhere else - Glib::Threads::Mutex mutex_; + std::mutex mutex_; JobList jobs_; @@ -95,7 +95,7 @@ public: bool inactive_waiting_; - Glib::Threads::Cond inactive_; + std::condition_variable inactive_; void processNextJob() @@ -103,7 +103,7 @@ public: Job j; { - Glib::Threads::Mutex::Lock lock(mutex_); + std::lock_guard lock(mutex_); // nothing to do; could be jobs have been removed if ( jobs_.empty() ) { @@ -166,10 +166,10 @@ public: } if ( --active_ == 0 ) { - Glib::Threads::Mutex::Lock lock(mutex_); + std::lock_guard lock(mutex_); if (inactive_waiting_) { inactive_waiting_ = false; - inactive_.broadcast(); + inactive_.notify_all(); } } } @@ -198,7 +198,7 @@ void ThumbImageUpdater::add(ThumbBrowserEntryBase* tbe, bool* priority, bool upg return; } - Glib::Threads::Mutex::Lock lock(impl_->mutex_); + std::lock_guard lock(impl_->mutex_); // look up if an older version is in the queue Impl::JobList::iterator i(impl_->jobs_.begin()); @@ -230,7 +230,7 @@ void ThumbImageUpdater::removeJobs(ThumbImageUpdateListener* listener) DEBUG("removeJobs(%p)", listener); { - Glib::Threads::Mutex::Lock lock(impl_->mutex_); + std::lock_guard lock(impl_->mutex_); for( Impl::JobList::iterator i(impl_->jobs_.begin()); i != impl_->jobs_.end(); ) { if (i->listener_ == listener) { @@ -246,9 +246,9 @@ void ThumbImageUpdater::removeJobs(ThumbImageUpdateListener* listener) while ( impl_->active_ != 0 ) { DEBUG("waiting for running jobs1"); { - Glib::Threads::Mutex::Lock lock(impl_->mutex_); + std::unique_lock lock(impl_->mutex_); impl_->inactive_waiting_ = true; - impl_->inactive_.wait(impl_->mutex_); + impl_->inactive_.wait(lock); } } } @@ -258,7 +258,7 @@ void ThumbImageUpdater::removeAllJobs() DEBUG("stop"); { - Glib::Threads::Mutex::Lock lock(impl_->mutex_); + std::lock_guard lock(impl_->mutex_); impl_->jobs_.clear(); } @@ -266,9 +266,9 @@ void ThumbImageUpdater::removeAllJobs() while ( impl_->active_ != 0 ) { DEBUG("waiting for running jobs2"); { - Glib::Threads::Mutex::Lock lock(impl_->mutex_); + std::unique_lock lock(impl_->mutex_); impl_->inactive_waiting_ = true; - impl_->inactive_.wait(impl_->mutex_); + impl_->inactive_.wait(lock); } } } diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index a2941aaa5..207b412bf 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -516,6 +516,7 @@ void Thumbnail::setProcParams (const ProcParams& pp, ParamsEdited* pe, int whoCh || pparams->epd != pp.epd || pparams->fattal != pp.fattal || pparams->sh != pp.sh + || pparams->toneEqualizer != pp.toneEqualizer || pparams->crop != pp.crop || pparams->coarse != pp.coarse || pparams->commonTrans != pp.commonTrans diff --git a/rtgui/toneequalizer.cc b/rtgui/toneequalizer.cc new file mode 100644 index 000000000..d524bdc05 --- /dev/null +++ b/rtgui/toneequalizer.cc @@ -0,0 +1,237 @@ +/* + * Adapted from ART. + * + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include "eventmapper.h" +#include "toneequalizer.h" +#include "rtimage.h" + +using namespace rtengine; +using namespace rtengine::procparams; + +const Glib::ustring ToneEqualizer::TOOL_NAME = "toneequalizer"; + +ToneEqualizer::ToneEqualizer(): FoldableToolPanel(this, TOOL_NAME, M("TP_TONE_EQUALIZER_LABEL"), false, true) +{ + auto m = ProcEventMapper::getInstance(); + EvEnabled = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_ENABLED"); + EvBands = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_BANDS"); + EvRegularization = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_REGULARIZATION"); + EvColormap = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_SHOW_COLOR_MAP"); + EvPivot = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_PIVOT"); + + std::array images = { + "purple", + "blue", + "gray", + "yellow", + "red" + }; + for (size_t i = 0; i < bands.size(); ++i) { + bands[i] = Gtk::manage(new Adjuster(M("TP_TONE_EQUALIZER_BAND_" + std::to_string(i)), -100, 100, 1, 0, Gtk::manage(new RTImage(Glib::ustring("circle-") + images[i] + "-small.png")))); + bands[i]->setAdjusterListener(this); + pack_start(*bands[i]); + bands[i]->showIcons(false); + } + + pivot = Gtk::manage(new Adjuster(M("TP_TONE_EQUALIZER_PIVOT"), -12, 12, 0.05, 0)); + pivot->setLogScale(64, 0, true); + pivot->setAdjusterListener(this); + pack_start(*pivot); + + pack_start(*Gtk::manage(new Gtk::HSeparator())); + regularization = Gtk::manage(new Adjuster(M("TP_TONE_EQUALIZER_DETAIL"), -5, 5, 1, 0)); + regularization->setAdjusterListener(this); + pack_start(*regularization); + + show_colormap = Gtk::manage(new CheckBox(M("TP_TONE_EQUALIZER_SHOW_COLOR_MAP"), multiImage)); + pack_start(*show_colormap); + show_colormap->setCheckBoxListener(this); + + show_all_children (); +} + + +void ToneEqualizer::read(const ProcParams *pp, const ParamsEdited* pedited) +{ + disableListener(); + + if (pedited) { + set_inconsistent(multiImage && !pedited->toneEqualizer.enabled); + for (size_t i = 0; i < bands.size(); ++i) { + bands[i]->setEditedState(pedited->toneEqualizer.bands[i] ? Edited : UnEdited); + } + regularization->setEditedState(pedited->toneEqualizer.regularization ? Edited : UnEdited); + pivot->setEditedState(pedited->toneEqualizer.pivot ? Edited : UnEdited); + show_colormap->setEdited(pedited->toneEqualizer.show_colormap ? Edited : UnEdited); + } + + setEnabled(pp->toneEqualizer.enabled); + + for (size_t i = 0; i < bands.size(); ++i) { + bands[i]->setValue(pp->toneEqualizer.bands[i]); + bands[i]->showIcons(pp->toneEqualizer.show_colormap); + } + regularization->setValue(pp->toneEqualizer.regularization); + + pivot->setValue(pp->toneEqualizer.pivot); + show_colormap->setValue(pp->toneEqualizer.show_colormap); + + enableListener(); +} + + +void ToneEqualizer::write(ProcParams *pp, ParamsEdited* pedited) +{ + for (size_t i = 0; i < bands.size(); ++i) { + pp->toneEqualizer.bands[i] = bands[i]->getValue(); + } + pp->toneEqualizer.enabled = getEnabled(); + pp->toneEqualizer.regularization = regularization->getValue(); + pp->toneEqualizer.show_colormap = show_colormap->getLastActive(); + pp->toneEqualizer.pivot = pivot->getValue(); + + if (pedited) { + auto &edited = pedited->toneEqualizer; + edited.enabled = !get_inconsistent(); + for (size_t i = 0; i < bands.size(); ++i) { + edited.bands[i] = bands[i]->getEditedState(); + } + edited.regularization = regularization->getEditedState(); + edited.pivot = pivot->getEditedState(); + edited.show_colormap = show_colormap->getEdited(); + } +} + + +void ToneEqualizer::setDefaults(const ProcParams *defParams, const ParamsEdited* pedited) +{ + for (size_t i = 0; i < bands.size(); ++i) { + bands[i]->setDefault(defParams->toneEqualizer.bands[i]); + } + regularization->setDefault(defParams->toneEqualizer.regularization); + + pivot->setDefault(defParams->toneEqualizer.pivot); + inital_params = defParams->toneEqualizer; + + if (pedited) { + auto &edited = pedited->toneEqualizer; + for (size_t i = 0; i < bands.size(); ++i) { + bands[i]->setDefaultEditedState(edited.bands[i] ? Edited : UnEdited); + } + regularization->setDefaultEditedState(edited.regularization ? Edited : UnEdited); + pivot->setDefaultEditedState(edited.pivot ? Edited : UnEdited); + } else { + for (auto band : bands) { + band->setDefaultEditedState(Irrelevant); + } + regularization->setDefaultEditedState(Irrelevant); + pivot->setDefaultEditedState(Irrelevant); + } +} + + +void ToneEqualizer::adjusterChanged(Adjuster *a, double newval) +{ + if (listener && getEnabled()) { + if (a == regularization) { + listener->panelChanged(EvRegularization, Glib::ustring::format(a->getValue())); + } else if (a == pivot) { + listener->panelChanged(EvPivot, Glib::ustring::format(a->getValue())); + } else { + Glib::ustring s; + for (size_t i = 0; i < bands.size(); ++i) { + s += Glib::ustring::format((int)bands[i]->getValue()) + " "; + } + listener->panelChanged(EvBands, s); + } + } +} + + +void ToneEqualizer::adjusterAutoToggled(Adjuster *a) +{ +} + + +void ToneEqualizer::enabledChanged() +{ + if (listener) { + if (get_inconsistent()) { + listener->panelChanged(EvEnabled, M("GENERAL_UNCHANGED")); + } else if (getEnabled()) { + listener->panelChanged(EvEnabled, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(EvEnabled, M("GENERAL_DISABLED")); + } + } +} + + +void ToneEqualizer::setBatchMode(bool batchMode) +{ + ToolPanel::setBatchMode(batchMode); + if (batchMode) { + for (auto band : bands) { + band->showEditedCB(); + } + regularization->showEditedCB(); + pivot->showEditedCB(); + } +} + + +void ToneEqualizer::setAdjusterBehavior(bool bands_add, bool regularization_add, bool pivot_add) +{ + for (auto band : bands) { + band->setAddMode(bands_add); + } + regularization->setAddMode(regularization_add); + pivot->setAddMode(pivot_add); +} + + +void ToneEqualizer::checkBoxToggled(CheckBox *c, CheckValue newval) +{ + if (c == show_colormap) { + colormapToggled(); + } +} + + +void ToneEqualizer::colormapToggled() +{ + for (size_t i = 0; i < bands.size(); ++i) { + bands[i]->showIcons(show_colormap->getLastActive()); + } + if (listener && getEnabled()) { + listener->panelChanged(EvColormap, show_colormap->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); + } +} + + +void ToneEqualizer::trimValues(rtengine::procparams::ProcParams *pp) +{ + for (size_t i = 0; i < bands.size(); ++i) { + bands[i]->trimValue(pp->toneEqualizer.bands[i]); + } + regularization->trimValue(pp->toneEqualizer.regularization); + pivot->trimValue(pp->toneEqualizer.pivot); +} + diff --git a/rtgui/toneequalizer.h b/rtgui/toneequalizer.h new file mode 100644 index 000000000..88a275799 --- /dev/null +++ b/rtgui/toneequalizer.h @@ -0,0 +1,62 @@ +/* -*- C++ -*- + * + * Adapted from ART. + * + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#pragma once + +#include +#include "adjuster.h" +#include "checkbox.h" +#include "toolpanel.h" + +class ToneEqualizer: public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public CheckBoxListener { +public: + static const Glib::ustring TOOL_NAME; + + ToneEqualizer(); + + void read(const rtengine::procparams::ProcParams *pp, const ParamsEdited* pedited = nullptr) override; + void write(rtengine::procparams::ProcParams *pp, ParamsEdited* pedited = nullptr) override; + void setDefaults(const rtengine::procparams::ProcParams *defParams, const ParamsEdited* pedited = nullptr) override; + void adjusterChanged(Adjuster *a, double newval) override; + void adjusterAutoToggled(Adjuster *a) override; + void enabledChanged() override; + void setBatchMode(bool batchMode) override; + void setAdjusterBehavior(bool bands_add, bool regularization_add, bool pivot_add); + void checkBoxToggled(CheckBox* c, CheckValue newval) override; + + void trimValues(rtengine::procparams::ProcParams *pp) override; + +private: + void colormapToggled(); + + std::array bands; + Adjuster *regularization; + Adjuster *pivot; + CheckBox *show_colormap; + + rtengine::ProcEvent EvEnabled; + rtengine::ProcEvent EvBands; + rtengine::ProcEvent EvRegularization; + rtengine::ProcEvent EvColormap; + rtengine::ProcEvent EvPivot; + + rtengine::procparams::ToneEqualizerParams inital_params; +}; diff --git a/rtgui/toollocationpref.cc b/rtgui/toollocationpref.cc index cf25dbc34..a2e2c9480 100644 --- a/rtgui/toollocationpref.cc +++ b/rtgui/toollocationpref.cc @@ -70,6 +70,8 @@ Glib::ustring getToolTitleKey(Tool tool) return "TP_EXPOSURE_LABEL"; case Tool::SHADOWS_HIGHLIGHTS: return "TP_SHADOWSHLIGHTS_LABEL"; + case Tool::TONE_EQUALIZER: + return "TP_TONE_EQUALIZER_LABEL"; case Tool::IMPULSE_DENOISE: return "TP_IMPULSEDENOISE_LABEL"; case Tool::DEFRINGE_TOOL: diff --git a/rtgui/toolpanel.cc b/rtgui/toolpanel.cc index 6db30bb14..46899f1a2 100644 --- a/rtgui/toolpanel.cc +++ b/rtgui/toolpanel.cc @@ -47,6 +47,11 @@ ToolParamBlock::ToolParamBlock() { //GTK318 } +Gtk::SizeRequestMode ToolParamBlock::get_request_mode_vfunc () const +{ + return Gtk::SIZE_REQUEST_HEIGHT_FOR_WIDTH; +} + FoldableToolPanel::FoldableToolPanel(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11, bool useEnabled) : ToolPanel(toolName, need11), parentContainer(nullptr), exp(nullptr), lastEnabled(true) { if (!content) { diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index 5ec59c9c2..f22f6f771 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -70,6 +70,7 @@ class ToolParamBlock : { public: ToolParamBlock(); + Gtk::SizeRequestMode get_request_mode_vfunc () const override; }; class ToolPanel : diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 4863732f9..77ac26d57 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -44,6 +44,9 @@ const std::vector EXPOSURE_PANEL_TOOLS = { { .id = Tool::SHADOWS_HIGHLIGHTS, }, + { + .id = Tool::TONE_EQUALIZER, + }, { .id = Tool::EPD, }, @@ -286,6 +289,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), favorit coarse = Gtk::manage (new CoarsePanel ()); toneCurve = Gtk::manage (new ToneCurve ()); shadowshighlights = Gtk::manage (new ShadowsHighlights ()); + toneEqualizer = Gtk::manage (new ToneEqualizer ()); impulsedenoise = Gtk::manage (new ImpulseDenoise ()); defringe = Gtk::manage (new Defringe ()); spot = Gtk::manage (new Spot ()); @@ -561,6 +565,8 @@ std::string ToolPanelCoordinator::getToolName(Tool tool) return ToneCurve::TOOL_NAME; case Tool::SHADOWS_HIGHLIGHTS: return ShadowsHighlights::TOOL_NAME; + case Tool::TONE_EQUALIZER: + return ToneEqualizer::TOOL_NAME; case Tool::IMPULSE_DENOISE: return ImpulseDenoise::TOOL_NAME; case Tool::DEFRINGE_TOOL: @@ -1913,6 +1919,8 @@ FoldableToolPanel *ToolPanelCoordinator::getFoldableToolPanel(Tool tool) const return toneCurve; case Tool::SHADOWS_HIGHLIGHTS: return shadowshighlights; + case Tool::TONE_EQUALIZER: + return toneEqualizer; case Tool::IMPULSE_DENOISE: return impulsedenoise; case Tool::DEFRINGE_TOOL: diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index b7e1d104e..762ea4a1e 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -79,6 +79,7 @@ #include "softlight.h" #include "spot.h" #include "tonecurve.h" +#include "toneequalizer.h" #include "toolbar.h" #include "toolpanel.h" #include "vibrance.h" @@ -134,6 +135,7 @@ protected: Crop* crop; ToneCurve* toneCurve; ShadowsHighlights* shadowshighlights; + ToneEqualizer* toneEqualizer; LocalContrast *localContrast; Spot* spot; Defringe* defringe; @@ -245,6 +247,7 @@ public: enum class Tool { TONE_CURVE, SHADOWS_HIGHLIGHTS, + TONE_EQUALIZER, IMPULSE_DENOISE, DEFRINGE_TOOL, SPOT, diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 761f2402a..f5ed63b37 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -247,6 +247,9 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC auto m = ProcEventMapper::getInstance(); EvWBObserver10 = m->newEvent(ALLNORAW, "HISTORY_MSG_WBALANCE_OBSERVER10"); + EvWBitcwbprim = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_PRIM"); + EvWBitcwbalg = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_OBS"); + EvWBitcwgreen = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_GREEN"); //Add the model columns to the Combo (which is a kind of view), @@ -342,6 +345,10 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC StudLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); StudLabel->set_tooltip_text(M("TP_WBALANCE_STUDLABEL_TOOLTIP")); + PatchLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); + PatchLabel->set_tooltip_text(M("TP_WBALANCE_PATCHLABEL_TOOLTIP")); + PatchlevelLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); + PatchlevelLabel->set_tooltip_text(M("TP_WBALANCE_PATCHLEVELLABEL_TOOLTIP")); mulLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); mulLabel->set_tooltip_text(M("TP_WBALANCE_MULLABEL_TOOLTIP")); @@ -350,7 +357,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC temp = Gtk::manage (new Adjuster (M("TP_WBALANCE_TEMPERATURE"), MINTEMP, MAXTEMP, 5, CENTERTEMP, itempL, itempR, &wbSlider2Temp, &wbTemp2Slider)); green = Gtk::manage (new Adjuster (M("TP_WBALANCE_GREEN"), MINGREEN, MAXGREEN, 0.001, 1.0, igreenL, igreenR)); equal = Gtk::manage (new Adjuster (M("TP_WBALANCE_EQBLUERED"), MINEQUAL, MAXEQUAL, 0.001, 1.0, iblueredL, iblueredR)); - tempBias = Gtk::manage (new Adjuster(M("TP_WBALANCE_TEMPBIAS"), -0.5, 0.5, 0.01, 0.0, itempbiasL, itempbiasR)); + tempBias = Gtk::manage (new Adjuster(M("TP_WBALANCE_TEMPBIAS"), -1.1, 1.1, 0.005, 0.0, itempbiasL, itempbiasR)); observer10 = Gtk::manage(new CheckBox(M("TP_WBALANCE_OBSERVER10"), multiImage)); cache_customTemp (0); @@ -364,6 +371,32 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC equal->show (); tempBias->show (); observer10->show(); + itcwbFrame = Gtk::manage(new Gtk::Frame(M("TP_WBALANCE_ITCWB_FRA"))); + + itcwbFrame->set_label_align(0.025, 0.5); + itcwbFrame->set_tooltip_markup (M("PREFERENCES_WBACORR_TOOLTIP")); + + ToolParamBlock* const itcwbBox = Gtk::manage(new ToolParamBlock()); + + + itcwb_green = Gtk::manage (new Adjuster (M("TP_WBALANCE_ITCWGREEN"), -0.35, 0.35, 0.005, 0.)); + itcwb_green ->set_tooltip_markup (M("TP_WBALANCE_ITCWGREEN_TOOLTIP")); + + itcwb_alg = Gtk::manage (new Gtk::CheckButton (M("TP_WBALANCE_ITCWB_ALG"))); + itcwb_alg ->set_tooltip_markup (M("TP_WBALANCE_ITCWALG_TOOLTIP")); + itcwb_alg ->set_active (false); + + + + itcwb_prim = Gtk::manage (new MyComboBoxText ()); + itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_SRGB")); + itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_BETA")); + itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_XYZCAM")); + itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_JDCMAX")); + itcwb_prim->set_active(1); + itcwb_primconn = itcwb_prim->signal_changed().connect(sigc::mem_fun(*this, &WhiteBalance::itcwb_prim_changed)); + itcwb_prim ->set_tooltip_markup (M("TP_WBALANCE_ITCWPRIM_TOOLTIP")); + /* Gtk::Box* boxgreen = Gtk::manage (new Gtk::Box ()); boxgreen->show (); @@ -373,6 +406,8 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC boxgreen->pack_start(*igreenR);*/ pack_start(*mulLabel); pack_start(*StudLabel); + pack_start(*PatchLabel); + pack_start(*PatchlevelLabel); pack_start (*temp); //pack_start (*boxgreen); @@ -382,14 +417,33 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC pack_start(*observer10); + itcwbBox->pack_start (*itcwb_green); + itcwbBox->pack_start (*itcwb_alg); + itcwbBox->pack_start (*itcwb_prim); + itcwbFrame->add(*itcwbBox); + pack_start(*itcwbFrame); + + if(options.rtSettings.itcwb_enable) { + itcwb_green->show(); + itcwb_alg->show(); + itcwb_prim->show(); + itcwbFrame->show(); + } else { + itcwb_green->show(); + itcwb_alg->hide(); + itcwb_prim->hide(); + } temp->setAdjusterListener (this); green->setAdjusterListener (this); equal->setAdjusterListener (this); tempBias->setAdjusterListener (this); observer10->setCheckBoxListener(this); + itcwb_green->setAdjusterListener (this); spotbutton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::spotPressed) ); methconn = method->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::optChanged) ); + itcwb_algconn = itcwb_alg->signal_toggled().connect( sigc::mem_fun(*this, &WhiteBalance::itcwb_alg_toggled) ); + resetButton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::resetWB) ); spotsize->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::spotSizeChanged) ); } @@ -411,9 +465,36 @@ void WhiteBalance::enabledChanged() } } } +void WhiteBalance::itcwb_prim_changed () +{ + if (listener && getEnabled()) { + listener->panelChanged(EvWBitcwbprim, M("GENERAL_ENABLED")); + } +} +void WhiteBalance::itcwb_alg_toggled () +{ + if (batchMode) { + if (itcwb_alg->get_inconsistent()) { + itcwb_alg->set_inconsistent (false); + itcwb_algconn.block (true); + itcwb_alg->set_active (false); + itcwb_algconn.block (false); + } else if (lastitcwb_alg) { + itcwb_alg->set_inconsistent (true); + } + lastitcwb_alg = itcwb_alg->get_active (); + } + if (listener && getEnabled()) { + if (itcwb_alg->get_active ()) { + listener->panelChanged (EvWBitcwbalg, M("GENERAL_ENABLED")); + } else { + listener->panelChanged (EvWBitcwbalg, M("GENERAL_DISABLED")); + } + } +} void WhiteBalance::adjusterChanged(Adjuster* a, double newval) { @@ -437,6 +518,7 @@ void WhiteBalance::adjusterChanged(Adjuster* a, double newval) ( a == equal || a == tempBias + || a == itcwb_green ) && ppMethod.second.type == WBEntry::Type::AUTO ) @@ -467,12 +549,16 @@ void WhiteBalance::adjusterChanged(Adjuster* a, double newval) if (listener && getEnabled()) { if (a == temp) { listener->panelChanged (EvWBTemp, Glib::ustring::format ((int)a->getValue())); + itcwbFrame->set_sensitive(false); } else if (a == green) { listener->panelChanged (EvWBGreen, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue())); + itcwbFrame->set_sensitive(false); } else if (a == equal) { listener->panelChanged (EvWBequal, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue())); } else if (a == tempBias) { listener->panelChanged (EvWBtempBias, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(2), a->getValue())); + } else if (a == itcwb_green) { + listener->panelChanged (EvWBitcwgreen, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(2), a->getValue())); } } } @@ -507,6 +593,7 @@ void WhiteBalance::checkBoxToggled(CheckBox* c, CheckValue newval) } } + void WhiteBalance::optChanged () { Gtk::TreeModel::Row row = getActiveMethod(); @@ -524,6 +611,8 @@ void WhiteBalance::optChanged () } StudLabel->hide(); mulLabel->show(); + PatchLabel->hide(); + PatchlevelLabel->hide(); if (opt != row[methodColumns.colId]) { @@ -543,8 +632,16 @@ void WhiteBalance::optChanged () bool autit = (currMethod.ppLabel == "autitcgreen"); if (autit) { StudLabel->show(); + PatchLabel->show(); + PatchlevelLabel->show(); + equal->hide(); + itcwbFrame->set_sensitive(true); } else { StudLabel->hide(); + PatchLabel->hide(); + PatchlevelLabel->hide(); + equal->show(); + itcwbFrame->set_sensitive(false); } switch (currMethod.type) { @@ -638,6 +735,8 @@ void WhiteBalance::spotPressed () { StudLabel->hide(); mulLabel->show(); + PatchLabel->hide(); + PatchlevelLabel->hide(); if (wblistener) { wblistener->spotWBRequested (getSize()); @@ -663,6 +762,41 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) tempBias->setValue (pp->wb.tempBias); tempBias->set_sensitive(true); + itcwb_algconn.block (true); + itcwb_alg->set_active (pp->wb.itcwb_alg); + itcwb_algconn.block (false); + lastitcwb_alg = pp->wb.itcwb_alg; + itcwb_green->setValue (pp->wb.itcwb_green); + + + itcwb_primconn.block (true); + + if (pp->wb.itcwb_prim == "srgb") { + itcwb_prim->set_active(0); + } else if (pp->wb.itcwb_prim == "beta") { + itcwb_prim->set_active(1); + } else if (pp->wb.itcwb_prim == "XYZcam") { + itcwb_prim->set_active(2); + } else if (pp->wb.itcwb_prim == "jdcmax") { + itcwb_prim->set_active(3); + } + itcwb_primconn.block (false); + + + + if(options.rtSettings.itcwb_enable) { + itcwb_green->show(); + itcwb_alg->show(); + itcwb_prim->show(); + itcwbFrame->show(); + + } else { + itcwb_green->hide(); + itcwb_alg->hide(); + itcwb_prim->hide(); + itcwbFrame->hide(); + } + if (pedited) { // By default, temperature and green are said "UnEdited", but it may change later temp->setEditedState (UnEdited); @@ -670,6 +804,8 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) equal->setEditedState (pedited->wb.equal ? Edited : UnEdited); tempBias->setEditedState (pedited->wb.tempBias ? Edited : UnEdited); observer10->setEdited(pedited->wb.observer); + itcwb_alg->set_inconsistent (!pedited->wb.itcwb_alg); + itcwb_green->setEditedState (pedited->wb.itcwb_green ? Edited : UnEdited); } if (pedited && !pedited->wb.method) { @@ -780,9 +916,21 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) bool autit = (wbValues.ppLabel == "autitcgreen"); if (autit) { StudLabel->show(); + PatchLabel->show(); + PatchlevelLabel->show(); + equal->hide(); + if(pp->wb.itcwb_sampling) { + tempBias->set_sensitive(false); + } + itcwbFrame->set_sensitive(!pp->wb.itcwb_sampling); + itcwb_prim_changed (); } else { StudLabel->hide(); + PatchLabel->hide(); + PatchlevelLabel->hide(); mulLabel->show(); + equal->show(); + itcwbFrame->set_sensitive(false); } } @@ -808,16 +956,32 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited) pedited->wb.equal = equal->getEditedState (); pedited->wb.tempBias = tempBias->getEditedState (); pedited->wb.observer = observer10->getEdited(); + pedited->wb.itcwb_alg = !itcwb_alg->get_inconsistent(); pedited->wb.method = row[methodColumns.colLabel] != M("GENERAL_UNCHANGED"); pedited->wb.enabled = !get_inconsistent(); + pedited->wb.itcwb_prim = itcwb_prim->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->wb.itcwb_green = itcwb_green->getEditedState (); } pp->wb.enabled = getEnabled(); + if (itcwb_prim->get_active_row_number() == 0) { + pp->wb.itcwb_prim = "srgb"; + } else if (itcwb_prim->get_active_row_number() == 1){ + pp->wb.itcwb_prim = "beta"; + } else if (itcwb_prim->get_active_row_number() == 2){ + pp->wb.itcwb_prim = "XYZcam"; + } else if (itcwb_prim->get_active_row_number() == 3){ + pp->wb.itcwb_prim = "jdcmax"; + } const std::pair ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); if (ppMethod.first) { pp->wb.method = ppMethod.second.ppLabel; + if (pp->wb.method != "autitcgreen") { + // Prepare migration to new ITCWB algorithm. + pp->wb.itcwb_sampling = false; + } } pp->wb.temperature = temp->getIntValue (); @@ -829,7 +993,9 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited) : observer10->getValue() == CheckValue::off ? rtengine::StandardObserver::TWO_DEGREES : pp->wb.observer; + pp->wb.itcwb_alg = itcwb_alg->get_active (); pp->wb.tempBias = tempBias->getValue (); + pp->wb.itcwb_green = itcwb_green->getValue (); } void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) @@ -837,6 +1003,7 @@ void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited* equal->setDefault (defParams->wb.equal); tempBias->setDefault (defParams->wb.tempBias); + itcwb_green->setDefault (defParams->wb.itcwb_green); if (wbp && defParams->wb.method == "Camera") { double ctemp; @@ -859,11 +1026,13 @@ void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited* green->setDefaultEditedState (pedited->wb.green ? Edited : UnEdited); equal->setDefaultEditedState (pedited->wb.equal ? Edited : UnEdited); tempBias->setDefaultEditedState (pedited->wb.tempBias ? Edited : UnEdited); + itcwb_green->setDefaultEditedState (pedited->wb.itcwb_green ? Edited : UnEdited); } else { temp->setDefaultEditedState (Irrelevant); green->setDefaultEditedState (Irrelevant); equal->setDefaultEditedState (Irrelevant); tempBias->setDefaultEditedState (Irrelevant); + itcwb_green->setDefaultEditedState (Irrelevant); } } @@ -1015,24 +1184,62 @@ inline Gtk::TreeRow WhiteBalance::getActiveMethod () return *(method->get_active()); } -void WhiteBalance::WBChanged(double temperature, double greenVal, double rw, double gw, double bw, float studgood) +void WhiteBalance::WBChanged(int met, double temperature, double greenVal, double rw, double gw, double bw, float temp0, float delta, int bia, int dread, float studgood, float minchrom, int kmin, float histmin, float histmax) { idle_register.add( - [this, temperature, greenVal, rw, gw, bw, studgood]() -> bool + [this, met, temperature, greenVal, rw, gw, bw, temp0, delta, bia, dread, studgood, minchrom, kmin, histmin, histmax]() -> bool { disableListener(); temp->setValue(temperature); green->setValue(greenVal); + double stud; + stud = studgood; + if(studgood < 0.0001) { + stud = 0.0001; + } + int bia2 = bia; mulLabel->set_text( Glib::ustring::compose(M("TP_WBALANCE_MULLABEL"), Glib::ustring::format(std::fixed, std::setprecision(4), rw), Glib::ustring::format(std::fixed, std::setprecision(2), gw), Glib::ustring::format(std::fixed, std::setprecision(4), bw)) ); - StudLabel->set_text( - Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL"), - Glib::ustring::format(std::fixed, std::setprecision(4), studgood)) - ); + if(bia == 3) { + bia2 = bia - 1; + StudLabel->set_text( + Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL"), + Glib::ustring::format(std::fixed, std::setprecision(4), stud), + Glib::ustring::format(std::fixed, std::setprecision(0), bia2), + Glib::ustring::format(std::fixed, std::setprecision(0), temp0)) + ); + } else if(bia == 2) { + StudLabel->set_text( + Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL1"), + Glib::ustring::format(std::fixed, std::setprecision(4), stud), + Glib::ustring::format(std::fixed, std::setprecision(0), bia), + Glib::ustring::format(std::fixed, std::setprecision(0), temp0)) + ); + } else { + StudLabel->set_text( + Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL0"), + Glib::ustring::format(std::fixed, std::setprecision(4), stud), + Glib::ustring::format(std::fixed, std::setprecision(0), bia), + Glib::ustring::format(std::fixed, std::setprecision(0), temp0)) + ); + } + PatchLabel->set_text( + Glib::ustring::compose(M("TP_WBALANCE_PATCHLABEL"), + Glib::ustring::format(std::fixed, std::setprecision(0), dread), + Glib::ustring::format(std::fixed, std::setprecision(4), minchrom), + Glib::ustring::format(std::fixed, std::setprecision(0), kmin)) + ); + PatchlevelLabel->set_text( + Glib::ustring::compose(M("TP_WBALANCE_PATCHLEVELLABEL"), + Glib::ustring::format(std::fixed, std::setprecision(4), delta), + Glib::ustring::format(std::fixed, std::setprecision(0), histmin), + Glib::ustring::format(std::fixed, std::setprecision(0), histmax)) + ); + temp->setDefault(temperature); green->setDefault(greenVal); enableListener(); diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index 56d8b646c..060026a48 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -46,6 +46,8 @@ class WhiteBalance final : public ToolParamBlock, public AdjusterListener, publi private: Gtk::Label* StudLabel; + Gtk::Label* PatchLabel; + Gtk::Label* PatchlevelLabel; Gtk::Label* mulLabel; protected: @@ -64,6 +66,9 @@ protected: }; rtengine::ProcEvent EvWBObserver10; + rtengine::ProcEvent EvWBitcwbprim; + rtengine::ProcEvent EvWBitcwbalg; + rtengine::ProcEvent EvWBitcwgreen; static Glib::RefPtr wbPixbufs[rtengine::toUnderlying(rtengine::procparams::WBEntry::Type::CUSTOM) + 1]; Glib::RefPtr refTreeModel; @@ -76,6 +81,12 @@ protected: Adjuster* equal; Adjuster* tempBias; CheckBox* observer10; + Gtk::Frame* itcwbFrame; + Gtk::CheckButton* itcwb_alg; + MyComboBoxText* itcwb_prim; + Adjuster* itcwb_green; + + bool lastitcwb_alg; Gtk::Button* spotbutton; int opt; @@ -83,7 +94,7 @@ protected: double nextGreen; WBProvider *wbp; // pointer to a ToolPanelCoordinator object, or its subclass BatchToolPanelCoordinator SpotWBListener* wblistener; - sigc::connection methconn; + sigc::connection methconn, itcwb_algconn, itcwb_primconn; int custom_temp; double custom_green; double custom_equal; @@ -131,8 +142,9 @@ public: } void setWB (int temp, double green); void resetWB (); - void WBChanged (double temp, double green, double rw, double gw, double bw, float studgood) override; - + void WBChanged (int met, double temp, double green, double rw, double gw, double bw, float temp0, float delta, int bia, int dread, float studgood, float minchrom, int kmin, float histmin, float histmax) override; + void itcwb_alg_toggled (); + void itcwb_prim_changed (); void setAdjusterBehavior (bool tempadd, bool greenadd, bool equaladd, bool tempbiasadd); void trimValues (rtengine::procparams::ProcParams* pp) override; void enabledChanged() override; diff --git a/tools/osx/Info.plist.in b/tools/osx/Info.plist.in index 876d35e3a..2faa69f83 100644 --- a/tools/osx/Info.plist.in +++ b/tools/osx/Info.plist.in @@ -73,6 +73,8 @@ arw CR2 cr2 + CR3 + cr3 CRF crf CRW diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index ca381ec14..ff5a44254 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -225,8 +225,11 @@ ModifyInstallNames 2>&1 # Copy libpng16 to the app bundle cp ${LOCAL_PREFIX}/lib/libpng16.16.dylib "${CONTENTS}/Frameworks/libpng16.16.dylib" -# Copy libtiff 5 into the app bundle -cp ${LOCAL_PREFIX}/lib/libtiff.5.dylib "${CONTENTS}/Frameworks/libtiff.5.dylib" +# Copy graphite to Frameworks +cp ${LOCAL_PREFIX}/lib/libgraphite2.3.dylib "${CONTENTS}/Frameworks" + +# Copy libtiff 6 into the app bundle +cp ${LOCAL_PREFIX}/lib/libtiff.6.dylib "${CONTENTS}/Frameworks/libtiff.6.dylib" # Copy libomp to Frameworks cp ${LOCAL_PREFIX}/lib/libomp.dylib "${CONTENTS}/Frameworks" @@ -316,7 +319,7 @@ for frameworklibs in "${LIB}"/*{dylib,so,cli}; do done install_name_tool -delete_rpath RawTherapee.app/Contents/Frameworks "${EXECUTABLE}"-cli 2>/dev/null install_name_tool -add_rpath /Applications/"${LIB}" "${EXECUTABLE}"-cli 2>/dev/null -ditto "${EXECUTABLE}"-cli "${APP}"/.. +# ditto "${EXECUTABLE}"-cli "${APP}"/.. # Merge the app with the other architecture to create the Universal app. if [[ -n $UNIVERSAL_URL ]]; then @@ -324,7 +327,7 @@ if [[ -n $UNIVERSAL_URL ]]; then curl -L ${UNIVERSAL_URL} -o univ.zip msg "Extracting app." unzip univ.zip -d univapp - hdiutil attach -mountpoint ./RawTherapeeuniv univapp/*/*dmg + hdiutil attach -mountpoint ./RawTherapeeuniv univapp/*dmg if [[ $arch = "arm64" ]]; then cp -R RawTherapee.app RawTherapee-arm64.app minimum_arm64_version=$(f=$(cat RawTherapee-arm64.app/Contents/Resources/AboutThisBuild.txt | grep mmacosx-version); echo "${f#*min=}" | cut -d ' ' -f1) @@ -344,13 +347,15 @@ if [[ -n $UNIVERSAL_URL ]]; then hdiutil unmount ./RawTherapeeuniv rm -r univapp # Create the fat main RawTherapee binary and move it into the new bundle - lipo -create -output RawTherapee RawTherapee-arm64.app/Contents/MacOS/RawTherapee RawTherapee-x86_64.app/Contents/MacOS/RawTherapee - mv RawTherapee RawTherapee.app/Contents/MacOS + lipo -create -output RawTherapee RawTherapee-arm64.app/Contents/MacOS/rawtherapee RawTherapee-x86_64.app/Contents/MacOS/rawtherapee + lipo -create -output rawtherapee-cli RawTherapee-arm64.app/Contents/MacOS/rawtherapee-cli RawTherapee-x86_64.app/Contents/MacOS/rawtherapee-cli + mv rawtherapee RawTherapee.app/Contents/MacOS # Create all the fat dependencies and move them into the bundle for lib in RawTherapee-arm64.app/Contents/Frameworks/* ; do lipo -create -output $(basename $lib) RawTherapee-arm64.app/Contents/Frameworks/$(basename $lib) RawTherapee-x86_64.app/Contents/Frameworks/$(basename $lib) done - sudo mv *cli *so *dylib RawTherapee.app/Contents/Frameworks + sudo mv *so *dylib RawTherapee.app/Contents/Frameworks + sudo mv *-cli RawTherapee.app/Contents/MacOS rm -r RawTherapee-arm64.app rm -r RawTherapee-x86_64.app else @@ -363,7 +368,8 @@ fi if [[ -n $CODESIGNID ]]; then msg "Codesigning Application." iconv -f UTF-8 -t ASCII "${PROJECT_SOURCE_DATA_DIR}"/rt.entitlements > "${CMAKE_BUILD_TYPE}"/rt.entitlements - mv "${EXECUTABLE}"-cli "${LIB}" +# mv "${EXECUTABLE}"-cli "${LIB}" + codesign --force --deep --timestamp --strict -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee-cli "${APP}"/Contents/MacOS/rawtherapee-cli codesign --force --deep --timestamp --strict -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee -o runtime --entitlements "${CMAKE_BUILD_TYPE}"/rt.entitlements "${APP}" spctl -a -vvvv "${APP}" fi @@ -441,7 +447,8 @@ function CreateDmg { # Zip disk image for redistribution msg "Zipping disk image for redistribution:" mkdir "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder" - cp {"${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.dmg","${PROJECT_NAME}.app/Contents/Frameworks/rawtherapee-cli","${PROJECT_SOURCE_DATA_DIR}/INSTALL.readme.rtf"} "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder" + cp {"${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.dmg","${PROJECT_NAME}.app/Contents/MacOS/rawtherapee-cli","${PROJECT_SOURCE_DATA_DIR}/INSTALL.readme.rtf"} "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder" + codesign -s - -i com.rawtherapee.rawtherapee-cli -f "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder/rawtherapee-cli" zip -r "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.zip" "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder/" if [[ -n $NIGHTLY ]]; then cp "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.zip" "${PROJECT_NAME}_macOS_${arch}_latest.zip"