diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c60fa37c..13c648de0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,12 @@ if(NOT DEFINED APPDATADIR) endif() endif() +if (NOT APPLE) + if(DEFINED LENSFUNDBDIR AND NOT IS_ABSOLUTE "${LENSFUNDBDIR}") + set(LENSFUNDBDIR "${DATADIR}/${LENSFUNDBDIR}") + endif() +endif() + if(APPLE) if("${CODESIGNID}") set(CODESIGNID "${CODESIGNID}" CACHE STRING "Codesigning Identity") @@ -396,7 +402,7 @@ if(WITH_PROF) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wuninitialized -Wcast-qual -Wno-deprecated-declarations -Wno-unused-result") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wuninitialized -Wcast-qual -Wno-deprecated-declarations -Wno-unused-result -Wunused-macros") if(OPTION_OMP) find_package(OpenMP) if(OPENMP_FOUND) diff --git a/LICENSE.txt b/LICENSE.txt index 653f0ac50..2ba8256ab 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ RawTherapee - A powerful, cross-platform raw image processing program. Copyright (C) 2004-2012 Gabor Horvath - Copyright (C) 2010-2019 RawTherapee development team. + Copyright (C) 2010-2020 RawTherapee development team. RawTherapee is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 33a984c1c..eb8d96379 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,4 +1,4 @@ -RAWTHERAPEE 5.7-dev RELEASE NOTES +RAWTHERAPEE 5.8-dev RELEASE NOTES This is a development version of RawTherapee. We update the code almost daily. Every few months, once enough changes have accumulated and the code is stabilized, we make a new official release. Every code change between these releases is known as a "development" version, and this is one of them. @@ -8,7 +8,7 @@ https://rawpedia.rawtherapee.com/ While we only commit tested and relatively stable code and so the development versions should be fairly stable, you should be aware that: - Development versions only had limited testing, so there may be bugs unknown to us. - You should report these bugs so that they get fixed for the next stable release. See - www.rawpedia.rawtherapee.com/How_to_write_useful_bug_reports + https://rawpedia.rawtherapee.com/How_to_write_useful_bug_reports - The way new tools work in the development versions is likely to change as we tweak and tune them, so your processing profiles may produce different results when used in a future stable version. - Bugs present in the stable versions get fixed in the development versions, and make it into the next stable version when we make a new official release. That means that in some ways the development versions can be "more stable" than the latest stable release. At the same time, new features may introduce new bugs. This is a trade-off you should be aware of. @@ -26,14 +26,14 @@ In order to use RawTherapee efficiently you should know that: - All curves support the Shift and Ctrl keys while dragging a point. Shift+drag makes the point snap to a meaningful axis (top, bottom, diagonal, other), while Ctrl+drag makes your mouse movement super-fine for precise point positioning. - There are many keyboard shortcuts which make working with RawTherapee much faster and give you greater control. Make sure you familiarize yourself with them on RawPedia's "Keyboard Shortcuts" page! -New features since 5.7: +New features since 5.8: - TODO NEWS RELEVANT TO PACKAGE MAINTAINERS -New since 5.7: +New since 5.8: - TODO In general: diff --git a/com.rawtherapee.RawTherapee.appdata.xml b/com.rawtherapee.RawTherapee.appdata.xml index 3a55109ba..f7d588684 100644 --- a/com.rawtherapee.RawTherapee.appdata.xml +++ b/com.rawtherapee.RawTherapee.appdata.xml @@ -19,13 +19,12 @@ https://www.paypal.me/rawtherapee https://rawpedia.rawtherapee.com https://www.rawtherapee.com - https://discuss.pixls.us/t/localization-how-to-translate-rawtherapee-and-rawpedia/2594 + https://rawpedia.rawtherapee.com/Main_Page#Localization rawtherapee.desktop + - - diff --git a/header b/header index 966153c0e..a98fbbac1 100644 --- a/header +++ b/header @@ -7,7 +7,7 @@ * 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 diff --git a/rtdata/CMakeLists.txt b/rtdata/CMakeLists.txt index 46722ba01..76804c0f0 100644 --- a/rtdata/CMakeLists.txt +++ b/rtdata/CMakeLists.txt @@ -29,9 +29,12 @@ if(UNIX) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/rawtherapee.desktop" DESTINATION ${DESKTOPDIR}) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-16.png" DESTINATION "${ICONSDIR}/hicolor/16x16/apps" RENAME rawtherapee.png) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-24.png" DESTINATION "${ICONSDIR}/hicolor/24x24/apps" RENAME rawtherapee.png) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-32.png" DESTINATION "${ICONSDIR}/hicolor/32x32/apps" RENAME rawtherapee.png) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-48.png" DESTINATION "${ICONSDIR}/hicolor/48x48/apps" RENAME rawtherapee.png) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-64.png" DESTINATION "${ICONSDIR}/hicolor/64x64/apps" RENAME rawtherapee.png) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-128.png" DESTINATION "${ICONSDIR}/hicolor/128x128/apps" RENAME rawtherapee.png) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-256.png" DESTINATION "${ICONSDIR}/hicolor/256x256/apps" RENAME rawtherapee.png) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/svg/rt-logo.svg" DESTINATION "${ICONSDIR}/hicolor/scalable/apps" RENAME rawtherapee.svg) endif() install(FILES ${LANGUAGEFILES} DESTINATION "${DATADIR}/languages") diff --git a/rtdata/dcpprofiles/Canon PowerShot S120.dcp b/rtdata/dcpprofiles/Canon PowerShot S120.dcp new file mode 100644 index 000000000..8bb089c29 Binary files /dev/null and b/rtdata/dcpprofiles/Canon PowerShot S120.dcp differ diff --git a/rtdata/images/svg/splash.svg b/rtdata/images/svg/splash.svg index 0989bfdb6..5609a45c1 100644 --- a/rtdata/images/svg/splash.svg +++ b/rtdata/images/svg/splash.svg @@ -1,6 +1,4 @@ - - + inkscape:export-xdpi="96" + inkscape:export-filename="/tmp/splash.png" + sodipodi:docname="splash.svg" + inkscape:version="1.1-dev (4cd8f7c, 2020-02-06)" + id="svg783" + version="1.1" + viewBox="0 0 146.05 91.545836" + height="346" + width="552"> RawTherapee splash screen + id="stop3964-8" /> + id="stop3966-8" /> + id="stop3956-7" /> + id="stop3958-6" /> + inkscape:collect="always" + id="linearGradient4002-3"> + id="stop4004-0" /> + id="stop4006-3" /> + id="stop4026-2" /> + id="stop4028-5" /> + inkscape:collect="always" + id="linearGradient4018-0"> + id="stop4020-5" /> + id="stop4022-9" /> + style="stop-color:#f18e01;stop-opacity:1;" /> + id="stop3982-2" /> + inkscape:collect="always" + id="linearGradient3994-4"> + id="stop3996-7" /> + id="stop3998-7" /> + id="stop3972-8" /> + id="stop3974-1" /> + id="stop3948-9" /> + id="stop3950-3" /> + id="stop3988-0" /> + id="stop3990-2" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + inkscape:window-maximized="1" + inkscape:window-y="0" + inkscape:window-x="0" + inkscape:window-height="1021" + inkscape:window-width="1920" + inkscape:snap-global="false" + inkscape:snap-nodes="true" + inkscape:object-nodes="false" + inkscape:snap-others="true" + inkscape:guide-bbox="true" + showguides="true" + inkscape:bbox-paths="false" + inkscape:snap-bbox-edge-midpoints="false" + inkscape:snap-bbox-midpoints="true" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:snap-smooth-nodes="false" + inkscape:snap-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="false" + inkscape:snap-text-baseline="false" + inkscape:snap-page="false" + inkscape:bbox-nodes="true" + inkscape:snap-bbox="true" + units="px" + showgrid="false" + inkscape:current-layer="layer1" + inkscape:document-units="px" + inkscape:cy="209.17983" + inkscape:cx="275.82889" + inkscape:zoom="0.95596044" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base"> - + + orientation="0,1" + position="27.648959,71.437501" /> - + + orientation="1,0" + position="138.12828,76.425406" /> - + - + - - + position="123.92422,11.509375" /> + + + orientation="1,0" + position="73.162242,39.921138" /> @@ -602,534 +570,375 @@ - - - Each logo element has a filter effect (ring*). Additionally, the logo as a whole (all elements grouped) also has a filter effect (logo glow)."Raw": font Eras Ultra ITC, 60pt, -3px spacing between characters."Therapee": font Eras Medium ITC, 60pt, +1px spacing between characters.Version: font Eras Bold ITC, 64pt, skewed -3°. RawTherapee splash screen design version 1.2 from 2019-02-27 | www.rawtherapee.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + inkscape:groupmode="layer" + inkscape:label="Layer 1"> - + GNU GPLv3 - - Development + d="m 9.4489751,288.85927 q 0.3352508,0.002 0.5154724,0.002 0.1918485,0 0.4321445,-0.002 -0.04263,0.57942 -0.06201,1.39914 -0.5871735,0.12596 -1.0038148,0.12596 -0.3081207,0 -0.5910491,-0.0795 -0.2809906,-0.0795 -0.4747773,-0.24224 -0.1937866,-0.16278 -0.2926178,-0.41858 -0.096893,-0.25579 -0.096893,-0.54066 0,-0.32362 0.1220856,-0.60849 0.1240234,-0.2868 0.346878,-0.48059 0.2228547,-0.19379 0.5019074,-0.27712 0.2790527,-0.0833 0.6181793,-0.0833 0.3720703,0 0.829407,0.0988 0.0039,0.14534 0.01938,0.31393 -0.271301,-0.0891 -0.4689632,-0.12208 -0.1976624,-0.0349 -0.3643189,-0.0349 -0.2616119,0 -0.4980316,0.0795 -0.2364196,0.0775 -0.405014,0.24029 -0.1685944,0.16084 -0.2557983,0.3992 -0.087204,0.23836 -0.087204,0.49222 0,0.22673 0.069763,0.42633 0.071701,0.19766 0.2151031,0.32362 0.1434021,0.12597 0.3488159,0.19379 0.2073517,0.0659 0.449585,0.0659 0.1317749,0 0.3139343,-0.0233 0.1821594,-0.0252 0.3681946,-0.0833 l 0.038757,-0.91661 H 9.855927 q -0.1821594,0 -0.4185791,0.01 0.011627,-0.13952 0.011627,-0.25773 z" /> + + + + + + + - Release Candidate 1 + style="filter:url(#filter173)" + id="g171"> + + + + + + + + + + + + + + + + + + + + + + + + + + - 5 - . 8 - Therapee - Raw - Therapee - Raw + transform="matrix(0.24127119,0,0.01264448,0.24127122,-4.8837849,265.42414)" + aria-label="5" /> + id="text3659" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Eras Medium ITC';-inkscape-font-specification:'Eras Medium ITC';letter-spacing:1px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.07075834px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4749);enable-background:new" + transform="matrix(0.24732122,0,0,0.24687704,-5.5339446,264.55152)" + aria-label="Therapee"> + id="path670" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:79.99999237px;line-height:1.25;font-family:'Eras Medium ITC';-inkscape-font-specification:'Eras Medium ITC';letter-spacing:0.99999994px;stroke-width:1.07075834px" + d="m 256.12553,-157.9659 0.78125,-11.95312 1.05469,-24.76562 0.35156,-11.44531 q -9.57031,0.0391 -16.75781,0.35156 0.23438,-3.125 0.27344,-5.50781 9.92187,0.0391 21.40625,0.0391 l 12.5,-0.0391 h 6.64062 q -0.27344,3.4375 -0.27344,5.46875 -6.05468,-0.35157 -13.39843,-0.35157 h -3.20313 l -0.82031,17.30469 -0.82031,24.375 v 6.52343 l -3.75,-0.0781 q -0.50782,0 -3.98438,0.0781 z" /> + id="path672" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:79.99999237px;line-height:1.25;font-family:'Eras Medium ITC';-inkscape-font-specification:'Eras Medium ITC';letter-spacing:0.99999994px;stroke-width:1.07075834px" + d="m 287.32084,-157.9659 0.97656,-16.99218 0.89844,-23.16406 0.23438,-13.16406 3.55468,0.0391 q 1.32813,0 3.47657,-0.0391 l -0.85938,13.55468 -0.3125,8.08594 q 0.9375,-1.67969 1.60156,-2.65625 0.70313,-1.01563 1.75782,-1.99219 1.09375,-1.01562 2.26562,-1.71875 1.17188,-0.70312 2.61719,-1.21094 1.44531,-0.54687 3.47656,-0.89843 2.03125,-0.35157 4.25781,-0.35157 3.32031,0 6.32813,0.74219 3.04687,0.74219 5.19531,2.46094 2.1875,1.71875 2.96875,4.10156 0.82031,2.38281 0.82031,4.84375 0,0.97656 -0.0391,2.57813 -0.11719,2.42187 -0.3125,5.66406 l -0.66406,14.375 q -0.11719,2.34375 -0.15625,5.74218 -2.26563,-0.0781 -3.47657,-0.0781 -1.32812,0 -3.71093,0.0781 0.42968,-4.21875 0.97656,-13.28125 0.58594,-9.06249 0.58594,-12.57812 0,-3.125 -1.13282,-5.15625 -1.13281,-2.07031 -3.75,-3.16406 -2.61718,-1.09375 -5.82031,-1.09375 -2.92968,0 -5.46875,0.89844 -2.30468,0.82031 -3.94531,2.30468 -1.60156,1.48438 -2.57812,3.63282 -1.05469,2.30468 -1.48438,4.64843 -0.66406,3.71094 -0.9375,10.3125 -0.15625,3.94531 -0.42969,13.47656 -2.1875,-0.0781 -3.28125,-0.0781 -1.01562,0 -3.63281,0.0781 z" /> + + + + + + + id="text3655" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Eras Ultra ITC';-inkscape-font-specification:'Eras Ultra ITC';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.08272994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4749);enable-background:new" + transform="matrix(0.24020317,0,0,0.23782112,-7.1514703,262.84505)" + aria-label="Raw"> + + + + + + + id="text1782" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:0%;font-family:'Eras Bold ITC';-inkscape-font-specification:'Eras Bold ITC Bold';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4749);enable-background:new" + transform="matrix(0.24127119,0,0.01264448,0.24127122,-57.800454,265.42414)" + aria-label="5"> + id="path1794" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:80px;line-height:1.25;font-family:'Eras Bold ITC';-inkscape-font-specification:'Eras Bold ITC Bold'" + d="m 290.0611,1.4557576 -0.27344,-3.9453125 q -0.11719,-1.9140625 -0.27344,-3.4765625 -0.11719,-1.5625 -0.50781,-5.0781246 8.08594,2.3046871 13.39844,2.3046871 2.85156,0 5.23437,-0.8984375 2.42188,-0.8984376 3.71094,-2.5390626 1.28906,-1.640625 1.28906,-3.59375 0,-2.851562 -2.65625,-4.296875 -2.61719,-1.484375 -8.24219,-1.484375 -2.5,0 -4.92187,0.195313 -2.38281,0.15625 -6.48438,0.703125 l 1.99219,-25.234375 q 0.11719,-1.875 0.23438,-5.195313 9.80468,0.07813 18.86718,0.07813 11.48438,0 19.14063,-0.07813 -0.35156,4.0625 -0.42969,6.445313 l -0.19531,5.3125 -5.19531,-0.195313 -2.42188,-0.03906 h -3.78906 q -2.42188,-0.03906 -6.01563,-0.03906 -1.21093,0 -3.98437,0.07813 l -0.78125,8.945313 q 2.61719,-0.195313 4.0625,-0.195313 6.09375,0 10.74219,1.953125 4.64843,1.914063 6.79687,5.390625 2.14844,3.476563 2.14844,7.851563 0,4.257812 -2.1875,8.2031246 -2.1875,3.90625 -6.01563,6.25 -3.78906,2.3046875 -8.82812,3.359375 -5,1.015625 -10.27344,1.015625 -1.99219,0 -4.72656,-0.2734375 -2.73438,-0.234375 -4.60938,-0.546875 -1.875,-0.3125 -4.80468,-0.9765625 z" /> + + + id="path1797" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:49.34799576px;line-height:1.25;font-family:'Eras Bold ITC';-inkscape-font-specification:'Eras Bold ITC Bold';letter-spacing:-7.09514618px" + d="m 286.21154,2.2370076 q 0.19276,-3.22882392 0.33734,-8.7226438 l 4.96371,0.072287 q 0.79516,0 4.19265,-0.072287 -0.19276,2.6264315 -0.43372,8.7226438 l -4.19265,-0.048191 q -0.45782,0 -4.86733,0.048191 z" /> - - - - - - - - + id="path1799" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:49.34799576px;line-height:1.25;font-family:'Eras Bold ITC';-inkscape-font-specification:'Eras Bold ITC Bold';letter-spacing:-7.09514618px" + d="m 305.49017,-14.629983 q -1.39755,-0.67468 -2.07223,-1.132498 -0.65058,-0.481914 -1.27707,-1.156594 -0.60239,-0.674679 -1.01202,-1.493933 -0.40963,-0.819254 -0.57829,-1.686699 -0.16867,-0.867445 -0.16867,-1.734891 0,-2.337283 1.06021,-4.216747 1.06021,-1.879465 3.13244,-3.08425 2.07223,-1.228881 4.43361,-1.686699 2.36137,-0.457819 4.96371,-0.457819 2.48186,0 4.79505,0.578297 2.31318,0.554201 3.95169,1.758986 1.6626,1.204786 2.43367,2.771006 0.77106,1.542125 0.77106,3.710738 0,1.036115 -0.21686,1.999943 -0.19277,0.963828 -0.62649,1.783082 -0.43372,0.795158 -1.06021,1.469838 -0.62649,0.674679 -1.32527,1.180689 -0.69877,0.50601 -2.33728,1.325264 1.54213,0.433722 2.36138,0.795158 0.81925,0.33734 1.56622,0.963828 0.77106,0.602392 1.30117,1.445742 0.5542,0.819254 0.79516,1.7589862 0.24095,0.9397323 0.24095,1.9758475 0,2.4095701 -1.18069,4.6022789 -1.18069,2.19270878 -3.22882,3.51797234 -2.02404,1.32526356 -4.72276,1.90356036 -2.69872,0.6023925 -5.51791,0.6023925 -2.69872,0 -5.20467,-0.5301054 -2.48186,-0.5301054 -4.43361,-1.75898615 -1.95175,-1.25297646 -2.8433,-2.93967555 -0.89154,-1.6866991 -0.89154,-3.8312165 0,-1.2529764 0.31325,-2.4336658 0.33734,-1.1806893 0.98792,-2.2168044 0.67468,-1.060211 1.54213,-1.758986 0.86744,-0.722871 1.6867,-1.108402 0.84334,-0.409627 2.36137,-0.915637 z m 7.90339,-9.999716 q -1.90356,0 -3.01196,1.060211 -1.1084,1.060211 -1.1084,2.602336 0,0.915636 0.48191,1.686699 0.48192,0.771062 1.34936,1.156593 0.86745,0.361436 1.87947,0.361436 1.75898,0 2.93967,-1.01202 1.18069,-1.036115 1.18069,-2.674623 0,-1.445742 -1.01202,-2.313187 -0.98792,-0.867445 -2.69872,-0.867445 z m -0.57829,13.22854 q -2.16862,0 -3.3975,1.108402 -1.20478,1.0843066 -1.20478,2.8191971 0,1.0120194 0.5301,1.8794647 0.5542,0.8674452 1.56622,1.3252635 1.03612,0.4337227 2.2409,0.4337227 1.25298,0 2.265,-0.4819141 1.03612,-0.481914 1.63851,-1.4216463 0.60239,-0.9638281 0.60239,-2.1927088 0,-1.6385077 -1.1325,-2.5541448 -1.1084,-0.915636 -3.10834,-0.915636 z" /> + transform="matrix(0.24804687,0,0,0.2480469,-16.632728,273.1232)" + id="g3926"> + + + + + + + + + + + + + + diff --git a/rtdata/images/svg/splash_template.svg b/rtdata/images/svg/splash_template.svg new file mode 100644 index 000000000..8044343c0 --- /dev/null +++ b/rtdata/images/svg/splash_template.svg @@ -0,0 +1,1078 @@ + + + + + RawTherapee splash screen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + RawTherapee splash screen + + + + Maciej Dworak + + + www.rawtherapee.com + + + + + + + + + + + + + + + + Each logo element has a filter effect (ring*). Additionally, the logo as a whole (all elements grouped) also has a filter effect (logo glow)."Raw": font Eras Ultra ITC, 60pt, -3px spacing between characters."Therapee": font Eras Medium ITC, 60pt, +1px spacing between characters.Version: font Eras Bold ITC, 64pt, skewed -3°. RawTherapee splash screen design version 1.2 from 2019-02-27 | www.rawtherapee.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GNU GPLv3 + + Development + + + Release Candidate 1 + + 5 + . 9 + Therapee + Raw + Therapee + Raw + + + + + + + + + + + + diff --git a/rtdata/languages/Polish b/rtdata/languages/Polish index b6d116479..06a5136d6 100644 --- a/rtdata/languages/Polish +++ b/rtdata/languages/Polish @@ -7,13 +7,23 @@ #07 2012-04-02 DrSlony #08 2013-05-21 DrSlony #09 2014-10-16 DrSlony +#10 2020-02-02 Bartłomiej Wiśniowski +#11 2020-02-02 Bartłomiej Wiśniowski +#12 2020-02-15 Bartłomiej Wiśniowski +#13 2020-02-17 Bartłomiej Wiśniowski ABOUT_TAB_BUILD;Wersja ABOUT_TAB_CREDITS;Zasługi ABOUT_TAB_LICENSE;Licencja ABOUT_TAB_RELEASENOTES;Notatki eksploatacyjne ABOUT_TAB_SPLASH;Ekran powitalny +ADJUSTER_RESET_TO_DEFAULT;Klik - przywróć wartość domyślną.\nCtrl+klik - przywróć wartość początkową. BATCH_PROCESSING;Przetwarzanie wsadowe +CURVEEDITOR_AXIS_IN;We: +CURVEEDITOR_AXIS_LEFT_TAN;Lw: +CURVEEDITOR_AXIS_OUT;Wy: +CURVEEDITOR_AXIS_RIGHT_TAN;Pw: +CURVEEDITOR_CATMULLROM;Elastyczny CURVEEDITOR_CURVE;Krzywa CURVEEDITOR_CURVES;Krzywe CURVEEDITOR_CUSTOM;Własna @@ -34,6 +44,16 @@ CURVEEDITOR_TOOLTIPPASTE;Wstaw krzywą ze schowka CURVEEDITOR_TOOLTIPSAVE;Zapisz krzywą CURVEEDITOR_TYPE;Typ: DIRBROWSER_FOLDERS;Katalogi +DONT_SHOW_AGAIN;Nie pokazuj tej wiadomości ponownie. +DYNPROFILEEDITOR_DELETE;Usuń +DYNPROFILEEDITOR_EDIT;Edytuj +DYNPROFILEEDITOR_IMGTYPE_ANY;Każdy +DYNPROFILEEDITOR_IMGTYPE_HDR;HDR +DYNPROFILEEDITOR_IMGTYPE_STD;Standardowy +DYNPROFILEEDITOR_MOVE_DOWN;Przesuń w dół +DYNPROFILEEDITOR_MOVE_UP;Przesuń w górę +DYNPROFILEEDITOR_NEW;Nowy +DYNPROFILEEDITOR_PROFILE;Profil przetwarzania EDITWINDOW_TITLE;Edytor obrazu EDIT_OBJECT_TOOLTIP;Wyświetla widżet na podglądzie który ułatwia ustawienie narzędzia. EDIT_PIPETTE_TOOLTIP;Aby dodać punkt do krzywej należy trzymac wciśnięty klawisz Ctrl podczas kliknięcia lewym guzikiem myszki na danym obszarze głównego podglądu.\nAby zmienic ustawienie już istniejącego punktu, należy trzymać wduszony klawisz Ctrl podczas kliknięcia lewym guzikiem myszki na danym obszarze głównego podglądu, następnie należy puścić klawisz Ctrl (chyba że chodzi nam o bardzo precyzyjne ustawienie dzieki spowolnieniu jakie trzymanie klawisza Ctrl nam daje) i podczas trzymania lewego guzika myszki należy myszką ruszać w pionie aby odpowiednio manipulować punktem w pionie. @@ -42,6 +62,7 @@ EXIFFILTER_CAMERA;Aparat EXIFFILTER_EXPOSURECOMPENSATION;Korekcja ekspozycji (EV) EXIFFILTER_FILETYPE;Typ pliku EXIFFILTER_FOCALLEN;Wartość ogniskowej +EXIFFILTER_IMAGETYPE;Typ obrazu EXIFFILTER_ISO;ISO EXIFFILTER_LENS;Obiektyw EXIFFILTER_METADATAFILTER;Włącz filtry metadanych @@ -59,6 +80,7 @@ EXIFPANEL_RESET;Przywróć EXIFPANEL_RESETALL;Przywróć wszystkie EXIFPANEL_RESETALLHINT;Przywraca orginalne wartości etykiet EXIFPANEL_RESETHINT;Przywraca orginalne wartości wybranych etykiet +EXIFPANEL_SHOWALL;Pokaż wszystkie EXIFPANEL_SUBDIRECTORY;Podkatalog EXPORT_BYPASS_ALL;Zaznacz / Odznacz wszystkie EXPORT_BYPASS_DEFRINGE;Pomiń usuwanie widma @@ -90,6 +112,8 @@ FILEBROWSER_AUTODARKFRAME;Automatyczne użycie czarnej klatki FILEBROWSER_AUTOFLATFIELD;Automatyczne użycie klatki typu puste pole FILEBROWSER_BROWSEPATHHINT;Umożliwia przeglądanie wprowadzonej ścieżki\nCtrl-o zaznaczenie\nEnter, Ctrl-Enter (w menedżerze plików) przeglądanie\nSkróty:\n ~ - katalog domowy użytkownika\n ! - katalog z obrazami użytkownia FILEBROWSER_CACHE;Pamięć podręczna +FILEBROWSER_CACHECLEARFROMFULL;Wyczyść wszystkie profile +FILEBROWSER_CACHECLEARFROMPARTIAL;Wyczyść wszystkie, oprócz znajdujących się w pamięci podręcznej FILEBROWSER_CLEARPROFILE;Wyczyść profil FILEBROWSER_COLORLABEL_TOOLTIP;Kolorowe etykiety\n\nUżyj za pomocą rozwijanej listy lub skrótów:\nShift-Ctrl-0 No Color\nShift-Ctrl-1 Czerwona\nShift-Ctrl-2 Żółta\nShift-Ctrl-3 Zielona\nShift-Ctrl-4 Niebieska\nShift-Ctrl-5 Purpurowa FILEBROWSER_COPYPROFILE;Kopiuj profil @@ -97,6 +121,7 @@ FILEBROWSER_CURRENT_NAME;Obecna nazwa: FILEBROWSER_DARKFRAME;Czarna klatka FILEBROWSER_DELETEDIALOG_HEADER;Potwierdzenie usunięcia pliku FILEBROWSER_EMPTYTRASH;Wyczyść kosz +FILEBROWSER_EMPTYTRASHHINT;Usuwa na zawsze pliki znajdujące się w koszu. FILEBROWSER_EXTPROGMENU;Otwórz za pomocą FILEBROWSER_FLATFIELD;Puste pole FILEBROWSER_MOVETODARKFDIR;Przenieś do katalogu zawierającego czarne klatki @@ -130,6 +155,7 @@ FILEBROWSER_POPUPRANK2;Ocena 2 ** FILEBROWSER_POPUPRANK3;Ocena 3 *** FILEBROWSER_POPUPRANK4;Ocena 4 **** FILEBROWSER_POPUPRANK5;Ocena 5 ***** +FILEBROWSER_POPUPREMOVE;Usuń na zawsze FILEBROWSER_POPUPRENAME;Zmień nazwę FILEBROWSER_POPUPSELECTALL;Zaznacz wszystkie FILEBROWSER_POPUPTRASH;Przenieś do kosza @@ -144,6 +170,7 @@ FILEBROWSER_RANK3_TOOLTIP;Oceń 3 *\nSkrót: Shift-3 FILEBROWSER_RANK4_TOOLTIP;Oceń 4 *\nSkrót: Shift-4 FILEBROWSER_RANK5_TOOLTIP;Oceń 5 *\nSkrót: Shift-5 FILEBROWSER_RENAMEDLGLABEL;Zmień nazwę pliku +FILEBROWSER_RESETDEFAULTPROFILE;Przywróć domyślne FILEBROWSER_SELECTDARKFRAME;Wybierz czarną klatkę... FILEBROWSER_SELECTFLATFIELD;Wybierz puste pole... FILEBROWSER_SHOWCOLORLABEL1HINT;Pokazuje zdjęcia z czerwoną etykietą.\nSkrót: Alt-1 @@ -155,6 +182,7 @@ FILEBROWSER_SHOWDIRHINT;Wyłącza wyszstkie filtry.\nSkrót: d FILEBROWSER_SHOWEDITEDHINT;Pokazuje edytowane zdjęcia.\nSkrót: 7 FILEBROWSER_SHOWEDITEDNOTHINT;Pokazuje nieedytowane zdjęcia.\nSkrót: 6 FILEBROWSER_SHOWEXIFINFO;Pokaż dane Exif.\n\nSkróty:\ni - Tryb wielu zakładek,\nAlt-i - Tryb jednej zakładki. +FILEBROWSER_SHOWNOTTRASHHINT;Pokazuj tylko obrazy które nie znajdują się w koszu. FILEBROWSER_SHOWRANK1HINT;Pokazuje zdjęcia ocenione na 1 gwiazdkę.\nSkrót: 1 FILEBROWSER_SHOWRANK2HINT;Pokazuje zdjęcia ocenione na 2 gwiazdki.\nSkrót: 2 FILEBROWSER_SHOWRANK3HINT;Pokazuje zdjęcia ocenione na 3 gwiazdki.\nSkrót: 3 @@ -169,24 +197,39 @@ FILEBROWSER_THUMBSIZE;Rozmiar minaturek FILEBROWSER_UNRANK_TOOLTIP;Usuń ocenę.\nSkrót: Shift-0 FILEBROWSER_ZOOMINHINT;Zwiększa rozmiar miniaturek.\n\nSkróty:\n+ - Tryb wielu zakładek,\nAlt-+ - Tryb pojedyńczej zakładki. FILEBROWSER_ZOOMOUTHINT;Zmniejsza rozmiar miniaturek.\n\nSkróty:\n- - Tryb wielu zakładek,\nAlt-- - Tryb pojedyńczej zakładki. +FILECHOOSER_FILTER_ANY;Wszystkie pliki +FILECHOOSER_FILTER_COLPROF;Profile kolorów (*.icc) +FILECHOOSER_FILTER_CURVE;Pliki krzywych +FILECHOOSER_FILTER_LCP;Profile korekcyjne obiektywów +FILECHOOSER_FILTER_PP;Profile przetwarzania +FILECHOOSER_FILTER_SAME;Taki sam format jak aktualnego zdjęcia +FILECHOOSER_FILTER_TIFF;Pliki TIFF GENERAL_ABOUT;O programie GENERAL_AFTER;Po +GENERAL_APPLY;Zastosuj +GENERAL_ASIMAGE;Jako obraz GENERAL_AUTO;Automatyczne GENERAL_BEFORE;Przed GENERAL_CANCEL;Anuluj GENERAL_CLOSE;Zamknij +GENERAL_CURRENT;Obecny GENERAL_DISABLE;Wyłącz GENERAL_DISABLED;Wyłączone GENERAL_ENABLE;Włącz GENERAL_ENABLED;Włączone GENERAL_FILE;Plik +GENERAL_HELP;Pomoc GENERAL_LANDSCAPE;Poziomo GENERAL_NA;nd. GENERAL_NO;Nie GENERAL_NONE;Żaden GENERAL_OK;OK +GENERAL_OPEN;Otwórz GENERAL_PORTRAIT;Pionowo +GENERAL_RESET;Resetuj GENERAL_SAVE;Zapisz +GENERAL_SAVE_AS;Zapisz jako... +GENERAL_SLIDER;Suwak GENERAL_UNCHANGED;(Niezmienione) GENERAL_WARNING;Uwaga HISTOGRAM_TOOLTIP_B;Pokaż/Ukryj histogram błękitów. @@ -364,12 +407,14 @@ HISTORY_MSG_162;Tone Mapping HISTORY_MSG_163;Krzywe RGB - Czerwona HISTORY_MSG_164;Krzywe RGB - Zielona HISTORY_MSG_165;Krzywe RGB - Niebieska +HISTORY_MSG_166;Ekspozycja - Reset HISTORY_MSG_167;Algorytm demozaikowania HISTORY_MSG_168;L*a*b* - Krzywa CC HISTORY_MSG_169;L*a*b* - Krzywa CH HISTORY_MSG_170;Jaskrawość - Krzywa HH HISTORY_MSG_171;L*a*b* - Krzywa LC HISTORY_MSG_172;L*a*b* - Ogranicz LC +HISTORY_MSG_173;NR - Odzyskiwanie detali HISTORY_MSG_174;CIECAM02 HISTORY_MSG_175;CAM02 - Adaptacja CAT02 HISTORY_MSG_176;CAM02 - Otoczenie @@ -399,6 +444,7 @@ HISTORY_MSG_199;CAM02 - Histogramy wyjściowe HISTORY_MSG_200;CAMO2 - Tone mapping HISTORY_MSG_201;RS - Chrominancja - R&G HISTORY_MSG_202;RS - Chrominancja - B&Y +HISTORY_MSG_203;NR - Przestrzeń kolorów HISTORY_MSG_204;Kroki poprawy LMMSE HISTORY_MSG_205;CAM02 - Gorące/uszkodzone px HISTORY_MSG_206;CAT02 - Auto luminancja sceny @@ -448,6 +494,7 @@ HISTORY_MSG_252;KwgPS - Odcienie skóry HISTORY_MSG_253;KwgPS - Redukcja błędów HISTORY_MSG_254;KwgPS - Odcienie skóry HISTORY_MSG_255;RS - Filtr mediana +HISTORY_MSG_256;NR - Mediana - Typ HISTORY_MSG_257;Koloryzacja HISTORY_MSG_258;Koloryzacja - Kolor HISTORY_MSG_259;Koloryzacja - Przezroczystość @@ -487,35 +534,211 @@ HISTORY_MSG_293;Symulacja Kliszy HISTORY_MSG_294;Symulacja Kliszy - Siła HISTORY_MSG_295;Symulacja Kliszy - Klisza HISTORY_MSG_296;RS - Modulacja luminancji +HISTORY_MSG_297;NR - Tryb HISTORY_MSG_298;Filtrowanie martwych pikseli +HISTORY_MSG_299;NR - Krzywa chrominancji +HISTORY_MSG_300;- +HISTORY_MSG_301;NR - Kontrola luminancji +HISTORY_MSG_302;NR - Metoda chrominancji +HISTORY_MSG_303;NR - Metoda chrominancji +HISTORY_MSG_304;W - Poziomy kontrastu +HISTORY_MSG_306;W - Proces +HISTORY_MSG_307;W - Proces +HISTORY_MSG_308;W - Kierunek procesu +HISTORY_MSG_309;W - ES - Detale +HISTORY_MSG_312;W - Residual - Próg cieni +HISTORY_MSG_315;W - Residual - Kontrast +HISTORY_MSG_317;W - Gamut - Odcień skóry +HISTORY_MSG_318;W - Kontrast - Poziom podświetleń +HISTORY_MSG_319;W - Kontrast - Zakres podświetleń +HISTORY_MSG_320;W - Kontrast - Zakres cieni +HISTORY_MSG_321;W - Kontrast - Poziom cieni +HISTORY_MSG_322;W - Gamut - Unikaj przesunięcia kolorów +HISTORY_MSG_323;W - ES - Kontrast lokalny +HISTORY_MSG_324;W - Chroma - Pastelowe +HISTORY_MSG_325;W - Chroma - Nasycone +HISTORY_MSG_326;W - Chroma - Metoda +HISTORY_MSG_333;W - Residual - Cienie +HISTORY_MSG_334;W - Residual - Chrominancja +HISTORY_MSG_335;W - Residual - Podświetlenia +HISTORY_MSG_336;W - Residual - Próg podświetleń +HISTORY_MSG_337;W - Residual - Odcień nieba +HISTORY_MSG_338;W - ES - Promień +HISTORY_MSG_339;W - ES - Siła +HISTORY_MSG_340;W - Siła +HISTORY_MSG_343;W - Poziomy chrominancji +HISTORY_MSG_345;W - ES - Kontrast lokalny +HISTORY_MSG_346;W - ES - Tryb kontrastu lokalnego +HISTORY_MSG_347;W - Odszumianie - Poziom 1 +HISTORY_MSG_348;W - Odszumianie - Poziom 2 +HISTORY_MSG_349;W - Odszumianie - Poziom 3 +HISTORY_MSG_352;W - Tło +HISTORY_MSG_355;W - ES - Niski próg +HISTORY_MSG_356;W - ES - Wysoki próg +HISTORY_MSG_359;Hot/Dead - Próg +HISTORY_MSG_362;W - Residual - Metoda kompresji +HISTORY_MSG_363;W - Residual - Siła kompersji +HISTORY_MSG_364;W - Final - Balans kontrastu +HISTORY_MSG_368;W - Final - Balans kontrastu +HISTORY_MSG_369;W - Final - Metoda balansu +HISTORY_MSG_370;W - Final - Krzywa lokalnego kontrastu +HISTORY_MSG_372;PRS USM - Promień +HISTORY_MSG_373;PRS USM - Ilość +HISTORY_MSG_374;PRS USM - Próg +HISTORY_MSG_376;PRS USM - Promień wykrywania krawędzi +HISTORY_MSG_377;PRS USM - Tolerancja krawędzi +HISTORY_MSG_380;PRS - Metoda +HISTORY_MSG_381;PRS RLD - Promień +HISTORY_MSG_382;PRS RLD - Ilość +HISTORY_MSG_384;PRS RLD - Iteracje +HISTORY_MSG_385;W - Residual - Balans kolorów +HISTORY_MSG_392;W - Residual - Balans kolorów +HISTORY_MSG_405;W - Odszumianie - Poziom 4 +HISTORY_MSG_407;Retinex - Metoda +HISTORY_MSG_408;Retinex - Promień +HISTORY_MSG_409;Retinex - Contrast +HISTORY_MSG_410;Retinex - Przesunięcie +HISTORY_MSG_411;Retinex - Siła +HISTORY_MSG_413;Retinex - Kontrast +HISTORY_MSG_418;Retinex - Próg +HISTORY_MSG_419;Retinex - Przestrzeń kolorów +HISTORY_MSG_421;Retinex - Gamma +HISTORY_MSG_422;Retinex - Gamma +HISTORY_MSG_426;Retinex - Wyrównywanie odcieni +HISTORY_MSG_429;Retinex - Iteracje +HISTORY_MSG_432;Retinex - M - Podświetlenia +HISTORY_MSG_434;Retinex - M - Cienie +HISTORY_MSG_436;Retinex - M - Promień +HISTORY_MSG_437;Retinex - M - Metoda +HISTORY_MSG_438;Retinex - M - Wyrównywanie +HISTORY_MSG_439;Retinex - Proces +HISTORY_MSG_440;CbDL - Metoda +HISTORY_MSG_442;Retinex - Skala +HISTORY_MSG_449;PS - Adaptacja ISO +HISTORY_MSG_452;PS - Pokaż ruch +HISTORY_MSG_453;PS - Pokaż tylko maskę +HISTORY_MSG_465;PS - Promień rozmycia +HISTORY_MSG_468;PS - Wypełnij dziury +HISTORY_MSG_471;PS - Korekcja ruchu +HISTORY_MSG_472;PS - Miękkie przejścia +HISTORY_MSG_474;PS - Wyrównaj +HISTORY_MSG_475;PS - Wyrównaj kanał +HISTORY_MSG_485;Korekcja obiektywu +HISTORY_MSG_486;Korekcja obiektywu - Aparat +HISTORY_MSG_487;Korekcja obiektywu - Obiektyw +HISTORY_MSG_489;DRC - Detal +HISTORY_MSG_490;DRC - Ilość +HISTORY_MSG_491;Balans bieli +HISTORY_MSG_492;Krzywe RGB +HISTORY_MSG_CLAMPOOG;Ucinaj kolory spoza zakresu +HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Korekcja koloru +HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Korekcja koloru +HISTORY_MSG_COLORTONING_LABREGION_CHANNEL;CT - Kanał +HISTORY_MSG_COLORTONING_LABREGION_SATURATION;CT - Saturacja +HISTORY_MSG_DEHAZE_DEPTH;Usuwanie mgły - Głębia +HISTORY_MSG_DEHAZE_ENABLED;Usuwanie mgły +HISTORY_MSG_DEHAZE_LUMINANCE;Usuwanie mgły - Tylko luminancja +HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;Usuwanie mgły - Pokaż mapę głębokości +HISTORY_MSG_DEHAZE_STRENGTH;Usuwanie mgły - Siła +HISTORY_MSG_LOCALCONTRAST_AMOUNT;Kontrast lokalny - Ilość +HISTORY_MSG_LOCALCONTRAST_DARKNESS;Kontrast lokalny - Ciemne miejsca +HISTORY_MSG_LOCALCONTRAST_ENABLED;Kontrast lokalny +HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Kontrast lokalny - Jasne miejsca +HISTORY_MSG_LOCALCONTRAST_RADIUS;Kontrast lokalny - Promień +HISTORY_MSG_MICROCONTRAST_CONTRAST;Mikrokontrast - Próg kontrastu +HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Automatyczny próg +HISTORY_MSG_PDSHARPEN_AUTO_RADIUS;CS - Automatyczny promień +HISTORY_MSG_PDSHARPEN_CHECKITER;CS - Automatycznie limituj iteracje +HISTORY_MSG_PDSHARPEN_CONTRAST;CS - Próg kontrastu +HISTORY_MSG_PDSHARPEN_ITERATIONS;CS - Iteracje +HISTORY_MSG_PDSHARPEN_RADIUS;CS - Promień +HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Próg kontrastu +HISTORY_MSG_RAWCACORR_AUTOIT;Korekcja aberracji chromatycznej - Iteracje +HISTORY_MSG_RAWCACORR_COLORSHIFT;Korekcja aberracji chromatycznej - Unikaj przesunięcia kolorów +HISTORY_MSG_SHARPENING_BLUR;Wyostrzanie - Promień rozmycia +HISTORY_MSG_SHARPENING_CONTRAST;Wyostrzanie - Próg kontrastu +HISTORY_MSG_SH_COLORSPACE;S/H - Przestrzeń kolorów +HISTORY_MSG_SOFTLIGHT_ENABLED;Miękkie światło +HISTORY_MSG_SOFTLIGHT_STRENGTH;Miękkie światło - Siła +HISTORY_MSG_TRANS_Method;Geometria - Metoda HISTORY_NEWSNAPSHOT;Nowa migawka HISTORY_NEWSNAPSHOT_TOOLTIP;Skrót: Alt-s HISTORY_SNAPSHOT;Migawka HISTORY_SNAPSHOTS;Migawki +ICCPROFCREATOR_COPYRIGHT;Prawa autorskie: +ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP;Przywróć prawa autorskie do domyślnych, przyznanych dla "RawTherapee, CC0" +ICCPROFCREATOR_CUSTOM;Własny +ICCPROFCREATOR_DESCRIPTION;Opis: +ICCPROFCREATOR_GAMMA;Gamma +ICCPROFCREATOR_ICCVERSION;Wersja ICC: +ICCPROFCREATOR_ILL_41;D41 +ICCPROFCREATOR_ILL_50;D50 +ICCPROFCREATOR_ILL_55;D55 +ICCPROFCREATOR_ILL_60;D60 +ICCPROFCREATOR_ILL_65;D65 +ICCPROFCREATOR_ILL_80;D80 +ICCPROFCREATOR_ILL_DEF;Domyślne +ICCPROFCREATOR_ILL_INC;StdA 2856K +ICCPROFCREATOR_PRIM_ACESP0;ACES AP0 +ICCPROFCREATOR_PRIM_ACESP1;ACES AP1 +ICCPROFCREATOR_PRIM_ADOBE;Adobe RGB (1998) +ICCPROFCREATOR_PRIM_BEST;BestRGB +ICCPROFCREATOR_PRIM_BETA;BetaRGB +ICCPROFCREATOR_PRIM_BLUX;Niebieski X +ICCPROFCREATOR_PRIM_BLUY;Niebieski Y +ICCPROFCREATOR_PRIM_BRUCE;BruceRGB +ICCPROFCREATOR_PRIM_GREX;Zielony X +ICCPROFCREATOR_PRIM_GREY;Zielony Y +ICCPROFCREATOR_PRIM_PROPH;Prophoto +ICCPROFCREATOR_PRIM_REC2020;Rec2020 +ICCPROFCREATOR_PRIM_REDX;Czerwony X +ICCPROFCREATOR_PRIM_REDY;Czerwony Y +ICCPROFCREATOR_PRIM_SRGB;sRGB +ICCPROFCREATOR_PRIM_WIDEG;Szeroka gama +ICCPROFCREATOR_PROF_V2;ICC v2 +ICCPROFCREATOR_PROF_V4;ICC v4 +ICCPROFCREATOR_SAVEDIALOG_TITLE;Zapisz profil ICC jako... +ICCPROFCREATOR_SLOPE;Nachylenie +ICCPROFCREATOR_TRC_PRESET;Krzywa odpowiedzi tonalnej: IPTCPANEL_CATEGORY;Kategoria IPTCPANEL_CITY;Miasto +IPTCPANEL_CITYHINT;Wprowadź nazwę miasta uwiecznionego na zdjęciu. IPTCPANEL_COPYHINT;Kopiuje ustawienia IPTC do schowka +IPTCPANEL_COPYRIGHT;Informacja o prawach autorskich +IPTCPANEL_COPYRIGHTHINT;Wprowadź informację o aktualnym posiadaczu praw autorskich np. ©2008 Jane Doe. IPTCPANEL_COUNTRY;Kraj +IPTCPANEL_COUNTRYHINT;Wprowadź nazwę kraju uwiecznionego na tym obrazie. +IPTCPANEL_CREATOR;Twórca +IPTCPANEL_CREATORHINT;Wprowadź nazwę twórcy obrazu. IPTCPANEL_CREDIT;Zasługa IPTCPANEL_CREDITHINT;Identyfikuje dostawcę zdjęcia, niekoniecznie właściciela lub autora (Credit). IPTCPANEL_DATECREATED;Data utworzenia +IPTCPANEL_DATECREATEDHINT;Wprowadź datę zrobienia zdjęcia. +IPTCPANEL_DESCRIPTION;Opis +IPTCPANEL_DESCRIPTIONWRITER;Twórca opisu IPTCPANEL_EMBEDDED;Osadzony IPTCPANEL_EMBEDDEDHINT;Resetuje dane IPTC do domyślnych ustawień osadzonych w orginalnym zdjęciu IPTCPANEL_HEADLINE;Nagłówek IPTCPANEL_INSTRUCTIONS;Instrukcje IPTCPANEL_KEYWORDS;Słowa kluczowe IPTCPANEL_PASTEHINT;Wstawia ustawienia IPTC ze schowka +IPTCPANEL_PROVINCE;Województwo lub stan IPTCPANEL_RESET;Reset IPTCPANEL_RESETHINT;Resetuje do domyślnych ustawień profilu IPTCPANEL_SOURCE;Źródło +IPTCPANEL_SUPPCATEGORIES;Dodatkowe kategorie IPTCPANEL_TITLE;Tytuł +IPTCPANEL_TRANSREFERENCE;Numer pracy +IPTCPANEL_TRANSREFERENCEHINT;!IPTCPANEL_TRANSREFERENCEHINT;Wprowadź numer pracy, który umożliwi śledzenie obrazu. MAIN_BUTTON_FULLSCREEN;Pełen ekran +MAIN_BUTTON_ICCPROFCREATOR;Kreator profili ICC MAIN_BUTTON_NAVNEXT_TOOLTIP;Przejdź do następnego zdjęcia względem zdjęcia otwartego w Edytorze.\nSkrót: Shift-F4\n\nAby przejść do następnego zdjęcia względem miniaturki wybranej w Nawigatorze Zdjęć:\nSkrót: F4 MAIN_BUTTON_NAVPREV_TOOLTIP;Przejdź do poprzedniego zdjęcia wzgledem zdjęcia otwartego w Edytorze.\nSkrót: Shift-F3 \n\nAby przejść do poprzedniego zdjęcia względem miniaturki wybranej w Nawigatorze Zdjęć:\nSkrót: F3 MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronizuj Nawigator Zdjęć z Edytorem aby ukazać miniaturkę obecnie otwartego zdjęcia, oraz usuń filtry w Nawigatorze Zdjęć.\nSkrót: x\n\nJak wyżej, ale bez usuwania filtrów:\nSkrót: y\n(Miniaturka otwartego zdjęcia nie zostanie wyświetlona jesli filtr ją ukrywa). MAIN_BUTTON_PREFERENCES;Ustawienia MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Dodaj bieżące zdjęcie do kolejki przetwarzania Ctrl+B MAIN_BUTTON_SAVE_TOOLTIP;Zapisz bieżące zdjęcieCtrl+S +MAIN_BUTTON_SENDTOEDITOR;Edytuj obraz w zewnętrznym edytorze MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Otwórz bieżące zdjęcie w zewnętrznym edytorze.\nSkrót: Ctrl+e MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Pokaż/Ukryj wszystkie panele boczne.\nSkrót: m MAIN_BUTTON_UNFULLSCREEN;Zwolnij ekran @@ -525,6 +748,7 @@ MAIN_FRAME_FILEBROWSER;Przeglądarka plików MAIN_FRAME_FILEBROWSER_TOOLTIP; Przeglądarka plików.\nSkrót: Ctrl-F2 MAIN_FRAME_PLACES;Miejsca MAIN_FRAME_PLACES_ADD;Dodaj +MAIN_FRAME_PLACES_DEL;Usuń MAIN_FRAME_QUEUE;Kolejka MAIN_FRAME_QUEUE_TOOLTIP;Przetwarzanie wsadowe\nSkrót: Ctrl-F3 MAIN_FRAME_RECENT;Ostatnio używane foldery @@ -540,7 +764,10 @@ MAIN_MSG_OPERATIONCANCELLED;Operację anulowano MAIN_MSG_PATHDOESNTEXIST;Ścieżka\n\n%1\n\nnie istnieje. Wybierz przawidłową ścieżkę w Ustawieniach. MAIN_MSG_QOVERWRITE;Zastąpić? MAIN_MSG_SETPATHFIRST;Aby użyć tej funkcji należy wpierw wybrać odpowiednią ścieżkę docelową w Ustawieniach! +MAIN_MSG_TOOMANYOPENEDITORS;Za duża liczba otwartych edytorów.\nZamknij edytor aby kontynuować. MAIN_MSG_WRITEFAILED;Zapis nie powiódł się:\n\n"%1"\n\nUpewnij się, że folder istnieje oraz że można do niego zapisywać. +MAIN_TAB_ADVANCED;Zaawansowane +MAIN_TAB_ADVANCED_TOOLTIP;Skrót: Alt-a MAIN_TAB_COLOR;Kolor MAIN_TAB_COLOR_TOOLTIP;Skrót: Alt-c MAIN_TAB_DETAIL;Szczegóły @@ -550,7 +777,10 @@ MAIN_TAB_EXIF;Exif MAIN_TAB_EXPORT; Szybki eksport MAIN_TAB_EXPOSURE;Ekspozycja MAIN_TAB_EXPOSURE_TOOLTIP;Skrót: Alt-e +MAIN_TAB_FAVORITES;Ulubione +MAIN_TAB_FAVORITES_TOOLTIP;Skrót: Alt-u MAIN_TAB_FILTER; Filtr +MAIN_TAB_INSPECT; Inspekcja MAIN_TAB_IPTC;IPTC MAIN_TAB_METADATA;Metadane MAIN_TAB_METADATA_TOOLTIP;Skrót: Alt-m @@ -576,6 +806,7 @@ MAIN_TOOLTIP_SHOWHIDERP1;Pokaż/Ukryj prawy panel.\nSkrót: Alt-l MAIN_TOOLTIP_SHOWHIDETP1;Pokaż/Ukryj górny panel.\nSkrót: Shift-l MAIN_TOOLTIP_THRESHOLD;Próg MAIN_TOOLTIP_TOGGLE;Przełącz widok Przed/Po.\nSkrót: Shift-b +MONITOR_PROFILE_SYSTEM;Ustawienia domyślne NAVIGATOR_B;B: NAVIGATOR_G;G: NAVIGATOR_H;H: @@ -588,6 +819,7 @@ NAVIGATOR_S;S: NAVIGATOR_V;V: NAVIGATOR_XY_FULL;Szerokość: %1, Wysokość: %2 NAVIGATOR_XY_NA;x: --, y: -- +PARTIALPASTE_ADVANCEDGROUP;Ustawienia zaawansowane PARTIALPASTE_BASICGROUP;Podstawowe ustawienia PARTIALPASTE_CACORRECTION;Korekcja aberacji chr. PARTIALPASTE_CHANNELMIXER;Mieszacz kanałów @@ -602,6 +834,7 @@ PARTIALPASTE_CROP;Kadrowanie PARTIALPASTE_DARKFRAMEAUTOSELECT;Auto-wybór czarnej klatki PARTIALPASTE_DARKFRAMEFILE;Wybór czarnej klatki PARTIALPASTE_DEFRINGE;Usuwanie widma +PARTIALPASTE_DEHAZE;Usuwanie mgły PARTIALPASTE_DETAILGROUP;Ustawienia szczegółowe PARTIALPASTE_DIALOGLABEL;Częściowe wklejenie profilu przetwarzania PARTIALPASTE_DIRPYRDENOISE;Redukcja szumu @@ -625,6 +858,7 @@ PARTIALPASTE_IPTCINFO;IPTC PARTIALPASTE_LABCURVE;Regulacje L*a*b* PARTIALPASTE_LENSGROUP;Ustawienia związane z obiektywem PARTIALPASTE_LENSPROFILE;Profil korekcji obiektywu LCP +PARTIALPASTE_LOCALCONTRAST;Kontrast lokalny PARTIALPASTE_METAGROUP;Metadane PARTIALPASTE_PCVIGNETTE;Winietowanie PARTIALPASTE_PERSPECTIVE;Perspektywa @@ -642,17 +876,26 @@ PARTIALPASTE_RAW_DMETHOD;Algorytm demozaikowania PARTIALPASTE_RAW_FALSECOLOR;Tłumienie fałszowania koloru PARTIALPASTE_RAW_LMMSEITERATIONS;Kroki poprawy LMMSE PARTIALPASTE_RESIZE;Zmiana rozmiaru +PARTIALPASTE_RETINEX;Retinex PARTIALPASTE_RGBCURVES;Krzywe RGB PARTIALPASTE_ROTATION;Obrót PARTIALPASTE_SHADOWSHIGHLIGHTS;Cienie/Podświetlenia PARTIALPASTE_SHARPENEDGE;Krawędzie PARTIALPASTE_SHARPENING;Wyostrzanie PARTIALPASTE_SHARPENMICRO;Mikrokontrast +PARTIALPASTE_SOFTLIGHT;Miękkie światło +PARTIALPASTE_TM_FATTAL;Kompresja zakresu dynamiki PARTIALPASTE_VIBRANCE;Jaskrawość PARTIALPASTE_VIGNETTING;Korekcja winietowania PARTIALPASTE_WHITEBALANCE;Balans bieli PREFERENCES_ADD;Dodaj +PREFERENCES_APPEARANCE;Wygląd +PREFERENCES_APPEARANCE_COLORPICKERFONT;Czcionka narzędzia do wybierania kolorów +PREFERENCES_APPEARANCE_CROPMASKCOLOR;Kolor maski kadrowania +PREFERENCES_APPEARANCE_MAINFONT;Główny font PREFERENCES_APPEARANCE_NAVGUIDECOLOR;Kolor ramki Nawigatora +PREFERENCES_APPEARANCE_PSEUDOHIDPI; Tryb pseudo-HiDPI +PREFERENCES_APPEARANCE_THEME;Motyw graficzny PREFERENCES_APPLNEXTSTARTUP;wymaga ponownego uruchomienia PREFERENCES_AUTOMONPROFILE;Automatycznie użyj systemowego profilu monitora PREFERENCES_BATCH_PROCESSING;Przetwarzanie wsadowe @@ -661,11 +904,33 @@ PREFERENCES_BEHADDALLHINT;Ustaw wszystkie narzędzia w tryb Dodaj.\nZmian PREFERENCES_BEHAVIOR;Zachowanie PREFERENCES_BEHSETALL;'Ustaw' wszystkie PREFERENCES_BEHSETALLHINT;Ustaw wszystkie narzędzia w tryb Ustaw.\nZmiany parametrów w panelu edycji zbiorczej zostaną traktowane jako absolutne, nie biorąc pod uwagę poprzednich wartości. +PREFERENCES_CACHECLEAR;Wyczyść +PREFERENCES_CACHECLEAR_ALL;Usuń wszystkie pliki z pamięci podręcznej: +PREFERENCES_CACHECLEAR_ONLYPROFILES;Usuń wszystkie profile przetwarzania z pamięci podręcznej: PREFERENCES_CACHEMAXENTRIES;Maksymalna liczba wpisów w pamięci podręcznej PREFERENCES_CACHEOPTS;Opcje pamięci podręcznej PREFERENCES_CACHETHUMBHEIGHT;Maksymalna wysokość miniatury +PREFERENCES_CHUNKSIZES;Liczba kafelków na wątek +PREFERENCES_CHUNKSIZE_RAW_AMAZE;Demozaikowanie AMaZE +PREFERENCES_CHUNKSIZE_RAW_CA;Korekcja aberracji chromatycznej +PREFERENCES_CHUNKSIZE_RAW_RCD;Demozaikowanie RCD +PREFERENCES_CHUNKSIZE_RAW_XT;Demozaikowanie Xtrans +PREFERENCES_CHUNKSIZE_RGB;Przetwarzanie RGB PREFERENCES_CLIPPINGIND;Pokazywanie obciętych prześwietleń/cieni +PREFERENCES_CLUTSCACHE;Cache HaldCLUT PREFERENCES_CLUTSDIR;Folder obrazów HaldCLUT +PREFERENCES_CMMBPC;Kompensacja punktu czerni +PREFERENCES_CROP;Kadrowanie +PREFERENCES_CROP_AUTO_FIT;Automatycznie przybliż aby dopasować do skadrowanego obrazu +PREFERENCES_CROP_GUIDES;Zawsze pokazuj ramkę kadrowania +PREFERENCES_CROP_GUIDES_FRAME;Ramka +PREFERENCES_CROP_GUIDES_FULL;Oryginał +PREFERENCES_CROP_GUIDES_NONE;Brak +PREFERENCES_CURVEBBOXPOS;Położenie przycisków kopiuj oraz wklej krzywą +PREFERENCES_CURVEBBOXPOS_ABOVE;Powyżej +PREFERENCES_CURVEBBOXPOS_BELOW;Poniżej +PREFERENCES_CURVEBBOXPOS_LEFT;Z lewej +PREFERENCES_CURVEBBOXPOS_RIGHT;Z prawej PREFERENCES_CUSTPROFBUILD;Zewnętrzny kreator profilów przetwarzania PREFERENCES_CUSTPROFBUILDHINT;Plik wykonywalny (lub skrypt) uruchamiany kiedy trzeba wygenerować profil przetwarzania dla zdjęcia.\n\nScieżka pliku nośnego (w stylu *.ini czyli sekcje i klucze/parametry) występuje jako parametr wiersza poleceń. Plik ten zawiera przeróżne parametry oraz dane Exif dzięki którym odpowiedni program bądź skrypt może wygenerować plik PP3 według reguł.\n\nUWAGA: Twoją odpowiedzialnością jest prawidłowe użycie cudzysłowiów w przypadku ścieżek zawierających spacje i znaki specjalne. PREFERENCES_CUSTPROFBUILDKEYFORMAT;Rodzaj kluczy @@ -678,14 +943,17 @@ PREFERENCES_DARKFRAMETEMPLATES;szablonów(ny) PREFERENCES_DATEFORMAT;Format daty PREFERENCES_DATEFORMATHINT;Dozwolone są następujące kody formatujące:\n%y - rok\n%m - miesiąc\n%d - dzień\n\nNa przykład według standardu ISO 8601 format daty wygląda następująco:\n%y-%m-%d PREFERENCES_DIRDARKFRAMES;Katalog z czarnymi klatkami +PREFERENCES_DIRECTORIES;Katalogi PREFERENCES_DIRHOME;Katalog domowy PREFERENCES_DIRLAST;Ostatnio odwiedzony katalog PREFERENCES_DIROTHER;Inny PREFERENCES_DIRSELECTDLG;Wybierz katalog z obrazami po uruchomieniu... PREFERENCES_DIRSOFTWARE;Katalog instalacyjny +PREFERENCES_EDITORCMDLINE;Własny wiersz poleceń PREFERENCES_EDITORLAYOUT;Układ edytora PREFERENCES_EXTERNALEDITOR;Zewnętrzny edytor PREFERENCES_FBROWSEROPTS;Opcje przeglądarki plików +PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Zwiń paski w przeglądarce plików PREFERENCES_FLATFIELDFOUND;Znaleziono PREFERENCES_FLATFIELDSDIR;Katalog z pustymi polami PREFERENCES_FLATFIELDSHOTS;kadry @@ -698,36 +966,57 @@ PREFERENCES_HISTOGRAM_TOOLTIP;Jeśli opcja jest włączona profil roboczy jest u PREFERENCES_HLTHRESHOLD;Próg dla prześwietleń PREFERENCES_ICCDIR;Katalog z profilami koloru ICC PREFERENCES_IMPROCPARAMS;Domyślne parametry przetwarzania obrazu +PREFERENCES_INSPECT_LABEL;Inspekcja +PREFERENCES_INSPECT_MAXBUFFERS_LABEL;Maksymalna liczba obrazów w pamięci podręcznej PREFERENCES_INTENT_ABSOLUTE;Absolutnie kolorymetryczny PREFERENCES_INTENT_PERCEPTUAL;Percepcyjny PREFERENCES_INTENT_RELATIVE;Względnie kolorymetryczny PREFERENCES_INTENT_SATURATION;Nasyceniowy PREFERENCES_INTERNALTHUMBIFUNTOUCHED;Pokaż osadzoną miniaturę JPEG jeśli plik raw jest nieedytowany +PREFERENCES_LANG;Język PREFERENCES_LANGAUTODETECT;Użyj języka systemowego +PREFERENCES_MAXRECENTFOLDERS;Maksymalna liczba ostatnio otwieranych folderów PREFERENCES_MENUGROUPEXTPROGS;Grupuj "Otwórz za pomocą" PREFERENCES_MENUGROUPFILEOPERATIONS;Grupuj operacje plików PREFERENCES_MENUGROUPLABEL;Grupuj operacje etykiet PREFERENCES_MENUGROUPPROFILEOPERATIONS;Grupuj operacje profili przetwarzania PREFERENCES_MENUGROUPRANK;Grupuj operacje oceny PREFERENCES_MENUOPTIONS;Opcje menu +PREFERENCES_MONITOR;Monitor +PREFERENCES_MONPROFILE;Domyślny profil kolorów +PREFERENCES_MONPROFILE_WARNOSX;Z powodu ograniczeń MacOS, dostępna jest tylko paleta sRGB. PREFERENCES_MULTITAB;Tryb wielu zakładek PREFERENCES_MULTITABDUALMON;Tryb wielu zakładek (na drugim monitorze jeśli dostępny) +PREFERENCES_NAVIGATIONFRAME;Nawigacja PREFERENCES_OVERLAY_FILENAMES;Nakładaj nazwy pliku na miniatury +PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Nakładaj nazwy plików na miniaturki w przeglądarce PREFERENCES_OVERWRITEOUTPUTFILE;Nadpisuj istniejące pliki PREFERENCES_PANFACTORLABEL;Współczynnik PREFERENCES_PARSEDEXT;Przetwarzane rozszerzenia PREFERENCES_PARSEDEXTADD;Dodaj rozszerzenie PREFERENCES_PARSEDEXTADDHINT;Proszę wprowadzić rozszerzenie i zatwierdzić przyciskiem, by dodać do listy PREFERENCES_PARSEDEXTDELHINT;Skasuje wybrane rozszerzenie z listy +PREFERENCES_PARSEDEXTDOWNHINT;Przenieś wybrane rozszerzenie w dół. +PREFERENCES_PARSEDEXTUPHINT;Przenieś wybrane rozszerzenie w górę. +PREFERENCES_PERFORMANCE_MEASURE;Zmierz +PREFERENCES_PERFORMANCE_THREADS;Wątki +PREFERENCES_PREVDEMO;Metoda demozaikowania podglądu +PREFERENCES_PREVDEMO_FAST;Szybka +PREFERENCES_PREVDEMO_LABEL;Metoda demozaikowania podczas podglądu przy powiększeniu mniejszym niż 100%: +PREFERENCES_PREVDEMO_SIDECAR;Tak jak w PP3 PREFERENCES_PROFILEHANDLING;Obsługa profili PREFERENCES_PROFILELOADPR;Priorytet wczytywania profilu PREFERENCES_PROFILEPRCACHE;Profil w pamięci podręcznej PREFERENCES_PROFILEPRFILE;Profil przy pliku wejściowym PREFERENCES_PROFILESAVECACHE;Zapisz parametry przetwarzania w pamięci podręcznej PREFERENCES_PROFILESAVEINPUT;Zapisz parametry przetwarzania obok pliku wejściowego +PREFERENCES_PROFILESAVELOCATION;Miejsce zapisywania profilu przetwarzania +PREFERENCES_PROFILE_NONE;Żaden PREFERENCES_PROPERTY;Własność +PREFERENCES_PRTPROFILE;Profil kolorów PREFERENCES_PSPATH;Katalog w którym zainstalowany jest Adobe Photoshop PREFERENCES_SELECTLANG;Wybierz język +PREFERENCES_SERIALIZE_TIFF_READ;Ustawienia odczytu TIFF PREFERENCES_SET;Ustaw PREFERENCES_SHOWBASICEXIF;Pokaż podstawowe dane Exif PREFERENCES_SHOWDATETIME;Pokaż datę i czas @@ -744,7 +1033,9 @@ PREFERENCES_TAB_BROWSER;Przeglądarka plików PREFERENCES_TAB_COLORMGR;Zarządzanie kolorami PREFERENCES_TAB_GENERAL;Ogólne PREFERENCES_TAB_IMPROC;Przetwarzanie obrazu +PREFERENCES_TAB_PERFORMANCE;Wydajność PREFERENCES_TAB_SOUND;Dźwięki +PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show PREFERENCES_TP_LABEL;Panel narzędzi: PREFERENCES_TP_VSCROLLBAR;Ukry pionowy pasek przesuwania PREFERENCES_USEBUNDLEDPROFILES;Użyj załączone profile przetwarzania @@ -758,6 +1049,7 @@ PROFILEPANEL_MODE_TIP;Tryb wypełnienia parametrów przetwarzania.\n\nWduszone: PROFILEPANEL_MYPROFILES;Moje profile przetwarzania PROFILEPANEL_PASTEPPASTE;Parametry do wklejenia PROFILEPANEL_PCUSTOM;Własny +PROFILEPANEL_PDYNAMIC;Dynamika PROFILEPANEL_PFILE;Z pliku PROFILEPANEL_PINTERNAL;Neutralny PROFILEPANEL_PLASTSAVED;Ostatnio zapisany @@ -767,6 +1059,11 @@ PROFILEPANEL_TOOLTIPCOPY;Skopiuj aktualny profil do schowka PROFILEPANEL_TOOLTIPLOAD;Ładuj profil z pliku.\nCtrl+klik aby wybrać parametry do ładowania. PROFILEPANEL_TOOLTIPPASTE;Wklej profil ze schowka.\nCtrl+klik aby wybrać parametry do wklejenia. PROFILEPANEL_TOOLTIPSAVE;Zapisz aktualny profil.\nCtrl+klik aby wybrać parametry do zapisania. +PROGRESSBAR_DECODING;Dekodowanie... +PROGRESSBAR_GREENEQUIL;Równoważenie koloru zielonego... +PROGRESSBAR_HLREC;Rekonstrukcja podświetleń... +PROGRESSBAR_HOTDEADPIXELFILTER;Filtr gorących/martwych pikseli.. +PROGRESSBAR_LINEDENOISE;Liniowy filtr szumu... PROGRESSBAR_LOADING;Wczytywanie obrazu... PROGRESSBAR_LOADINGTHUMBS;Wczytywanie miniatur... PROGRESSBAR_LOADJPEG;Ładowanie pliku JPEG... @@ -775,14 +1072,18 @@ PROGRESSBAR_LOADTIFF;Ładowanie pliku TIFF... PROGRESSBAR_NOIMAGES;Nie znaleziono żadnych obrazów PROGRESSBAR_PROCESSING;Przetwarzanie obrazu... PROGRESSBAR_PROCESSING_PROFILESAVED;Zapisano profil przetwarzania +PROGRESSBAR_RAWCACORR;Korekcja aberracji chromatycznej... PROGRESSBAR_READY;Gotowe PROGRESSBAR_SAVEJPEG;Zapisywanie pliku JPEG... PROGRESSBAR_SAVEPNG;Zapisywanie pliku PNG... PROGRESSBAR_SAVETIFF;Zapisywanie pliku TIFF... PROGRESSBAR_SNAPSHOT_ADDED;Dodano migawkę PROGRESSDLG_PROFILECHANGEDINBROWSER;Profil zmieniony w przeglądarce +QINFO_FRAMECOUNT;%2 klatki +QINFO_HDR;HDR / %2 klatka/i QINFO_ISO;ISO QINFO_NOEXIF;Dane Exif niedostępne. +QINFO_PIXELSHIFT;Pixel Shift / %2 klatka/i QUEUE_AUTOSTART;Autostart QUEUE_AUTOSTART_TOOLTIP;Rozpocznij przetwarzanie automatycznie gdy pojawi się nowe zadanie. QUEUE_DESTFILENAME;Ścieżka i nazwa pliku @@ -790,8 +1091,18 @@ QUEUE_FORMAT_TITLE;Format pliku QUEUE_LOCATION_FOLDER;Zapisz do katalogu QUEUE_LOCATION_TEMPLATE;Użyj schemat QUEUE_LOCATION_TEMPLATE_TOOLTIP;Dozwolone są następujące kody formatujące:\n%f, %d1, %d2, ..., %p1, %p2, ..., %r, %s1, %s2, ...\n\nKody formatujące odnoszą się do różnych elementów ścieżki zdjęcia, atrybutów zdjęcia oraz do arbitralnego ciągu numerycznego operacji wsadowej.\n\nPrzykładowo, jeśli zdjęcie obrabiane ma następującą ścieżkę:\n/home/andrzej/zdjecia/2010-10-31/dsc0042.nef\nznaczenie kodów formatujących jest następujące:\n%d4 = home\n%d3 = andrzej\n%d2 = zdjecia\n%d1 = 2010-10-31\n%f = dsc0042\n%p1 = /home/tom/photos/2010-10-31/\n%p2 = /home/andrzej/zdjecia/\n%p3 = /home/andrzej/\n%p4 = /home/\n\n%r zostanie zastąpione oceną zdjęcia. Jeśli zdjęcie nie posiada oceny, %r zostanie zastąpione liczbą '0'. Jeśli zdjęcie leży w śmietniku, %r zostanie zastąpione znakiem 'x'.\n\n%s1, %s2, etc. zostanie zastąpione ciągniem numerycznym dopełnionym od jednej do dziewięciu cyfr. Ciąg ten zostanie rozpocznięty od "1" za każdym razem gdy kolejka przetwarzania zostanie uruchomiona, i liczba jest zwiększona o "1" dla każdego zapisanego obrazu.\n\nJeśli chcesz zapisać obraz wyjściowy obok obrazu wejściowego, napisz:\n%p1/%f\n\nJeśli chcesz zapisać obraz wyjściowy w folderze o nazwie "wywolane" znajdującego się w katalogu zawierającym otwarty obraz, napisz:\n%p1/wywolane/%f\n\nJeśli chcesz zapisać obraz wyjściowy w folderze o nazwie "/home/andrzej/zdjecia/wywolane/2010-10-31", napisz:\n%p2/wywolane/%d1/%f +QUEUE_LOCATION_TITLE;Lokalizacja wyjściowa +SAMPLEFORMAT_0;Nieznany typ pliku +SAMPLEFORMAT_1;8-bit bez znaku +SAMPLEFORMAT_2;16-bit bez znaku +SAMPLEFORMAT_4;24-bit LogLuv +SAMPLEFORMAT_8;32-bit LogLuv +SAMPLEFORMAT_16;16-bit zmiennoprzecinkowy +SAMPLEFORMAT_32;24-bit zmiennoprzecinkowy +SAMPLEFORMAT_64;32-bit zmiennoprzecinkowy SAVEDLG_AUTOSUFFIX;Automatycznie dodaj przyrostek, jeżeli plik już istnieje SAVEDLG_FILEFORMAT;Format pliku +SAVEDLG_FILEFORMAT_FLOAT; zmiennoprzecinkowy SAVEDLG_FORCEFORMATOPTS;Wymuś opcje zapisu SAVEDLG_JPEGQUAL;Jakość JPEG SAVEDLG_PUTTOQUEUE;Umieść w kolejce przetwarzania @@ -848,6 +1159,8 @@ TP_BWMIX_MET;Metoda TP_BWMIX_MET_CHANMIX;Mieszacz kanałów TP_BWMIX_MET_DESAT;Desaturacja TP_BWMIX_MET_LUMEQUAL;Ekwalizator luminancji +TP_BWMIX_MIXC;Mieszacz kanałów +TP_BWMIX_NEUTRAL;Reset TP_BWMIX_RGBLABEL;R: %1%% G: %2%% B: %3%% Total: %4%% TP_BWMIX_RGBLABEL_HINT;Ostateczne wartości RGB które uwzględniają wszystkie opcje mieszacza.\n"Total" wyświetla sumę wartości RGB:\n- zawsze 100% w trybie relatywnym,\n- ponad (jaśniej) lub poniżej (ciemniej) 100% w trybie absolutnym. TP_BWMIX_RGB_TOOLTIP;Miesza kanały RGB. Kieruj się gotowymi ustawieniami.\nNależy zwrócić uwagę na ujemne wartości ponieważ mogą pojawić się zniekształcenia sygnału w obrazie lub działać w sposób nieprzewidywalny. @@ -876,6 +1189,9 @@ TP_BWMIX_VAL;L TP_CACORRECTION_BLUE;Niebieski TP_CACORRECTION_LABEL;Korekcja aberracji chromatycznej TP_CACORRECTION_RED;Czerwony +TP_CBDL_AFT;Po zmianie na Cz-B +TP_CBDL_BEF;Przed zmianą na Cz-B +TP_CBDL_METHOD;Gdzie TP_CHMIXER_BLUE;Niebieski TP_CHMIXER_GREEN;Zielony TP_CHMIXER_LABEL;Mieszacz kanałów @@ -884,6 +1200,7 @@ TP_COARSETRAF_TOOLTIP_HFLIP;Odbij w poziomie TP_COARSETRAF_TOOLTIP_ROTLEFT;Obróć w lewo.\n\nSkróty:\n[ - Tryb wielu zakładek,\nAlt-[ - Tryb jednej zakładki. TP_COARSETRAF_TOOLTIP_ROTRIGHT;Obróć w prawo.\n\nSkróty:\n] - Tryb wielu zakładek,\nAlt-] - Tryb jednej zakładki. TP_COARSETRAF_TOOLTIP_VFLIP;Odbij w pionie +TP_COLORAPP_ABSOLUTELUMINANCE;Luminancja absolutna TP_COLORAPP_ALGO;Algorytm TP_COLORAPP_ALGO_ALL;Wszystkie TP_COLORAPP_ALGO_JC;Światłość + Chroma (JC) @@ -925,6 +1242,8 @@ TP_COLORAPP_LIGHT;Światłość (J) TP_COLORAPP_LIGHT_TOOLTIP;Światłość w CIECAM02 różni się od światłości CIELab oraz RGB TP_COLORAPP_MODEL;Model PB TP_COLORAPP_MODEL_TOOLTIP;Model punktu bieli.\n\nBB [RT] + [wyjściowy]:\nBalans bieli RawTherapee jest użyty dla sceny, CIECAM02 jest ustawione na D50, i balans bieli urządzenia wyjściowego ustawiony jest w Ustawieniach > Zarządzanie Kolorami\n\nBB [RT+CAT02] + [wyjściowe]:\nUstawienia balansu bieli RawTherapee są używane przez CAT02, i balans bieli urządzenia wyjściowego jest ustawione w Ustawieniach > Zarządzanie Kolorami. +TP_COLORAPP_NEUTRAL;Reset +TP_COLORAPP_NEUTRAL_TIP;Przywróć wszystkie suwaki oraz krzywe do wartości domyślnych TP_COLORAPP_RSTPRO;Ochrona odcieni skóry i czerwieni TP_COLORAPP_RSTPRO_TOOLTIP;Ochrona odcieni skóry i czerwieni (suwaki i krzywe) TP_COLORAPP_SURROUND;Otoczenie @@ -957,6 +1276,22 @@ TP_COLORTONING_HIGHLIGHT;Podświetlenia TP_COLORTONING_HUE;Odcień (hue) TP_COLORTONING_LAB;Mieszanie L*a*b* TP_COLORTONING_LABEL;Koloryzacja +TP_COLORTONING_LABREGION_CHANNEL;Kanał +TP_COLORTONING_LABREGION_CHANNEL_ALL;Wszystkie +TP_COLORTONING_LABREGION_CHANNEL_B;Niebieski +TP_COLORTONING_LABREGION_CHANNEL_G;Zielony +TP_COLORTONING_LABREGION_CHANNEL_R;Czerwony +TP_COLORTONING_LABREGION_CHROMATICITYMASK;C +TP_COLORTONING_LABREGION_HUEMASK;H +TP_COLORTONING_LABREGION_LIGHTNESSMASK;L +TP_COLORTONING_LABREGION_LIST_TITLE;Korekcja +TP_COLORTONING_LABREGION_MASK;Maska +TP_COLORTONING_LABREGION_MASKBLUR;Rozmycie maski +TP_COLORTONING_LABREGION_OFFSET;Przesunięcie +TP_COLORTONING_LABREGION_POWER;Moc +TP_COLORTONING_LABREGION_SATURATION;Saturacja +TP_COLORTONING_LABREGION_SHOWMASK;Pokaż maskę +TP_COLORTONING_LABREGION_SLOPE;Nachylenie TP_COLORTONING_LUMA;Luminancja TP_COLORTONING_LUMAMODE;Zachowaj luminancję TP_COLORTONING_LUMAMODE_TOOLTIP;Luminancja zostanie zachowana przy zmianie kolorów. @@ -969,7 +1304,7 @@ TP_COLORTONING_OPACITY;Przezroczystość TP_COLORTONING_RGBCURVES;RGB - Krzywe TP_COLORTONING_RGBSLIDERS;RGB - Suwaki TP_COLORTONING_SA;Ochrona przed przesyceniem -TP_COLORTONING_SATURATEDOPACITY;Śiła +TP_COLORTONING_SATURATEDOPACITY;Siła TP_COLORTONING_SATURATIONTHRESHOLD;Próg TP_COLORTONING_SHADOWS;Cienie TP_COLORTONING_SPLITCO;Cienie/półcienie/podświetlenia @@ -992,6 +1327,9 @@ TP_CROP_GTRULETHIRDS;Trójpodział TP_CROP_GUIDETYPE;Typ pomocy: TP_CROP_H;Wysokość TP_CROP_LABEL;Kadrowanie +TP_CROP_PPI;PPI +TP_CROP_RESETCROP;Reset +TP_CROP_SELECTCROP;Wybierz TP_CROP_W;Szerokość TP_CROP_X;X TP_CROP_Y;Y @@ -1000,13 +1338,28 @@ TP_DARKFRAME_LABEL;Czarna klatka TP_DEFRINGE_LABEL;Usuwanie widma TP_DEFRINGE_RADIUS;Promień TP_DEFRINGE_THRESHOLD;Próg +TP_DEHAZE_DEPTH;Głębia +TP_DEHAZE_LABEL;Usuwanie mgły +TP_DEHAZE_LUMINANCE;Tylko luminancja +TP_DEHAZE_SHOW_DEPTH_MAP;Pokaż mapę głębokości +TP_DEHAZE_STRENGTH;Siła +TP_DIRPYRDENOISE_CHROMINANCE_AUTOGLOBAL;Automatycznie TP_DIRPYRDENOISE_CHROMINANCE_BLUEYELLOW;Chrominancja - Błękit-żółć +TP_DIRPYRDENOISE_CHROMINANCE_CURVE;Krzywa chrominancji +TP_DIRPYRDENOISE_CHROMINANCE_FRAME;Chrominancja +TP_DIRPYRDENOISE_CHROMINANCE_MANUAL;Ręcznie TP_DIRPYRDENOISE_CHROMINANCE_MASTER;Chrominancja - Główna +TP_DIRPYRDENOISE_CHROMINANCE_METHOD;Metoda +TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW;Podgląd TP_DIRPYRDENOISE_CHROMINANCE_REDGREEN;Chrominancja - Czerwień-zieleń +TP_DIRPYRDENOISE_LABEL;Redukcja szumu +TP_DIRPYRDENOISE_LUMINANCE_CONTROL;Kontrola luminancji TP_DIRPYRDENOISE_LUMINANCE_CURVE;Krzywa luminancji TP_DIRPYRDENOISE_LUMINANCE_DETAIL;Szczegółowość luminancji +TP_DIRPYRDENOISE_LUMINANCE_FRAME;Luminancja TP_DIRPYRDENOISE_LUMINANCE_SMOOTHING;Luminacja TP_DIRPYRDENOISE_MAIN_COLORSPACE;Metoda +TP_DIRPYRDENOISE_MAIN_COLORSPACE_LAB;L*a*b* TP_DIRPYRDENOISE_MAIN_COLORSPACE_RGB;RGB TP_DIRPYRDENOISE_MAIN_COLORSPACE_TOOLTIP;Dla obrazów raw można używać metody RGB oraz L*a*b*.\n\nDla obrazów nie-raw metoda L*a*b* zostanie użyta niezależnie od wyboru. TP_DIRPYRDENOISE_MAIN_GAMMA;Gamma @@ -1016,6 +1369,7 @@ TP_DIRPYRDENOISE_MAIN_MODE_AGGRESSIVE;Wysoka TP_DIRPYRDENOISE_MAIN_MODE_CONSERVATIVE;Standardowa TP_DIRPYRDENOISE_MAIN_MODE_TOOLTIP;Jakość może zostać dopasowana do wzoru szumów. Ustawienie "wysoka" ulepsza odszumianie około 20% wzrostu czasu przetwarzania. TP_DIRPYRDENOISE_MEDIAN_METHOD;Metoda mediana +TP_DIRPYRDENOISE_MEDIAN_METHOD_CHROMINANCE;Tylko Chroma TP_DIRPYRDENOISE_MEDIAN_METHOD_LAB;L*a*b* TP_DIRPYRDENOISE_MEDIAN_METHOD_LABEL;Filtr Mediana TP_DIRPYRDENOISE_MEDIAN_METHOD_LUMINANCE;Tylko luminancja @@ -1023,8 +1377,15 @@ TP_DIRPYRDENOISE_MEDIAN_METHOD_RGB;RGB TP_DIRPYRDENOISE_MEDIAN_METHOD_TOOLTIP;Przy użyciu metod "tylko luminancja" oraz "L*a*b*", filtrowanie mediana zostanie wykonane prosto po funkcji falki w procesie odszumiania.\nW trybie "RGB" filtrowanie to zostanie wykonana pod koniec calego procesu. TP_DIRPYRDENOISE_MEDIAN_PASSES;Liczba powtórzeń mediana TP_DIRPYRDENOISE_MEDIAN_TYPE;Rodzaj mediana +TP_DIRPYRDENOISE_TYPE_3X3;3×3 +TP_DIRPYRDENOISE_TYPE_3X3SOFT;3×3 miękko +TP_DIRPYRDENOISE_TYPE_5X5;5×5 +TP_DIRPYRDENOISE_TYPE_5X5SOFT;5×5 miękko +TP_DIRPYRDENOISE_TYPE_7X7;7×7 +TP_DIRPYRDENOISE_TYPE_9X9;9×9 TP_DIRPYREQUALIZER_ALGO;Zakres odcieni skóry TP_DIRPYREQUALIZER_ALGO_TOOLTIP;- +TP_DIRPYREQUALIZER_ARTIF;Usuń artefakty TP_DIRPYREQUALIZER_HUESKIN;Odcień skóry TP_DIRPYREQUALIZER_HUESKIN_TOOLTIP;Piramida wyznacza zakres kolorów uważany jako zakres odcieni skóry. Większość odcieni skóry - białej, czarnej, i pomiędzy - ma tę samą odcień. Małe poprawki są dopuszczalne, jednak jeśli potrzebna jest większa zmiana w lewo lub prawo, lub jeśli są widoczne artefakty, to najprawdopobniej balans bieli jest niepoprawny. TP_DIRPYREQUALIZER_LABEL;Kontrast wg. precyzji detali @@ -1040,6 +1401,7 @@ TP_DIRPYREQUALIZER_TOOLTIP;Zapobiega artefaktom w strefach przejścia pomiędzy TP_DISTORTION_AMOUNT;Siła TP_DISTORTION_LABEL;Dystorsja TP_EPD_EDGESTOPPING;Wyszukiwanie krawędzi +TP_EPD_GAMMA;Gamma TP_EPD_LABEL;Tone Mapping TP_EPD_REWEIGHTINGITERATES;Powtarzanie rozważania TP_EPD_SCALE;Skala @@ -1048,6 +1410,7 @@ TP_EXPOSURE_AUTOLEVELS;Wyrównaj poziomy TP_EXPOSURE_AUTOLEVELS_TIP;Dokonaj automatycznego ustawienia parametrów ekspozycji na podstawie analizy obrazu TP_EXPOSURE_BLACKLEVEL;Czerń TP_EXPOSURE_BRIGHTNESS;Jasność +TP_EXPOSURE_CLAMPOOG;Przytnij kolory spoza gamy kolorów TP_EXPOSURE_CLIP;Przytnij % TP_EXPOSURE_CLIP_TIP;Ułamek pikseli ktore mają zostać rozjaśnione do punktu prześwietlenia podczas automatycznego wyrównania poziomów. TP_EXPOSURE_COMPRHIGHLIGHTS;Kompresja podświetleń @@ -1064,11 +1427,17 @@ TP_EXPOSURE_SATURATION;Nasycenie TP_EXPOSURE_TCMODE_FILMLIKE;Klisza TP_EXPOSURE_TCMODE_LABEL1;Tryb krzywej 1 TP_EXPOSURE_TCMODE_LABEL2;Tryb krzywej 2 +TP_EXPOSURE_TCMODE_LUMINANCE;Luminancja +TP_EXPOSURE_TCMODE_PERCEPTUAL;Percepcyjny TP_EXPOSURE_TCMODE_SATANDVALBLENDING;Mieszanie nasycenia i mocy światła białego TP_EXPOSURE_TCMODE_STANDARD;Standardowa TP_EXPOSURE_TCMODE_WEIGHTEDSTD;Ważona standardowa TP_EXPOS_BLACKPOINT_LABEL;Punkt czerni raw TP_EXPOS_WHITEPOINT_LABEL;Punkt bieli raw +TP_FILMNEGATIVE_BLUE;Proporcja niebieskiego +TP_FILMNEGATIVE_LABEL;Negatyw - klisza +TP_FILMNEGATIVE_PICK;Wybierz miejsce neutralne +TP_FILMNEGATIVE_RED;Proporcja czerwonego TP_FILMSIMULATION_LABEL;Symulacja Kliszy TP_FILMSIMULATION_STRENGTH;Siła TP_FILMSIMULATION_ZEROCLUTSFOUND;Ustaw folder HaldCLUT w Ustawieniach @@ -1107,6 +1476,7 @@ TP_HSVEQUALIZER_HUE;H TP_HSVEQUALIZER_LABEL;Ekwalizator HSV TP_HSVEQUALIZER_SAT;S TP_HSVEQUALIZER_VAL;V +TP_ICM_BPC;Kompensacja punktu czerni TP_ICM_DCPILLUMINANT;Iluminant TP_ICM_DCPILLUMINANT_INTERPOLATED;Interpolowany TP_ICM_DCPILLUMINANT_TOOLTIP;Wybierz który osadzony iluminant DCP należy użyć. Domyślną opcją jest "interpolowany", czyli wartość jest mieszaniną pomiędzy dwoma osadzonymi wartościami iluminantu zależnie od balansu bieli. Ten wybór jest możliwy jedynie kiedy DCP zawiera dwa iluminanty z możliwościa interpolacji. @@ -1125,10 +1495,17 @@ TP_ICM_INPUTPROFILE;Profil wejściowy TP_ICM_LABEL;ICM TP_ICM_NOICM;Brak ICM: Wyjście sRGB TP_ICM_OUTPUTPROFILE;Profil wyjściowy +TP_ICM_SAVEREFERENCE_APPLYWB;Zastosuj balans bieli TP_ICM_SAVEREFERENCE_TOOLTIP;Zapisz liniowy obraz TIFF zanim profil wejściowy zostanie zastosowany. Obraz ten można użyć do kalibracji oraz do wytworzenia profilu aparatu. TP_ICM_TONECURVE;Użyj krzywą tonalną z DCP TP_ICM_TONECURVE_TOOLTIP;Włącz aby użyć krzywą tonalną znajdującą się w profilu DCP. Opcja ta jest tylko aktywna jeśli profil DCP zawiera krzywą tonalną. TP_ICM_WORKINGPROFILE;Profil roboczy +TP_ICM_WORKING_TRC;Krzywa odpowiedzi tonalnej: +TP_ICM_WORKING_TRC_CUSTOM;Własna +TP_ICM_WORKING_TRC_GAMMA;Gamma +TP_ICM_WORKING_TRC_NONE;Żadna +TP_ICM_WORKING_TRC_SLOPE;Nachylenie +TP_ICM_WORKING_TRC_TOOLTIP;Tylko dla wbudowanych profili. TP_IMPULSEDENOISE_LABEL;Redukcja Szumów Impulsowych TP_IMPULSEDENOISE_THRESH;Próg TP_LABCURVE_AVOIDCOLORSHIFT;Zapobiegaj zmianom koloru @@ -1171,7 +1548,27 @@ TP_LABCURVE_RSTPRO_TOOLTIP;Ma wpływ na suwak Chromatyczności oraz na krzywą C TP_LENSGEOM_AUTOCROP;Auto-kadrowanie TP_LENSGEOM_FILL;Auto-wypełnienie TP_LENSGEOM_LABEL;Obiektyw / Geometria +TP_LENSGEOM_LIN;Liniowo +TP_LENSGEOM_LOG;Logarytmicznie +TP_LENSPROFILE_CORRECTION_AUTOMATCH;Wybierz automatycznie +TP_LENSPROFILE_CORRECTION_LCPFILE;Plik LCP +TP_LENSPROFILE_CORRECTION_MANUAL;Wybierz ręcznie TP_LENSPROFILE_LABEL;Profil korekcji obiektywu LCP +TP_LENSPROFILE_MODE_HEADER;Profil obiektywu +TP_LENSPROFILE_USE_CA;Aberracja chromatyczna +TP_LENSPROFILE_USE_GEOMETRIC;Zniekształcenia geometryczne +TP_LENSPROFILE_USE_HEADER;Popraw +TP_LENSPROFILE_USE_VIGNETTING;Winietowanie +TP_LOCALCONTRAST_AMOUNT;Ilość +TP_LOCALCONTRAST_DARKNESS;Ciemne miejsca +TP_LOCALCONTRAST_LABEL;Kontrast lokalny +TP_LOCALCONTRAST_LIGHTNESS;Jasne miejsca +TP_LOCALCONTRAST_RADIUS;Promień +TP_METADATA_EDIT;Zastosuj modyfikacje +TP_METADATA_MODE;Tryb kopiowania metadanych +TP_METADATA_STRIP;Usuń wszystkie metadane +TP_METADATA_TUNNEL;Kopiuj niezmienione +TP_NEUTRAL;Reset TP_NEUTRAL_TIP;Zresetuj ustawienia do wartości neutralnych.\nDziała na tych samych suwakach na których funkcja "Wyrównaj poziomy" działa, niezależnie od tego czy funkcja ta była użyta czy nie. TP_PCVIGNETTE_FEATHER;Wtapianie TP_PCVIGNETTE_FEATHER_TOOLTIP;Wtapianie:\n0 = tylko brzegi,\n50 = w pół drogi do środka,\n100 = aż do środka. @@ -1192,8 +1589,15 @@ TP_PREPROCESS_HOTPIXFILT;Filtr gorących pikseli TP_PREPROCESS_HOTPIXFILT_TOOLTIP;Łata gorące piksele (pojedyńcze świecące, przesycone piksele). TP_PREPROCESS_LABEL;Przetwarzanie początkowe TP_PREPROCESS_LINEDENOISE;Filtr zakłóceń liniowych +TP_PREPROCESS_LINEDENOISE_DIRECTION;Kierunek +TP_PREPROCESS_LINEDENOISE_DIRECTION_BOTH;Oba +TP_PREPROCESS_LINEDENOISE_DIRECTION_HORIZONTAL;Poziomo +TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Pionowo TP_PREPROCESS_NO_FOUND;Nic nie znaleziono +TP_PRSHARPENING_LABEL;Wyostrzanie po zmianie rozmiaru TP_RAWCACORR_AUTO;Autokorekcja +TP_RAWCACORR_AUTOIT;Iteracje +TP_RAWCACORR_AVOIDCOLORSHIFT;Unikaj przesunięcia kolorów TP_RAWCACORR_CABLUE;Niebieski TP_RAWCACORR_CARED;Czerwony TP_RAWCACORR_LABEL;Korekcja aberracji chromatycznej @@ -1207,19 +1611,60 @@ TP_RAWEXPOS_BLACK_RED;Czerwony TP_RAWEXPOS_LINEAR;Liniowy współczynnik korekcji TP_RAWEXPOS_RGB;Czerwony, Zielony, Niebieski TP_RAWEXPOS_TWOGREEN;Połącz obie zielenie +TP_RAW_1PASSMEDIUM;1-pass (Markesteijn) +TP_RAW_2PASS;1-pass+fast +TP_RAW_3PASSBEST;3-pass (Markesteijn) +TP_RAW_4PASS;3-pass+fast +TP_RAW_AHD;AHD +TP_RAW_AMAZE;AMaZE +TP_RAW_AMAZEVNG4;AMaZE+VNG4 +TP_RAW_DCB;DCB TP_RAW_DCBENHANCE;Zastosuj poprawę DCB TP_RAW_DCBITERATIONS;Liczba powtórzeń DCB +TP_RAW_DCBVNG4;DCB+VNG4 TP_RAW_DMETHOD;Metoda TP_RAW_DMETHOD_PROGRESSBAR;Demozaikowanie %1... TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Udoskonalanie demozaikowania... TP_RAW_DMETHOD_TOOLTIP;IGV oraz LMMSE są przeznaczone dla zdjęć raw o wysokim poziomie szumów (wysokie ISO) aby zapobiec utworzeniu się wzorków w kształcie małych labiryntów, posteryzacji oraz mydlanego wyglądu. +TP_RAW_DUALDEMOSAICAUTOCONTRAST;Próg automatyczny +TP_RAW_DUALDEMOSAICCONTRAST;Próg kontrastu +TP_RAW_EAHD;EAHD TP_RAW_FALSECOLOR;Kroki zapobiegające fałszowaniu kolorów +TP_RAW_FAST;Szybki +TP_RAW_HD;Próg +TP_RAW_HPHD;HPHD +TP_RAW_IGV;IGV TP_RAW_LABEL;Demozaikowanie +TP_RAW_LMMSE;LMMSE TP_RAW_LMMSEITERATIONS;Ilość kroków udoskonalenia LMMSE TP_RAW_LMMSE_TOOLTIP;Aby zmniejszyć ilość artefaktów i poprawić stosunek sygnału do szumów, można wykorzystać następujące ustawienia:\n1: Gamma\n2-4: Średnia mediana\n5-6: Rafinowanie +TP_RAW_MONO;Mono +TP_RAW_PIXELSHIFTBLUR;Maska rozmycia ruchu +TP_RAW_PIXELSHIFTDMETHOD;Metoda demozaikowania ruchu +TP_RAW_PIXELSHIFTEPERISO;Czułość +TP_RAW_PIXELSHIFTEQUALBRIGHT;Wyrównaj jasność klatek +TP_RAW_PIXELSHIFTHOLEFILL;Wypełnij dziury w masce ruchu +TP_RAW_PIXELSHIFTHOLEFILL_TOOLTIP;Wypełnia dziury w masce ruchu +TP_RAW_PIXELSHIFTMEDIAN;Użyj mediany dla poruszonych fragmentów +TP_RAW_PIXELSHIFTMM_AUTO;Automatyczny +TP_RAW_PIXELSHIFTMM_CUSTOM;Własny +TP_RAW_PIXELSHIFTMM_OFF;Wyłączony +TP_RAW_PIXELSHIFTMOTIONMETHOD;Korekcja ruchu +TP_RAW_PIXELSHIFTNONGREENCROSS;Szukaj ruchu w kanale niebieskim/czerwonym +TP_RAW_PIXELSHIFTSHOWMOTION;Pokaż maskę ruchu +TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY;Pokaż tylko maskę ruchu +TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY_TOOLTIP;Pokaż samą maskę ruchu (bez obrazu). +TP_RAW_PIXELSHIFTSIGMA;Promień rozmycia +TP_RAW_PIXELSHIFTSMOOTH;Miękkie przejścia +TP_RAW_RCD;RCD +TP_RAW_RCDVNG4;RCD+VNG4 TP_RAW_SENSOR_BAYER_LABEL;Matryca z filtrem Bayera TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;Trzy powtórzenia prowadzą do najlepszych rezultatów (zalecane dla zdjęć o niskim ISO).\nJedno powtórzenie jest prawie nie do odróżnienia od trzech dla zdjęć o wysokim ISO a jest znacznie szybsze. TP_RAW_SENSOR_XTRANS_LABEL;Matryca z filtrem X-Trans +TP_RAW_VNG4;VNG4 +TP_RAW_XTRANS;X-Trans +TP_RAW_XTRANSFAST;Szybki X-Trans +TP_RESIZE_ALLOW_UPSCALING;Zezwól na zwiększenie rozdzielczości TP_RESIZE_APPLIESTO;Dotyczy: TP_RESIZE_CROPPEDAREA;Obszaru kadrowanego TP_RESIZE_FITBOX;Wymiary obwodu @@ -1234,6 +1679,46 @@ TP_RESIZE_SCALE;Skalę TP_RESIZE_SPECIFY;Określ: TP_RESIZE_W;Szerokość TP_RESIZE_WIDTH;Szerokość +TP_RETINEX_CONTEDIT_HSL;Histogram HSL +TP_RETINEX_CONTEDIT_LAB;Histogram L*a*b* +TP_RETINEX_CONTEDIT_LH;Odcień +TP_RETINEX_CONTEDIT_MAP;Wyrównywanie +TP_RETINEX_CURVEEDITOR_CD;L=f(L) +TP_RETINEX_CURVEEDITOR_LH;Siła=f(H) +TP_RETINEX_CURVEEDITOR_MAP;L=f(L) +TP_RETINEX_EQUAL;Wyrównywanie +TP_RETINEX_GAIN;Wzmocnienie +TP_RETINEX_GAMMA;Gamma +TP_RETINEX_GAMMA_FREE;Wolna +TP_RETINEX_GAMMA_HIGH;Wysoka +TP_RETINEX_GAMMA_LOW;Niska +TP_RETINEX_GAMMA_MID;Średnia +TP_RETINEX_GAMMA_NONE;Żaden +TP_RETINEX_HIGH;Wysoki +TP_RETINEX_HIGHLIGHT;Próg podświetleń +TP_RETINEX_HSLSPACE_LIN;HSL-Liniowa +TP_RETINEX_HSLSPACE_LOG;HSL-Logarytmiczna +TP_RETINEX_LABEL;Retinex +TP_RETINEX_LABEL_MASK;Maska +TP_RETINEX_LABSPACE;L*a*b* +TP_RETINEX_LOW;Niski +TP_RETINEX_MAP;Metoda +TP_RETINEX_MAP_GAUS;Maska Gaussa +TP_RETINEX_MAP_NONE;Żaden +TP_RETINEX_METHOD;Metoda +TP_RETINEX_NEIGHBOR;Promień +TP_RETINEX_NEUTRAL;Reset +TP_RETINEX_OFFSET;Przesunięcie (jasność) +TP_RETINEX_SETTINGS;Ustawienia +TP_RETINEX_SKAL;Skala +TP_RETINEX_STRENGTH;Siła +TP_RETINEX_THRESHOLD;Próg +TP_RETINEX_UNIFORM;Jednolity +TP_RETINEX_VARIANCE;Kontrast +TP_RETINEX_VIEW;Proces +TP_RETINEX_VIEW_MASK;Maska +TP_RETINEX_VIEW_NONE;Standardowy +TP_RETINEX_VIEW_UNSHARP;Maska wyostrzająca TP_RGBCURVES_BLUE;B TP_RGBCURVES_CHANNEL;Kanał TP_RGBCURVES_GREEN;G @@ -1256,6 +1741,8 @@ TP_SHARPENEDGE_LABEL;Krawędzie TP_SHARPENEDGE_PASSES;Powtórzenia TP_SHARPENEDGE_THREE;Tylko luminancja TP_SHARPENING_AMOUNT;Siła +TP_SHARPENING_BLUR;Promień rozmycia +TP_SHARPENING_CONTRAST;Próg kontrastu TP_SHARPENING_EDRADIUS;Promień TP_SHARPENING_EDTOLERANCE;Tolerancja krawędzi TP_SHARPENING_HALOCONTROL;Kontrola poświaty @@ -1271,9 +1758,14 @@ TP_SHARPENING_RLD_ITERATIONS;Powtórzenia TP_SHARPENING_THRESHOLD;Próg TP_SHARPENING_USM;Maska wyostrzająca TP_SHARPENMICRO_AMOUNT;Siła +TP_SHARPENMICRO_CONTRAST;Próg kontrastu TP_SHARPENMICRO_LABEL;Mikrokontrast TP_SHARPENMICRO_MATRIX;Matryca 3×3 zamiast 5×5 TP_SHARPENMICRO_UNIFORMITY;Jednolitość +TP_SOFTLIGHT_STRENGTH;Siła +TP_TM_FATTAL_AMOUNT;Ilość +TP_TM_FATTAL_LABEL;Kompresja zakresu dynamiki +TP_TM_FATTAL_THRESHOLD;Detale TP_VIBRANCE_AVOIDCOLORSHIFT;Zapobiegaj przesunięcia kolorów TP_VIBRANCE_CURVEEDITOR_SKINTONES;HH TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL;Odcienie skóry @@ -1298,6 +1790,105 @@ TP_VIGNETTING_CENTER_Y;Środek Y TP_VIGNETTING_LABEL;Korekcja winietowania TP_VIGNETTING_RADIUS;Promień TP_VIGNETTING_STRENGTH;Siła +TP_WAVELET_1;Poziom 1 +TP_WAVELET_2;Poziom 2 +TP_WAVELET_3;Poziom 3 +TP_WAVELET_4;Poziom 4 +TP_WAVELET_5;Poziom 5 +TP_WAVELET_6;Poziom 6 +TP_WAVELET_7;Poziom 7 +TP_WAVELET_8;Poziom 8 +TP_WAVELET_9;Poziom 9 +TP_WAVELET_APPLYTO;Zastosuj do +TP_WAVELET_AVOID;Unikaj przesunięcia kolorów +TP_WAVELET_B0;Czarny +TP_WAVELET_B1;Szary +TP_WAVELET_BACKGROUND;Tło +TP_WAVELET_BACUR;Krzywa +TP_WAVELET_BALCHRO;Balans chrominancji +TP_WAVELET_BANONE;Żaden +TP_WAVELET_BASLI;Suwak +TP_WAVELET_BATYPE;Metoda balansu kontrastu +TP_WAVELET_CBENAB;Tonowanie i balans kolorów +TP_WAVELET_CCURVE;Kontrast lokalny +TP_WAVELET_CH1;Cały zakres chrominancji +TP_WAVELET_CH2;Nasycone/pastelowe +TP_WAVELET_CH3;Połącz poziomy kontrastu +TP_WAVELET_CHCU;Krzywa +TP_WAVELET_CHSL;Suwaki +TP_WAVELET_COMPCONT;Kontrast +TP_WAVELET_COMPGAMMA;Kompresja - Gamma +TP_WAVELET_CONTR;Gamut +TP_WAVELET_CONTRA;Kontrast +TP_WAVELET_CONTRAST_MINUS;Kontrast - +TP_WAVELET_CONTRAST_PLUS;Kontrast + +TP_WAVELET_CTYPE;Kontrola chrominancji +TP_WAVELET_CURVEEDITOR_CL;L +TP_WAVELET_CURVEEDITOR_HH;HH +TP_WAVELET_DALL;We wszystkich kierunkach +TP_WAVELET_DAUB2;D2 - niski +TP_WAVELET_DAUB4;D4 - standard +TP_WAVELET_DAUB6;D6 - standard plus +TP_WAVELET_DAUB10;D10 - średni +TP_WAVELET_DAUB14;D14 - wysoki +TP_WAVELET_DONE;Pionowo +TP_WAVELET_DTHR;Po przekątnej +TP_WAVELET_DTWO;Poziomo +TP_WAVELET_EDCU;Krzywa +TP_WAVELET_EDGCONT;Kontrast lokalny +TP_WAVELET_EDGE;Ostrość krawędzi +TP_WAVELET_EDGEDETECTTHR;Niski próg (szum) +TP_WAVELET_EDGEDETECTTHR2;Wysoki próg (wykrywanie) +TP_WAVELET_EDGTHRESH;Szczegółowość +TP_WAVELET_EDRAD;Promień +TP_WAVELET_EDSL;Suwaki progów +TP_WAVELET_EDTYPE;Metoda kontrastu lokalnego: +TP_WAVELET_EDVAL;Siła +TP_WAVELET_FINAL;Ostateczny retusz +TP_WAVELET_FINEST;Najdokładniej +TP_WAVELET_HIGHLIGHT;Zakres luminancji podświetleń +TP_WAVELET_HS1;Zakres luminancji +TP_WAVELET_HS2;Cienie/Podświetlenia +TP_WAVELET_HUESKIN;Odcień skóry +TP_WAVELET_HUESKY;Odcień nieba +TP_WAVELET_LEVCH;Chrominancja +TP_WAVELET_LEVF;Kontrast +TP_WAVELET_LEVONE;Poziom 2 +TP_WAVELET_LEVTHRE;Poziom 4 +TP_WAVELET_LEVTWO;Poziom 3 +TP_WAVELET_LEVZERO;Poziom 1 +TP_WAVELET_LINKEDG;Połącz z siłą 'Ostrość krawędzi' +TP_WAVELET_LIPST;Usprawniony algorytm +TP_WAVELET_LOWLIGHT;Zakres luminancji cieni +TP_WAVELET_MEDGREINF;Pierwszy poziom +TP_WAVELET_MEDI;Usuwaj artefakty niebieskiego nieba +TP_WAVELET_MEDILEV;Wykrywanie krawędzi +TP_WAVELET_NEUTRAL;Neutralny +TP_WAVELET_NOIS;Odszumianie +TP_WAVELET_NPHIGH;Wysoki +TP_WAVELET_NPLOW;Niski +TP_WAVELET_NPNONE;Brak +TP_WAVELET_NPTYPE;Piksele sąsiadujące +TP_WAVELET_PASTEL;Chrominancja kolorów pastelowych +TP_WAVELET_PROC;Proces +TP_WAVELET_RE1;Wzmocniony +TP_WAVELET_RE2;Niezmieniony +TP_WAVELET_RE3;Zmniejszony +TP_WAVELET_RESCHRO;Chrominancja +TP_WAVELET_RESCON;Cienie +TP_WAVELET_RESCONH;Podświetlenia +TP_WAVELET_SAT;Chrominancja kolorów nasyconych +TP_WAVELET_SKY;Odcień nieba - wybór/ochrona +TP_WAVELET_STREN;Siła +TP_WAVELET_STRENGTH;Siła +TP_WAVELET_SUPE;Ekstra +TP_WAVELET_THR;Próg cieni +TP_WAVELET_THRESHOLD;Poziom podświetleń +TP_WAVELET_THRESHOLD2;Poziom cieni +TP_WAVELET_THRH;Próg podświetleń +TP_WAVELET_TMSTRENGTH;Siła kompresji +TP_WAVELET_TMTYPE;Metoda kompresji +TP_WAVELET_TON;Tonowanie TP_WBALANCE_AUTO;Auto TP_WBALANCE_CAMERA;Z aparatu TP_WBALANCE_CLOUDY;Pochmurnie @@ -1332,6 +1923,7 @@ TP_WBALANCE_LED_CRS;CRS SP12 WWMR16 TP_WBALANCE_LED_HEADER;LED TP_WBALANCE_LED_LSI;LSI Lumelex 2040 TP_WBALANCE_METHOD;Metoda +TP_WBALANCE_PICKER;Wybierz TP_WBALANCE_SHADE;Ćień TP_WBALANCE_SIZE;Wielkość: TP_WBALANCE_SOLUX35;Solux 3500K @@ -1339,6 +1931,7 @@ TP_WBALANCE_SOLUX41;Solux 4100K TP_WBALANCE_SOLUX47;Solux 4700K (vendor) TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) TP_WBALANCE_SPOTWB;Punktowy +TP_WBALANCE_TEMPBIAS;Kompensacja automatycznego balansu bieli (AWB) TP_WBALANCE_TEMPERATURE;Temperatura TP_WBALANCE_TUNGSTEN;Wolfram TP_WBALANCE_WATER1;Pod wodą 1 @@ -1356,29 +1949,11 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - ! Untranslated keys follow; remove the ! prefix after an entry is translated. !!!!!!!!!!!!!!!!!!!!!!!!! -!ADJUSTER_RESET_TO_DEFAULT;Click - reset to default value.\nCtrl+click - reset to initial value. -!CURVEEDITOR_AXIS_IN;I: -!CURVEEDITOR_AXIS_LEFT_TAN;LT: -!CURVEEDITOR_AXIS_OUT;O: -!CURVEEDITOR_AXIS_RIGHT_TAN;RT: -!CURVEEDITOR_CATMULLROM;Flexible !CURVEEDITOR_EDITPOINT_HINT;Enable edition of node in/out values.\n\nRight-click on a node to select it.\nRight-click on empty space to de-select the node. -!DONT_SHOW_AGAIN;Don't show this message again. -!DYNPROFILEEDITOR_DELETE;Delete -!DYNPROFILEEDITOR_EDIT;Edit !DYNPROFILEEDITOR_EDIT_RULE;Edit Dynamic Profile Rule !DYNPROFILEEDITOR_ENTRY_TOOLTIP;The matching is case insensitive.\nUse the "re:" prefix to enter\na regular expression. -!DYNPROFILEEDITOR_IMGTYPE_ANY;Any -!DYNPROFILEEDITOR_IMGTYPE_HDR;HDR !DYNPROFILEEDITOR_IMGTYPE_PS;Pixel Shift -!DYNPROFILEEDITOR_IMGTYPE_STD;Standard -!DYNPROFILEEDITOR_MOVE_DOWN;Move Down -!DYNPROFILEEDITOR_MOVE_UP;Move Up -!DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule -!DYNPROFILEEDITOR_PROFILE;Processing Profile -!EXIFFILTER_IMAGETYPE;Image type -!EXIFPANEL_SHOWALL;Show all !EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels !EXPORT_PIPELINE;Processing pipeline @@ -1386,136 +1961,53 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. !EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !FILEBROWSER_BROWSEPATHBUTTONHINT;Click to open specified path, reload folder and apply "find" keywords. -!FILEBROWSER_CACHECLEARFROMFULL;Clear all including cached profiles -!FILEBROWSER_CACHECLEARFROMPARTIAL;Clear all except cached profiles !FILEBROWSER_DELETEDIALOG_ALL;Are you sure you want to permanently delete all %1 files in trash? !FILEBROWSER_DELETEDIALOG_SELECTED;Are you sure you want to permanently delete the selected %1 files? !FILEBROWSER_DELETEDIALOG_SELECTEDINCLPROC;Are you sure you want to permanently delete the selected %1 files, including a queue-processed version? -!FILEBROWSER_EMPTYTRASHHINT;Permanently delete all files in trash. -!FILEBROWSER_POPUPREMOVE;Delete permanently !FILEBROWSER_POPUPREMOVEINCLPROC;Delete permanently, including queue-processed version -!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default -!FILEBROWSER_SHOWNOTTRASHHINT;Show only images not in trash. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. -!FILECHOOSER_FILTER_ANY;All files -!FILECHOOSER_FILTER_COLPROF;Color profiles (*.icc) -!FILECHOOSER_FILTER_CURVE;Curve files -!FILECHOOSER_FILTER_LCP;Lens correction profiles -!FILECHOOSER_FILTER_PP;Processing profiles -!FILECHOOSER_FILTER_SAME;Same format as current photo -!FILECHOOSER_FILTER_TIFF;TIFF files -!GENERAL_APPLY;Apply -!GENERAL_ASIMAGE;As Image -!GENERAL_CURRENT;Current -!GENERAL_HELP;Help -!GENERAL_OPEN;Open -!GENERAL_RESET;Reset -!GENERAL_SAVE_AS;Save as... -!GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. !HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. -!HISTORY_MSG_166;Exposure - Reset -!HISTORY_MSG_173;NR - Detail recovery -!HISTORY_MSG_203;NR - Color space !HISTORY_MSG_235;B&W - CM - Auto !HISTORY_MSG_237;B&W - CM -!HISTORY_MSG_256;NR - Median - Type !HISTORY_MSG_273;CT - Color Balance SMH -!HISTORY_MSG_297;NR - Mode -!HISTORY_MSG_299;NR - Chrominance curve -!HISTORY_MSG_300;- -!HISTORY_MSG_301;NR - Luma control -!HISTORY_MSG_302;NR - Chroma method -!HISTORY_MSG_303;NR - Chroma method -!HISTORY_MSG_304;W - Contrast levels !HISTORY_MSG_305;Wavelet Levels -!HISTORY_MSG_306;W - Process -!HISTORY_MSG_307;W - Process -!HISTORY_MSG_308;W - Process direction -!HISTORY_MSG_309;W - ES - Detail !HISTORY_MSG_310;W - Residual - Sky tar/prot !HISTORY_MSG_311;W - Wavelet levels -!HISTORY_MSG_312;W - Residual - Shadows threshold !HISTORY_MSG_313;W - Chroma - Sat/past !HISTORY_MSG_314;W - Gamut - Reduce artifacts -!HISTORY_MSG_315;W - Residual - Contrast !HISTORY_MSG_316;W - Gamut - Skin tar/prot -!HISTORY_MSG_317;W - Gamut - Skin hue -!HISTORY_MSG_318;W - Contrast - Highlight levels -!HISTORY_MSG_319;W - Contrast - Highlight range -!HISTORY_MSG_320;W - Contrast - Shadow range -!HISTORY_MSG_321;W - Contrast - Shadow levels -!HISTORY_MSG_322;W - Gamut - Avoid color shift -!HISTORY_MSG_323;W - ES - Local contrast -!HISTORY_MSG_324;W - Chroma - Pastel -!HISTORY_MSG_325;W - Chroma - Saturated -!HISTORY_MSG_326;W - Chroma - Method !HISTORY_MSG_327;W - Contrast - Apply to !HISTORY_MSG_328;W - Chroma - Link strength !HISTORY_MSG_329;W - Toning - Opacity RG !HISTORY_MSG_330;W - Toning - Opacity BY !HISTORY_MSG_331;W - Contrast levels - Extra !HISTORY_MSG_332;W - Tiling method -!HISTORY_MSG_333;W - Residual - Shadows -!HISTORY_MSG_334;W - Residual - Chroma -!HISTORY_MSG_335;W - Residual - Highlights -!HISTORY_MSG_336;W - Residual - Highlights threshold -!HISTORY_MSG_337;W - Residual - Sky hue -!HISTORY_MSG_338;W - ES - Radius -!HISTORY_MSG_339;W - ES - Strength -!HISTORY_MSG_340;W - Strength !HISTORY_MSG_341;W - Edge performance !HISTORY_MSG_342;W - ES - First level -!HISTORY_MSG_343;W - Chroma levels !HISTORY_MSG_344;W - Meth chroma sl/cur -!HISTORY_MSG_345;W - ES - Local contrast -!HISTORY_MSG_346;W - ES - Local contrast method -!HISTORY_MSG_347;W - Denoise - Level 1 -!HISTORY_MSG_348;W - Denoise - Level 2 -!HISTORY_MSG_349;W - Denoise - Level 3 !HISTORY_MSG_350;W - ES - Edge detection !HISTORY_MSG_351;W - Residual - HH curve -!HISTORY_MSG_352;W - Background !HISTORY_MSG_353;W - ES - Gradient sensitivity !HISTORY_MSG_354;W - ES - Enhanced -!HISTORY_MSG_355;W - ES - Threshold low -!HISTORY_MSG_356;W - ES - Threshold high !HISTORY_MSG_357;W - Denoise - Link with ES !HISTORY_MSG_358;W - Gamut - CH -!HISTORY_MSG_359;Hot/Dead - Threshold !HISTORY_MSG_360;TM - Gamma !HISTORY_MSG_361;W - Final - Chroma balance -!HISTORY_MSG_362;W - Residual - Compression method -!HISTORY_MSG_363;W - Residual - Compression strength -!HISTORY_MSG_364;W - Final - Contrast balance !HISTORY_MSG_365;W - Final - Delta balance !HISTORY_MSG_366;W - Residual - Compression gamma !HISTORY_MSG_367;W - Final - 'After' contrast curve -!HISTORY_MSG_368;W - Final - Contrast balance -!HISTORY_MSG_369;W - Final - Balance method -!HISTORY_MSG_370;W - Final - Local contrast curve !HISTORY_MSG_371;Post-Resize Sharpening -!HISTORY_MSG_372;PRS USM - Radius -!HISTORY_MSG_373;PRS USM - Amount -!HISTORY_MSG_374;PRS USM - Threshold !HISTORY_MSG_375;PRS USM - Sharpen only edges -!HISTORY_MSG_376;PRS USM - Edge detection radius -!HISTORY_MSG_377;PRS USM - Edge tolerance !HISTORY_MSG_378;PRS USM - Halo control !HISTORY_MSG_379;PRS USM - Halo control amount -!HISTORY_MSG_380;PRS - Method -!HISTORY_MSG_381;PRS RLD - Radius -!HISTORY_MSG_382;PRS RLD - Amount !HISTORY_MSG_383;PRS RLD - Damping -!HISTORY_MSG_384;PRS RLD - Iterations -!HISTORY_MSG_385;W - Residual - Color Balance !HISTORY_MSG_386;W - Residual - CB green high !HISTORY_MSG_387;W - Residual - CB blue high !HISTORY_MSG_388;W - Residual - CB green mid !HISTORY_MSG_389;W - Residual - CB blue mid !HISTORY_MSG_390;W - Residual - CB green low !HISTORY_MSG_391;W - Residual - CB blue low -!HISTORY_MSG_392;W - Residual - Color Balance !HISTORY_MSG_393;DCP - Look table !HISTORY_MSG_394;DCP - Baseline exposure !HISTORY_MSG_395;DCP - Base table @@ -1528,61 +2020,31 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !HISTORY_MSG_402;W - Denoise sub-tool !HISTORY_MSG_403;W - ES - Edge sensitivity !HISTORY_MSG_404;W - ES - Base amplification -!HISTORY_MSG_405;W - Denoise - Level 4 !HISTORY_MSG_406;W - ES - Neighboring pixels -!HISTORY_MSG_407;Retinex - Method -!HISTORY_MSG_408;Retinex - Radius -!HISTORY_MSG_409;Retinex - Contrast -!HISTORY_MSG_410;Retinex - Offset -!HISTORY_MSG_411;Retinex - Strength !HISTORY_MSG_412;Retinex - Gaussian gradient -!HISTORY_MSG_413;Retinex - Contrast !HISTORY_MSG_414;Retinex - Histogram - Lab !HISTORY_MSG_415;Retinex - Transmission !HISTORY_MSG_416;Retinex !HISTORY_MSG_417;Retinex - Transmission median -!HISTORY_MSG_418;Retinex - Threshold -!HISTORY_MSG_419;Retinex - Color space !HISTORY_MSG_420;Retinex - Histogram - HSL -!HISTORY_MSG_421;Retinex - Gamma -!HISTORY_MSG_422;Retinex - Gamma !HISTORY_MSG_423;Retinex - Gamma slope !HISTORY_MSG_424;Retinex - HL threshold !HISTORY_MSG_425;Retinex - Log base -!HISTORY_MSG_426;Retinex - Hue equalizer !HISTORY_MSG_427;Output rendering intent !HISTORY_MSG_428;Monitor rendering intent -!HISTORY_MSG_429;Retinex - Iterations !HISTORY_MSG_430;Retinex - Transmission gradient !HISTORY_MSG_431;Retinex - Strength gradient -!HISTORY_MSG_432;Retinex - M - Highlights !HISTORY_MSG_433;Retinex - M - Highlights TW -!HISTORY_MSG_434;Retinex - M - Shadows !HISTORY_MSG_435;Retinex - M - Shadows TW -!HISTORY_MSG_436;Retinex - M - Radius -!HISTORY_MSG_437;Retinex - M - Method -!HISTORY_MSG_438;Retinex - M - Equalizer -!HISTORY_MSG_439;Retinex - Process -!HISTORY_MSG_440;CbDL - Method !HISTORY_MSG_441;Retinex - Gain transmission -!HISTORY_MSG_442;Retinex - Scale !HISTORY_MSG_443;Output black point compensation !HISTORY_MSG_444;WB - Temp bias !HISTORY_MSG_445;Raw sub-image -!HISTORY_MSG_449;PS - ISO adaption -!HISTORY_MSG_452;PS - Show motion -!HISTORY_MSG_453;PS - Show mask only !HISTORY_MSG_457;PS - Check red/blue !HISTORY_MSG_462;PS - Check green !HISTORY_MSG_464;PS - Blur motion mask -!HISTORY_MSG_465;PS - Blur radius -!HISTORY_MSG_468;PS - Fill holes !HISTORY_MSG_469;PS - Median -!HISTORY_MSG_471;PS - Motion correction -!HISTORY_MSG_472;PS - Smooth transitions !HISTORY_MSG_473;PS - Use LMMSE -!HISTORY_MSG_474;PS - Equalize -!HISTORY_MSG_475;PS - Equalize channel !HISTORY_MSG_476;CAM02 - Temp out !HISTORY_MSG_477;CAM02 - Green out !HISTORY_MSG_478;CAM02 - Yb out @@ -1592,20 +2054,9 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !HISTORY_MSG_482;CAM02 - Green scene !HISTORY_MSG_483;CAM02 - Yb scene !HISTORY_MSG_484;CAM02 - Auto Yb scene -!HISTORY_MSG_485;Lens Correction -!HISTORY_MSG_486;Lens Correction - Camera -!HISTORY_MSG_487;Lens Correction - Lens !HISTORY_MSG_488;Dynamic Range Compression -!HISTORY_MSG_489;DRC - Detail -!HISTORY_MSG_490;DRC - Amount -!HISTORY_MSG_491;White Balance -!HISTORY_MSG_492;RGB Curves !HISTORY_MSG_493;L*a*b* Adjustments !HISTORY_MSG_494;Capture Sharpening -!HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors -!HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction -!HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction -!HISTORY_MSG_COLORTONING_LABREGION_CHANNEL;CT - Channel !HISTORY_MSG_COLORTONING_LABREGION_CHROMATICITYMASK;CT - region C mask !HISTORY_MSG_COLORTONING_LABREGION_HUEMASK;CT - H mask !HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESS;CT - Lightness @@ -1614,14 +2065,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !HISTORY_MSG_COLORTONING_LABREGION_MASKBLUR;CT - region mask blur !HISTORY_MSG_COLORTONING_LABREGION_OFFSET;CT - region offset !HISTORY_MSG_COLORTONING_LABREGION_POWER;CT - region power -!HISTORY_MSG_COLORTONING_LABREGION_SATURATION;CT - Saturation !HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;CT - region show mask !HISTORY_MSG_COLORTONING_LABREGION_SLOPE;CT - region slope -!HISTORY_MSG_DEHAZE_DEPTH;Dehaze - Depth -!HISTORY_MSG_DEHAZE_ENABLED;Haze Removal -!HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only -!HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;Dehaze - Show depth map -!HISTORY_MSG_DEHAZE_STRENGTH;Dehaze - Strength !HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;Dual demosaic - Auto threshold !HISTORY_MSG_DUALDEMOSAIC_CONTRAST;Dual demosaic - Contrast threshold !HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative @@ -1633,121 +2078,39 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !HISTORY_MSG_ICM_WORKING_GAMMA;Working - Gamma !HISTORY_MSG_ICM_WORKING_SLOPE;Working - Slope !HISTORY_MSG_ICM_WORKING_TRC_METHOD;Working - TRC method -!HISTORY_MSG_LOCALCONTRAST_AMOUNT;Local Contrast - Amount -!HISTORY_MSG_LOCALCONTRAST_DARKNESS;Local Contrast - Darkness -!HISTORY_MSG_LOCALCONTRAST_ENABLED;Local Contrast -!HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Local Contrast - Lightness -!HISTORY_MSG_LOCALCONTRAST_RADIUS;Local Contrast - Radius !HISTORY_MSG_METADATA_MODE;Metadata copy mode -!HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold -!HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Auto threshold -!HISTORY_MSG_PDSHARPEN_AUTO_RADIUS;CS - Auto radius -!HISTORY_MSG_PDSHARPEN_CHECKITER;CS - Auto limit iterations -!HISTORY_MSG_PDSHARPEN_CONTRAST;CS - Contrast threshold -!HISTORY_MSG_PDSHARPEN_ITERATIONS;CS - Iterations -!HISTORY_MSG_PDSHARPEN_RADIUS;CS - Radius !HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - Corner radius boost !HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - Demosaic method for motion !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter -!HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold -!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations -!HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling -!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius -!HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold -!HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace -!HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light -!HISTORY_MSG_SOFTLIGHT_STRENGTH;Soft light - Strength !HISTORY_MSG_TM_FATTAL_ANCHOR;DRC - Anchor -!HISTORY_MSG_TRANS_Method;Geometry - Method -!ICCPROFCREATOR_COPYRIGHT;Copyright: -!ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP;Reset to the default copyright, granted to "RawTherapee, CC0" -!ICCPROFCREATOR_CUSTOM;Custom -!ICCPROFCREATOR_DESCRIPTION;Description: !ICCPROFCREATOR_DESCRIPTION_ADDPARAM;Append gamma and slope values to the description !ICCPROFCREATOR_DESCRIPTION_TOOLTIP;Leave empty to set the default description. -!ICCPROFCREATOR_GAMMA;Gamma -!ICCPROFCREATOR_ICCVERSION;ICC version: !ICCPROFCREATOR_ILL;Illuminant: -!ICCPROFCREATOR_ILL_41;D41 -!ICCPROFCREATOR_ILL_50;D50 -!ICCPROFCREATOR_ILL_55;D55 -!ICCPROFCREATOR_ILL_60;D60 -!ICCPROFCREATOR_ILL_65;D65 -!ICCPROFCREATOR_ILL_80;D80 -!ICCPROFCREATOR_ILL_DEF;Default -!ICCPROFCREATOR_ILL_INC;StdA 2856K !ICCPROFCREATOR_ILL_TOOLTIP;You can only set the illuminant for ICC v4 profiles. !ICCPROFCREATOR_PRIMARIES;Primaries: -!ICCPROFCREATOR_PRIM_ACESP0;ACES AP0 -!ICCPROFCREATOR_PRIM_ACESP1;ACES AP1 -!ICCPROFCREATOR_PRIM_ADOBE;Adobe RGB (1998) -!ICCPROFCREATOR_PRIM_BEST;BestRGB -!ICCPROFCREATOR_PRIM_BETA;BetaRGB -!ICCPROFCREATOR_PRIM_BLUX;Blue X -!ICCPROFCREATOR_PRIM_BLUY;Blue Y -!ICCPROFCREATOR_PRIM_BRUCE;BruceRGB -!ICCPROFCREATOR_PRIM_GREX;Green X -!ICCPROFCREATOR_PRIM_GREY;Green Y -!ICCPROFCREATOR_PRIM_PROPH;Prophoto -!ICCPROFCREATOR_PRIM_REC2020;Rec2020 -!ICCPROFCREATOR_PRIM_REDX;Red X -!ICCPROFCREATOR_PRIM_REDY;Red Y -!ICCPROFCREATOR_PRIM_SRGB;sRGB !ICCPROFCREATOR_PRIM_TOOLTIP;You can only set custom primaries for ICC v4 profiles. -!ICCPROFCREATOR_PRIM_WIDEG;Widegamut -!ICCPROFCREATOR_PROF_V2;ICC v2 -!ICCPROFCREATOR_PROF_V4;ICC v4 -!ICCPROFCREATOR_SAVEDIALOG_TITLE;Save ICC profile as... -!ICCPROFCREATOR_SLOPE;Slope -!ICCPROFCREATOR_TRC_PRESET;Tone response curve: !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. -!IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. -!IPTCPANEL_COPYRIGHT;Copyright notice -!IPTCPANEL_COPYRIGHTHINT;Enter a Notice on the current owner of the Copyright for this image, such as ©2008 Jane Doe. -!IPTCPANEL_COUNTRYHINT;Enter the name of the country pictured in this image. -!IPTCPANEL_CREATOR;Creator -!IPTCPANEL_CREATORHINT;Enter the name of the person that created this image. !IPTCPANEL_CREATORJOBTITLE;Creator's job title !IPTCPANEL_CREATORJOBTITLEHINT;Enter the Job Title of the person listed in the Creator field. -!IPTCPANEL_DATECREATEDHINT;Enter the Date the image was taken. -!IPTCPANEL_DESCRIPTION;Description !IPTCPANEL_DESCRIPTIONHINT;Enter a "caption" describing the who, what, and why of what is happening in this image, this might include names of people, and/or their role in the action that is taking place within the image. -!IPTCPANEL_DESCRIPTIONWRITER;Description writer !IPTCPANEL_DESCRIPTIONWRITERHINT;Enter the name of the person involved in writing, editing or correcting the description of the image. !IPTCPANEL_HEADLINEHINT;Enter a brief publishable synopsis or summary of the contents of the image. !IPTCPANEL_INSTRUCTIONSHINT;Enter information about embargoes, or other restrictions not covered by the Copyright field. !IPTCPANEL_KEYWORDSHINT;Enter any number of keywords, terms or phrases used to express the subject matter in the image. -!IPTCPANEL_PROVINCE;Province or state !IPTCPANEL_PROVINCEHINT;Enter the name of the province or state pictured in this image. !IPTCPANEL_SOURCEHINT;Enter or edit the name of a person or party who has a role in the content supply chain, such as a person or entity from whom you received this image from. -!IPTCPANEL_SUPPCATEGORIES;Supplemental categories !IPTCPANEL_SUPPCATEGORIESHINT;Further refines the subject of the image. !IPTCPANEL_TITLEHINT;Enter a short verbal and human readable name for the image, this may be the file name. -!IPTCPANEL_TRANSREFERENCE;Job ID -!IPTCPANEL_TRANSREFERENCEHINT;Enter a number or identifier needed for workflow control or tracking. -!MAIN_BUTTON_ICCPROFCREATOR;ICC Profile Creator -!MAIN_BUTTON_SENDTOEDITOR;Edit image in external editor -!MAIN_FRAME_PLACES_DEL;Remove -!MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. -!MAIN_TAB_ADVANCED;Advanced -!MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-a -!MAIN_TAB_FAVORITES;Favorites -!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u -!MAIN_TAB_INSPECT; Inspect !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. -!MONITOR_PROFILE_SYSTEM;System default !OPTIONS_BUNDLED_MISSING;The bundled profile "%1" could not be found!\n\nYour installation could be damaged.\n\nDefault internal values will be used instead. !OPTIONS_DEFIMG_MISSING;The default profile for non-raw photos could not be found or is not set.\n\nPlease check your profiles' directory, it may be missing or damaged.\n\n"%1" will be used instead. !OPTIONS_DEFRAW_MISSING;The default profile for raw photos could not be found or is not set.\n\nPlease check your profiles' directory, it may be missing or damaged.\n\n"%1" will be used instead. -!PARTIALPASTE_ADVANCEDGROUP;Advanced Settings -!PARTIALPASTE_DEHAZE;Haze removal !PARTIALPASTE_EQUALIZER;Wavelet levels !PARTIALPASTE_FILMNEGATIVE;Film Negative -!PARTIALPASTE_LOCALCONTRAST;Local contrast !PARTIALPASTE_METADATA;Metadata mode !PARTIALPASTE_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening @@ -1756,200 +2119,65 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !PARTIALPASTE_RAW_BORDER;Raw border !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_PIXELSHIFT;Pixel Shift -!PARTIALPASTE_RETINEX;Retinex -!PARTIALPASTE_SOFTLIGHT;Soft light -!PARTIALPASTE_TM_FATTAL;Dynamic range compression -!PREFERENCES_APPEARANCE;Appearance -!PREFERENCES_APPEARANCE_COLORPICKERFONT;Color picker font -!PREFERENCES_APPEARANCE_CROPMASKCOLOR;Crop mask color -!PREFERENCES_APPEARANCE_MAINFONT;Main font -!PREFERENCES_APPEARANCE_PSEUDOHIDPI;Pseudo-HiDPI mode -!PREFERENCES_APPEARANCE_THEME;Theme !PREFERENCES_AUTOSAVE_TP_OPEN;Save tool collapsed/expanded state on exit -!PREFERENCES_CACHECLEAR;Clear -!PREFERENCES_CACHECLEAR_ALL;Clear all cached files: !PREFERENCES_CACHECLEAR_ALLBUTPROFILES;Clear all cached files except for cached processing profiles: -!PREFERENCES_CACHECLEAR_ONLYPROFILES;Clear only cached processing profiles: !PREFERENCES_CACHECLEAR_SAFETY;Only files in the cache are cleared. Processing profiles stored alongside the source images are not touched. -!PREFERENCES_CHUNKSIZES;Tiles per thread -!PREFERENCES_CHUNKSIZE_RAW_AMAZE;AMaZE demosaic -!PREFERENCES_CHUNKSIZE_RAW_CA;Raw CA correction -!PREFERENCES_CHUNKSIZE_RAW_RCD;RCD demosaic -!PREFERENCES_CHUNKSIZE_RAW_XT;Xtrans demosaic -!PREFERENCES_CHUNKSIZE_RGB;RGB processing -!PREFERENCES_CLUTSCACHE;HaldCLUT Cache !PREFERENCES_CLUTSCACHE_LABEL;Maximum number of cached CLUTs -!PREFERENCES_CMMBPC;Black point compensation -!PREFERENCES_CROP;Crop Editing -!PREFERENCES_CROP_AUTO_FIT;Automatically zoom to fit the crop -!PREFERENCES_CROP_GUIDES;Guides shown when not editing the crop -!PREFERENCES_CROP_GUIDES_FRAME;Frame -!PREFERENCES_CROP_GUIDES_FULL;Original -!PREFERENCES_CROP_GUIDES_NONE;None -!PREFERENCES_CURVEBBOXPOS;Position of curve copy & paste buttons -!PREFERENCES_CURVEBBOXPOS_ABOVE;Above -!PREFERENCES_CURVEBBOXPOS_BELOW;Below -!PREFERENCES_CURVEBBOXPOS_LEFT;Left -!PREFERENCES_CURVEBBOXPOS_RIGHT;Right -!PREFERENCES_DIRECTORIES;Directories -!PREFERENCES_EDITORCMDLINE;Custom command line -!PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Compact toolbars in File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. -!PREFERENCES_INSPECT_LABEL;Inspect -!PREFERENCES_INSPECT_MAXBUFFERS_LABEL;Maximum number of cached images !PREFERENCES_INSPECT_MAXBUFFERS_TOOLTIP;Set the maximum number of images stored in cache when hovering over them in the File Browser; systems with little RAM (2GB) should keep this value set to 1 or 2. -!PREFERENCES_LANG;Language -!PREFERENCES_MAXRECENTFOLDERS;Maximum number of recent folders !PREFERENCES_MONINTENT;Default rendering intent -!PREFERENCES_MONITOR;Monitor -!PREFERENCES_MONPROFILE;Default color profile -!PREFERENCES_MONPROFILE_WARNOSX;Due to MacOS limitations, only sRGB is supported. -!PREFERENCES_NAVIGATIONFRAME;Navigation -!PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel -!PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. -!PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. -!PREFERENCES_PERFORMANCE_MEASURE;Measure !PREFERENCES_PERFORMANCE_MEASURE_HINT;Logs processing times in console -!PREFERENCES_PERFORMANCE_THREADS;Threads !PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) -!PREFERENCES_PREVDEMO;Preview Demosaic Method -!PREFERENCES_PREVDEMO_FAST;Fast -!PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: -!PREFERENCES_PREVDEMO_SIDECAR;As in PP3 !PREFERENCES_PRINTER;Printer (Soft-Proofing) !PREFERENCES_PROFILESAVEBOTH;Save processing profile both to the cache and next to the input file -!PREFERENCES_PROFILESAVELOCATION;Processing profile saving location -!PREFERENCES_PROFILE_NONE;None !PREFERENCES_PRTINTENT;Rendering intent -!PREFERENCES_PRTPROFILE;Color profile !PREFERENCES_REMEMBERZOOMPAN;Remember zoom % and pan offset !PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Remember the zoom % and pan offset of the current image when opening a new image.\n\nThis option only works in "Single Editor Tab Mode" and when "Demosaicing method used for the preview at <100% zoom" is set to "As in PP3". !PREFERENCES_SAVE_TP_OPEN_NOW;Save tool collapsed/expanded state now -!PREFERENCES_SERIALIZE_TIFF_READ;TIFF Read Settings !PREFERENCES_SERIALIZE_TIFF_READ_LABEL;Serialize reading of TIFF files !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;Enabling this option when working with folders containing uncompressed TIFF files can increase performance of thumbnail generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show Filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules -!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview -!PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show !PREFERENCES_THUMBNAIL_INSPECTOR_RAW;Neutral raw rendering !PREFERENCES_THUMBNAIL_INSPECTOR_RAW_IF_NO_JPEG_FULLSIZE;Embedded JPEG if fullsize, neutral raw otherwise -!PROFILEPANEL_PDYNAMIC;Dynamic -!PROGRESSBAR_DECODING;Decoding... -!PROGRESSBAR_GREENEQUIL;Green equilibration... -!PROGRESSBAR_HLREC;Highlight reconstruction... -!PROGRESSBAR_HOTDEADPIXELFILTER;Hot/dead pixel filter... -!PROGRESSBAR_LINEDENOISE;Line noise filter... -!PROGRESSBAR_RAWCACORR;Raw CA correction... -!QINFO_FRAMECOUNT;%2 frames -!QINFO_HDR;HDR / %2 frame(s) -!QINFO_PIXELSHIFT;Pixel Shift / %2 frame(s) -!QUEUE_LOCATION_TITLE;Output Location !QUEUE_STARTSTOP_TOOLTIP;Start or stop processing the images in the queue.\n\nShortcut: Ctrl+s -!SAMPLEFORMAT_0;Unknown data format -!SAMPLEFORMAT_1;8-bit unsigned -!SAMPLEFORMAT_2;16-bit unsigned -!SAMPLEFORMAT_4;24-bit LogLuv -!SAMPLEFORMAT_8;32-bit LogLuv -!SAMPLEFORMAT_16;16-bit floating-point -!SAMPLEFORMAT_32;24-bit floating-point -!SAMPLEFORMAT_64;32-bit floating-point -!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. !TOOLBAR_TOOLTIP_COLORPICKER;Lockable Color Picker\n\nWhen the tool is active:\n- Add a picker: left-click.\n- Drag a picker: left-click and drag.\n- Delete a picker: right-click.\n- Delete all pickers: Ctrl+Shift+right-click.\n- Revert to hand tool: right-click outside any picker. -!TP_BWMIX_MIXC;Channel Mixer -!TP_BWMIX_NEUTRAL;Reset -!TP_CBDL_AFT;After Black-and-White -!TP_CBDL_BEF;Before Black-and-White -!TP_CBDL_METHOD;Process located !TP_CBDL_METHOD_TOOLTIP;Choose whether the Contrast by Detail Levels tool is to be positioned after the Black-and-White tool, which makes it work in L*a*b* space, or before it, which makes it work in RGB space. -!TP_COLORAPP_ABSOLUTELUMINANCE;Absolute luminance !TP_COLORAPP_CAT02ADAPTATION_TOOLTIP;When setting manually, values above 65 are recommended. !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_MEANLUMINANCE;Mean luminance (Yb%) -!TP_COLORAPP_NEUTRAL;Reset -!TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values !TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORTONING_LABGRID;L*a*b* color correction grid !TP_COLORTONING_LABGRID_VALUES;HL: a=%1 b=%2\nS: a=%3 b=%4 !TP_COLORTONING_LABREGIONS;Color correction regions !TP_COLORTONING_LABREGION_ABVALUES;a=%1 b=%2 -!TP_COLORTONING_LABREGION_CHANNEL;Channel -!TP_COLORTONING_LABREGION_CHANNEL_ALL;All -!TP_COLORTONING_LABREGION_CHANNEL_B;Blue -!TP_COLORTONING_LABREGION_CHANNEL_G;Green -!TP_COLORTONING_LABREGION_CHANNEL_R;Red -!TP_COLORTONING_LABREGION_CHROMATICITYMASK;C -!TP_COLORTONING_LABREGION_HUEMASK;H !TP_COLORTONING_LABREGION_LIGHTNESS;Lightness -!TP_COLORTONING_LABREGION_LIGHTNESSMASK;L -!TP_COLORTONING_LABREGION_LIST_TITLE;Correction -!TP_COLORTONING_LABREGION_MASK;Mask -!TP_COLORTONING_LABREGION_MASKBLUR;Mask Blur -!TP_COLORTONING_LABREGION_OFFSET;Offset -!TP_COLORTONING_LABREGION_POWER;Power -!TP_COLORTONING_LABREGION_SATURATION;Saturation -!TP_COLORTONING_LABREGION_SHOWMASK;Show mask -!TP_COLORTONING_LABREGION_SLOPE;Slope !TP_CROP_GTHARMMEANS;Harmonic Means !TP_CROP_GTTRIANGLE1;Golden Triangles 1 !TP_CROP_GTTRIANGLE2;Golden Triangles 2 -!TP_CROP_PPI;PPI -!TP_CROP_RESETCROP;Reset -!TP_CROP_SELECTCROP;Select -!TP_DEHAZE_DEPTH;Depth -!TP_DEHAZE_LABEL;Haze Removal -!TP_DEHAZE_LUMINANCE;Luminance only -!TP_DEHAZE_SHOW_DEPTH_MAP;Show depth map -!TP_DEHAZE_STRENGTH;Strength !TP_DIRPYRDENOISE_CHROMINANCE_AMZ;Auto multi-zones -!TP_DIRPYRDENOISE_CHROMINANCE_AUTOGLOBAL;Automatic global -!TP_DIRPYRDENOISE_CHROMINANCE_CURVE;Chrominance curve !TP_DIRPYRDENOISE_CHROMINANCE_CURVE_TOOLTIP;Increase (multiply) the value of all chrominance sliders.\nThis curve lets you adjust the strength of chromatic noise reduction as a function of chromaticity, for instance to increase the action in areas of low saturation and to decrease it in those of high saturation. -!TP_DIRPYRDENOISE_CHROMINANCE_FRAME;Chrominance -!TP_DIRPYRDENOISE_CHROMINANCE_MANUAL;Manual -!TP_DIRPYRDENOISE_CHROMINANCE_METHOD;Method !TP_DIRPYRDENOISE_CHROMINANCE_METHODADVANCED_TOOLTIP;Manual\nActs on the full image.\nYou control the noise reduction settings manually.\n\nAutomatic global\nActs on the full image.\n9 zones are used to calculate a global chrominance noise reduction setting.\n\nPreview\nActs on the whole image.\nThe part of the image visible in the preview is used to calculate global chrominance noise reduction settings. !TP_DIRPYRDENOISE_CHROMINANCE_METHOD_TOOLTIP;Manual\nActs on the full image.\nYou control the noise reduction settings manually.\n\nAutomatic global\nActs on the full image.\n9 zones are used to calculate a global chrominance noise reduction setting.\n\nAutomatic multi-zones\nNo preview - works only during saving, but using the "Preview" method by matching the tile size and center to the preview size and center you can get an idea of the expected results.\nThe image is divided into tiles (about 10 to 70 depending on image size) and each tile receives its own chrominance noise reduction settings.\n\nPreview\nActs on the whole image.\nThe part of the image visible in the preview is used to calculate global chrominance noise reduction settings. !TP_DIRPYRDENOISE_CHROMINANCE_PMZ;Preview multi-zones -!TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW;Preview !TP_DIRPYRDENOISE_CHROMINANCE_PREVIEWRESIDUAL_INFO_TOOLTIP;Displays the remaining noise levels of the part of the image visible in the preview after wavelet.\n\n>300 Very noisy\n100-300 Noisy\n50-100 A little noisy\n<50 Very low noise\n\nBeware, the values will differ between RGB and L*a*b* mode. The RGB values are less accurate because the RGB mode does not completely separate luminance and chrominance. !TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_INFO;Preview size=%1, Center: Px=%2 Py=%3 !TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_NOISEINFO;Preview noise: Mean=%1 High=%2 !TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_NOISEINFO_EMPTY;Preview noise: Mean= - High= - !TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_TILEINFO;Tile size=%1, Center: Tx=%2 Ty=%3 -!TP_DIRPYRDENOISE_LABEL;Noise Reduction -!TP_DIRPYRDENOISE_LUMINANCE_CONTROL;Luminance control -!TP_DIRPYRDENOISE_LUMINANCE_FRAME;Luminance -!TP_DIRPYRDENOISE_MAIN_COLORSPACE_LAB;L*a*b* -!TP_DIRPYRDENOISE_MEDIAN_METHOD_CHROMINANCE;Chroma only !TP_DIRPYRDENOISE_MEDIAN_METHOD_WEIGHTED;Weighted L* (little) + a*b* (normal) !TP_DIRPYRDENOISE_MEDIAN_PASSES_TOOLTIP;Applying three median filter iterations with a 3×3 window size often leads to better results than using one median filter iteration with a 7×7 window size. !TP_DIRPYRDENOISE_MEDIAN_TYPE_TOOLTIP;Apply a median filter of the desired window size. The larger the window's size, the longer it takes.\n\n3×3 soft: treats 5 pixels in a 3×3 pixel window.\n3×3: treats 9 pixels in a 3×3 pixel window.\n5×5 soft: treats 13 pixels in a 5×5 pixel window.\n5×5: treats 25 pixels in a 5×5 pixel window.\n7×7: treats 49 pixels in a 7×7 pixel window.\n9×9: treats 81 pixels in a 9×9 pixel window.\n\nSometimes it is possible to achieve higher quality running several iterations with a smaller window size than one iteration with a larger one. -!TP_DIRPYRDENOISE_TYPE_3X3;3×3 -!TP_DIRPYRDENOISE_TYPE_3X3SOFT;3×3 soft -!TP_DIRPYRDENOISE_TYPE_5X5;5×5 -!TP_DIRPYRDENOISE_TYPE_5X5SOFT;5×5 soft -!TP_DIRPYRDENOISE_TYPE_7X7;7×7 -!TP_DIRPYRDENOISE_TYPE_9X9;9×9 -!TP_DIRPYREQUALIZER_ARTIF;Reduce artifacts !TP_DISTORTION_AUTO_TIP;Automatically corrects lens distortion in raw files by matching it against the embedded JPEG image if one exists and has had its lens disortion auto-corrected by the camera. -!TP_EPD_GAMMA;Gamma -!TP_EXPOSURE_CLAMPOOG;Clip out-of-gamut colors !TP_EXPOSURE_HISTMATCHING;Auto-Matched Tone Curve !TP_EXPOSURE_HISTMATCHING_TOOLTIP;Automatically adjust sliders and curves (except exposure compensation) to match the look of the embedded JPEG thumbnail. -!TP_EXPOSURE_TCMODE_LUMINANCE;Luminance -!TP_EXPOSURE_TCMODE_PERCEPTUAL;Perceptual -!TP_FILMNEGATIVE_BLUE;Blue ratio !TP_FILMNEGATIVE_GREEN;Reference exponent (contrast) !TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards. -!TP_FILMNEGATIVE_LABEL;Film Negative -!TP_FILMNEGATIVE_PICK;Pick neutral spots -!TP_FILMNEGATIVE_RED;Red ratio !TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now? !TP_ICM_APPLYBASELINEEXPOSUREOFFSET;Baseline exposure !TP_ICM_APPLYBASELINEEXPOSUREOFFSET_TOOLTIP;Employ the embedded DCP baseline exposure offset. The setting is only available if the selected DCP has one. @@ -1957,170 +2185,60 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_ICM_APPLYHUESATMAP_TOOLTIP;Employ the embedded DCP base table (HueSatMap). The setting is only available if the selected DCP has one. !TP_ICM_APPLYLOOKTABLE;Look table !TP_ICM_APPLYLOOKTABLE_TOOLTIP;Employ the embedded DCP look table. The setting is only available if the selected DCP has one. -!TP_ICM_BPC;Black Point Compensation !TP_ICM_PROFILEINTENT;Rendering Intent !TP_ICM_SAVEREFERENCE;Save Reference Image -!TP_ICM_SAVEREFERENCE_APPLYWB;Apply white balance !TP_ICM_SAVEREFERENCE_APPLYWB_TOOLTIP;Generally, apply the white balance when saving images to create ICC profiles, and do not apply the white balance to create DCP profiles. -!TP_ICM_WORKING_TRC;Tone response curve: -!TP_ICM_WORKING_TRC_CUSTOM;Custom -!TP_ICM_WORKING_TRC_GAMMA;Gamma -!TP_ICM_WORKING_TRC_NONE;None -!TP_ICM_WORKING_TRC_SLOPE;Slope -!TP_ICM_WORKING_TRC_TOOLTIP;Only for built-in profiles. -!TP_LENSGEOM_LIN;Linear -!TP_LENSGEOM_LOG;Logarithmic -!TP_LENSPROFILE_CORRECTION_AUTOMATCH;Automatically selected -!TP_LENSPROFILE_CORRECTION_LCPFILE;LCP file -!TP_LENSPROFILE_CORRECTION_MANUAL;Manually selected !TP_LENSPROFILE_LENS_WARNING;Warning: the crop factor used for lens profiling is larger than the crop factor of the camera, the results might be wrong. -!TP_LENSPROFILE_MODE_HEADER;Lens Profile -!TP_LENSPROFILE_USE_CA;Chromatic aberration -!TP_LENSPROFILE_USE_GEOMETRIC;Geometric distortion -!TP_LENSPROFILE_USE_HEADER;Correct -!TP_LENSPROFILE_USE_VIGNETTING;Vignetting -!TP_LOCALCONTRAST_AMOUNT;Amount -!TP_LOCALCONTRAST_DARKNESS;Darkness level -!TP_LOCALCONTRAST_LABEL;Local Contrast -!TP_LOCALCONTRAST_LIGHTNESS;Lightness level -!TP_LOCALCONTRAST_RADIUS;Radius -!TP_METADATA_EDIT;Apply modifications -!TP_METADATA_MODE;Metadata copy mode -!TP_METADATA_STRIP;Strip all metadata -!TP_METADATA_TUNNEL;Copy unchanged -!TP_NEUTRAL;Reset !TP_PDSHARPENING_LABEL;Capture Sharpening -!TP_PREPROCESS_LINEDENOISE_DIRECTION;Direction -!TP_PREPROCESS_LINEDENOISE_DIRECTION_BOTH;Both -!TP_PREPROCESS_LINEDENOISE_DIRECTION_HORIZONTAL;Horizontal !TP_PREPROCESS_LINEDENOISE_DIRECTION_PDAF_LINES;Horizontal only on PDAF rows -!TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Vertical !TP_PREPROCESS_PDAFLINESFILTER;PDAF lines filter -!TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. -!TP_RAWCACORR_AUTOIT;Iterations !TP_RAWCACORR_AUTOIT_TOOLTIP;This setting is available if "Auto-correction" is checked.\nAuto-correction is conservative, meaning that it often does not correct all chromatic aberration.\nTo correct the remaining chromatic aberration, you can use up to five iterations of automatic chromatic aberration correction.\nEach iteration will reduce the remaining chromatic aberration from the last iteration at the cost of additional processing time. -!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift -!TP_RAW_1PASSMEDIUM;1-pass (Markesteijn) -!TP_RAW_2PASS;1-pass+fast -!TP_RAW_3PASSBEST;3-pass (Markesteijn) -!TP_RAW_4PASS;3-pass+fast -!TP_RAW_AHD;AHD -!TP_RAW_AMAZE;AMaZE -!TP_RAW_AMAZEVNG4;AMaZE+VNG4 !TP_RAW_BORDER;Border -!TP_RAW_DCB;DCB -!TP_RAW_DCBVNG4;DCB+VNG4 -!TP_RAW_DUALDEMOSAICAUTOCONTRAST;Auto threshold !TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP;If the checkbox is checked (recommended), RawTherapee calculates an optimum value based on flat regions in the image.\nIf there is no flat region in the image or the image is too noisy, the value will be set to 0.\nTo set the value manually, uncheck the checkbox first (reasonable values depend on the image). -!TP_RAW_DUALDEMOSAICCONTRAST;Contrast threshold -!TP_RAW_EAHD;EAHD -!TP_RAW_FAST;Fast -!TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;HPHD -!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image !TP_RAW_IMAGENUM_SN;SN mode !TP_RAW_IMAGENUM_TOOLTIP;Some raw files consist of several sub-images (Pentax/Sony Pixel Shift, Pentax 3-in-1 HDR, Canon Dual Pixel, Fuji EXR).\n\nWhen using any demosaicing method other than Pixel Shift, this selects which sub-image is used.\n\nWhen using the Pixel Shift demosaicing method on a Pixel Shift raw, all sub-images are used, and this selects which sub-image should be used for moving parts. -!TP_RAW_LMMSE;LMMSE -!TP_RAW_MONO;Mono !TP_RAW_NONE;None (Shows sensor pattern) !TP_RAW_PIXELSHIFT;Pixel Shift -!TP_RAW_PIXELSHIFTBLUR;Blur motion mask -!TP_RAW_PIXELSHIFTDMETHOD;Demosaic method for motion -!TP_RAW_PIXELSHIFTEPERISO;Sensitivity !TP_RAW_PIXELSHIFTEPERISO_TOOLTIP;The default value of 0 should work fine for base ISO.\nHigher values increase sensitivity of motion detection.\nChange in small steps and watch the motion mask while changing.\nIncrease sensitivity for underexposed or high ISO images. -!TP_RAW_PIXELSHIFTEQUALBRIGHT;Equalize brightness of frames !TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL;Equalize per channel !TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL_TOOLTIP;Enabled: Equalize the RGB channels individually.\nDisabled: Use same equalization factor for all channels. !TP_RAW_PIXELSHIFTEQUALBRIGHT_TOOLTIP;Equalize the brightness of the frames to the brightness of the selected frame.\nIf there are overexposed areas in the frames select the brightest frame to avoid magenta color cast in overexposed areas or enable motion correction. !TP_RAW_PIXELSHIFTGREEN;Check green channel for motion -!TP_RAW_PIXELSHIFTHOLEFILL;Fill holes in motion mask -!TP_RAW_PIXELSHIFTHOLEFILL_TOOLTIP;Fill holes in motion mask -!TP_RAW_PIXELSHIFTMEDIAN;Use median for moving parts !TP_RAW_PIXELSHIFTMEDIAN_TOOLTIP;Use median of all frames instead of selected frame for regions with motion.\nRemoves objects which are at different places in all frames.\nGives motion effect on slow moving (overlapping) objects. -!TP_RAW_PIXELSHIFTMM_AUTO;Automatic -!TP_RAW_PIXELSHIFTMM_CUSTOM;Custom -!TP_RAW_PIXELSHIFTMM_OFF;Off -!TP_RAW_PIXELSHIFTMOTIONMETHOD;Motion Correction -!TP_RAW_PIXELSHIFTNONGREENCROSS;Check red/blue channels for motion -!TP_RAW_PIXELSHIFTSHOWMOTION;Show motion mask -!TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY;Show only motion mask -!TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY_TOOLTIP;Shows the motion mask without the image. !TP_RAW_PIXELSHIFTSHOWMOTION_TOOLTIP;Overlays the image with a green mask showing the regions with motion. -!TP_RAW_PIXELSHIFTSIGMA;Blur radius !TP_RAW_PIXELSHIFTSIGMA_TOOLTIP;The default radius of 1.0 usually fits well for base ISO.\nIncrease the value for high ISO shots, 5.0 is a good starting point.\nWatch the motion mask while changing the value. -!TP_RAW_PIXELSHIFTSMOOTH;Smooth transitions !TP_RAW_PIXELSHIFTSMOOTH_TOOLTIP;Smooth transitions between areas with motion and areas without.\nSet to 0 to disable transition smoothing.\nSet to 1 to either get the AMaZE/LMMSE result of the selected frame (depending on whether "Use LMMSE" is selected), or the median of all four frames if "Use median" is selected. -!TP_RAW_RCD;RCD -!TP_RAW_RCDVNG4;RCD+VNG4 -!TP_RAW_VNG4;VNG4 -!TP_RAW_XTRANS;X-Trans -!TP_RAW_XTRANSFAST;Fast X-Trans -!TP_RESIZE_ALLOW_UPSCALING;Allow Upscaling -!TP_RETINEX_CONTEDIT_HSL;HSL histogram -!TP_RETINEX_CONTEDIT_LAB;L*a*b* histogram -!TP_RETINEX_CONTEDIT_LH;Hue -!TP_RETINEX_CONTEDIT_MAP;Equalizer -!TP_RETINEX_CURVEEDITOR_CD;L=f(L) !TP_RETINEX_CURVEEDITOR_CD_TOOLTIP;Luminance according to luminance L=f(L)\nCorrect raw data to reduce halos and artifacts. -!TP_RETINEX_CURVEEDITOR_LH;Strength=f(H) !TP_RETINEX_CURVEEDITOR_LH_TOOLTIP;Strength according to hue Strength=f(H)\nThis curve also acts on chroma when using the "Highlight" retinex method. -!TP_RETINEX_CURVEEDITOR_MAP;L=f(L) !TP_RETINEX_CURVEEDITOR_MAP_TOOLTIP;This curve can be applied alone or with a Gaussian mask or wavelet mask.\nBeware of artifacts! -!TP_RETINEX_EQUAL;Equalizer !TP_RETINEX_FREEGAMMA;Free gamma -!TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission !TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. -!TP_RETINEX_GAMMA;Gamma -!TP_RETINEX_GAMMA_FREE;Free -!TP_RETINEX_GAMMA_HIGH;High -!TP_RETINEX_GAMMA_LOW;Low -!TP_RETINEX_GAMMA_MID;Middle -!TP_RETINEX_GAMMA_NONE;None !TP_RETINEX_GAMMA_TOOLTIP;Restore tones by applying gamma before and after Retinex. Different from Retinex curves or others curves (Lab, Exposure, etc.). !TP_RETINEX_GRAD;Transmission gradient !TP_RETINEX_GRADS;Strength gradient !TP_RETINEX_GRADS_TOOLTIP;If slider at 0, all iterations are identical.\nIf > 0 Strength is reduced when iterations increase, and conversely. !TP_RETINEX_GRAD_TOOLTIP;If slider at 0, all iterations are identical.\nIf > 0 Variance and Threshold are reduced when iterations increase, and conversely. -!TP_RETINEX_HIGH;High !TP_RETINEX_HIGHLIG;Highlight -!TP_RETINEX_HIGHLIGHT;Highlight threshold !TP_RETINEX_HIGHLIGHT_TOOLTIP;Increase action of High algorithm.\nMay require you to re-adjust "Neighboring pixels" and to increase the "White-point correction" in the Raw tab -> Raw White Points tool. -!TP_RETINEX_HSLSPACE_LIN;HSL-Linear -!TP_RETINEX_HSLSPACE_LOG;HSL-Logarithmic !TP_RETINEX_ITER;Iterations (Tone-mapping) !TP_RETINEX_ITERF;Tone mapping !TP_RETINEX_ITER_TOOLTIP;Simulate a tone-mapping operator.\nHigh values increase the processing time. -!TP_RETINEX_LABEL;Retinex -!TP_RETINEX_LABEL_MASK;Mask -!TP_RETINEX_LABSPACE;L*a*b* -!TP_RETINEX_LOW;Low -!TP_RETINEX_MAP;Method -!TP_RETINEX_MAP_GAUS;Gaussian mask !TP_RETINEX_MAP_MAPP;Sharp mask (wavelet partial) !TP_RETINEX_MAP_MAPT;Sharp mask (wavelet total) !TP_RETINEX_MAP_METHOD_TOOLTIP;Use the mask generated by the Gaussian function above (Radius, Method) to reduce halos and artifacts.\n\nCurve only: apply a diagonal contrast curve on the mask.\nBeware of artifacts!\n\nGaussian mask: generate and use a Gaussian blur of the original mask.\nQuick.\n\nSharp mask: generate and use a wavelet on the original mask.\nSlow. -!TP_RETINEX_MAP_NONE;None !TP_RETINEX_MEDIAN;Transmission median filter -!TP_RETINEX_METHOD;Method !TP_RETINEX_METHOD_TOOLTIP;Low = Reinforce low light.\nUniform = Equalize action.\nHigh = Reinforce high light.\nHighlights = Remove magenta in highlights. !TP_RETINEX_MLABEL;Restored haze-free Min=%1 Max=%2 !TP_RETINEX_MLABEL_TOOLTIP;Should be near min=0 max=32768\nRestored image with no mixture. -!TP_RETINEX_NEIGHBOR;Radius -!TP_RETINEX_NEUTRAL;Reset !TP_RETINEX_NEUTRAL_TIP;Reset all sliders and curves to their default values. -!TP_RETINEX_OFFSET;Offset (brightness) !TP_RETINEX_SCALES;Gaussian gradient !TP_RETINEX_SCALES_TOOLTIP;If slider at 0, all iterations are identical.\nIf > 0 Scale and radius are reduced when iterations increase, and conversely. -!TP_RETINEX_SETTINGS;Settings -!TP_RETINEX_SKAL;Scale !TP_RETINEX_SLOPE;Free gamma slope -!TP_RETINEX_STRENGTH;Strength -!TP_RETINEX_THRESHOLD;Threshold !TP_RETINEX_THRESHOLD_TOOLTIP;Limits in/out.\nIn = image source,\nOut = image gauss. !TP_RETINEX_TLABEL;TM Min=%1 Max=%2 Mean=%3 Sigma=%4 !TP_RETINEX_TLABEL2;TM Tm=%1 TM=%2 @@ -2128,190 +2246,76 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_RETINEX_TRANF;Transmission !TP_RETINEX_TRANSMISSION;Transmission map !TP_RETINEX_TRANSMISSION_TOOLTIP;Transmission according to transmission.\nAbscissa: transmission from negative values (min), mean, and positives values (max).\nOrdinate: amplification or reduction. -!TP_RETINEX_UNIFORM;Uniform -!TP_RETINEX_VARIANCE;Contrast !TP_RETINEX_VARIANCE_TOOLTIP;Low variance increase local contrast and saturation, but can lead to artifacts. -!TP_RETINEX_VIEW;Process -!TP_RETINEX_VIEW_MASK;Mask !TP_RETINEX_VIEW_METHOD_TOOLTIP;Standard - Normal display.\nMask - Displays the mask.\nUnsharp mask - Displays the image with a high radius unsharp mask.\nTransmission - Auto/Fixed - Displays the file transmission-map, before any action on contrast and brightness.\n\nAttention: the mask does not correspond to reality, but is amplified to make it more visible. -!TP_RETINEX_VIEW_NONE;Standard !TP_RETINEX_VIEW_TRAN;Transmission - Auto !TP_RETINEX_VIEW_TRAN2;Transmission - Fixed -!TP_RETINEX_VIEW_UNSHARP;Unsharp mask -!TP_SHARPENING_BLUR;Blur radius -!TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENING_ITERCHECK;Auto limit iterations !TP_SHARPENING_RADIUS_BOOST;Corner radius boost -!TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light -!TP_SOFTLIGHT_STRENGTH;Strength -!TP_TM_FATTAL_AMOUNT;Amount !TP_TM_FATTAL_ANCHOR;Anchor -!TP_TM_FATTAL_LABEL;Dynamic Range Compression -!TP_TM_FATTAL_THRESHOLD;Detail -!TP_WAVELET_1;Level 1 -!TP_WAVELET_2;Level 2 -!TP_WAVELET_3;Level 3 -!TP_WAVELET_4;Level 4 -!TP_WAVELET_5;Level 5 -!TP_WAVELET_6;Level 6 -!TP_WAVELET_7;Level 7 -!TP_WAVELET_8;Level 8 -!TP_WAVELET_9;Level 9 -!TP_WAVELET_APPLYTO;Apply To -!TP_WAVELET_AVOID;Avoid color shift -!TP_WAVELET_B0;Black -!TP_WAVELET_B1;Grey !TP_WAVELET_B2;Residual -!TP_WAVELET_BACKGROUND;Background -!TP_WAVELET_BACUR;Curve !TP_WAVELET_BALANCE;Contrast balance d/v-h !TP_WAVELET_BALANCE_TOOLTIP;Alters the balance between the wavelet directions: vertical-horizontal and diagonal.\nIf contrast, chroma or residual tone mapping are activated, the effect due to balance is amplified. -!TP_WAVELET_BALCHRO;Chroma balance !TP_WAVELET_BALCHRO_TOOLTIP;If enabled, the 'Contrast balance' curve or slider also modifies chroma balance. -!TP_WAVELET_BANONE;None -!TP_WAVELET_BASLI;Slider -!TP_WAVELET_BATYPE;Contrast balance method -!TP_WAVELET_CBENAB;Toning and Color Balance !TP_WAVELET_CB_TOOLTIP;For strong values product color-toning by combining it or not with levels decomposition 'toning'\nFor low values you can change the white balance of the background (sky, ...) without changing that of the front plane, generally more contrasted -!TP_WAVELET_CCURVE;Local contrast -!TP_WAVELET_CH1;Whole chroma range -!TP_WAVELET_CH2;Saturated/pastel -!TP_WAVELET_CH3;Link contrast levels -!TP_WAVELET_CHCU;Curve !TP_WAVELET_CHR;Chroma-contrast link strength !TP_WAVELET_CHRO;Saturated/pastel threshold !TP_WAVELET_CHRO_TOOLTIP;Sets the wavelet level which will be the threshold between saturated and pastel colors.\n1-x: saturated\nx-9: pastel\n\nIf the value exceeds the amount of wavelet levels you are using then it will be ignored. !TP_WAVELET_CHR_TOOLTIP;Adjusts chroma as a function of "contrast levels" and "chroma-contrast link strength" -!TP_WAVELET_CHSL;Sliders !TP_WAVELET_CHTYPE;Chrominance method !TP_WAVELET_COLORT;Opacity Red-Green -!TP_WAVELET_COMPCONT;Contrast -!TP_WAVELET_COMPGAMMA;Compression gamma !TP_WAVELET_COMPGAMMA_TOOLTIP;Adjusting the gamma of the residual image allows you to equilibrate the data and histogram. !TP_WAVELET_COMPTM;Tone mapping !TP_WAVELET_CONTEDIT;'After' contrast curve -!TP_WAVELET_CONTR;Gamut -!TP_WAVELET_CONTRA;Contrast -!TP_WAVELET_CONTRAST_MINUS;Contrast - -!TP_WAVELET_CONTRAST_PLUS;Contrast + !TP_WAVELET_CONTRA_TOOLTIP;Changes contrast of the residual image. -!TP_WAVELET_CTYPE;Chrominance control !TP_WAVELET_CURVEEDITOR_CC_TOOLTIP;Modifies local contrast as a function of the original local contrast (abscissa).\nLow abscissa values represent small local contrast (real values about 10..20).\n50% abscissa represents average local contrast (real value about 100..300).\n66% abscissa represents standard deviation of local contrast (real value about 300..800).\n100% abscissa represents maximum local contrast (real value about 3000..8000). !TP_WAVELET_CURVEEDITOR_CH;Contrast levels=f(Hue) !TP_WAVELET_CURVEEDITOR_CH_TOOLTIP;Modifies each level's contrast as a function of hue.\nTake care not to overwrite changes made with the Gamut sub-tool's hue controls.\nThe curve will only have an effect when wavelet contrast level sliders are non-zero. -!TP_WAVELET_CURVEEDITOR_CL;L !TP_WAVELET_CURVEEDITOR_CL_TOOLTIP;Applies a final contrast luminance curve at the end of the wavelet treatment. -!TP_WAVELET_CURVEEDITOR_HH;HH !TP_WAVELET_CURVEEDITOR_HH_TOOLTIP;Modifies the residual image's hue as a function of hue. -!TP_WAVELET_DALL;All directions !TP_WAVELET_DAUB;Edge performance -!TP_WAVELET_DAUB2;D2 - low -!TP_WAVELET_DAUB4;D4 - standard -!TP_WAVELET_DAUB6;D6 - standard plus -!TP_WAVELET_DAUB10;D10 - medium -!TP_WAVELET_DAUB14;D14 - high !TP_WAVELET_DAUB_TOOLTIP;Changes Daubechies coefficients:\nD4 = Standard,\nD14 = Often best performance, 10% more time-intensive.\n\nAffects edge detection as well as the general quality of the firsts levels. However the quality is not strictly related to this coefficient and can vary with images and uses. -!TP_WAVELET_DONE;Vertical -!TP_WAVELET_DTHR;Diagonal -!TP_WAVELET_DTWO;Horizontal -!TP_WAVELET_EDCU;Curve -!TP_WAVELET_EDGCONT;Local contrast !TP_WAVELET_EDGCONT_TOOLTIP;Adjusting the points to the left decreases contrast, and to the right increases it.\nBottom-left, top-left, top-right and bottom-right represent respectively local contrast for low values, mean, mean+stdev and maxima. -!TP_WAVELET_EDGE;Edge Sharpness !TP_WAVELET_EDGEAMPLI;Base amplification !TP_WAVELET_EDGEDETECT;Gradient sensitivity -!TP_WAVELET_EDGEDETECTTHR;Threshold low (noise) -!TP_WAVELET_EDGEDETECTTHR2;Threshold high (detection) !TP_WAVELET_EDGEDETECTTHR_TOOLTIP;This adjuster lets you target edge detection for example to avoid applying edge sharpness to fine details, such as noise in the sky. !TP_WAVELET_EDGEDETECT_TOOLTIP;Moving the slider to the right increases edge sensitivity. This affects local contrast, edge settings and noise. !TP_WAVELET_EDGESENSI;Edge sensitivity !TP_WAVELET_EDGREINF_TOOLTIP;Reinforce or reduce the action of the first level, do the opposite to the second level, and leave the rest unchanged. -!TP_WAVELET_EDGTHRESH;Detail !TP_WAVELET_EDGTHRESH_TOOLTIP;Change the repartition between the first levels and the others. The higher the threshold the more the action is centered on the first levels. Be careful with negative values, they increase the action of high levels and can introduce artifacts. -!TP_WAVELET_EDRAD;Radius !TP_WAVELET_EDRAD_TOOLTIP;This radius adjustment is very different from those in other sharpening tools. Its value is compared to each level through a complex function. In this sense, a value of zero still has an effect. -!TP_WAVELET_EDSL;Threshold Sliders -!TP_WAVELET_EDTYPE;Local contrast method -!TP_WAVELET_EDVAL;Strength -!TP_WAVELET_FINAL;Final Touchup -!TP_WAVELET_FINEST;Finest -!TP_WAVELET_HIGHLIGHT;Highlight luminance range -!TP_WAVELET_HS1;Whole luminance range -!TP_WAVELET_HS2;Shadows/Highlights -!TP_WAVELET_HUESKIN;Skin hue !TP_WAVELET_HUESKIN_TOOLTIP;The bottom points set the beginning of the transition zone, and the upper points the end of it, where the effect is at its maximum.\n\nIf you need to move the area significantly, or if there are artifacts, then the white balance is incorrect. -!TP_WAVELET_HUESKY;Sky hue !TP_WAVELET_HUESKY_TOOLTIP;The bottom points set the beginning of the transition zone, and the upper points the end of it, where the effect is at its maximum.\n\nIf you need to move the area significantly, or if there are artifacts, then the white balance is incorrect. !TP_WAVELET_ITER;Delta balance levels !TP_WAVELET_ITER_TOOLTIP;Left: increase low levels and reduce high levels,\nRight: reduce low levels and increase high levels. !TP_WAVELET_LABEL;Wavelet Levels !TP_WAVELET_LARGEST;Coarsest -!TP_WAVELET_LEVCH;Chroma !TP_WAVELET_LEVDIR_ALL;All levels in all directions !TP_WAVELET_LEVDIR_INF;Below or equal the level !TP_WAVELET_LEVDIR_ONE;One level !TP_WAVELET_LEVDIR_SUP;Above the level !TP_WAVELET_LEVELS;Wavelet levels !TP_WAVELET_LEVELS_TOOLTIP;Choose the number of detail levels the image is to be decomposed into. More levels require more RAM and require a longer processing time. -!TP_WAVELET_LEVF;Contrast !TP_WAVELET_LEVLABEL;Preview maximum possible levels = %1 -!TP_WAVELET_LEVONE;Level 2 -!TP_WAVELET_LEVTHRE;Level 4 -!TP_WAVELET_LEVTWO;Level 3 -!TP_WAVELET_LEVZERO;Level 1 -!TP_WAVELET_LINKEDG;Link with Edge Sharpness' Strength -!TP_WAVELET_LIPST;Enhanced algoritm -!TP_WAVELET_LOWLIGHT;Shadow luminance range -!TP_WAVELET_MEDGREINF;First level -!TP_WAVELET_MEDI;Reduce artifacts in blue sky -!TP_WAVELET_MEDILEV;Edge detection !TP_WAVELET_MEDILEV_TOOLTIP;When you enable Edge Detection, it is recommanded:\n- to disabled low contrast levels to avoid artifacts,\n- to use high values of gradient sensitivity.\n\nYou can modulate the strength with 'refine' from Denoise and Refine. -!TP_WAVELET_NEUTRAL;Neutral -!TP_WAVELET_NOIS;Denoise !TP_WAVELET_NOISE;Denoise and Refine -!TP_WAVELET_NPHIGH;High -!TP_WAVELET_NPLOW;Low -!TP_WAVELET_NPNONE;None -!TP_WAVELET_NPTYPE;Neighboring pixels !TP_WAVELET_NPTYPE_TOOLTIP;This algorithm uses the proximity of a pixel and eight of its neighbors. If less difference, edges are reinforced. !TP_WAVELET_OPACITY;Opacity Blue-Yellow !TP_WAVELET_OPACITYW;Contrast balance d/v-h curve !TP_WAVELET_OPACITYWL;Final local contrast !TP_WAVELET_OPACITYWL_TOOLTIP;Modify the final local contrast at the end of the wavelet treatment.\n\nThe left side represents the smallest local contrast, progressing to the largest local contrast on the right. -!TP_WAVELET_PASTEL;Pastel chroma -!TP_WAVELET_PROC;Process -!TP_WAVELET_RE1;Reinforced -!TP_WAVELET_RE2;Unchanged -!TP_WAVELET_RE3;Reduced -!TP_WAVELET_RESCHRO;Chroma -!TP_WAVELET_RESCON;Shadows -!TP_WAVELET_RESCONH;Highlights !TP_WAVELET_RESID;Residual Image -!TP_WAVELET_SAT;Saturated chroma !TP_WAVELET_SETTINGS;Wavelet Settings !TP_WAVELET_SKIN;Skin targetting/protection !TP_WAVELET_SKIN_TOOLTIP;At -100 skin-tones are targetted.\nAt 0 all tones are treated equally.\nAt +100 skin-tones are protected while all other tones are affected. -!TP_WAVELET_SKY;Sky targetting/protection !TP_WAVELET_SKY_TOOLTIP;At -100 sky-tones are targetted.\nAt 0 all tones are treated equally.\nAt +100 sky-tones are protected while all other tones are affected. -!TP_WAVELET_STREN;Strength -!TP_WAVELET_STRENGTH;Strength -!TP_WAVELET_SUPE;Extra -!TP_WAVELET_THR;Shadows threshold -!TP_WAVELET_THRESHOLD;Highlight levels -!TP_WAVELET_THRESHOLD2;Shadow levels !TP_WAVELET_THRESHOLD2_TOOLTIP;Only levels between 9 and 9 minus the value will be affected by the shadow luminance range. Other levels will be fully treated. The highest level possible is limited by the highlight level value (9 minus highlight level value). !TP_WAVELET_THRESHOLD_TOOLTIP;Only levels beyond the chosen value will be affected by the highlight luminance range. Other levels will be fully treated. The chosen value here limits the highest possible value of the shadow levels. -!TP_WAVELET_THRH;Highlights threshold !TP_WAVELET_TILESBIG;Big tiles !TP_WAVELET_TILESFULL;Full image !TP_WAVELET_TILESIZE;Tiling method !TP_WAVELET_TILESLIT;Little tiles !TP_WAVELET_TILES_TOOLTIP;Processing the full image leads to better quality and is the recommended option, while using tiles is a fall-back solution for users with little RAM. Refer to RawPedia for memory requirements. -!TP_WAVELET_TMSTRENGTH;Compression strength !TP_WAVELET_TMSTRENGTH_TOOLTIP;Control the strength of tone mapping or contrast compression of the residual image. When the value is different from 0, the Strength and Gamma sliders of the Tone Mapping tool in the Exposure tab will become grayed out. -!TP_WAVELET_TMTYPE;Compression method -!TP_WAVELET_TON;Toning -!TP_WBALANCE_PICKER;Pick -!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". diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index f4d082199..fa9788af0 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -790,12 +790,12 @@ float* RawImageSource::CA_correct_RT( for (int m = 0; m < polyord; m++) { double powHblock = powHblockInit; for (int n = 0; n < polyord; n++) { - polymat[c][dir][numpar * (polyord * i + j) + (polyord * m + n)] += powVblock * powHblock * blockwt[vblock * hblsz + hblock]; + polymat[c][dir][numpar * (polyord * i + j) + (polyord * m + n)] += powVblock * powHblock * static_cast(blockwt[vblock * hblsz + hblock]); powHblock *= hblock; } powVblock *= vblock; } - shiftmat[c][dir][(polyord * i + j)] += powVblockInit * powHblockInit * bstemp[dir] * blockwt[vblock * hblsz + hblock]; + shiftmat[c][dir][(polyord * i + j)] += powVblockInit * powHblockInit * static_cast(bstemp[dir]) * static_cast(blockwt[vblock * hblsz + hblock]); powHblockInit *= hblock; } powVblockInit *= vblock; @@ -848,7 +848,7 @@ float* RawImageSource::CA_correct_RT( for (int top = -border; top < height; top += ts - border2) { for (int left = -border; left < width - (W & 1); left += ts - border2) { memset(bufferThr, 0, buffersizePassTwo); - float lblockshifts[2][2]; + double lblockshifts[2][2]; const int vblock = ((top + border) / (ts - border2)) + 1; const int hblock = ((left + border) / (ts - border2)) + 1; const int bottom = min(top + ts, height + border); @@ -1036,8 +1036,8 @@ float* RawImageSource::CA_correct_RT( } if (!autoCA) { - float hfrac = -((float)(hblock - 0.5) / (hblsz - 2) - 0.5); - float vfrac = -((float)(vblock - 0.5) / (vblsz - 2) - 0.5) * height / width; + double hfrac = -((hblock - 0.5) / (hblsz - 2) - 0.5); + double vfrac = -((vblock - 0.5) / (vblsz - 2) - 0.5) * height / width; lblockshifts[0][0] = 2 * vfrac * cared; lblockshifts[0][1] = 2 * hfrac * cared; lblockshifts[1][0] = 2 * vfrac * cablue; @@ -1058,7 +1058,7 @@ float* RawImageSource::CA_correct_RT( } powVblock *= vblock; } - constexpr float bslim = 3.99; //max allowed CA shift + constexpr double bslim = 3.99f; //max allowed CA shift lblockshifts[0][0] = LIM(lblockshifts[0][0], -bslim, bslim); lblockshifts[0][1] = LIM(lblockshifts[0][1], -bslim, bslim); lblockshifts[1][0] = LIM(lblockshifts[1][0], -bslim, bslim); @@ -1070,14 +1070,14 @@ float* RawImageSource::CA_correct_RT( //some parameters for the bilinear interpolation shiftvfloor[c] = floor((float)lblockshifts[c>>1][0]); shiftvceil[c] = ceil((float)lblockshifts[c>>1][0]); - if (lblockshifts[c>>1][0] < 0.f) { + if (lblockshifts[c>>1][0] < 0.0) { std::swap(shiftvfloor[c], shiftvceil[c]); } shiftvfrac[c] = fabs(lblockshifts[c>>1][0] - shiftvfloor[c]); shifthfloor[c] = floor((float)lblockshifts[c>>1][1]); shifthceil[c] = ceil((float)lblockshifts[c>>1][1]); - if (lblockshifts[c>>1][1] < 0.f) { + if (lblockshifts[c>>1][1] < 0.0) { std::swap(shifthfloor[c], shifthceil[c]); } shifthfrac[c] = fabs(lblockshifts[c>>1][1] - shifthfloor[c]); diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 6bce68d1a..5f59da371 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -12,6 +12,11 @@ include_directories(${EXTRA_INCDIR} ${LENSFUN_INCLUDE_DIRS} ${RSVG_INCLUDE_DIRS} ) +if(NOT WITH_SYSTEM_KLT) + include_directories("${CMAKE_SOURCE_DIR}/rtengine/klt") +else() + include_directories(${KLT_INCLUDE_DIRS}) +endif() link_directories("${PROJECT_SOURCE_DIR}/rtexif" ${EXPAT_LIBRARY_DIRS} @@ -94,6 +99,7 @@ set(RTENGINESOURCEFILES ipretinex.cc ipshadowshighlights.cc ipsharpen.cc + ipsharpenedges.cc ipsoftlight.cc iptransform.cc ipvibrance.cc @@ -105,6 +111,7 @@ set(RTENGINESOURCEFILES lj92.c lmmse_demosaic.cc loadinitial.cc + munselllch.cc myfile.cc panasonic_decoders.cc pdaflinesfilter.cc @@ -185,6 +192,7 @@ target_link_libraries(rtengine rtexif ${ZLIB_LIBRARIES} ${LENSFUN_LIBRARIES} ${RSVG_LIBRARIES} + ${KLT_LIBRARIES} ) install(FILES ${CAMCONSTSFILE} DESTINATION "${DATADIR}" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) diff --git a/rtengine/EdgePreservingDecomposition.cc b/rtengine/EdgePreservingDecomposition.cc index 700181e1d..04459e88a 100644 --- a/rtengine/EdgePreservingDecomposition.cc +++ b/rtengine/EdgePreservingDecomposition.cc @@ -55,7 +55,7 @@ float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), fl #endif for(int ii = 0; ii < n; ii++) { - rs += r[ii] * s[ii]; + rs += static_cast(r[ii]) * static_cast(s[ii]); } //Search direction d. @@ -84,15 +84,15 @@ float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), fl #endif for(int ii = 0; ii < n; ii++) { - ab += d[ii] * ax[ii]; + ab += static_cast(d[ii]) * static_cast(ax[ii]); } - if(ab == 0.0f) { + if(ab == 0.0) { break; //So unlikely. It means perfectly converged or singular, stop either way. } ab = rs / ab; - + float abf = ab; //Update x and r with this step size. double rms = 0.0; // use double precision for large summations #ifdef _OPENMP @@ -100,15 +100,15 @@ float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), fl #endif for(int ii = 0; ii < n; ii++) { - x[ii] += ab * d[ii]; - r[ii] -= ab * ax[ii]; //"Fast recursive formula", use explicit r = b - Ax occasionally? - rms += r[ii] * r[ii]; + x[ii] += abf * d[ii]; + r[ii] -= abf * ax[ii]; //"Fast recursive formula", use explicit r = b - Ax occasionally? + rms += rtengine::SQR(r[ii]); } rms = sqrtf(rms / n); //Quit? This probably isn't the best stopping condition, but ok. - if(rms < RMSResidual) { + if(rms < static_cast(RMSResidual)) { break; } @@ -129,20 +129,20 @@ float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), fl #endif for(int ii = 0; ii < n; ii++) { - rs += r[ii] * s[ii]; + rs += static_cast(r[ii]) * static_cast(s[ii]); } } ab = rs / ab; - + abf = ab; //Update search direction p. #ifdef _OPENMP #pragma omp parallel for #endif for(int ii = 0; ii < n; ii++) { - d[ii] = s[ii] + ab * d[ii]; + d[ii] = s[ii] + abf * d[ii]; } diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 121c8189d..9120fe0ad 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -56,7 +56,6 @@ #define TS 64 // Tile size #define offset 25 // shift between tiles -#define fTS ((TS/2+1)) // second dimension of Fourier tiles #define blkrad 1 // radius of block averaging #define epsilon 0.001f/(TS*TS) //tolerance @@ -548,7 +547,7 @@ BENCHFUN const bool denoiseMethodRgb = (dnparams.dmethod == "RGB"); // init luma noisevarL const float noiseluma = static_cast(dnparams.luma); - const float noisevarL = (useNoiseLCurve && (denoiseMethodRgb || !isRAW)) ? static_cast(SQR(((noiseluma + 1.0) / 125.0) * (10. + (noiseluma + 1.0) / 25.0))) : static_cast(SQR((noiseluma / 125.0) * (1.0 + noiseluma / 25.0))); + const float noisevarL = (useNoiseLCurve && (denoiseMethodRgb || !isRAW)) ? SQR(((noiseluma + 1.f) / 125.f) * (10.f + (noiseluma + 1.f) / 25.f)) : SQR((noiseluma / 125.f) * (1.f + noiseluma / 25.f)); const bool denoiseLuminance = (noisevarL > 0.00001f); //printf("NL=%f \n",noisevarL); @@ -635,20 +634,20 @@ BENCHFUN if (dnparams.luma != 0 || dnparams.chroma != 0 || dnparams.methodmed == "Lab" || dnparams.methodmed == "Lonly") { // gamma transform for input data - float gam = dnparams.gamma; - float gamthresh = 0.001f; + double gam = dnparams.gamma; + constexpr double gamthresh = 0.001; if (!isRAW) {//reduce gamma under 1 for Lab mode ==> TIF and JPG - if (gam < 1.9f) { - gam = 1.f - (1.9f - gam) / 3.f; //minimum gamma 0.7 - } else if (gam >= 1.9f && gam <= 3.f) { - gam = (1.4f / 1.1f) * gam - 1.41818f; + if (gam < 1.9) { + gam = 1.0 - (1.9 - gam) / 3.0; //minimum gamma 0.7 + } else if (gam >= 1.9 && gam <= 3.0) { + gam = (1.4 / 1.1) * gam - 1.41818; } } LUTf gamcurve(65536, LUT_CLIP_BELOW); - float gamslope = exp(log(static_cast(gamthresh)) / gam) / gamthresh; + const double gamslope = exp(log(gamthresh) / gam) / gamthresh; if (denoiseMethodRgb) { Color::gammaf2lut(gamcurve, gam, gamthresh, gamslope, 65535.f, 32768.f); @@ -657,9 +656,9 @@ BENCHFUN } // inverse gamma transform for output data - float igam = 1.f / gam; - float igamthresh = gamthresh * gamslope; - float igamslope = 1.f / gamslope; + const float igam = 1.0 / gam; + const float igamthresh = gamthresh * gamslope; + const float igamslope = 1.0 / gamslope; LUTf igamcurve(65536, LUT_CLIP_BELOW); @@ -669,9 +668,9 @@ BENCHFUN Color::gammanf2lut(igamcurve, igam, 32768.f, 65535.f); } - const float gain = pow(2.0f, float(expcomp)); - float params_Ldetail = min(float(dnparams.Ldetail), 99.9f); // max out to avoid div by zero when using noisevar_Ldetail as divisor - float noisevar_Ldetail = SQR(static_cast(SQR(100. - params_Ldetail) + 50.*(100. - params_Ldetail)) * TS * 0.5f); + const float gain = std::pow(2.0, expcomp); + const double params_Ldetail = std::min(dnparams.Ldetail, 99.9); // max out to avoid div by zero when using noisevar_Ldetail as divisor + const float noisevar_Ldetail = SQR(SQR(100. - params_Ldetail) + 50.0 * (100.0 - params_Ldetail) * TS * 0.5); array2D tilemask_in(TS, TS); array2D tilemask_out(TS, TS); @@ -681,13 +680,13 @@ BENCHFUN for (int i = 0; i < TS; ++i) { float i1 = abs((i > TS / 2 ? i - TS + 1 : i)); - float vmask = (i1 < border ? SQR(sin((rtengine::RT_PI * i1) / (2 * border))) : 1.0f); - float vmask2 = (i1 < 2 * border ? SQR(sin((rtengine::RT_PI * i1) / (2 * border))) : 1.0f); + float vmask = (i1 < border ? SQR(sin((rtengine::RT_PI_F * i1) / (2 * border))) : 1.f); + float vmask2 = (i1 < 2 * border ? SQR(sin((rtengine::RT_PI_F * i1) / (2 * border))) : 1.f); for (int j = 0; j < TS; ++j) { float j1 = abs((j > TS / 2 ? j - TS + 1 : j)); - tilemask_in[i][j] = (vmask * (j1 < border ? SQR(sin((rtengine::RT_PI * j1) / (2 * border))) : 1.0f)) + epsilon; - tilemask_out[i][j] = (vmask2 * (j1 < 2 * border ? SQR(sin((rtengine::RT_PI * j1) / (2 * border))) : 1.0f)) + epsilon; + tilemask_in[i][j] = (vmask * (j1 < border ? SQR(sin((rtengine::RT_PI_F * j1) / (2 * border))) : 1.0f)) + epsilon; + tilemask_out[i][j] = (vmask2 * (j1 < 2 * border ? SQR(sin((rtengine::RT_PI_F * j1) / (2 * border))) : 1.0f)) + epsilon; } } @@ -883,19 +882,19 @@ BENCHFUN int height = tilebottom - tiletop; int width2 = (width + 1) / 2; float realred, realblue; - float interm_med = static_cast(dnparams.chroma) / 10.0; + float interm_med = dnparams.chroma / 10.0; float intermred, intermblue; if (dnparams.redchro > 0.) { - intermred = (dnparams.redchro / 10.); + intermred = dnparams.redchro / 10.0; } else { - intermred = static_cast(dnparams.redchro) / 7.0; //increase slower than linear for more sensit + intermred = dnparams.redchro / 7.0; //increase slower than linear for more sensit } if (dnparams.bluechro > 0.) { - intermblue = (dnparams.bluechro / 10.); + intermblue = dnparams.bluechro / 10.0; } else { - intermblue = static_cast(dnparams.bluechro) / 7.0; //increase slower than linear for more sensit + intermblue = dnparams.bluechro / 7.0; //increase slower than linear for more sensit } if (ponder && kall == 2) { @@ -1096,7 +1095,7 @@ BENCHFUN //binary 1 or 0 for each level, eg subsampling = 0 means no subsampling, 1 means subsample //the first level only, 7 means subsample the first three levels, etc. //actual implementation only works with subsampling set to 1 - float interm_medT = static_cast(dnparams.chroma) / 10.0; + float interm_medT = dnparams.chroma / 10.0; bool execwavelet = true; if (!denoiseLuminance && interm_medT < 0.05f && dnparams.median && (dnparams.methodmed == "Lab" || dnparams.methodmed == "Lonly")) { @@ -2121,7 +2120,7 @@ float ImProcFunctions::Mad(const float * DataList, const int datalen) int count_ = count - histo[median - 1]; // interpolate - return (((median - 1) + (datalen / 2 - count_) / (static_cast(count - count_))) / 0.6745); + return (((median - 1) + (datalen / 2 - count_) / (static_cast(count - count_))) / 0.6745f); } float ImProcFunctions::MadRgb(const float * DataList, const int datalen) @@ -2155,7 +2154,7 @@ float ImProcFunctions::MadRgb(const float * DataList, const int datalen) // interpolate delete[] histo; - return (((median - 1) + (datalen / 2 - count_) / (static_cast(count - count_))) / 0.6745); + return (((median - 1) + (datalen / 2 - count_) / (static_cast(count - count_))) / 0.6745f); } @@ -2908,7 +2907,7 @@ void ImProcFunctions::RGB_denoise_infoGamCurve(const procparams::DirPyrDenoisePa bool denoiseMethodRgb = (dnparams.dmethod == "RGB"); if (denoiseMethodRgb) { - gamslope = exp(log(static_cast(gamthresh)) / gam) / gamthresh; + gamslope = exp(log(static_cast(gamthresh)) / static_cast(gam)) / static_cast(gamthresh); Color::gammaf2lut(gamcurve, gam, gamthresh, gamslope, 65535.f, 32768.f); } else { Color::gammanf2lut(gamcurve, gam, 65535.f, 32768.f); @@ -3189,19 +3188,19 @@ void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc, } float realred, realblue; - float interm_med = static_cast(dnparams.chroma) / 10.0; + float interm_med = dnparams.chroma / 10.0; float intermred, intermblue; if (dnparams.redchro > 0.) { - intermred = (dnparams.redchro / 10.); + intermred = dnparams.redchro / 10.0; } else { - intermred = static_cast(dnparams.redchro) / 7.0; //increase slower than linear for more sensit + intermred = dnparams.redchro / 7.0; //increase slower than linear for more sensit } if (dnparams.bluechro > 0.) { - intermblue = (dnparams.bluechro / 10.); + intermblue = dnparams.bluechro / 10.0; } else { - intermblue = static_cast(dnparams.bluechro) / 7.0; //increase slower than linear for more sensit + intermblue = dnparams.bluechro / 7.0; //increase slower than linear for more sensit } realred = interm_med + intermred; diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index 9a95b8e2f..15b7b21ee 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -103,7 +103,7 @@ void ImProcFunctions::PF_correct_RT(LabImage * lab, double radius, int thresh) // no precalculated values without SSE => calculate const float HH = xatan2f(lab->b[i][j], lab->a[i][j]); #endif - float chparam = chCurve->getVal((Color::huelab_to_huehsv2(HH))) - 0.5f; // get C=f(H) + float chparam = chCurve->getVal((Color::huelab_to_huehsv2(HH))) - 0.5; // get C=f(H) if (chparam < 0.f) { chparam *= 2.f; // increased action if chparam < 0 @@ -113,25 +113,25 @@ void ImProcFunctions::PF_correct_RT(LabImage * lab, double radius, int thresh) } const float chroma = chromaChfactor * (SQR(lab->a[i][j] - tmpa[i][j]) + SQR(lab->b[i][j] - tmpb[i][j])); // modulate chroma function hue - chromave += chroma; + chromave += static_cast(chroma); fringe[i * width + j] = chroma; } } } chromave /= height * width; - if (chromave > 0.0) { // now as chromave is calculated, we postprocess fringe to reduce the number of divisions in future + const float chromavef = chromave; #ifdef _OPENMP #pragma omp parallel for simd #endif for (int j = 0; j < width * height; j++) { - fringe[j] = 1.f / (fringe[j] + chromave); + fringe[j] = 1.f / (fringe[j] + chromavef); } - const float threshfactor = 1.f / (SQR(thresh / 33.f) * chromave * 5.0f + chromave); + const float threshfactor = 1.f / (SQR(thresh / 33.f) * chromavef * 5.0f + chromavef); const int halfwin = std::ceil(2 * radius) + 1; // Issue 1674: @@ -297,7 +297,7 @@ void ImProcFunctions::PF_correct_RTcam(CieImage * ncie, double radius, int thres // no precalculated values without SSE => calculate const float HH = xatan2f(srbb[i][j], sraa[i][j]); #endif - float chparam = chCurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5f; //get C=f(H) + float chparam = chCurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5; //get C=f(H) if (chparam < 0.f) { chparam *= 2.f; // increase action if chparam < 0 @@ -307,7 +307,7 @@ void ImProcFunctions::PF_correct_RTcam(CieImage * ncie, double radius, int thres } const float chroma = chromaChfactor * (SQR(sraa[i][j] - tmaa[i][j]) + SQR(srbb[i][j] - tmbb[i][j])); //modulate chroma function hue - chromave += chroma; + chromave += static_cast(chroma); fringe[i * width + j] = chroma; } } @@ -317,15 +317,16 @@ void ImProcFunctions::PF_correct_RTcam(CieImage * ncie, double radius, int thres if (chromave > 0.0) { // now as chromave is calculated, we postprocess fringe to reduce the number of divisions in future + const float chromavef = chromave; #ifdef _OPENMP #pragma omp parallel for simd #endif for (int j = 0; j < width * height; j++) { - fringe[j] = 1.f / (fringe[j] + chromave); + fringe[j] = 1.f / (fringe[j] + chromavef); } - const float threshfactor = 1.f / (SQR(thresh / 33.f) * chromave * 5.0f + chromave); + const float threshfactor = 1.f / (SQR(thresh / 33.f) * chromavef * 5.0f + chromavef); const int halfwin = std::ceil(2 * radius) + 1; // Issue 1674: @@ -695,7 +696,7 @@ void ImProcFunctions::Badpixelscam(CieImage * ncie, double radius, int thresh, i for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { const float chroma = SQR(sraa[i][j] - tmaa[i][j]) + SQR(srbb[i][j] - tmbb[i][j]); - chrommed += chroma; + chrommed += static_cast(chroma); badpix[i * width + j] = chroma; } } @@ -703,15 +704,16 @@ void ImProcFunctions::Badpixelscam(CieImage * ncie, double radius, int thresh, i chrommed /= height * width; if (chrommed > 0.0) { + const float chrommedf = chrommed; // now as chrommed is calculated, we postprocess badpix to reduce the number of divisions in future - const float threshfactor = 1.f / ((thresh * chrommed) / 33.f + chrommed); + const float threshfactor = 1.f / ((thresh * chrommedf) / 33.f + chrommedf); const int halfwin = std::ceil(2 * radius) + 1; #ifdef _OPENMP #pragma omp parallel #endif { #ifdef __SSE2__ - const vfloat chrommedv = F2V(chrommed); + const vfloat chrommedv = F2V(chrommedf); const vfloat onev = F2V(1.f); #endif #ifdef _OPENMP @@ -726,7 +728,7 @@ void ImProcFunctions::Badpixelscam(CieImage * ncie, double radius, int thresh, i } #endif for (; j < width; j++) { - badpix[i * width + j] = 1.f / (badpix[i * width + j] + chrommed); + badpix[i * width + j] = 1.f / (badpix[i * width + j] + chrommedf); } } @@ -1040,7 +1042,7 @@ void ImProcFunctions::BadpixelsLab(LabImage * lab, double radius, int thresh, fl for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { const float chroma = SQR(lab->a[i][j] - tmaa[i][j]) + SQR(lab->b[i][j] - tmbb[i][j]); - chrommed += chroma; + chrommed += static_cast(chroma); badpix[i * width + j] = chroma; } } @@ -1049,13 +1051,13 @@ void ImProcFunctions::BadpixelsLab(LabImage * lab, double radius, int thresh, fl if (chrommed > 0.0) { // now as chrommed is calculated, we postprocess badpix to reduce the number of divisions in future - + const float chrommedf = chrommed; #ifdef _OPENMP #pragma omp parallel #endif { #ifdef __SSE2__ - const vfloat chrommedv = F2V(chrommed); + const vfloat chrommedv = F2V(chrommedf); const vfloat onev = F2V(1.f); #endif #ifdef _OPENMP @@ -1070,12 +1072,12 @@ void ImProcFunctions::BadpixelsLab(LabImage * lab, double radius, int thresh, fl } #endif for (; j < width; j++) { - badpix[i * width + j] = 1.f / (badpix[i * width + j] + chrommed); + badpix[i * width + j] = 1.f / (badpix[i * width + j] + chrommedf); } } } - const float threshfactor = 1.f / ((thresh * chrommed) / 33.f + chrommed); + const float threshfactor = 1.f / ((thresh * chrommedf) / 33.f + chrommedf); chrom *= 327.68f; chrom *= chrom; diff --git a/rtengine/ahd_demosaic_RT.cc b/rtengine/ahd_demosaic_RT.cc index 064dfd6e1..536726925 100644 --- a/rtengine/ahd_demosaic_RT.cc +++ b/rtengine/ahd_demosaic_RT.cc @@ -52,13 +52,13 @@ void RawImageSource::ahd_demosaic() int width = W, height = H; - constexpr double xyz_rgb[3][3] = { /* XYZ from RGB */ - { 0.412453, 0.357580, 0.180423 }, - { 0.212671, 0.715160, 0.072169 }, - { 0.019334, 0.119193, 0.950227 } + constexpr float xyz_rgb[3][3] = { /* XYZ from RGB */ + { 0.412453f, 0.357580f, 0.180423f }, + { 0.212671f, 0.715160f, 0.072169f }, + { 0.019334f, 0.119193f, 0.950227f } }; - constexpr float d65_white[3] = { 0.950456, 1, 1.088754 }; + constexpr float d65_white[3] = { 0.950456f, 1.f, 1.088754f }; double progress = 0.0; @@ -76,7 +76,7 @@ void RawImageSource::ahd_demosaic() for (unsigned int j = 0; j < 3; j++) { xyz_cam[i][j] = 0; for (int k = 0; k < 3; k++) { - xyz_cam[i][j] += xyz_rgb[i][k] * imatrices.rgb_cam[k][j] / d65_white[i]; + xyz_cam[i][j] += xyz_rgb[i][k] * static_cast(imatrices.rgb_cam[k][j]) / d65_white[i]; } } } diff --git a/rtengine/badpixels.cc b/rtengine/badpixels.cc index 0ae63a618..97294bdf7 100644 --- a/rtengine/badpixels.cc +++ b/rtengine/badpixels.cc @@ -477,7 +477,7 @@ int RawImageSource::interpolateBadPixelsXtrans(const PixelsMap &bitmapBads) int RawImageSource::findHotDeadPixels(PixelsMap &bpMap, const float thresh, const bool findHotPixels, const bool findDeadPixels) const { BENCHFUN - const float varthresh = (20.0 * (thresh / 100.0) + 1.0) / 24.f; + const float varthresh = (20.f * (thresh / 100.f) + 1.f) / 24.f; // counter for dead or hot pixels int counter = 0; diff --git a/rtengine/calc_distort.cc b/rtengine/calc_distort.cc index 7af47adb2..3a7a4a1c4 100644 --- a/rtengine/calc_distort.cc +++ b/rtengine/calc_distort.cc @@ -5,8 +5,8 @@ locations (before and after tracking) to text files and to PPM files, and prints the features to the screen. **********************************************************************/ -#include "klt/pnmio.h" -#include "klt/klt.h" +#include +#include #include #include diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index d136d6a21..36aa96030 100644 --- a/rtengine/camconst.cc +++ b/rtengine/camconst.cc @@ -553,7 +553,7 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float float av = (avh - 1) + (float)k / 3; float aperture = sqrtf(powf(2, av)); - if (fnumber > aperture * 0.97 && fnumber < aperture / 0.97) { + if (fnumber > aperture * 0.97f && fnumber < aperture / 0.97f) { fnumber = fn_tab[avh][k]; it = mApertureScaling.find(fnumber); avh = 7; @@ -579,7 +579,7 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float scaling = it->second; } - if (scaling > 1.0) { + if (scaling > 1.f) { for (int i = 0; i < 4; i++) { lvl.levels[i] *= scaling; @@ -638,7 +638,7 @@ CameraConst::update_globalGreenEquilibration(bool other) } bool -CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_) +CameraConstantsStore::parse_camera_constants_file(const Glib::ustring& filename_) { // read the file into a single long string const char *filename = filename_.c_str(); @@ -809,7 +809,7 @@ CameraConstantsStore::~CameraConstantsStore() } } -void CameraConstantsStore::init(Glib::ustring baseDir, Glib::ustring userSettingsDir) +void CameraConstantsStore::init(const Glib::ustring& baseDir, const Glib::ustring& userSettingsDir) { parse_camera_constants_file(Glib::build_filename(baseDir, "camconst.json")); diff --git a/rtengine/camconst.h b/rtengine/camconst.h index 1096e1767..3af05ab01 100644 --- a/rtengine/camconst.h +++ b/rtengine/camconst.h @@ -3,10 +3,17 @@ */ #pragma once -#include #include +#include #include +namespace Glib +{ + +class ustring; + +} + namespace rtengine { @@ -14,7 +21,7 @@ struct camera_const_levels { int levels[4]; }; -class CameraConst +class CameraConst final { private: std::string make_model; @@ -56,17 +63,17 @@ public: void update_globalGreenEquilibration(bool other); }; -class CameraConstantsStore +class CameraConstantsStore final { private: std::map mCameraConstants; CameraConstantsStore(); - bool parse_camera_constants_file(Glib::ustring filename); + bool parse_camera_constants_file(const Glib::ustring& filename); public: ~CameraConstantsStore(); - void init(Glib::ustring baseDir, Glib::ustring userSettingsDir); + void init(const Glib::ustring& baseDir, const Glib::ustring& userSettingsDir); static CameraConstantsStore *getInstance(void); CameraConst *get(const char make[], const char model[]); }; diff --git a/rtengine/camconst.json b/rtengine/camconst.json index ab42f3d19..f58167478 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1221,7 +1221,7 @@ Camera constants: { // Quality A, changes for raw crop which is wrong (larger) in dcraw "make_model": "Canon PowerShot S120", - "dcraw_matrix": [ 6961,-1685,-695,-4625,12945,1836,-1114,2152,5518 ], + "dcraw_matrix": [ 6961, -1685, -695, -4625, 12945, 1836, -1114, 2152, 5518 ], // ColorMatrix2 using illuminant D65 from Adobe DNG Converter 12.2 "raw_crop": [ 120, 30, 4024, 3030 ], "masked_areas": [ 32, 2, 3028, 80 ], "ranges": { "white": 4050 } diff --git a/rtengine/canon_cr3_decoder.cc b/rtengine/canon_cr3_decoder.cc index 6274154cb..d9a10900c 100644 --- a/rtengine/canon_cr3_decoder.cc +++ b/rtengine/canon_cr3_decoder.cc @@ -18,6 +18,7 @@ */ // Code adapted from ART +// https://bitbucket.org/agriggio/art/ /* * * This file is part of ART. @@ -37,11 +38,16 @@ */ // Code adapted from libraw -/* -*- C++ -*- - * Copyright 2019 LibRaw LLC (info@libraw.org) +// https://github.com/LibRaw/LibRaw/ +/* + * File: libraw_crxdec.cpp + * Copyright (C) 2018-2019 Alexey Danilchenko + * Copyright (C) 2019 Alex Tutubalin, LibRaw LLC * - LibRaw is free software; you can redistribute it and/or modify - it under the terms of the one of two licenses as you choose: + Canon CR3 file decoder + +LibRaw is free software; you can redistribute it and/or modify +it under the terms of the one of two licenses as you choose: 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1 (See file LICENSE.LGPL provided in LibRaw distribution archive for details). @@ -49,7 +55,7 @@ 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 (See file LICENSE.CDDL provided in LibRaw distribution archive for details). -*/ + */ #include #include diff --git a/rtengine/capturesharpening.cc b/rtengine/capturesharpening.cc index 9b60694f2..4dcdd0734 100644 --- a/rtengine/capturesharpening.cc +++ b/rtengine/capturesharpening.cc @@ -761,13 +761,13 @@ bool checkForStop(float** tmpIThr, float** iterCheck, int fullTileSize, int bord return false; } -void CaptureDeconvSharpening (float** luminance, const float* const * oldLuminance, const float * const * blend, int W, int H, double sigma, double sigmaCornerOffset, int iterations, bool checkIterStop, rtengine::ProgressListener* plistener, double startVal, double endVal) +void CaptureDeconvSharpening (float** luminance, const float* const * oldLuminance, const float * const * blend, int W, int H, float sigma, float sigmaCornerOffset, int iterations, bool checkIterStop, rtengine::ProgressListener* plistener, double startVal, double endVal) { BENCHFUN - const bool is9x9 = (sigma <= 1.50 && sigmaCornerOffset == 0.0); - const bool is7x7 = (sigma <= 1.15 && sigmaCornerOffset == 0.0); - const bool is5x5 = (sigma <= 0.84 && sigmaCornerOffset == 0.0); - const bool is3x3 = (sigma < 0.6 && sigmaCornerOffset == 0.0); + const bool is9x9 = (sigma <= 1.5f && sigmaCornerOffset == 0.f); + const bool is7x7 = (sigma <= 1.15f && sigmaCornerOffset == 0.f); + const bool is5x5 = (sigma <= 0.84f && sigmaCornerOffset == 0.f); + const bool is3x3 = (sigma < 0.6f && sigmaCornerOffset == 0.f); float kernel13[13][13]; float kernel9[9][9]; float kernel7[7][7]; @@ -906,11 +906,11 @@ BENCHFUN } } } else { - if (sigmaCornerOffset != 0.0) { + if (sigmaCornerOffset != 0.f) { const float distance = sqrt(rtengine::SQR(i + tileSize / 2 - H / 2) + rtengine::SQR(j + tileSize / 2 - W / 2)); const float sigmaTile = static_cast(sigma) + distanceFactor * distance; if (sigmaTile >= 0.4f) { - if (sigmaTile > 1.50) { // have to use 13x13 kernel + if (sigmaTile > 1.5f) { // have to use 13x13 kernel float lkernel13[13][13]; compute13x13kernel(static_cast(sigma) + distanceFactor * distance, lkernel13); for (int k = 0; k < iterations; ++k) { @@ -921,7 +921,7 @@ BENCHFUN break; } } - } else if (sigmaTile > 1.15) { // have to use 9x9 kernel + } else if (sigmaTile > 1.15f) { // have to use 9x9 kernel float lkernel9[9][9]; compute9x9kernel(static_cast(sigma) + distanceFactor * distance, lkernel9); for (int k = 0; k < iterations; ++k) { @@ -932,7 +932,7 @@ BENCHFUN break; } } - } else if (sigmaTile > 0.84) { // have to use 7x7 kernel + } else if (sigmaTile > 0.84f) { // have to use 7x7 kernel float lkernel7[7][7]; compute7x7kernel(static_cast(sigma) + distanceFactor * distance, lkernel7); for (int k = 0; k < iterations; ++k) { @@ -1021,7 +1021,7 @@ BENCHFUN { 0.019334, 0.119193, 0.950227 } }; - float contrast = conrastThreshold / 100.f; + float contrast = conrastThreshold / 100.0; const float clipVal = (ri->get_white(1) - ri->get_cblack(1)) * scale_mul[1]; diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc index c7e49b2ed..208ed4366 100644 --- a/rtengine/ciecam02.cc +++ b/rtengine/ciecam02.cc @@ -28,7 +28,7 @@ #endif #undef CLIPD -#define CLIPD(a) ((a)>0.0?((a)<1.0?(a):1.0):0.0) +#define CLIPD(a) ((a)>0.f?((a)<1.f?(a):1.f):0.f) #define MAXR(a,b) ((a) > (b) ? (a) : (b)) namespace rtengine @@ -408,7 +408,7 @@ void Ciecam02::initcam1float (float yb, float pilotd, float f, float la, float x { n = yb / yw; - if (pilotd == 2.0) { + if (pilotd == 2.f) { d = d_factorfloat ( f, la ); } else { d = pilotd; @@ -434,7 +434,7 @@ void Ciecam02::initcam2float (float yb, float pilotd, float f, float la, float x { n = yb / yw; - if (pilotd == 2.0) { + if (pilotd == 2.f) { d = d_factorfloat ( f, la ); } else { d = pilotd; @@ -492,7 +492,7 @@ void Ciecam02::xyz2jchqms_ciecam02float ( float &J, float &C, float &h, float &Q myh = xatan2f ( cb, ca ); if ( myh < 0.0f ) { - myh += (2.f * rtengine::RT_PI); + myh += (2.f * rtengine::RT_PI_F); } a = ((2.0f * rpa) + gpa + (0.05f * bpa) - 0.305f) * nbb; @@ -620,7 +620,7 @@ void Ciecam02::xyz2jch_ciecam02float ( float &J, float &C, float &h, float aw, f myh = xatan2f ( cb, ca ); if ( myh < 0.0f ) { - myh += (2.f * rtengine::RT_PI); + myh += (2.f * rtengine::RT_PI_F); } a = ((2.0f * rpa) + gpa + (0.05f * bpa) - 0.305f) * nbb; diff --git a/rtengine/cieimage.h b/rtengine/cieimage.h index fea675cd4..329c0ba74 100644 --- a/rtengine/cieimage.h +++ b/rtengine/cieimage.h @@ -23,7 +23,7 @@ namespace rtengine { -class CieImage : +class CieImage final : public NonCopyable { private: diff --git a/rtengine/color.cc b/rtengine/color.cc index 8d20fb9ba..e998b665c 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include #include "rtengine.h" #include "color.h" @@ -2997,1384 +2998,6 @@ void Color::LabGamutMunsell(float *labL, float *laba, float *labb, const int N, } -/* - * MunsellLch correction - * Copyright (c) 2012 Jacques Desmis - * - * Find the right LUT and calculate the correction - */ -void Color::MunsellLch (float lum, float hue, float chrom, float memChprov, float &correction, int zone, float &lbe, bool &correctL) -{ - - int x = int(memChprov); - int y = int(chrom); - - //begin PB correction + sky - if(zone == 1) { - if(lum > 5.0) { - if(lum < 15.0) { - if( (hue >= (_15PB10[x] - 0.035)) && (hue < (_15PB10[x] + 0.052) && x <= 45)) { - if(y > 49) { - y = 49; - } - - correction = _15PB10[y] - _15PB10[x] ; - lbe = _15PB10[y]; - correctL = true; - } else if (( hue >= ( _3PB10[x] - 0.052)) && (hue < (_45PB10[x] + _3PB10[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _3PB10[y] - _3PB10[x]; - lbe = _3PB10[y]; - correctL = true; - } else if (( hue >= (_45PB10[x] + _3PB10[x]) / 2.0) && (hue < (_45PB10[x] + 0.052)) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _45PB10[y] - _45PB10[x] ; - lbe = _45PB10[y]; - correctL = true; - } else if (( hue >= (_6PB10[x] - 0.052) && (hue < (_6PB10[x] + _75PB10[x]) / 2.0))) { - correction = _6PB10[y] - _6PB10[x] ; - lbe = _6PB10[y]; - correctL = true; - } else if (( hue >= (_6PB10[x] + _75PB10[x]) / 2.0) && (hue < (_9PB10[x] + _75PB10[x]) / 2.0)) { - correction = _75PB10[y] - _75PB10[x] ; - lbe = _75PB10[y]; - correctL = true; - } else if (( hue >= (_9PB10[x] + _75PB10[x]) / 2.0) && (hue < (_9PB10[x] + _10PB10[x]) / 2.0)) { - correction = _9PB10[y] - _9PB10[x] ; - lbe = _9PB10[y]; - correctL = true; - } else if (( hue >= (_10PB10[x] + _9PB10[x]) / 2.0) && (hue < (_1P10[x] + _10PB10[x]) / 2.0)) { - correction = _10PB10[y] - _10PB10[x] ; - lbe = _10PB10[y]; - correctL = true; - } else if (( hue >= (_10PB10[x] + _1P10[x]) / 2.0) && (hue < (_1P10[x] + _4P10[x]) / 2.0)) { - correction = _1P10[y] - _1P10[x]; - lbe = _1P10[y]; - correctL = true; - } else if (( hue >= (_1P10[x] + _4P10[x]) / 2.0) && (hue < (0.035 + _4P10[x]) / 2.0)) { - correction = _4P10[y] - _4P10[x] ; - lbe = _4P10[y]; - correctL = true; - } - } else if (lum < 25.0) { - if( (hue >= (_15PB20[x] - 0.035)) && (hue < (_15PB20[x] + _3PB20[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _15PB20[y] - _15PB20[x] ; - lbe = _15PB20[y]; - correctL = true; - } else if (( hue >= (_15PB20[x] + _3PB20[x]) / 2.0) && (hue < (_45PB20[x] + _3PB20[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _3PB20[y] - _3PB20[x] ; - lbe = _3PB20[y]; - correctL = true; - } else if (( hue >= (_45PB20[x] + _3PB20[x]) / 2.0) && (hue < ( _45PB20[x] + 0.052)) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _45PB20[y] - _45PB20[x] ; - lbe = _45PB20[y]; - correctL = true; - } else if (( hue >= (_45PB20[x] + 0.052)) && (hue < (_6PB20[x] + _75PB20[x]) / 2.0)) { - correction = _6PB20[y] - _6PB20[x]; - lbe = _6PB20[y]; - correctL = true; - } else if (( hue >= (_6PB20[x] + _75PB20[x]) / 2.0) && (hue < (_9PB20[x] + _75PB20[x]) / 2.0)) { - correction = _75PB20[y] - _75PB20[x] ; - lbe = _75PB20[y]; - correctL = true; - } else if (( hue >= (_9PB20[x] + _75PB20[x]) / 2.0) && (hue < (_9PB20[x] + _10PB20[x]) / 2.0)) { - correction = _9PB20[y] - _9PB20[x] ; - lbe = _9PB20[y]; - correctL = true; - } else if (( hue >= (_10PB20[x] + _9PB20[x]) / 2.0) && (hue < (_1P20[x] + _10PB20[x]) / 2.0)) { - correction = _10PB20[y] - _10PB20[x] ; - lbe = _10PB20[y]; - correctL = true; - } else if (( hue >= (_10PB20[x] + _1P20[x]) / 2.0) && (hue < (_1P20[x] + _4P20[x]) / 2.0)) { - correction = _1P20[y] - _1P20[x] ; - lbe = _1P20[y]; - correctL = true; - } else if (( hue >= (_1P20[x] + _4P20[x]) / 2.0) && (hue < (0.035 + _4P20[x]) / 2.0)) { - correction = _4P20[y] - _4P20[x] ; - lbe = _4P20[y]; - correctL = true; - } - } else if (lum < 35.0) { - if( (hue >= (_15PB30[x] - 0.035)) && (hue < (_15PB30[x] + _3PB30[x]) / 2.0) && x <= 85 ) { - if(y > 89) { - y = 89; - } - - correction = _15PB30[y] - _15PB30[x] ; - lbe = _15PB30[y]; - correctL = true; - } else if (( hue >= (_15PB30[x] + _3PB30[x]) / 2.0) && (hue < (_45PB30[x] + _3PB30[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _3PB30[y] - _3PB30[x] ; - lbe = _3PB30[y]; - correctL = true; - } else if (( hue >= (_45PB30[x] + _3PB30[x]) / 2.0) && (hue < (_45PB30[x] + 0.052)) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _45PB30[y] - _45PB30[x] ; - lbe = _45PB30[y]; - correctL = true; - } else if (( hue >= ( _45PB30[x] + 0.052)) && (hue < (_6PB30[x] + _75PB30[x]) / 2.0)) { - correction = _6PB30[y] - _6PB30[x] ; - lbe = _6PB30[y]; - correctL = true; - } else if (( hue >= (_6PB30[x] + _75PB30[x]) / 2.0) && (hue < (_9PB30[x] + _75PB30[x]) / 2.0)) { - correction = _75PB30[y] - _75PB30[x] ; - lbe = _75PB30[y] ; - correctL = true; - } else if (( hue >= (_9PB30[x] + _75PB30[x]) / 2.0) && (hue < (_9PB30[x] + _10PB30[x]) / 2.0)) { - correction = _9PB30[y] - _9PB30[x] ; - lbe = _9PB30[y]; - correctL = true; - } else if (( hue >= (_10PB30[x] + _9PB30[x]) / 2.0) && (hue < (_1P30[x] + _10PB30[x]) / 2.0)) { - correction = _10PB30[y] - _10PB30[x] ; - lbe = _10PB30[y]; - correctL = true; - } else if (( hue >= (_10PB30[x] + _1P30[x]) / 2.0) && (hue < (_1P30[x] + _4P30[x]) / 2.0)) { - correction = _1P30[y] - _1P30[x] ; - lbe = _1P30[y]; - correctL = true; - } else if (( hue >= (_1P30[x] + _4P30[x]) / 2.0) && (hue < (0.035 + _4P30[x]) / 2.0)) { - correction = _4P30[y] - _4P30[x] ; - lbe = _4P30[y]; - correctL = true; - } - } else if (lum < 45.0) { - if( (hue <= (_05PB40[x] + _15PB40[x]) / 2.0) && (hue > (_05PB40[x] + _10B40[x]) / 2.0) && x < 75 ) { - if(y > 75) { - y = 75; - } - - correction = _05PB40[y] - _05PB40[x] ; - lbe = _05PB40[y]; - correctL = true; - } else if( (hue <= (_05PB40[x] + _10B40[x]) / 2.0) && (hue > (_10B40[x] + _9B40[x]) / 2.0) && x < 70 ) { - if(y > 70) { - y = 70; - } - - correction = _10B40[y] - _10B40[x] ; - lbe = _10B40[y]; - correctL = true; - } else if( (hue <= (_10B40[x] + _9B40[x]) / 2.0) && (hue > (_9B40[x] + _7B40[x]) / 2.0) && x < 70 ) { - if(y > 70) { - y = 70; - } - - correction = _9B40[y] - _9B40[x] ; - lbe = _9B40[y]; - correctL = true; - } else if( (hue <= (_9B40[x] + _7B40[x]) / 2.0) && (hue > (_5B40[x] + _7B40[x]) / 2.0) && x < 70 ) { - if(y > 70) { - y = 70; - } - - correction = _7B40[y] - _7B40[x] ; - lbe = _7B40[y]; - correctL = true; - } else if (( hue <= (_5B40[x] + _7B40[x]) / 2.0) && (hue > (_5B40[x] - 0.035)) && x < 70) { - if(y > 70) { - y = 70; // - } - - correction = _5B40[y] - _5B40[x] ; - lbe = _5B40[y]; - correctL = true; - } - - else if( (hue >= (_15PB40[x] - 0.035)) && (hue < (_15PB40[x] + _3PB40[x]) / 2.0) && x <= 85 ) { - if(y > 89) { - y = 89; - } - - correction = _15PB40[y] - _15PB40[x] ; - lbe = _15PB40[y]; - correctL = true; - } else if (( hue >= (_15PB40[x] + _3PB40[x]) / 2.0) && (hue < (_45PB40[x] + _3PB40[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _3PB40[y] - _3PB40[x] ; - lbe = _3PB40[y]; - correctL = true; - } else if (( hue >= (_45PB40[x] + _3PB40[x]) / 2.0) && (hue < (_45PB40[x] + 0.052)) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _45PB40[y] - _45PB40[x] ; - lbe = _45PB40[y] ; - correctL = true; - } else if (( hue >= (_45PB40[x] + 0.052)) && (hue < (_6PB40[x] + _75PB40[x]) / 2.0)) { - correction = _6PB40[y] - _6PB40[x] ; - lbe = _6PB40[y]; - correctL = true; - } else if (( hue >= (_6PB40[x] + _75PB40[x]) / 2.0) && (hue < (_9PB40[x] + _75PB40[x]) / 2.0)) { - correction = _75PB40[y] - _75PB40[x] ; - lbe = _75PB40[y]; - correctL = true; - } else if (( hue >= (_9PB40[x] + _75PB40[x]) / 2.0) && (hue < (_9PB40[x] + _10PB40[x]) / 2.0)) { - correction = _9PB40[y] - _9PB40[x] ; - lbe = _9PB40[y]; - correctL = true; - } else if (( hue >= (_10PB40[x] + _9PB40[x]) / 2.0) && (hue < (_1P40[x] + _10PB40[x]) / 2.0)) { - correction = _10PB40[y] - _10PB40[x] ; - lbe = _10PB40[y]; - correctL = true; - } else if (( hue >= (_10PB40[x] + _1P40[x]) / 2.0) && (hue < (_1P40[x] + _4P40[x]) / 2.0)) { - correction = _1P40[y] - _1P40[x] ; - lbe = _1P40[y]; - correctL = true; - } else if (( hue >= (_1P40[x] + _4P40[x]) / 2.0) && (hue < (0.035 + _4P40[x]) / 2.0)) { - correction = _4P40[y] - _4P40[x] ; - lbe = _4P40[y]; - correctL = true; - } - } else if (lum < 55.0) { - if( (hue <= (_05PB50[x] + _15PB50[x]) / 2.0) && (hue > (_05PB50[x] + _10B50[x]) / 2.0) && x < 79 ) { - if(y > 79) { - y = 79; - } - - correction = _05PB50[y] - _05PB50[x] ; - lbe = _05PB50[y]; - correctL = true; - } else if( (hue <= (_05PB50[x] + _10B50[x]) / 2.0) && (hue > (_10B50[x] + _9B50[x]) / 2.0) && x < 79 ) { - if(y > 79) { - y = 79; - } - - correction = _10B50[y] - _10B50[x] ; - lbe = _10B50[y]; - correctL = true; - } else if( (hue <= (_10B50[x] + _9B50[x]) / 2.0) && (hue > (_9B50[x] + _7B50[x]) / 2.0) && x < 79 ) { - if(y > 79) { - y = 79; - } - - correction = _9B50[y] - _9B50[x] ; - lbe = _9B50[y]; - correctL = true; - } else if( (hue <= (_9B50[x] + _7B50[x]) / 2.0) && (hue > (_5B50[x] + _7B50[x]) / 2.0) && x < 79 ) { - if(y > 79) { - y = 79; - } - - correction = _7B50[y] - _7B50[x] ; - lbe = _7B50[y]; - correctL = true; - } else if (( hue <= (_5B50[x] + _7B50[x]) / 2.0) && (hue > (_5B50[x] - 0.035)) && x < 79) { - if(y > 79) { - y = 79; // - } - - correction = _5B50[y] - _5B50[x] ; - lbe = _5B50[y]; - correctL = true; - } - - else if( (hue >= (_15PB50[x] - 0.035)) && (hue < (_15PB50[x] + _3PB50[x]) / 2.0) && x <= 85 ) { - if(y > 89) { - y = 89; - } - - correction = _15PB50[y] - _15PB50[x] ; - lbe = _15PB50[y]; - correctL = true; - } else if (( hue >= (_15PB50[x] + _3PB50[x]) / 2.0) && (hue < (_45PB50[x] + _3PB50[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _3PB50[y] - _3PB50[x] ; - lbe = _3PB50[y]; - correctL = true; - } else if (( hue >= (_45PB50[x] + _3PB50[x]) / 2.0) && (hue < (_6PB50[x] + _45PB50[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _45PB50[y] - _45PB50[x] ; - lbe = _45PB50[y]; - correctL = true; - } else if (( hue >= (_6PB50[x] + _45PB50[x]) / 2.0) && (hue < (_6PB50[x] + _75PB50[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _6PB50[y] - _6PB50[x] ; - lbe = _6PB50[y]; - correctL = true; - } else if (( hue >= (_6PB50[x] + _75PB50[x]) / 2.0) && (hue < (_9PB50[x] + _75PB50[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _75PB50[y] - _75PB50[x] ; - lbe = _75PB50[y]; - correctL = true; - } else if (( hue >= (_9PB50[x] + _75PB50[x]) / 2.0) && (hue < (_9PB50[x] + _10PB50[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _9PB50[y] - _9PB50[x] ; - lbe = _9PB50[y]; - correctL = true; - } else if (( hue >= (_10PB50[x] + _9PB50[x]) / 2.0) && (hue < (_1P50[x] + _10PB50[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _10PB50[y] - _10PB50[x] ; - lbe = _10PB50[y]; - correctL = true; - } else if (( hue >= (_10PB50[x] + _1P50[x]) / 2.0) && (hue < (_1P50[x] + _4P50[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _1P50[y] - _1P50[x] ; - lbe = _1P50[y]; - correctL = true; - } else if (( hue >= (_1P50[x] + _4P50[x]) / 2.0) && (hue < (0.035 + _4P50[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _4P50[y] - _4P50[x] ; - lbe = _4P50[y]; - correctL = true; - } - } else if (lum < 65.0) { - if( (hue <= (_05PB60[x] + _15PB60[x]) / 2.0) && (hue > (_05PB60[x] + _10B60[x]) / 2.0) && x < 79 ) { - if(y > 79) { - y = 79; - } - - correction = _05PB60[y] - _05PB60[x] ; - lbe = _05PB60[y]; - correctL = true; - } else if( (hue <= (_05PB60[x] + _10B60[x]) / 2.0) && (hue > (_10B60[x] + _9B60[x]) / 2.0) && x < 79 ) { - if(y > 79) { - y = 79; - } - - correction = _10B60[y] - _10B60[x] ; - lbe = _10B60[y]; - correctL = true; - } else if( (hue <= (_10B60[x] + _9B60[x]) / 2.0) && (hue > (_9B60[x] + _7B60[x]) / 2.0) && x < 79 ) { - if(y > 79) { - y = 79; - } - - correction = _9B60[y] - _9B60[x] ; - lbe = _9B60[y]; - correctL = true; - } else if( (hue <= (_9B60[x] + _7B60[x]) / 2.0) && (hue > (_5B60[x] + _7B60[x]) / 2.0) && x < 79 ) { - if(y > 79) { - y = 79; - } - - correction = _7B60[y] - _7B60[x] ; - lbe = _7B60[y]; - correctL = true; - } else if (( hue <= (_5B60[x] + _7B60[x]) / 2.0) && (hue > (_5B60[x] - 0.035)) && x < 79) { - if(y > 79) { - y = 79; // - } - - correction = _5B60[y] - _5B60[x] ; - lbe = _5B60[y]; - correctL = true; - } - - else if( (hue >= (_15PB60[x] - 0.035)) && (hue < (_15PB60[x] + _3PB60[x]) / 2.0) && x <= 85 ) { - if(y > 89) { - y = 89; - } - - correction = _15PB60[y] - _15PB60[x] ; - lbe = _15PB60[y]; - correctL = true; - } else if (( hue >= (_15PB60[x] + _3PB60[x]) / 2.0) && (hue < (_45PB60[x] + _3PB60[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _3PB60[y] - _3PB60[x] ; - lbe = _3PB60[y]; - correctL = true; - } else if (( hue >= (_45PB60[x] + _3PB60[x]) / 2.0) && (hue < (_6PB60[x] + _45PB60[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _45PB60[y] - _45PB60[x] ; - lbe = _45PB60[y]; - correctL = true; - } else if (( hue >= (_6PB60[x] + _45PB60[x]) / 2.0) && (hue < (_6PB60[x] + _75PB60[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _6PB60[y] - _6PB60[x] ; - lbe = _6PB60[y]; - correctL = true; - } else if (( hue >= (_6PB60[x] + _75PB60[x]) / 2.0) && (hue < (_9PB60[x] + _75PB60[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _75PB60[y] - _75PB60[x] ; - lbe = _75PB60[y]; - correctL = true; - } else if (( hue >= (_9PB60[x] + _75PB60[x]) / 2.0) && (hue < (_9PB60[x] + _10PB60[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _9PB60[y] - _9PB60[x] ; - lbe = _9PB60[y]; - correctL = true; - } else if (( hue >= (_10PB60[x] + _9PB60[x]) / 2.0) && (hue < (_1P60[x] + _10PB60[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _10PB60[y] - _10PB60[x] ; - lbe = _10PB60[y]; - correctL = true; - } else if (( hue >= (_10PB60[x] + _1P60[x]) / 2.0) && (hue < (_1P60[x] + _4P60[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _1P60[y] - _1P60[x] ; - lbe = _1P60[y]; - correctL = true; - } else if (( hue >= (_1P60[x] + _4P60[x]) / 2.0) && (hue < (0.035 + _4P60[x]) / 2.0) && x <= 85) { - if(y > 89) { - y = 89; - } - - correction = _4P60[y] - _4P60[x] ; - lbe = _4P60[y]; - correctL = true; - } - } else if (lum < 75.0) { - if( (hue <= (_05PB70[x] + _15PB70[x]) / 2.0) && (hue > (_05PB70[x] + _10B70[x]) / 2.0) && x < 50 ) { - if(y > 49) { - y = 49; - } - - correction = _05PB70[y] - _05PB70[x] ; - lbe = _05PB70[y]; - correctL = true; - } else if( (hue <= (_05PB70[x] + _10B70[x]) / 2.0) && (hue > (_10B70[x] + _9B70[x]) / 2.0) && x < 50 ) { - if(y > 49) { - y = 49; - } - - correction = _10B70[y] - _10B70[x] ; - lbe = _10B70[y]; - correctL = true; - } else if( (hue <= (_10B70[x] + _9B70[x]) / 2.0) && (hue > (_9B70[x] + _7B70[x]) / 2.0) && x < 50 ) { - if(y > 49) { - y = 49; - } - - correction = _9B70[y] - _9B70[x] ; - lbe = _9B70[y]; - correctL = true; - } else if( (hue <= (_9B70[x] + _7B70[x]) / 2.0) && (hue > (_5B70[x] + _7B70[x]) / 2.0) && x < 50 ) { - if(y > 49) { - y = 49; - } - - correction = _7B70[y] - _7B70[x] ; - lbe = _7B70[y]; - correctL = true; - } else if (( hue <= (_5B70[x] + _7B70[x]) / 2.0) && (hue > (_5B70[x] - 0.035)) && x < 50) { - if(y > 49) { - y = 49; // - } - - correction = _5B70[y] - _5B70[x] ; - lbe = _5B70[y]; - correctL = true; - } - - else if( (hue >= (_15PB70[x] - 0.035)) && (hue < (_15PB70[x] + _3PB70[x]) / 2.0) && x < 50 ) { - if(y > 49) { - y = 49; - } - - correction = _15PB70[y] - _15PB70[x] ; - lbe = _15PB70[y]; - correctL = true; - } else if (( hue >= (_45PB70[x] + _3PB70[x]) / 2.0) && (hue < (_6PB70[x] + _45PB70[x]) / 2.0) && x < 50) { - if(y > 49) { - y = 49; - } - - correction = _45PB70[y] - _45PB70[x] ; - lbe = _45PB70[y]; - correctL = true; - } else if (( hue >= (_6PB70[x] + _45PB70[x]) / 2.0) && (hue < (_6PB70[x] + _75PB70[x]) / 2.0) && x < 50) { - if(y > 49) { - y = 49; - } - - correction = _6PB70[y] - _6PB70[x] ; - lbe = _6PB70[y]; - correctL = true; - } else if (( hue >= (_6PB70[x] + _75PB70[x]) / 2.0) && (hue < (_9PB70[x] + _75PB70[x]) / 2.0) && x < 50) { - if(y > 49) { - y = 49; - } - - correction = _75PB70[y] - _75PB70[x] ; - lbe = _75PB70[y]; - correctL = true; - } else if (( hue >= (_9PB70[x] + _75PB70[x]) / 2.0) && (hue < (_9PB70[x] + 0.035)) && x < 50) { - if(y > 49) { - y = 49; - } - - correction = _9PB70[y] - _9PB70[x] ; - lbe = _9PB70[y]; - correctL = true; - } - } else if (lum < 85.0) { - if( (hue <= (_05PB80[x] + _15PB80[x]) / 2.0) && (hue > (_05PB80[x] + _10B80[x]) / 2.0) && x < 40 ) { - if(y > 39) { - y = 39; - } - - correction = _05PB80[y] - _05PB80[x] ; - lbe = _05PB80[y] ; - correctL = true; - } else if( (hue <= (_05PB80[x] + _10B80[x]) / 2.0) && (hue > (_10B80[x] + _9B80[x]) / 2.0) && x < 40 ) { - if(y > 39) { - y = 39; - } - - correction = _10B80[y] - _10B80[x] ; - lbe = _10B80[y]; - correctL = true; - } else if( (hue <= (_10B80[x] + _9B80[x]) / 2.0) && (hue > (_9B80[x] + _7B80[x]) / 2.0) && x < 40 ) { - if(y > 39) { - y = 39; - } - - correction = _9B80[y] - _9B80[x] ; - lbe = _9B80[y]; - correctL = true; - } else if( (hue <= (_9B80[x] + _7B80[x]) / 2.0) && (hue > (_5B80[x] + _7B80[x]) / 2.0) && x < 50 ) { - if(y > 49) { - y = 49; - } - - correction = _7B80[y] - _7B80[x] ; - lbe = _7B80[y]; - correctL = true; - } else if (( hue <= (_5B80[x] + _7B80[x]) / 2.0) && (hue > (_5B80[x] - 0.035)) && x < 50) { - if(y > 49) { - y = 49; // - } - - correction = _5B80[y] - _5B80[x] ; - lbe = _5B80[y]; - correctL = true; - } - - else if( (hue >= (_15PB80[x] - 0.035)) && (hue < (_15PB80[x] + _3PB80[x]) / 2.0) && x < 50 ) { - if(y > 49) { - y = 49; - } - - correction = _15PB80[y] - _15PB80[x] ; - lbe = _15PB80[y]; - correctL = true; - } else if (( hue >= (_45PB80[x] + _3PB80[x]) / 2.0) && (hue < (_6PB80[x] + _45PB80[x]) / 2.0) && x < 50) { - if(y > 49) { - y = 49; - } - - correction = _45PB80[y] - _45PB80[x] ; - lbe = _45PB80[y]; - correctL = true; - } else if (( hue >= (_6PB80[x] + _45PB80[x]) / 2.0) && (hue < (_6PB80[x] + _75PB80[x]) / 2.0) && x < 50) { - if(y > 49) { - y = 49; - } - - correction = _6PB80[y] - _6PB80[x] ; - lbe = _6PB80[y]; - correctL = true; - } else if (( hue >= (_6PB80[x] + _75PB80[x]) / 2.0) && (hue < (_9PB80[x] + _75PB80[x]) / 2.0) && x < 50) { - if(y > 49) { - y = 49; - } - - correction = _75PB80[y] - _75PB80[x] ; - lbe = _75PB80[y]; - correctL = true; - } else if (( hue >= (_9PB80[x] + _75PB80[x]) / 2.0) && (hue < (_9PB80[x] + 0.035)) && x < 50) { - if(y > 49) { - y = 49; - } - - correction = _9PB80[y] - _9PB80[x] ; - lbe = _9PB80[y]; - correctL = true; - } - } - } - } - // end PB correction - - //red yellow correction - else if(zone == 2) { - if(lum > 15.0) { - if(lum < 25.0) { - if( (hue <= (_10YR20[x] + 0.035)) && (hue > (_10YR20[x] + _85YR20[x]) / 2.0) && x <= 45) { - if(y > 49) { - y = 49; - } - - correction = _10YR20[y] - _10YR20[x] ; - lbe = _10YR20[y]; - correctL = true; - } else if (( hue <= (_85YR20[x] + _10YR20[x]) / 2.0) && (hue > (_85YR20[x] + 0.035) && x <= 45)) { - if(y > 49) { - y = 49; - } - - correction = _85YR20[y] - _85YR20[x] ; - lbe = _85YR20[y]; - correctL = true; - } - } else if (lum < 35.0) { - if( (hue <= (_10YR30[x] + 0.035)) && (hue > (_10YR30[x] + _85YR30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10YR30[y] - _10YR30[x] ; - lbe = _10YR30[y]; - correctL = true; - } else if( (hue <= (_10YR30[x] + _85YR30[x]) / 2.0) && (hue > (_85YR30[x] + _7YR30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _85YR30[y] - _85YR30[x] ; - lbe = _85YR30[y]; - correctL = true; - } else if (( hue <= (_85YR30[x] + _7YR30[x]) / 2.0) && (hue > (_7YR30[x] + _55YR30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _7YR30[y] - _7YR30[x] ; - lbe = _7YR30[y]; - correctL = true; - } else if (( hue <= (_7YR30[x] + _55YR30[x]) / 2.0) && (hue > (_55YR30[x] + _4YR30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _55YR30[y] - _55YR30[x] ; - lbe = _55YR30[y]; - correctL = true; - } else if (( hue <= (_55YR30[x] + _4YR30[x]) / 2.0) && (hue > (_4YR30[x] + _25YR30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _4YR30[y] - _4YR30[x] ; - lbe = _4YR30[y]; - correctL = true; - } else if (( hue <= (_4YR30[x] + _25YR30[x]) / 2.0) && (hue > (_25YR30[x] + _10R30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _25YR30[y] - _25YR30[x] ; - lbe = _25YR30[y]; - correctL = true; - } else if (( hue <= (_25YR30[x] + _10R30[x]) / 2.0) && (hue > (_10R30[x] + _9R30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10R30[y] - _10R30[x] ; - lbe = _10R30[y]; - correctL = true; - } else if (( hue <= (_10R30[x] + _9R30[x]) / 2.0) && (hue > (_9R30[x] + _7R30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _9R30[y] - _9R30[x] ; - lbe = _9R30[y]; - correctL = true; - } else if (( hue <= (_9R30[x] + _7R30[x]) / 2.0) && (hue > (_7R30[x] - 0.035)) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _7R30[y] - _7R30[x] ; - lbe = _7R30[y] ; - correctL = true; - } - } else if (lum < 45.0) { - if( (hue <= (_10YR40[x] + 0.035)) && (hue > (_10YR40[x] + _85YR40[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10YR40[y] - _10YR40[x] ; - lbe = _10YR40[y]; - correctL = true; - } else if( (hue <= (_10YR40[x] + _85YR40[x]) / 2.0) && (hue > (_85YR40[x] + _7YR40[x]) / 2.0) && x < 85 ) { - if(y > 89) { - y = 89; - } - - correction = _85YR40[y] - _85YR40[x] ; - lbe = _85YR40[y]; - correctL = true; - } else if (( hue <= (_85YR40[x] + _7YR40[x]) / 2.0) && (hue > (_7YR40[x] + _55YR40[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _7YR40[y] - _7YR40[x] ; - lbe = _7YR40[y]; - correctL = true; - } else if (( hue <= (_7YR40[x] + _55YR40[x]) / 2.0) && (hue > (_55YR40[x] + _4YR40[x]) / 2.0) && x < 85 ) { - if(y > 89) { - y = 89; - } - - correction = _55YR40[y] - _55YR40[x] ; - lbe = _55YR40[y]; - correctL = true; - } else if (( hue <= (_55YR40[x] + _4YR40[x]) / 2.0) && (hue > (_4YR40[x] + _25YR40[x]) / 2.0) && x < 85 ) { - if(y > 89) { - y = 89; - } - - correction = _4YR40[y] - _4YR40[x] ; - lbe = _4YR40[y]; - correctL = true; - } else if (( hue <= (_4YR40[x] + _25YR40[x]) / 2.0) && (hue > (_25YR40[x] + _10R40[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _25YR40[y] - _25YR40[x] ; - lbe = _25YR40[y] ; - correctL = true; - } else if (( hue <= (_25YR40[x] + _10R40[x]) / 2.0) && (hue > (_10R40[x] + _9R40[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10R40[y] - _10R40[x] ; - lbe = _10R40[y]; - correctL = true; - } else if (( hue <= (_10R40[x] + _9R40[x]) / 2.0) && (hue > (_9R40[x] + _7R40[x]) / 2.0) && x < 85 ) { - if(y > 89) { - y = 89; - } - - correction = _9R40[y] - _9R40[x] ; - lbe = _9R40[y]; - correctL = true; - } else if (( hue <= (_9R40[x] + _7R40[x]) / 2.0) && (hue > (_7R40[x] - 0.035)) && x < 85 ) { - if(y > 89) { - y = 89; - } - - correction = _7R40[y] - _7R40[x] ; - lbe = _7R40[y]; - correctL = true; - } - } else if (lum < 55.0) { - if( (hue <= (_10YR50[x] + 0.035)) && (hue > (_10YR50[x] + _85YR50[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10YR50[y] - _10YR50[x] ; - lbe = _10YR50[y]; - correctL = true; - } else if( (hue <= (_10YR50[x] + _85YR50[x]) / 2.0) && (hue > (_85YR50[x] + _7YR50[x]) / 2.0) && x < 85 ) { - if(y > 89) { - y = 89; - } - - correction = _85YR50[y] - _85YR50[x] ; - lbe = _85YR50[y]; - correctL = true; - } else if (( hue <= (_85YR50[x] + _7YR50[x]) / 2.0) && (hue > (_7YR50[x] + _55YR50[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _7YR50[y] - _7YR50[x] ; - lbe = _7YR50[y]; - correctL = true; - } else if (( hue <= (_7YR50[x] + _55YR50[x]) / 2.0) && (hue > (_55YR50[x] + _4YR50[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _55YR50[y] - _55YR50[x] ; - lbe = _55YR50[y]; - correctL = true; - } else if (( hue <= (_55YR50[x] + _4YR50[x]) / 2.0) && (hue > (_4YR50[x] + _25YR50[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _4YR50[y] - _4YR50[x] ; - lbe = _4YR50[y]; - correctL = true; - } else if (( hue <= (_4YR50[x] + _25YR50[x]) / 2.0) && (hue > (_25YR50[x] + _10R50[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _25YR50[y] - _25YR50[x] ; - lbe = _25YR50[y]; - correctL = true; - } else if (( hue <= (_25YR50[x] + _10R50[x]) / 2.0) && (hue > (_10R50[x] + _9R50[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10R50[y] - _10R50[x] ; - lbe = _10R50[y]; - correctL = true; - } else if (( hue <= (_10R50[x] + _9R50[x]) / 2.0) && (hue > (_9R50[x] + _7R50[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _9R50[y] - _9R50[x] ; - lbe = _9R50[y]; - correctL = true; - } else if (( hue <= (_9R50[x] + _7R50[x]) / 2.0) && (hue > (_7R50[x] - 0.035)) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _7R50[y] - _7R50[x] ; - lbe = _7R50[y]; - correctL = true; - } - } else if (lum < 65.0) { - if( (hue <= (_10YR60[x] + 0.035)) && (hue > (_10YR60[x] + _85YR60[x]) / 2.0)) { - ; - correction = _10YR60[y] - _10YR60[x] ; - lbe = _10YR60[y]; - correctL = true; - } else if( (hue <= (_10YR60[x] + _85YR60[x]) / 2.0) && (hue > (_85YR60[x] + _7YR60[x]) / 2.0) ) { - ; - correction = _85YR60[y] - _85YR60[x] ; - lbe = _85YR60[y]; - correctL = true; - } else if (( hue <= (_85YR60[x] + _7YR60[x]) / 2.0) && (hue > (_7YR60[x] + _55YR60[x]) / 2.0)) { - correction = _7YR60[y] - _7YR60[x] ; - lbe = _7YR60[y]; - correctL = true; - } else if (( hue <= (_7YR60[x] + _55YR60[x]) / 2.0) && (hue > (_55YR60[x] + _4YR60[x]) / 2.0)) { - correction = _55YR60[y] - _55YR60[x] ; - lbe = _55YR60[y]; - correctL = true; - } else if (( hue <= (_55YR60[x] + _4YR60[x]) / 2.0) && (hue > (_4YR60[x] + _25YR60[x]) / 2.0)) { - correction = _4YR60[y] - _4YR60[x] ; - lbe = _4YR60[y]; - correctL = true; - } else if (( hue <= (_4YR60[x] + _25YR60[x]) / 2.0) && (hue > (_25YR60[x] + _10R60[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _25YR60[y] - _25YR60[x] ; - lbe = _25YR60[y]; - correctL = true; - } else if (( hue <= (_25YR60[x] + _10R60[x]) / 2.0) && (hue > (_10R60[x] + _9R60[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10R60[y] - _10R60[x] ; - lbe = _10R60[y]; - correctL = true; - } else if (( hue <= (_10R60[x] + _9R60[x]) / 2.0) && (hue > (_9R60[x] + _7R60[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _9R60[y] - _9R60[x] ; - lbe = _9R60[y]; - correctL = true; - } else if (( hue <= (_9R60[x] + _7R60[x]) / 2.0) && (hue > (_7R60[x] - 0.035)) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _7R60[y] - _7R60[x] ; - lbe = _7R60[y]; - correctL = true; - } - } else if (lum < 75.0) { - if( (hue <= (_10YR70[x] + 0.035)) && (hue > (_10YR70[x] + _85YR70[x]) / 2.0)) { - correction = _10YR70[y] - _10YR70[x] ; - lbe = _10YR70[y]; - correctL = true; - } else if( (hue <= (_10YR70[x] + _85YR70[x]) / 2.0) && (hue > (_85YR70[x] + _7YR70[x]) / 2.0)) { - correction = _85YR70[y] - _85YR70[x] ; - lbe = _85YR70[y]; - correctL = true; - } - - if (( hue <= (_85YR70[x] + _7YR70[x]) / 2.0) && (hue > (_7YR70[x] + _55YR70[x]) / 2.0)) { - correction = _7YR70[y] - _7YR70[x] ; - lbe = _7YR70[y]; - correctL = true; - } else if (( hue <= (_7YR70[x] + _55YR70[x]) / 2.0) && (hue > (_55YR70[x] + _4YR70[x]) / 2.0)) { - correction = _55YR70[y] - _55YR70[x] ; - lbe = _55YR70[y]; - correctL = true; - } else if (( hue <= (_55YR70[x] + _4YR70[x]) / 2.0) && (hue > (_4YR70[x] + _25YR70[x]) / 2.0)) { - correction = _4YR70[y] - _4YR70[x] ; - lbe = _4YR70[y]; - correctL = true; - } else if (( hue <= (_4YR70[x] + _25YR70[x]) / 2.0) && (hue > (_25YR70[x] + _10R70[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _25YR70[y] - _25YR70[x] ; - lbe = _25YR70[y]; - correctL = true; - } else if (( hue <= (_25YR70[x] + _10R70[x]) / 2.0) && (hue > (_10R70[x] + _9R70[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10R70[y] - _10R70[x] ; - lbe = _10R70[y]; - correctL = true; - } else if (( hue <= (_10R70[x] + _9R70[x]) / 2.0) && (hue > (_9R70[x] + _7R70[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _9R70[y] - _9R70[x] ; - lbe = _9R70[y] ; - correctL = true; - } else if (( hue <= (_9R70[x] + _7R70[x]) / 2.0) && (hue > (_7R70[x] - 0.035)) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _7R70[y] - _7R70[x] ; - lbe = _7R70[y]; - correctL = true; - } - } else if (lum < 85.0) { - if( (hue <= (_10YR80[x] + 0.035)) && (hue > (_10YR80[x] + _85YR80[x]) / 2.0)) { - correction = _10YR80[y] - _10YR80[x] ; - lbe = _10YR80[y]; - correctL = true; - } else if( (hue <= (_10YR80[x] + _85YR80[x]) / 2.0) && (hue > (_85YR80[x] + _7YR80[x]) / 2.0)) { - correction = _85YR80[y] - _85YR80[x] ; - lbe = _85YR80[y]; - } else if (( hue <= (_85YR80[x] + _7YR80[x]) / 2.0) && (hue > (_7YR80[x] + _55YR80[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _7YR80[y] - _7YR80[x] ; - lbe = _7YR80[y]; - correctL = true; - } else if (( hue <= (_7YR80[x] + _55YR80[x]) / 2.0) && (hue > (_55YR80[x] + _4YR80[x]) / 2.0) && x < 45) { - correction = _55YR80[y] - _55YR80[x] ; - lbe = _55YR80[y]; - correctL = true; - } else if (( hue <= (_55YR80[x] + _4YR80[x]) / 2.0) && (hue > (_4YR80[x] - 0.035) && x < 45)) { - if(y > 49) { - y = 49; - } - - correction = _4YR80[y] - _4YR80[x] ; - lbe = _4YR80[y] ; - correctL = true; - } - } else if (lum < 95.0) { - if( (hue <= (_10YR90[x] + 0.035)) && (hue > (_10YR90[x] - 0.035) && x < 85)) { - if(y > 89) { - y = 89; - } - - correction = _10YR90[y] - _10YR90[x] ; - lbe = _10YR90[y]; - correctL = true; - } else if ( hue <= (_85YR90[x] + 0.035) && hue > (_85YR90[x] - 0.035) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _85YR90[y] - _85YR90[x] ; - lbe = _85YR90[y]; - correctL = true; - } else if (( hue <= (_55YR90[x] + 0.035) && (hue > (_55YR90[x] - 0.035) && x < 45))) { - if(y > 49) { - y = 49; - } - - correction = _55YR90[y] - _55YR90[x] ; - lbe = _55YR90[y]; - correctL = true; - } - } - } - } - //end red yellow - - //Green yellow correction - else if(zone == 3) { - if (lum >= 25.0) { - if (lum < 35.0) { - if( (hue <= (_7G30[x] + 0.035)) && (hue > (_7G30[x] + _5G30[x]) / 2.0) ) { - correction = _7G30[y] - _7G30[x] ; - lbe = _7G30[y]; - correctL = true; - } else if( (hue <= (_7G30[x] + _5G30[x]) / 2.0) && (hue > (_5G30[x] + _25G30[x]) / 2.0)) { - correction = _5G30[y] - _5G30[x] ; - lbe = _5G30[y]; - correctL = true; - } else if (( hue <= (_25G30[x] + _5G30[x]) / 2.0) && (hue > (_25G30[x] + _1G30[x]) / 2.0)) { - correction = _25G30[y] - _25G30[x] ; - lbe = _25G30[y]; - correctL = true; - } else if (( hue <= (_1G30[x] + _25G30[x]) / 2.0) && (hue > (_1G30[x] + _10GY30[x]) / 2.0)) { - correction = _1G30[y] - _1G30[x] ; - lbe = _1G30[y]; - correctL = true; - } else if (( hue <= (_1G30[x] + _10GY30[x]) / 2.0) && (hue > (_10GY30[x] + _75GY30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10GY30[y] - _10GY30[x] ; - lbe = _10GY30[y]; - correctL = true; - } else if (( hue <= (_10GY30[x] + _75GY30[x]) / 2.0) && (hue > (_75GY30[x] + _5GY30[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _75GY30[y] - _75GY30[x] ; - lbe = _75GY30[y]; - correctL = true; - } else if (( hue <= (_5GY30[x] + _75GY30[x]) / 2.0) && (hue > (_5GY30[x] - 0.035)) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _5GY30[y] - _5GY30[x] ; - lbe = _5GY30[y] ; - correctL = true; - } - } else if (lum < 45.0) { - if( (hue <= (_7G40[x] + 0.035)) && (hue > (_7G40[x] + _5G40[x]) / 2.0) ) { - correction = _7G40[y] - _7G40[x] ; - lbe = _7G40[y]; - correctL = true; - } else if( (hue <= (_7G40[x] + _5G40[x]) / 2.0) && (hue > (_5G40[x] + _25G40[x]) / 2.0)) { - correction = _5G40[y] - _5G40[x] ; - lbe = _5G40[y]; - correctL = true; - } else if (( hue <= (_25G40[x] + _5G40[x]) / 2.0) && (hue > (_25G40[x] + _1G40[x]) / 2.0)) { - correction = _25G40[y] - _25G40[x] ; - lbe = _25G40[y]; - correctL = true; - } else if (( hue <= (_1G40[x] + _25G40[x]) / 2.0) && (hue > (_1G40[x] + _10GY40[x]) / 2.0)) { - correction = _1G40[y] - _1G40[x] ; - lbe = _1G40[y]; - correctL = true; - } else if (( hue <= (_1G40[x] + _10GY40[x]) / 2.0) && (hue > (_10GY40[x] + _75GY40[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _10GY40[y] - _10GY40[x] ; - lbe = _10GY40[y]; - correctL = true; - } else if (( hue <= (_10GY40[x] + _75GY40[x]) / 2.0) && (hue > (_75GY40[x] + _5GY40[x]) / 2.0) && x < 85) { - if(y > 89) { - y = 89; - } - - correction = _75GY40[y] - _75GY40[x] ; - lbe = _75GY40[y]; - correctL = true; - } else if (( hue <= (_5GY40[x] + _75GY40[x]) / 2.0) && (hue > (_5GY40[x] - 0.035)) && x < 85) { - if(y > 89) { - y = 89; // - } - - correction = _5GY40[y] - _5GY40[x] ; - lbe = _5GY40[y]; - correctL = true; - } - } else if (lum < 55.0) { - if( (hue <= (_7G50[x] + 0.035)) && (hue > (_7G50[x] + _5G50[x]) / 2.0) ) { - correction = _7G50[y] - _7G50[x] ; - lbe = _7G50[y]; - correctL = true; - } else if( (hue <= (_7G50[x] + _5G50[x]) / 2.0) && (hue > (_5G50[x] + _25G50[x]) / 2.0)) { - correction = _5G50[y] - _5G50[x] ; - lbe = _5G50[y]; - correctL = true; - } else if (( hue <= (_25G50[x] + _5G50[x]) / 2.0) && (hue > (_25G50[x] + _1G50[x]) / 2.0)) { - correction = _25G50[y] - _25G50[x] ; - lbe = _25G50[y]; - correctL = true; - } else if (( hue <= (_1G50[x] + _25G50[x]) / 2.0) && (hue > (_1G50[x] + _10GY50[x]) / 2.0)) { - correction = _1G50[y] - _1G50[x] ; - lbe = _1G50[y]; - correctL = true; - } else if (( hue <= (_1G50[x] + _10GY50[x]) / 2.0) && (hue > (_10GY50[x] + _75GY50[x]) / 2.0)) { - correction = _10GY50[y] - _10GY50[x] ; - lbe = _10GY50[y]; - correctL = true; - } else if (( hue <= (_10GY50[x] + _75GY50[x]) / 2.0) && (hue > (_75GY50[x] + _5GY50[x]) / 2.0)) { - correction = _75GY50[y] - _75GY50[x] ; - lbe = _75GY50[y]; - correctL = true; - } else if (( hue <= (_5GY50[x] + _75GY50[x]) / 2.0) && (hue > (_5GY50[x] - 0.035))) { - correction = _5GY50[y] - _5GY50[x] ; - lbe = _5GY50[y]; - correctL = true; - } - } else if (lum < 65.0) { - if( (hue <= (_7G60[x] + 0.035)) && (hue > (_7G60[x] + _5G60[x]) / 2.0) ) { - correction = _7G60[y] - _7G60[x] ; - lbe = _7G60[y]; - correctL = true; - } else if( (hue <= (_7G60[x] + _5G60[x]) / 2.0) && (hue > (_5G60[x] + _25G60[x]) / 2.0)) { - correction = _5G60[y] - _5G60[x] ; - lbe = _5G60[y]; - correctL = true; - } else if (( hue <= (_25G60[x] + _5G60[x]) / 2.0) && (hue > (_25G60[x] + _1G60[x]) / 2.0)) { - correction = _25G60[y] - _25G60[x] ; - lbe = _25G60[y]; - correctL = true; - } else if (( hue <= (_1G60[x] + _25G60[x]) / 2.0) && (hue > (_1G60[x] + _10GY60[x]) / 2.0)) { - correction = _1G60[y] - _1G60[x] ; - lbe = _1G60[y]; - correctL = true; - } else if (( hue <= (_1G60[x] + _10GY60[x]) / 2.0) && (hue > (_10GY60[x] + _75GY60[x]) / 2.0)) { - correction = _10GY60[y] - _10GY60[x] ; - lbe = _10GY60[y]; - correctL = true; - } else if (( hue <= (_10GY60[x] + _75GY60[x]) / 2.0) && (hue > (_75GY60[x] + _5GY60[x]) / 2.0)) { - correction = _75GY60[y] - _75GY60[x] ; - lbe = _75GY60[y] ; - correctL = true; - } else if (( hue <= (_5GY60[x] + _75GY60[x]) / 2.0) && (hue > (_5GY60[x] - 0.035))) { - correction = _5GY60[y] - _5GY60[x] ; - lbe = _5GY60[y]; - correctL = true; - } - } else if (lum < 75.0) { - if( (hue <= (_7G70[x] + 0.035)) && (hue > (_7G70[x] + _5G70[x]) / 2.0) ) { - correction = _7G70[y] - _7G70[x] ; - lbe = _7G70[y]; - correctL = true; - } else if( (hue <= (_7G70[x] + _5G70[x]) / 2.0) && (hue > (_5G70[x] + _25G70[x]) / 2.0)) { - correction = _5G70[y] - _5G70[x] ; - lbe = _5G70[y]; - correctL = true; - } else if (( hue <= (_25G70[x] + _5G70[x]) / 2.0) && (hue > (_25G70[x] + _1G70[x]) / 2.0)) { - correction = _25G70[y] - _25G70[x] ; - lbe = _25G70[y]; - correctL = true; - } else if (( hue <= (_1G70[x] + _25G70[x]) / 2.0) && (hue > (_1G70[x] + _10GY70[x]) / 2.0)) { - correction = _1G70[y] - _1G70[x] ; - lbe = _1G70[y] ; - correctL = true; - } else if (( hue <= (_1G70[x] + _10GY70[x]) / 2.0) && (hue > (_10GY70[x] + _75GY70[x]) / 2.0)) { - correction = _10GY70[y] - _10GY70[x] ; - lbe = _10GY70[y]; - correctL = true; - } else if (( hue <= (_10GY70[x] + _75GY70[x]) / 2.0) && (hue > (_75GY70[x] + _5GY70[x]) / 2.0)) { - correction = _75GY70[y] - _75GY70[x] ; - lbe = _75GY70[y]; - correctL = true; - } else if (( hue <= (_5GY70[x] + _75GY70[x]) / 2.0) && (hue > (_5GY70[x] - 0.035))) { - correction = _5GY70[y] - _5GY70[x] ; - lbe = _5GY70[y]; - correctL = true; - } - } else if (lum < 85.0) { - if( (hue <= (_7G80[x] + 0.035)) && (hue > (_7G80[x] + _5G80[x]) / 2.0) ) { - correction = _7G80[y] - _7G80[x] ; - lbe = _7G80[y]; - correctL = true; - } else if( (hue <= (_7G80[x] + _5G80[x]) / 2.0) && (hue > (_5G80[x] + _25G80[x]) / 2.0)) { - correction = _5G80[y] - _5G80[x] ; - lbe = _5G80[y]; - correctL = true; - } else if (( hue <= (_25G80[x] + _5G80[x]) / 2.0) && (hue > (_25G80[x] + _1G80[x]) / 2.0)) { - correction = _25G80[y] - _25G80[x] ; - lbe = _25G80[y]; - correctL = true; - } else if (( hue <= (_1G80[x] + _25G80[x]) / 2.0) && (hue > (_1G80[x] + _10GY80[x]) / 2.0)) { - correction = _1G80[y] - _1G80[x] ; - lbe = _1G80[y]; - correctL = true; - } else if (( hue <= (_1G80[x] + _10GY80[x]) / 2.0) && (hue > (_10GY80[x] + _75GY80[x]) / 2.0)) { - correction = _10GY80[y] - _10GY80[x] ; - lbe = _10GY80[y]; - correctL = true; - } else if (( hue <= (_10GY80[x] + _75GY80[x]) / 2.0) && (hue > (_75GY80[x] + _5GY80[x]) / 2.0)) { - correction = _75GY80[y] - _75GY80[x] ; - lbe = _75GY80[y]; - correctL = true; - } else if (( hue <= (_5GY80[x] + _75GY80[x]) / 2.0) && (hue > (_5GY80[x] - 0.035))) { - correction = _5GY80[y] - _5GY80[x] ; - lbe = _5GY80[y]; - correctL = true; - } - } - } - } - //end green yellow - - //Red purple correction : only for L < 30 - else if(zone == 4) { - if (lum > 5.0) { - if (lum < 15.0) { - if( (hue <= (_5R10[x] + 0.035)) && (hue > (_5R10[x] - 0.043)) && x < 45) { - if(y > 44) { - y = 44; - } - - correction = _5R10[y] - _5R10[x] ; - lbe = _5R10[y]; - correctL = true; - } else if( (hue <= (_25R10[x] + 0.043)) && (hue > (_25R10[x] + _10RP10[x]) / 2.0) && x < 45 ) { - if(y > 44) { - y = 44; - } - - correction = _25R10[y] - _25R10[x] ; - lbe = _25R10[y]; - correctL = true; - } else if ( (hue <= (_25R10[x] + _10RP10[x]) / 2.0) && (hue > (_10RP10[x] - 0.035) ) && x < 45) { - if(y > 44) { - y = 44; - } - - correction = _10RP10[y] - _10RP10[x] ; - lbe = _10RP10[y]; - correctL = true; - } - } else if (lum < 25.0) { - if( (hue <= (_5R20[x] + 0.035)) && (hue > (_5R20[x] + _25R20[x]) / 2.0) && x < 70 ) { - if(y > 70) { - y = 70; - } - - correction = _5R20[y] - _5R20[x] ; - lbe = _5R20[y]; - correctL = true; - } else if( (hue <= (_5R20[x] + _25R20[x]) / 2.0) && (hue > (_10RP20[x] + _25R20[x]) / 2.0) && x < 70) { - if(y > 70) { - y = 70; - } - - correction = _25R20[y] - _25R20[x] ; - lbe = _25R20[y]; - correctL = true; - } else if (( hue <= (_10RP20[x] + _25R20[x]) / 2.0) && (hue > (_10RP20[x] - 0.035)) && x < 70) { - if(y > 70) { - y = 70; - } - - correction = _10RP20[y] - _10RP20[x] ; - lbe = _10RP20[y]; - correctL = true; - } - } else if (lum < 35.0) { - if( (hue <= (_5R30[x] + 0.035)) && (hue > (_5R30[x] + _25R30[x]) / 2.0) && x < 85 ) { - if(y > 85) { - y = 85; - } - - correction = _5R30[y] - _5R30[x] ; - lbe = _5R30[y]; - correctL = true; - } else if( (hue <= (_5R30[x] + _25R30[x]) / 2.0) && (hue > (_10RP30[x] + _25R30[x]) / 2.0) && x < 85) { - if(y > 85) { - y = 85; - } - - correction = _25R30[y] - _25R30[x] ; - lbe = _25R30[y]; - correctL = true; - } else if (( hue <= (_10RP30[x] + _25R30[x]) / 2.0) && (hue > (_10RP30[x] - 0.035)) && x < 85) { - if(y > 85) { - y = 85; - } - - correction = _10RP30[y] - _10RP30[x] ; - lbe = _10RP30[y]; - correctL = true; - } - } - } - } - - //end red purple -} - - /* * SkinSat * Copyright (c)2011 Jacques Desmis diff --git a/rtengine/color.h b/rtengine/color.h index 211615de1..c8aa571d3 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -20,15 +20,16 @@ #pragma once #include -#include #include "rt_math.h" #include "LUT.h" -#include "iccmatrices.h" #include "lcms2.h" #include "sleef.h" -#define SAT(a,b,c) ((float)max(a,b,c)-(float)min(a,b,c))/(float)max(a,b,c) +namespace Glib +{ +class ustring; +} namespace rtengine { @@ -132,7 +133,7 @@ public: constexpr static double sRGBGammaCurve = 2.4; constexpr static double eps = 216.0 / 24389.0; //0.008856 - constexpr static double eps_max = MAXVALF * eps; //580.40756; + constexpr static double eps_max = MAXVALD * eps; //580.40756; constexpr static double kappa = 24389.0 / 27.0; //903.29630; constexpr static double kappaInv = 27.0 / 24389.0; constexpr static double epsilonExpInv3 = 6.0 / 29.0; @@ -144,9 +145,10 @@ public: constexpr static float D50x = 0.9642f; //0.96422; constexpr static float D50z = 0.8249f; //0.82521; - constexpr static double u0 = 4.0 * D50x / (D50x + 15 + 3 * D50z); - constexpr static double v0 = 9.0 / (D50x + 15 + 3 * D50z); + constexpr static double u0 = 4.0 * static_cast(D50x) / (static_cast(D50x) + 15 + 3 * static_cast(D50z)); + constexpr static double v0 = 9.0 / (static_cast(D50x) + 15 + 3 * static_cast(D50z)); constexpr static double epskap = 8.0; + constexpr static float epskapf = epskap; constexpr static float c1By116 = 1.0 / 116.0; constexpr static float c16By116 = 16.0 / 116.0; @@ -206,7 +208,7 @@ public: static float rgbLuminance(float r, float g, float b, const double workingspace[3][3]) { - return r * workingspace[1][0] + g * workingspace[1][1] + b * workingspace[1][2]; + return static_cast(r) * workingspace[1][0] + static_cast(g) * workingspace[1][1] + static_cast(b) * workingspace[1][2]; } #ifdef __SSE2__ @@ -972,10 +974,10 @@ public: template static inline T interpolatePolarHue_PI (T h1, T h2, U balance) { - float d = h2 - h1; - float f; + T d = h2 - h1; + T f; f = T(balance); - double h; + T h; if (h1 > h2) { std::swap(h1, h2); @@ -986,7 +988,7 @@ public: if (d < T(0) || d < T(0.5) || d > T(1.)) { //there was an inversion here !! d > T(rtengine::RT_PI) h1 += T(1.); h = h1 + f * (h2 - h1); - h = std::fmod(h, 1.); + h = std::fmod(h, T(1.)); } else { h = h1 + f * d; } diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index 02d3e0e6d..525ed339e 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -1071,10 +1071,10 @@ void ColorTemp::temp2mul (double temp, double green, double equal, double& rmul, double Xwb, Zwb; temp2mulxyz(temp, method, Xwb, Zwb); - float adj = 1.f; + double adj = 1.0; if(equal < 0.9999 || equal > 1.0001 ) { - adj = (100.f + ( 1000.f - (1000.f * (float)equal) ) / 20.f) / 100.f; + adj = (100.0 + ( 1000.0 - (1000.0 * equal) ) / 20.0) / 100.0; } @@ -1389,7 +1389,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, double& rmul, } for(int i = 0; i < 8; i++) { - CRIs[i] = 100 - 3.0 * DeltaEs[i]; //3.0 coef to adapt ==> same results than CRI "official" + CRIs[i] = 100 - 3.f * DeltaEs[i]; //3.0 coef to adapt ==> same results than CRI "official" } for(int i = 0; i < 8; i++) { @@ -1409,7 +1409,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, double& rmul, } for(int i = 0; i < N_c; i++) { - CRI[i] = 100 - 3.0 * DeltaE[i]; //3.0 coef to adapt ==> same results than CRI "official" + 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++) { @@ -1425,8 +1425,8 @@ void ColorTemp::temp2mul (double temp, double green, double equal, double& rmul, quadCRI /= N_c; 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(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], sqrt(quadCRI)); + 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))); } } } diff --git a/rtengine/curves.cc b/rtengine/curves.cc index b2105a091..a2b5d1d2b 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -21,8 +21,7 @@ #include #include #include -#include -#include +#include #include "rt_math.h" @@ -33,6 +32,7 @@ #include "opthelper.h" #include "ciecam02.h" #include "color.h" +#include "iccmatrices.h" #include "iccstore.h" using namespace std; @@ -2186,7 +2186,7 @@ void PerceptualToneCurve::init() } } -void PerceptualToneCurve::initApplyState(PerceptualToneCurveState & state, Glib::ustring workingSpace) const +void PerceptualToneCurve::initApplyState(PerceptualToneCurveState & state, const Glib::ustring &workingSpace) const { // Get the curve's contrast value, and convert to a chroma scaling diff --git a/rtengine/curves.h b/rtengine/curves.h index bc8193b76..c5bb0c18f 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -22,21 +22,23 @@ #include #include -#include - #include "rt_math.h" #include "flatcurvetypes.h" #include "diagonalcurvetypes.h" -#include "pipettebuffer.h" #include "noncopyable.h" #include "LUT.h" #include "sleef.h" #define CURVES_MIN_POLY_POINTS 1000 -#include "rt_math.h" - #define CLIPI(a) ((a)>0?((a)<65534?(a):65534):0) +namespace Glib +{ + +class ustring; + +} + using namespace std; namespace rtengine @@ -292,11 +294,11 @@ public: } static inline float gamma2 (float x) { - return x <= 0.00304 ? x * 12.92310 : 1.055 * expf(logf(x) / sRGBGammaCurve) - 0.055; + return x <= 0.00304f ? x * 12.92310f : 1.055f * expf(logf(x) / static_cast(sRGBGammaCurve)) - 0.055f; } static inline float igamma2 (float x) { - return x <= 0.03928 ? x / 12.92310 : expf(logf((x + 0.055) / 1.055) * sRGBGammaCurve); + return x <= 0.03928f ? x / 12.92310f : expf(logf((x + 0.055f) / 1.055f) * static_cast(sRGBGammaCurve)); } // gamma function with adjustable parameters static inline double gamma (double x, double gamma, double start, double slope, double mul, double add) @@ -327,8 +329,8 @@ public: #endif static inline float hlcurve (const float exp_scale, const float comp, const float hlrange, float level) { - if (comp > 0.0) { - float val = level + (hlrange - 65536.0); + if (comp > 0.f) { + float val = level + (hlrange - 65536.f); if(val == 0.0f) { // to avoid division by zero val = 0.000001f; @@ -337,7 +339,7 @@ public: float Y = val * exp_scale / hlrange; Y *= comp; - if(Y <= -1.0) { // to avoid log(<=0) + if(Y <= -1.f) { // to avoid log(<=0) Y = -.999999f; } @@ -454,7 +456,7 @@ public: virtual bool isIdentity () const = 0; }; -class DiagonalCurve : public Curve +class DiagonalCurve final : public Curve { protected: @@ -476,7 +478,7 @@ public: }; }; -class FlatCurve : public Curve, public rtengine::NonCopyable +class FlatCurve final : public Curve, public rtengine::NonCopyable { private: @@ -940,7 +942,7 @@ private: float calculateToneCurveContrastValue() const; public: static void init(); - void initApplyState(PerceptualToneCurveState & state, Glib::ustring workingSpace) const; + void initApplyState(PerceptualToneCurveState & state, const Glib::ustring& workingSpace) const; void BatchApply(const size_t start, const size_t end, float *r, float *g, float *b, const PerceptualToneCurveState &state) const; }; diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 11fe306b8..89256bba4 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -1064,9 +1064,11 @@ void DCPProfile::apply( for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { + double temp = 0.0; for (int k = 0; k < 3; ++k) { - mat[i][j] += work_matrix[i][k] * xyz_cam[k][j]; + temp += work_matrix[i][k] * xyz_cam[k][j]; } + mat[i][j] = temp; } } @@ -1092,9 +1094,11 @@ void DCPProfile::apply( for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { + double temp = 0.0; for (int k = 0; k < 3; ++k) { - pro_photo[i][j] += prophoto_xyz[i][k] * xyz_cam[k][j]; + temp += prophoto_xyz[i][k] * xyz_cam[k][j]; } + pro_photo[i][j] = temp; } } @@ -1102,9 +1106,11 @@ void DCPProfile::apply( for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { + double temp = 0.0; for (int k = 0; k < 3; ++k) { - work[i][j] += work_matrix[i][k] * xyz_prophoto[k][j]; + temp += work_matrix[i][k] * xyz_prophoto[k][j]; } + work[i][j] = temp; } } @@ -1173,27 +1179,35 @@ void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use mWork = ICCStore::getInstance()->workingSpaceMatrix (working_space); memset(as_out.data->pro_photo, 0, sizeof(as_out.data->pro_photo)); - 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++) { + double temp = 0.0; for (int k = 0; k < 3; k++) { - as_out.data->pro_photo[i][j] += prophoto_xyz[i][k] * mWork[k][j]; + temp += prophoto_xyz[i][k] * mWork[k][j]; } + as_out.data->pro_photo[i][j] = temp; + } + } mWork = ICCStore::getInstance()->workingSpaceInverseMatrix (working_space); memset(as_out.data->work, 0, sizeof(as_out.data->work)); - 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++) { + double temp = 0.0; for (int k = 0; k < 3; k++) { - as_out.data->work[i][j] += mWork[i][k] * xyz_prophoto[k][j]; + temp += mWork[i][k] * xyz_prophoto[k][j]; } + as_out.data->work[i][j] = temp; + } + } } } void DCPProfile::step2ApplyTile(float* rc, float* gc, float* bc, int width, int height, int tile_width, const DCPProfileApplyState& as_in) const { -#define FCLIP(a) ((a)>0.0?((a)<65535.5?(a):65535.5):0.0) +#define FCLIP(a) ((a)>0.f?((a)<65535.5f?(a):65535.5f):0.f) #define CLIP01(a) ((a)>0?((a)<1?(a):1):0) float exp_scale = as_in.data->bl_scale; diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 812f122b3..0858bdaaa 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -1,6 +1,7 @@ #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wunused-macros" #if (__GNUC__ >= 6) #pragma GCC diagnostic ignored "-Wmisleading-indentation" #endif @@ -94,7 +95,6 @@ #ifdef WIN32 #include #include -#define snprintf _snprintf #define strcasecmp stricmp #define strncasecmp strnicmp typedef __int64 INT64; @@ -158,7 +158,6 @@ const float d65_white[3] = { 0.950456, 1, 1.088754 }; #define MIN(a,b) rtengine::min(a,static_cast<__typeof__(a)>(b)) #define MAX(a,b) rtengine::max(a,static_cast<__typeof__(a)>(b)) #define LIM(x,min,max) rtengine::LIM(x,static_cast<__typeof__(x)>(min),static_cast<__typeof__(x)>(max)) -#define ULIM(x,y,z) rtengine::median(x,static_cast<__typeof__(x)>(y),static_cast<__typeof__(x)>(z)) #define CLIP(x) rtengine::CLIP(x) #define SWAP(a,b) { a=a+b; b=a-b; a=a-b; } @@ -9868,6 +9867,7 @@ void CLASS identify() filters = 0; tiff_samples = colors = 3; load_raw = &CLASS canon_sraw_load_raw; + FORC4 cblack[c] = 0; // ALB } else if (!strcmp(model,"PowerShot 600")) { height = 613; width = 854; @@ -11021,7 +11021,6 @@ void CLASS nikon_14bit_load_raw() /*RT*/#undef MIN /*RT*/#undef ABS /*RT*/#undef LIM -/*RT*/#undef ULIM /*RT*/#undef CLIP #ifdef __GNUC__ #pragma GCC diagnostic pop diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 890003ee0..77392a552 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -24,6 +24,7 @@ #include "dcrop.h" #include "image8.h" #include "imagefloat.h" +#include "improccoordinator.h" #include "labimage.h" #include "mytime.h" #include "procparams.h" diff --git a/rtengine/dcrop.h b/rtengine/dcrop.h index c65c1e72f..0b33854c5 100644 --- a/rtengine/dcrop.h +++ b/rtengine/dcrop.h @@ -18,11 +18,7 @@ */ #pragma once -#include "improccoordinator.h" #include "rtengine.h" -#include "improcfun.h" -#include "imagesource.h" -#include "procevents.h" #include "pipettebuffer.h" #include "../rtgui/threadutils.h" @@ -30,12 +26,13 @@ namespace rtengine { class Image8; +class CieImage; using namespace procparams; class ImProcCoordinator; -class Crop : public DetailedCrop, public PipetteBuffer +class Crop final : public DetailedCrop, public PipetteBuffer { protected: diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 538858a9a..a31415968 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -1069,7 +1069,7 @@ void RawImageSource::dcb_hid(float (*image)[3], int x0, int y0) for (int col = colMin + (FC(y0 - TILEBORDER + row, x0 - TILEBORDER + colMin) & 1), indx = row * CACHESIZE + col; col < colMax; col += 2, indx += 2) { assert(indx - u - 1 >= 0 && indx + u + 1 < u * u); - image[indx][1] = 0.25*(image[indx-1][1]+image[indx+1][1]+image[indx-u][1]+image[indx+u][1]); + image[indx][1] = 0.25f * (image[indx-1][1]+image[indx+1][1]+image[indx-u][1]+image[indx+u][1]); } } diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index 1fb1d2e1b..6961a4b54 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -476,7 +476,7 @@ dfInfo* DFManager::find( const std::string &mak, const std::string &mod, int iso } } - return bestD != INFINITY ? &(bestMatch->second) : nullptr ; + return bestD != RT_INFINITY ? &(bestMatch->second) : nullptr ; } } diff --git a/rtengine/dfmanager.h b/rtengine/dfmanager.h index 216dcfc53..b23981ffb 100644 --- a/rtengine/dfmanager.h +++ b/rtengine/dfmanager.h @@ -31,7 +31,7 @@ namespace rtengine { class RawImage; -class dfInfo +class dfInfo final { public: @@ -74,7 +74,7 @@ protected: void updateRawImage(); }; -class DFManager +class DFManager final { public: void init(const Glib::ustring &pathname); diff --git a/rtengine/diagonalcurves.cc b/rtengine/diagonalcurves.cc index bb20b7cc1..622683ea2 100644 --- a/rtengine/diagonalcurves.cc +++ b/rtengine/diagonalcurves.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#include -#include #include "curves.h" #include #include @@ -65,23 +63,23 @@ DiagonalCurve::DiagonalCurve (const std::vector& p, int poly_pn) } } - if (x[0] != 0.0f || x[N - 1] != 1.0f) + if (x[0] != 0.0 || x[N - 1] != 1.0) // Special (and very rare) case where all points are on the identity line but // not reaching the limits { identity = false; } - if(x[0] == 0.f && x[1] == 0.f) + if(x[0] == 0.0 && x[1] == 0.0) // Avoid crash when first two points are at x = 0 (git Issue 2888) { - x[1] = 0.01f; + x[1] = 0.01; } - if(x[0] == 1.f && x[1] == 1.f) + if(x[0] == 1.0 && x[1] == 1.0) // Avoid crash when first two points are at x = 1 (100 in gui) (git Issue 2923) { - x[0] = 0.99f; + x[0] = 0.99; } if (!identity) { @@ -97,7 +95,7 @@ DiagonalCurve::DiagonalCurve (const std::vector& p, int poly_pn) } } } else if (kind == DCT_Parametric) { - if ((p.size() == 8 || p.size() == 9) && (p.at(4) != 0.0f || p.at(5) != 0.0f || p.at(6) != 0.0f || p.at(7) != 0.0f)) { + if ((p.size() == 8 || p.size() == 9) && (p.at(4) != 0.0 || p.at(5) != 0.0 || p.at(6) != 0.0 || p.at(7) != 0.0)) { identity = false; x = new double[9]; diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index 1f62badcb..0624f4443 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -228,11 +228,11 @@ void fillLut(LUTf &irangefn, int level, double dirpyrThreshold, float mult, floa } const float offs = skinprot == 0.f ? 0.f : -1.f; - constexpr float noise = 2000.f; - const float noisehi = 1.33f * noise * dirpyrThreshold / expf(level * log(3.0)), noiselo = 0.66f * noise * dirpyrThreshold / expf(level * log(3.0)); + constexpr double noise = 2000.0; + const float noisehi = 1.33 * noise * dirpyrThreshold / exp(level * log(3.0)), noiselo = 0.66 * noise * dirpyrThreshold / exp(level * log(3.0)); for (int i = 0; i < 0x20000; i++) { - if (abs(i - 0x10000) > noisehi || multbis < 1.0) { + if (abs(i - 0x10000) > noisehi || multbis < 1.f) { irangefn[i] = multbis + offs; } else { if (abs(i - 0x10000) < noiselo) { @@ -262,7 +262,7 @@ void idirpyr_eq_channel(const float * const * data_coarse, const float * const * buffer[i][j] += irangefn[hipass + 0x10000] * hipass; } } - } else if (skinprot > 0.f) { + } else if (skinprot > 0.0) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -314,7 +314,7 @@ void idirpyr_eq_channelcam(const float * const * data_coarse, const float * cons buffer[i][j] += irangefn[hipass + 0x10000] * hipass; } } - } else if (skinprot > 0.f) { + } else if (skinprot > 0.0) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif diff --git a/rtengine/dual_demosaic_RT.cc b/rtengine/dual_demosaic_RT.cc index 93508808c..253468a76 100644 --- a/rtengine/dual_demosaic_RT.cc +++ b/rtengine/dual_demosaic_RT.cc @@ -45,7 +45,7 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams { BENCHFUN - if (contrast == 0.f && !autoContrast) { + if (contrast == 0.0 && !autoContrast) { // contrast == 0.0 means only first demosaicer will be used if(isBayer) { if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) ) { @@ -103,7 +103,7 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams } // calculate contrast based blend factors to use vng4 in regions with low contrast JaggedArray blend(winw, winh); - float contrastf = contrast / 100.f; + float contrastf = contrast / 100.0; buildBlendMask(L, blend, winw, winh, contrastf, autoContrast); contrast = contrastf * 100.f; diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index ce60277e1..c55bc5108 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -428,7 +428,7 @@ ffInfo* FFManager::find( const std::string &mak, const std::string &mod, const s } } - return bestD != INFINITY ? &(bestMatch->second) : nullptr ; + return bestD != RT_INFINITY ? &(bestMatch->second) : nullptr ; } } diff --git a/rtengine/ffmanager.h b/rtengine/ffmanager.h index 80ef5fa1c..f3303f12b 100644 --- a/rtengine/ffmanager.h +++ b/rtengine/ffmanager.h @@ -29,7 +29,7 @@ namespace rtengine { class RawImage; -class ffInfo +class ffInfo final { public: @@ -71,7 +71,7 @@ protected: void updateRawImage(); }; -class FFManager +class FFManager final { public: void init(const Glib::ustring &pathname); diff --git a/rtengine/filmnegativeproc.cc b/rtengine/filmnegativeproc.cc index 1f27983ed..c7de3c483 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -122,8 +122,8 @@ bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D s } if (settings->verbose) { - printf("Clear film values: R=%g G=%g B=%g\n", clearVals[0], clearVals[1], clearVals[2]); - printf("Dense film values: R=%g G=%g B=%g\n", denseVals[0], denseVals[1], denseVals[2]); + printf("Clear film values: R=%g G=%g B=%g\n", static_cast(clearVals[0]), static_cast(clearVals[1]), static_cast(clearVals[2])); + printf("Dense film values: R=%g G=%g B=%g\n", static_cast(denseVals[0]), static_cast(denseVals[1]), static_cast(denseVals[2])); } const float denseGreenRatio = clearVals[1] / denseVals[1]; @@ -141,12 +141,12 @@ bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D s if (ch == 1) { newExps[ch] = 1.f; // Green is the reference channel } else { - newExps[ch] = CLAMP(logBase(clearVals[ch] / denseVals[ch], denseGreenRatio), 0.3f, 4.f); + newExps[ch] = rtengine::LIM(logBase(clearVals[ch] / denseVals[ch], denseGreenRatio), 0.3f, 4.f); } } if (settings->verbose) { - printf("New exponents: R=%g G=%g B=%g\n", newExps[0], newExps[1], newExps[2]); + printf("New exponents: R=%g G=%g B=%g\n", static_cast(newExps[0]), static_cast(newExps[1]), static_cast(newExps[2])); } return true; @@ -246,8 +246,8 @@ void rtengine::RawImageSource::filmNegativeProcess(const procparams::FilmNegativ if (settings->verbose) { printf("Sample count: %zu, %zu, %zu\n", cvs[0].size(), cvs[1].size(), cvs[2].size()); - printf("Medians: %g %g %g\n", medians[0], medians[1], medians[2] ); - printf("Computed multipliers: %g %g %g\n", mults[0], mults[1], mults[2] ); + printf("Medians: %g %g %g\n", static_cast(medians[0]), static_cast(medians[1]), static_cast(medians[2])); + printf("Computed multipliers: %g %g %g\n", static_cast(mults[0]), static_cast(mults[1]), static_cast(mults[2])); printf("Median calc time us: %d\n", t3.etime(t2)); } diff --git a/rtengine/filmnegativethumb.cc b/rtengine/filmnegativethumb.cc index b31432a55..003fab8e0 100644 --- a/rtengine/filmnegativethumb.cc +++ b/rtengine/filmnegativethumb.cc @@ -89,8 +89,8 @@ void rtengine::Thumbnail::processFilmNegative( const float bmult = (MAX_OUT_VALUE / (bmed * 24)) ; if (settings->verbose) { - printf("Thumbnail channel medians: %g %g %g\n", rmed, gmed, bmed); - printf("Thumbnail computed multipliers: %g %g %g\n", rmult, gmult, bmult); + printf("Thumbnail channel medians: %g %g %g\n", static_cast(rmed), static_cast(gmed), static_cast(bmed)); + printf("Thumbnail computed multipliers: %g %g %g\n", static_cast(rmult), static_cast(gmult), static_cast(bmult)); } #ifdef __SSE2__ diff --git a/rtengine/green_equil_RT.cc b/rtengine/green_equil_RT.cc index fc4f18548..a66bca160 100644 --- a/rtengine/green_equil_RT.cc +++ b/rtengine/green_equil_RT.cc @@ -47,7 +47,7 @@ void RawImageSource::green_equilibrate_global(array2D &rawData) for (int i = border; i < H - border; i++) { double avgg = 0.; for (int j = border + ((FC(i, border) & 1) ^ 1); j < W - border; j += 2) { - avgg += rawData[i][j]; + avgg += static_cast(rawData[i][j]); } int ng = (W - 2 * border + (FC(i, border) & 1)) / 2; @@ -71,15 +71,15 @@ void RawImageSource::green_equilibrate_global(array2D &rawData) avgg2 = 1.0; } - double corrg1 = (avgg1 / ng1 + avgg2 / ng2) / 2.0 / (avgg1 / ng1); - double corrg2 = (avgg1 / ng1 + avgg2 / ng2) / 2.0 / (avgg2 / ng2); + const float corrg1 = (avgg1 / ng1 + avgg2 / ng2) / 2.0 / (avgg1 / ng1); + const float corrg2 = (avgg1 / ng1 + avgg2 / ng2) / 2.0 / (avgg2 / ng2); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif for (int i = border; i < H - border; i++) { - double corrg = (i & 1) ? corrg2 : corrg1; + const float corrg = (i & 1) ? corrg2 : corrg1; for (int j = border + ((FC(i, border) & 1) ^ 1); j < W - border; j += 2) { rawData[i][j] *= corrg; @@ -220,7 +220,7 @@ void RawImageSource::green_equilibrate(const GreenEqulibrateThreshold &thresh, a float tf = thresh(rr, cc); - if (c1 + c2 < 6 * tf * fabs(d1 - d2)) { + if (c1 + c2 < 6 * tf * std::fabs(d1 - d2)) { //pixel interpolation float gin = cfa[rr][cc >> 1]; diff --git a/rtengine/guidedfilter.cc b/rtengine/guidedfilter.cc index ad3beec51..f83560cfc 100644 --- a/rtengine/guidedfilter.cc +++ b/rtengine/guidedfilter.cc @@ -29,6 +29,7 @@ * available at https://arxiv.org/abs/1505.00996 */ +#include "array2D.h" #include "boxblur.h" #include "guidedfilter.h" #include "imagefloat.h" diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc index 697a5e3d3..1ba42a68b 100644 --- a/rtengine/hilite_recon.cc +++ b/rtengine/hilite_recon.cc @@ -323,7 +323,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue if (settings->verbose) { for (int c = 0; c < 3; ++c) { - printf("chmax[%d] : %f\tclmax[%d] : %f\tratio[%d] : %f\n", c, chmax[c], c, clmax[c], c, chmax[c] / clmax[c]); + printf("chmax[%d] : %f\tclmax[%d] : %f\tratio[%d] : %f\n", c, static_cast(chmax[c]), c, static_cast(clmax[c]), c, static_cast(chmax[c] / clmax[c])); } } @@ -366,7 +366,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue if (settings->verbose) { for (int c = 0; c < 3; ++c) { - printf("correction factor[%d] : %f\n", c, factor[c]); + printf("correction factor[%d] : %f\n", c, static_cast(factor[c])); } } @@ -496,7 +496,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue && blue[i + miny][j + minx] < max_f[2] ) { // if one or more channels is highlight but none are blown, add to highlight accumulator - hipass_sum += channelblur[0][i][j]; + hipass_sum += static_cast(channelblur[0][i][j]); ++hipass_norm; hilite_full[0][i][j] = red[i + miny][j + minx]; @@ -507,7 +507,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue } } - const float hipass_ave = 2.f * hipass_sum / (hipass_norm + epsilon); + const float hipass_ave = 2.0 * hipass_sum / (hipass_norm + static_cast(epsilon)); if (plistener) { progress += 0.05; diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index f5d16866e..0053cb0d4 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -179,7 +179,7 @@ void mappingToCurve(const std::vector &mapping, std::vector &curve) }; idx = -1; for (ssize_t i = curve.size()-1; i > 0; i -= 2) { - if (curve[i] <= 0.f) { + if (curve[i] <= 0.0) { idx = i+1; break; } @@ -328,7 +328,7 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st int tw = target->getWidth(), th = target->getHeight(); float thumb_ratio = float(std::max(sw, sh)) / float(std::min(sw, sh)); float target_ratio = float(std::max(tw, th)) / float(std::min(tw, th)); - if (std::abs(thumb_ratio - target_ratio) > 0.01) { + if (std::abs(thumb_ratio - target_ratio) > 0.01f) { int cx = 0, cy = 0; if (thumb_ratio > target_ratio) { // crop the height @@ -342,7 +342,7 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st tw -= cw; } if (settings->verbose) { - std::cout << "histogram matching: cropping target to get an aspect ratio of " << round(thumb_ratio * 100)/100.0 << ":1, new size is " << tw << "x" << th << std::endl; + std::cout << "histogram matching: cropping target to get an aspect ratio of " << round(thumb_ratio * 100)/100.f << ":1, new size is " << tw << "x" << th << std::endl; } if (cx || cy) { diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index aea03664e..9d7024bff 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -43,7 +43,6 @@ #include "color.h" #include "cJSON.h" -#define inkc_constant 0x696E6B43 namespace { diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index 731a155bb..117124122 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -39,7 +39,7 @@ namespace procparams typedef const double(*TMatrix)[3]; -class ProfileContent +class ProfileContent final { public: ProfileContent(); @@ -54,7 +54,7 @@ private: std::string data; }; -class ICCStore +class ICCStore final { public: enum class ProfileType { diff --git a/rtengine/iimage.h b/rtengine/iimage.h index 7309dd91f..247d0cdaa 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -20,7 +20,6 @@ #include -#include #include #include "alignedbuffer.h" @@ -41,6 +40,13 @@ #define CHECK_BOUNDS 0 +namespace Glib +{ + +class ustring; + +} + namespace rtengine { @@ -658,7 +664,7 @@ public: /* If any of the required allocation fails, "width" and "height" are set to -1, and all remaining buffer are freed * Can be safely used to reallocate an existing image */ - void allocate (int W, int H) override + void allocate (int W, int H) final { if (W == width && H == height) { @@ -746,7 +752,7 @@ public: } } - void rotate (int deg) override + void rotate (int deg) final { if (deg == 90) { @@ -873,7 +879,7 @@ public: } } - void hflip () override + void hflip () final { int width2 = width / 2; @@ -905,7 +911,7 @@ public: #endif } - void vflip () override + void vflip () final { int height2 = height / 2; @@ -989,7 +995,7 @@ public: } } - void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const override + void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const final { histogram.clear(); avg_r = avg_g = avg_b = 0.; @@ -1328,7 +1334,7 @@ public: * If any of the required allocation fails, "width" and "height" are set to -1, and all remaining buffer are freed * Can be safely used to reallocate an existing image or to free up it's memory with "allocate (0,0);" */ - void allocate (int W, int H) override + void allocate (int W, int H) final { if (W == width && H == height) { @@ -1382,7 +1388,7 @@ public: memcpy (dest->data, data, 3 * width * height * sizeof(T)); } - void rotate (int deg) override + void rotate (int deg) final { if (deg == 90) { @@ -1516,7 +1522,7 @@ public: } } - void hflip () override + void hflip () final { int width2 = width / 2; @@ -1552,7 +1558,7 @@ public: } } - void vflip () override + void vflip () final { AlignedBuffer lBuffer(3 * width); @@ -1619,7 +1625,7 @@ public: } } - void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const override + void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const final { histogram.clear(); avg_r = avg_g = avg_b = 0.; diff --git a/rtengine/image16.cc b/rtengine/image16.cc index a98d64d51..07fc66fad 100644 --- a/rtengine/image16.cc +++ b/rtengine/image16.cc @@ -147,10 +147,10 @@ void Image16::getStdImage(const ColorTemp &ctemp, int tran, Imagefloat* image, P gm = dgm; bm = dbm; - rm = 1.0 / rm; - gm = 1.0 / gm; - bm = 1.0 / bm; - float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; + rm = 1.f / rm; + gm = 1.f / gm; + bm = 1.f / bm; + float mul_lum = 0.299f * rm + 0.587f * gm + 0.114f * bm; rm /= mul_lum; gm /= mul_lum; bm /= mul_lum; @@ -187,8 +187,6 @@ void Image16::getStdImage(const ColorTemp &ctemp, int tran, Imagefloat* image, P gm /= area; bm /= area; -#define GCLIP( x ) Color::gamma_srgb(CLIP(x)) - #ifdef _OPENMP #pragma omp parallel { diff --git a/rtengine/image16.h b/rtengine/image16.h index d0053cbfc..de9288f2d 100644 --- a/rtengine/image16.h +++ b/rtengine/image16.h @@ -29,7 +29,7 @@ namespace rtengine class Image8; class Imagefloat; -class Image16 : public IImage16, public ImageIO +class Image16 final : public IImage16, public ImageIO { public: diff --git a/rtengine/image8.cc b/rtengine/image8.cc index 66ad8b60f..67b38d0c1 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -111,10 +111,10 @@ void Image8::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, P gm = dgm; bm = dbm; - rm = 1.0 / rm; - gm = 1.0 / gm; - bm = 1.0 / bm; - float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; + rm = 1.f / rm; + gm = 1.f / gm; + bm = 1.f / bm; + float mul_lum = 0.299f * rm + 0.587f * gm + 0.114f * bm; rm /= mul_lum; gm /= mul_lum; bm /= mul_lum; @@ -151,8 +151,6 @@ void Image8::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, P gm /= area; bm /= area; -#define GCLIP( x ) Color::gamma_srgb(CLIP(x)) - #ifdef _OPENMP #pragma omp parallel { diff --git a/rtengine/image8.h b/rtengine/image8.h index f125dccf8..c11d9d7fc 100644 --- a/rtengine/image8.h +++ b/rtengine/image8.h @@ -27,7 +27,7 @@ namespace rtengine { class Imagefloat; -class Image8 : public IImage8, public ImageIO +class Image8 final : public IImage8, public ImageIO { public: diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 24cfefde9..a631a6c8d 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -502,11 +502,11 @@ FrameData::FrameData(rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory* } else if (!make.compare (0, 6, "PENTAX") || (!make.compare (0, 5, "RICOH") && !model.compare (0, 6, "PENTAX"))) { // ISO at max value supported, check manufacturer specific if (iso_speed == 65535 || iso_speed == 0) { - rtexif::Tag* baseIsoTag = mnote->getTag("ISO"); + const rtexif::Tag* const baseIsoTag = mnote->getTag("ISO"); if (baseIsoTag) { - std::string isoData = baseIsoTag->valueToString(); + const std::string isoData = baseIsoTag->valueToString(); if (isoData.size() > 1) { - iso_speed = stoi(isoData); + iso_speed = std::stoi(isoData); } } } diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index ff8ed4b86..4bf9bdf5b 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -23,12 +23,18 @@ #include #include -#include #include #include "imageio.h" +namespace Glib +{ + +class ustring; + +} + namespace rtexif { @@ -38,7 +44,7 @@ class TagDirectory; namespace rtengine { -class FrameData +class FrameData final { protected: @@ -95,7 +101,7 @@ public: int getRating () const; }; -class FramesData : public FramesMetaData { +class FramesData final : public FramesMetaData { private: // frame's root IFD, can be a file root IFD or a SUB-IFD std::vector> frames; diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 1da91a4b4..f905134a0 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -178,10 +178,10 @@ void Imagefloat::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* imag gm = dgm; bm = dbm; - rm = 1.0 / rm; - gm = 1.0 / gm; - bm = 1.0 / bm; - float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; + rm = 1.f / rm; + gm = 1.f / gm; + bm = 1.f / bm; + float mul_lum = 0.299f * rm + 0.587f * gm + 0.114f * bm; rm /= mul_lum; gm /= mul_lum; bm /= mul_lum; @@ -368,7 +368,7 @@ Imagefloat::to16() const void Imagefloat::normalizeFloat(float srcMinVal, float srcMaxVal) { - float scale = MAXVALD / (srcMaxVal - srcMinVal); + float scale = MAXVALF / (srcMaxVal - srcMinVal); int w = width; int h = height; diff --git a/rtengine/imagefloat.h b/rtengine/imagefloat.h index 4a2b2f7e1..cd08daf70 100644 --- a/rtengine/imagefloat.h +++ b/rtengine/imagefloat.h @@ -34,7 +34,7 @@ class LabImage; /* * Image type used by most tools; expected range: [0.0 ; 65535.0] */ -class Imagefloat : public IImagefloat, public ImageIO +class Imagefloat final : public IImagefloat, public ImageIO { public: diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index e0c26aa9f..96711c1a0 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -25,7 +25,6 @@ #include "coord2d.h" #include "imagedata.h" -#include "LUT.h" #include "rtengine.h" template @@ -86,7 +85,7 @@ protected: public: ImageSource () : references (1), redAWBMul(-1.), greenAWBMul(-1.), blueAWBMul(-1.), - embProfile(nullptr), idata(nullptr), dirpyrdenoiseExpComp(INFINITY) {} + embProfile(nullptr), idata(nullptr), dirpyrdenoiseExpComp(RT_INFINITY) {} ~ImageSource () override {} virtual int load (const Glib::ustring &fname) = 0; @@ -143,11 +142,11 @@ public: virtual void setProgressListener (ProgressListener* pl) {} - void increaseRef () override + void increaseRef () final { references++; } - void decreaseRef () override + void decreaseRef () final { references--; @@ -175,15 +174,15 @@ public: return dirpyrdenoiseExpComp; } // functions inherited from the InitialImage interface - Glib::ustring getFileName () override + Glib::ustring getFileName () final { return fileName; } - cmsHPROFILE getEmbeddedProfile () override + cmsHPROFILE getEmbeddedProfile () final { return embProfile; } - const FramesMetaData* getMetaData () override + const FramesMetaData* getMetaData () final { return idata; } diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index e915a11b0..c14e889ad 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -734,7 +734,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if (params->blackwhite.enabled && params->blackwhite.autoc && abwListener) { if (settings->verbose) { - printf("ImProcCoordinator / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", bwAutoR, bwAutoG, bwAutoB); + printf("ImProcCoordinator / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", static_cast(bwAutoR), static_cast(bwAutoG), static_cast(bwAutoB)); } abwListener->BWChanged((float) rrm, (float) ggm, (float) bbm); @@ -871,7 +871,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) double E_V = fcomp + log2(double ((fnum * fnum) / fspeed / (fiso / 100.f))); E_V += params->toneCurve.expcomp;// exposure compensation in tonecurve ==> direct EV E_V += log2(params->raw.expos); // exposure raw white point ; log2 ==> linear to EV - adap = powf(2.f, E_V - 3.f); // cd / m2 + adap = pow(2.0, E_V - 3.0); // cd / m2 // end calculation adaptation scene luminosity } diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 96d1f80ce..37318c64b 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -27,7 +27,6 @@ #include "imagesource.h" #include "improcfun.h" #include "LUT.h" -#include "procevents.h" #include "rtengine.h" #include "../rtgui/threadutils.h" @@ -55,7 +54,7 @@ class Crop; * but using this class' LUT and other precomputed parameters. The main preview area is displaying a non framed Crop object, * while detail windows are framed Crop objects. */ -class ImProcCoordinator : public StagedImageProcessor +class ImProcCoordinator final : public StagedImageProcessor { friend class Crop; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index d5c69773e..7ade3e92c 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -31,15 +31,16 @@ #include "cieimage.h" #include "clutstore.h" #include "color.h" +#include "colortemp.h" #include "curves.h" #include "dcp.h" #include "EdgePreservingDecomposition.h" #include "iccmatrices.h" #include "iccstore.h" #include "imagesource.h" -#include "improccoordinator.h" #include "improcfun.h" #include "labimage.h" +#include "pipettebuffer.h" #include "procparams.h" #include "rt_math.h" #include "rtengine.h" @@ -54,9 +55,6 @@ #include "mytime.h" #endif -#undef CLIPD -#define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f) - namespace { using namespace rtengine; @@ -137,7 +135,7 @@ void highlightToneCurve(const LUTf &hltonecurve, float *rtemp, float *gtemp, flo float b = btemp[ti * tileSize + tj + k]; float tonefactor = ((r < MAXVALF ? hltonecurve[r] : CurveFactory::hlcurve(exp_scale, comp, hlrange, r)) + (g < MAXVALF ? hltonecurve[g] : CurveFactory::hlcurve(exp_scale, comp, hlrange, g)) + - (b < MAXVALF ? hltonecurve[b] : CurveFactory::hlcurve(exp_scale, comp, hlrange, b))) / 3.0; + (b < MAXVALF ? hltonecurve[b] : CurveFactory::hlcurve(exp_scale, comp, hlrange, b))) / 3.f; // note: tonefactor includes exposure scaling, that is here exposure slider and highlight compression takes place rtemp[ti * tileSize + tj + k] = r * tonefactor; @@ -165,7 +163,7 @@ void highlightToneCurve(const LUTf &hltonecurve, float *rtemp, float *gtemp, flo //float tonefactor = hltonecurve[(0.299f*r+0.587f*g+0.114f*b)]; float tonefactor = ((r < MAXVALF ? hltonecurve[r] : CurveFactory::hlcurve(exp_scale, comp, hlrange, r)) + (g < MAXVALF ? hltonecurve[g] : CurveFactory::hlcurve(exp_scale, comp, hlrange, g)) + - (b < MAXVALF ? hltonecurve[b] : CurveFactory::hlcurve(exp_scale, comp, hlrange, b))) / 3.0; + (b < MAXVALF ? hltonecurve[b] : CurveFactory::hlcurve(exp_scale, comp, hlrange, b))) / 3.f; // note: tonefactor includes exposure scaling, that is here exposure slider and highlight compression takes place rtemp[ti * tileSize + tj] = r * tonefactor; @@ -518,8 +516,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw int width = lab->W, height = lab->H; float minQ = 10000.f; float maxQ = -1000.f; - float Yw; - Yw = 1.0; + double Yw = 1.0; double Xw, Zw; float f = 0.f, nc = 0.f, la, c = 0.f, xw, yw, zw, f2 = 1.f, c2 = 1.f, nc2 = 1.f, yb2; float fl, n, nbb, ncb, aw; //d @@ -596,13 +593,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw algepd = true; } - xwd = 100.f * Xwout; - zwd = 100.f * Zwout; - ywd = 100.f / params->colorappearance.greenout;//approximation to simplify + xwd = 100.0 * Xwout; + zwd = 100.0 * Zwout; + ywd = 100.0 / params->colorappearance.greenout;//approximation to simplify - xws = 100.f * Xwsc; - zws = 100.f * Zwsc; - yws = 100.f / params->colorappearance.greensc;//approximation to simplify + xws = 100.0 * Xwsc; + zws = 100.0 * Zwsc; + yws = 100.0 / params->colorappearance.greensc;//approximation to simplify /* @@ -699,20 +696,20 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw if (alg == 3 || alg == 1) { schr = params->colorappearance.schroma; - if (schr > 0.0) { - schr = schr / 2.0f; //divide sensibility for saturation + if (schr > 0.f) { + schr = schr / 2.f; //divide sensibility for saturation } if (alg == 3) { - if (schr == -100.0f) { + if (schr == -100.f) { schr = -99.f; } - if (schr == 100.0f) { + if (schr == 100.f) { schr = 98.f; } } else { - if (schr == -100.0f) { + if (schr == -100.f) { schr = -99.8f; } } @@ -751,7 +748,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw LUTu hist16J; LUTu hist16Q; - if ((needJ && CAMBrightCurveJ.dirty) || (needQ && CAMBrightCurveQ.dirty) || (std::isnan (mean) && settings->viewinggreySc != 0)) { + if ((needJ && CAMBrightCurveJ.dirty) || (needQ && CAMBrightCurveQ.dirty) || (std::isnan(mean) && settings->viewinggreySc != 0)) { if (needJ) { hist16J (32768); @@ -788,7 +785,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw #endif - for (int i = 0; i < height; i++) + for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { //rough correspondence between L and J float currL = lab->L[i][j] / 327.68f; float koef; //rough correspondence between L and J @@ -849,10 +846,11 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw //hist16Qthr[ (int) (sqrtf ((koef * (lab->L[i][j])) * 32768.f))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L } - sum += koef * lab->L[i][j]; //evaluate mean J to calculate Yb + sum += static_cast(koef) * static_cast(lab->L[i][j]); //evaluate mean J to calculate Yb //sumQ += whestim * sqrt ((koef * (lab->L[i][j])) / 32768.f); //can be used in case of... } + } #ifdef _OPENMP #pragma omp critical @@ -868,8 +866,8 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw } - if (std::isnan (mean)) { - mean = (sum / ((height) * width)) / 327.68f; //for Yb for all image...if one day "pipette" we can adapt Yb for each zone + if (std::isnan(mean)) { + mean = (sum / ((height) * width)) / 327.68; //for Yb for all image...if one day "pipette" we can adapt Yb for each zone } } #ifdef _OPENMP @@ -916,9 +914,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw const bool highlight = params->toneCurve.hrenabled; //Get the value if "highlight reconstruction" is activated const int gamu = (params->colorappearance.gamut) ? 1 : 0; - xw = 100.0f * Xw; - yw = 100.0f * Yw; - zw = 100.0f * Zw; + xw = 100.0 * Xw; + yw = 100.0 * Yw; + zw = 100.0 * Zw; float xw1 = 0.f, yw1 = 0.f, zw1 = 0.f, xw2 = 0.f, yw2 = 0.f, zw2 = 0.f; // settings of WB: scene and viewing @@ -2002,9 +2000,9 @@ void ImProcFunctions::moyeqt (Imagefloat* working, float &moyS, float &eqty) for (int i = 0; i < tHh; i++) { for (int j = 0; j < tWw; j++) { - float s = Color::rgb2s (CLIP (working->r (i, j)), CLIP (working->g (i, j)), CLIP (working->b (i, j))); + double s = Color::rgb2s (CLIP (working->r (i, j)), CLIP (working->g (i, j)), CLIP (working->b (i, j))); moy += s; - sqrs += SQR (s); + sqrs += SQR(s); } } @@ -2108,17 +2106,17 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float toxyz[3][3] = { { - static_cast ( wprof[0][0] / Color::D50x), - static_cast ( wprof[0][1] / Color::D50x), - static_cast ( wprof[0][2] / Color::D50x) + static_cast(wprof[0][0] / static_cast(Color::D50x)), + static_cast(wprof[0][1] / static_cast(Color::D50x)), + static_cast(wprof[0][2] / static_cast(Color::D50x)) }, { - static_cast ( wprof[1][0]), - static_cast ( wprof[1][1]), - static_cast ( wprof[1][2]) + static_cast(wprof[1][0]), + static_cast(wprof[1][1]), + static_cast(wprof[1][2]) }, { - static_cast ( wprof[2][0] / Color::D50z), - static_cast ( wprof[2][1] / Color::D50z), - static_cast ( wprof[2][2] / Color::D50z) + static_cast(wprof[2][0] / static_cast(Color::D50z)), + static_cast(wprof[2][1] / static_cast(Color::D50z)), + static_cast(wprof[2][2] / static_cast(Color::D50z)) } }; float maxFactorToxyz = max (toxyz[1][0], toxyz[1][1], toxyz[1][2]); @@ -2238,10 +2236,10 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer const float film_simulation_strength = static_cast (params->filmSimulation.strength) / 100.0f; - const float exp_scale = pow (2.0, expcomp); - const float comp = (max (0.0, expcomp) + 1.0) * hlcompr / 100.0; - const float shoulder = ((65536.0 / max (1.0f, exp_scale)) * (hlcomprthresh / 200.0)) + 0.1; - const float hlrange = 65536.0 - shoulder; + const float exp_scale = pow(2.0, expcomp); + 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 bool isProPhoto = (params->icm.workingProfile == "ProPhoto"); // extracting data from 'params' to avoid cache flush (to be confirmed) ToneCurveMode curveMode = params->toneCurve.curveMode; @@ -2303,43 +2301,43 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } */ - float RedLow = params->colorToning.redlow / 100.f; - float GreenLow = params->colorToning.greenlow / 100.f; - float BlueLow = params->colorToning.bluelow / 100.f; - float RedMed = params->colorToning.redmed / 100.f; - float GreenMed = params->colorToning.greenmed / 100.f; - float BlueMed = params->colorToning.bluemed / 100.f; - float RedHigh = params->colorToning.redhigh / 100.f; - float GreenHigh = params->colorToning.greenhigh / 100.f; - float BlueHigh = params->colorToning.bluehigh / 100.f; - float SatLow = float (params->colorToning.shadowsColSat.getBottom()) / 100.f; - float SatHigh = float (params->colorToning.hlColSat.getBottom()) / 100.f; + float RedLow = params->colorToning.redlow / 100.0; + float GreenLow = params->colorToning.greenlow / 100.0; + float BlueLow = params->colorToning.bluelow / 100.0; + float RedMed = params->colorToning.redmed / 100.0; + float GreenMed = params->colorToning.greenmed / 100.0; + float BlueMed = params->colorToning.bluemed / 100.0; + float RedHigh = params->colorToning.redhigh / 100.0; + float GreenHigh = params->colorToning.greenhigh / 100.0; + float BlueHigh = params->colorToning.bluehigh / 100.0; + float SatLow = params->colorToning.shadowsColSat.getBottom() / 100.f; + float SatHigh = params->colorToning.hlColSat.getBottom() / 100.f; - float Balan = float (params->colorToning.balance); + float Balan = params->colorToning.balance; - float chMixRR = float (params->chmixer.red[0])/10.f; - float chMixRG = float (params->chmixer.red[1])/10.f; - float chMixRB = float (params->chmixer.red[2])/10.f; - float chMixGR = float (params->chmixer.green[0])/10.f; - float chMixGG = float (params->chmixer.green[1])/10.f; - float chMixGB = float (params->chmixer.green[2])/10.f; - float chMixBR = float (params->chmixer.blue[0])/10.f; - float chMixBG = float (params->chmixer.blue[1])/10.f; - float chMixBB = float (params->chmixer.blue[2])/10.f; + float chMixRR = params->chmixer.red[0] / 10.f; + float chMixRG = params->chmixer.red[1] / 10.f; + float chMixRB = params->chmixer.red[2] / 10.f; + float chMixGR = params->chmixer.green[0] / 10.f; + float chMixGG = params->chmixer.green[1] / 10.f; + float chMixGB = params->chmixer.green[2] / 10.f; + float chMixBR = params->chmixer.blue[0] / 10.f; + float chMixBG = params->chmixer.blue[1] / 10.f; + float chMixBB = params->chmixer.blue[2] / 10.f; bool blackwhite = params->blackwhite.enabled; bool complem = params->blackwhite.enabledcc; - float bwr = float (params->blackwhite.mixerRed); - float bwg = float (params->blackwhite.mixerGreen); - float bwb = float (params->blackwhite.mixerBlue); - float bwrgam = float (params->blackwhite.gammaRed); - float bwggam = float (params->blackwhite.gammaGreen); - float bwbgam = float (params->blackwhite.gammaBlue); - float mixerOrange = float (params->blackwhite.mixerOrange); - float mixerYellow = float (params->blackwhite.mixerYellow); - float mixerCyan = float (params->blackwhite.mixerCyan); - float mixerMagenta = float (params->blackwhite.mixerMagenta); - float mixerPurple = float (params->blackwhite.mixerPurple); + float bwr = params->blackwhite.mixerRed; + float bwg = params->blackwhite.mixerGreen; + float bwb = params->blackwhite.mixerBlue; + float bwrgam = params->blackwhite.gammaRed; + float bwggam = params->blackwhite.gammaGreen; + float bwbgam = params->blackwhite.gammaBlue; + float mixerOrange = params->blackwhite.mixerOrange; + float mixerYellow = params->blackwhite.mixerYellow; + float mixerCyan = params->blackwhite.mixerCyan; + float mixerMagenta = params->blackwhite.mixerMagenta; + float mixerPurple = params->blackwhite.mixerPurple; int algm = 0; if (params->blackwhite.method == "Desaturation") { @@ -2720,7 +2718,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer //HSV equalizer if (hCurveEnabled) { - h = (hCurve->getVal (double (h)) - 0.5) * 2.f + h; + h = (hCurve->getVal(h) - 0.5) * 2.0 + static_cast(h); if (h > 1.0f) { h -= 1.0f; @@ -2751,7 +2749,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } //shift value - float valparam = vCurve->getVal ((double)h) - 0.5f; + float valparam = vCurve->getVal(h) - 0.5; valparam *= (1.f - SQR (SQR (1.f - min (s, 1.0f)))); if (valparam > 0.00001f) { @@ -3063,7 +3061,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (bwlCurveEnabled) { L /= 32768.f; double hr = Color::huelab_to_huehsv2 (HH); - float valparam = float ((bwlCurve->getVal (hr) - 0.5f) * 2.0f); //get l_r=f(H) + float valparam = (bwlCurve->getVal(hr) - 0.5) * 2.0; //get l_r=f(H) float kcc = (CC / 70.f); //take Chroma into account...70 "middle" of chromaticity (arbitrary and simple), one can imagine other algorithme //reduct action for low chroma and increase action for high chroma valparam *= kcc; @@ -3317,9 +3315,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - nr += tmpImage->r (i, j); - ng += tmpImage->g (i, j); - nb += tmpImage->b (i, j); + nr += static_cast(tmpImage->r(i, j)); + ng += static_cast(tmpImage->g(i, j)); + nb += static_cast(tmpImage->b(i, j)); } } @@ -4385,8 +4383,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW float factnoise = 1.f; if (params->dirpyrDenoise.enabled) { - factnoise = (1.f + params->dirpyrDenoise.chroma / 500.f); //levels=5 -// if(yyyy) factnoise=(1.f+params->dirpyrDenoise.chroma/100.f);//levels=7 + factnoise = 1.0 + params->dirpyrDenoise.chroma / 500.0; //levels=5 } const float scaleConst = 100.0f / 100.1f; @@ -4564,7 +4561,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW float l_r;//Luminance Lab in 0..1 l_r = Lprov1 / 100.f; { - float valparam = float ((lhCurve->getVal (Color::huelab_to_huehsv2 (HH)) - 0.5f)); //get l_r=f(H) + float valparam = lhCurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5; //get l_r=f(H) float valparamneg; valparamneg = valparam; float kcc = (CC / amountchroma); //take Chroma into account...40 "middle low" of chromaticity (arbitrary and simple), one can imagine other algorithme @@ -4597,9 +4594,9 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW float fx = (0.002f * aprov1) + fy; float fz = fy - (0.005f * bprov1); - float x_ = 65535.0f * Color::f2xyz (fx) * Color::D50x; - float z_ = 65535.0f * Color::f2xyz (fz) * Color::D50z; - float y_ = (Lprov1 > Color::epskap) ? 65535.0 * fy * fy * fy : 65535.0 * Lprov1 / Color::kappa; + float x_ = 65535.f * Color::f2xyz (fx) * Color::D50x; + float z_ = 65535.f * Color::f2xyz (fz) * Color::D50z; + float y_ = Lprov1 > Color::epskapf ? 65535.f * fy * fy * fy : 65535.f * Lprov1 / Color::kappaf; float R, G, B; Color::xyz2rgb (x_, y_, z_, R, G, B, wip); @@ -4627,7 +4624,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW // calculate C=f(H) if (chutili) { double hr = Color::huelab_to_huehsv2 (HH); - float chparam = float ((chCurve->getVal (hr) - 0.5f) * 2.0f); //get C=f(H) + float chparam = (chCurve->getVal(hr) - 0.5) * 2.0; //get C=f(H) float chromaChfactor = 1.0f + chparam; atmp *= chromaChfactor;//apply C=f(H) btmp *= chromaChfactor; @@ -4635,9 +4632,9 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW if (hhutili) { // H=f(H) //hue Lab in -PI +PI - float valparam = float ((hhCurve->getVal (Color::huelab_to_huehsv2 (HH)) - 0.5f) * 1.7f) + HH; //get H=f(H) 1.7 optimisation ! + float valparam = (hhCurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5) * 1.7 + static_cast(HH); //get H=f(H) 1.7 optimisation ! HH = valparam; - sincosval = xsincosf (HH); + sincosval = xsincosf(HH); } if (!bwToning) { @@ -4713,11 +4710,11 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW deltaHH = protect_redhcur; //transition hue - if (chromaCfactor > 0.0) { + if (chromaCfactor > 0.f) { Color::scalered ( rstprotection, chromaCfactor, 0.0, HH, deltaHH, scale, scaleext); //1.0 } - if (chromaCfactor > 1.0) { + if (chromaCfactor > 1.f) { float interm = (chromaCfactor - 1.0f) * 100.0f; factorskin = 1.0f + (interm * scale) / 100.0f; factorskinext = 1.0f + (interm * scaleext) / 100.0f; @@ -4774,11 +4771,11 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW deltaHH = protect_redhcur; //transition hue - if (chromaCfactor > 0.0) { + if (chromaCfactor > 0.f) { Color::scalered ( rstprotection, chromaCfactor, 0.0, HH, deltaHH, scale, scaleext); //1.0 } - if (chromaCfactor > 1.0) { + if (chromaCfactor > 1.f) { float interm = (chromaCfactor - 1.0f) * 100.0f; factorskin = 1.0f + (interm * scale) / 100.0f; factorskinext = 1.0f + (interm * scaleext) / 100.0f; @@ -5061,7 +5058,7 @@ void ImProcFunctions::impulsedenoise (LabImage* lab) if (params->impulseDenoise.enabled && lab->W >= 8 && lab->H >= 8) { - impulse_nr (lab, (float)params->impulseDenoise.thresh / 20.0 ); + impulse_nr(lab, params->impulseDenoise.thresh / 20.0); } } @@ -5071,7 +5068,7 @@ void ImProcFunctions::impulsedenoisecam (CieImage* ncie, float **buffers[3]) if (params->impulseDenoise.enabled && ncie->W >= 8 && ncie->H >= 8) { - impulse_nrcam (ncie, (float)params->impulseDenoise.thresh / 20.0, buffers ); + impulse_nrcam(ncie, params->impulseDenoise.thresh / 20.0, buffers); } } @@ -5141,11 +5138,11 @@ void ImProcFunctions::EPDToneMapCIE (CieImage *ncie, float a_w, float c_, int Wi float sca = params->epd.scale; float gamm = params->epd.gamma; float rew = params->epd.reweightingIterates; - float Qpro = ( 4.0 / c_) * ( a_w + 4.0 ) ; //estimate Q max if J=100.0 + float Qpro = (4.f / c_) * (a_w + 4.f) ; //estimate Q max if J=100.0 float *Qpr = ncie->Q_p[0]; if (settings->verbose) { - printf ("minQ=%f maxQ=%f Qpro=%f\n", minQ, maxQ, Qpro); + printf ("minQ=%f maxQ=%f Qpro=%f\n", static_cast(minQ), static_cast(maxQ), static_cast(Qpro)); } if (maxQ > Qpro) { @@ -5172,7 +5169,7 @@ void ImProcFunctions::EPDToneMapCIE (CieImage *ncie, float a_w, float c_, int Wi //Auto select number of iterates. Note that p->EdgeStopping = 0 makes a Gaussian blur. if (Iterates == 0) { - Iterates = (unsigned int) (edgest * 15.0); + Iterates = edgest * 15.f; } //Jacques Desmis : always Iterates=5 for compatibility images between preview and output @@ -5399,7 +5396,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double octile[count] += histogram[j]; if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) { - octile[count] = xlog (1. + j) / log (2.f); + octile[count] = xlog(1. + j) / log(2.0); count++;// = min(count+1,7); } } @@ -5412,7 +5409,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double octile[count] += histogram[j]; if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) { - octile[count] = xlog (1. + j) / log (2.f); + octile[count] = xlog(1. + j) / log(2.0); count++;// = min(count+1,7); } } @@ -5487,7 +5484,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double } //compute clipped white point - unsigned int clippable = (int) (sum * clip / 100.f ); + unsigned int clippable = (int) (static_cast(sum) * clip / 100.0 ); clipped = 0; int whiteclip = (imax) - 1; @@ -5546,8 +5543,8 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double hlcomprthresh = 0; //this is a series approximation of the actual formula for comp, //which is a transcendental equation - float comp = (gain * ((float)whiteclip) / scale - 1.f) * 2.3f; // 2.3 instead of 2 to increase slightly comp - hlcompr = (int) (100.*comp / (max (0.0, expcomp) + 1.0)); + double comp = (gain * whiteclip / scale - 1.f) * 2.3f; // 2.3 instead of 2 to increase slightly comp + hlcompr = 100.0 * comp / (max(0.0, expcomp) + 1.0); hlcompr = max (0, min (100, hlcompr)); //now find brightness if gain didn't bring ave to midgray using @@ -5555,9 +5552,9 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double float midtmp = gain * sqrt (median * ave) / scale; if (midtmp < 0.1f) { - bright = (midgray - midtmp) * 15.0 / (midtmp); + bright = (midgray - midtmp) * 15.f / (midtmp); } else { - bright = (midgray - midtmp) * 15.0 / (0.10833 - 0.0833 * midtmp); + bright = (midgray - midtmp) * 15.f / (0.10833f - 0.0833f * midtmp); } bright = 0.25 */*(median/ave)*(hidev/lodev)*/max (0, bright); @@ -5566,7 +5563,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double contr = (int) 50.0f * (1.1f - ospread); contr = max (0, min (100, contr)); //take gamma into account - double whiteclipg = (int) (CurveFactory::gamma2 (whiteclip * corr / 65536.0) * 65536.0); + double whiteclipg = (int) (CurveFactory::gamma2(whiteclip * static_cast(corr) / 65536.0) * 65536.0); float gavg = 0.; @@ -5588,7 +5585,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double } } - whiteclipg = CurveFactory::igamma2 ((float) (whiteclipg / 65535.0)) * 65535.0; //need to inverse gamma transform to get correct exposure compensation parameter + whiteclipg = CurveFactory::igamma2(whiteclipg / 65535.0) * 65535.0; //need to inverse gamma transform to get correct exposure compensation parameter //correction with gamma black = (int) ((65535 * black) / whiteclipg); @@ -5823,8 +5820,8 @@ void ImProcFunctions::lab2rgb (const LabImage &src, Imagefloat &dst, const Glib: */ void ImProcFunctions::colorToningLabGrid(LabImage *lab, int xstart, int xend, int ystart, int yend, bool MultiThread) { - const float factor = ColorToningParams::LABGRID_CORR_MAX * 3.f; - const float scaling = ColorToningParams::LABGRID_CORR_SCALE; + const double factor = ColorToningParams::LABGRID_CORR_MAX * 3.0; + const double scaling = ColorToningParams::LABGRID_CORR_SCALE; float a_scale = (params->colorToning.labgridAHigh - params->colorToning.labgridALow) / factor / scaling; float a_base = params->colorToning.labgridALow / scaling; float b_scale = (params->colorToning.labgridBHigh - params->colorToning.labgridBLow) / factor / scaling; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 8f4ae7771..6538bd6b1 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -19,11 +19,17 @@ #pragma once #include +#include #include "coord2d.h" #include "gamutwarning.h" -#include "pipettebuffer.h" +namespace Glib +{ + +class ustring; + +} template class LUT; @@ -44,6 +50,7 @@ class FramesMetaData; class LensCorrection; class NoiseCurve; class OpacityCurve; +class PipetteBuffer; class ToneCurve; class WavCurve; class WavOpacityCurveBY; diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 28a0f2d57..53939b5c0 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -32,6 +32,7 @@ #include #include +#include "array2D.h" #include "color.h" #include "guidedfilter.h" #include "iccstore.h" @@ -240,9 +241,9 @@ float estimate_ambient_light(const array2D &R, const array2D &G, c float g = G[y][x]; float b = B[y][x]; if (r + g + b >= bright_lim) { - rr += r; - gg += g; - bb += b; + rr += static_cast(r); + gg += static_cast(g); + bb += static_cast(b); ++n; } } diff --git a/rtengine/iplabregions.cc b/rtengine/iplabregions.cc index 6526419f5..786d42e56 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -139,7 +139,7 @@ BENCHFUN auto &hm = hmask[i]; auto &cm = cmask[i]; auto &lm = lmask[i]; - float blend = LIM01((hm ? hm->getVal(h) : 1.f) * (cm ? cm->getVal(c) : 1.f) * (lm ? lm->getVal(l) : 1.f)); + float blend = LIM01((hm ? hm->getVal(h) : 1.0) * (cm ? cm->getVal(c) : 1.0) * (lm ? lm->getVal(l) : 1.0)); Lmask[i][y][x] = abmask[i][y][x] = blend; } } @@ -147,8 +147,8 @@ BENCHFUN } for (int i = begin_idx; i < end_idx; ++i) { - float blur = params->colorToning.labregions[i].maskBlur; - blur = blur < 0.f ? -1.f/blur : 1.f + blur; + double blur = params->colorToning.labregions[i].maskBlur; + blur = blur < 0.0 ? -1.0 / blur : 1.0 + blur; int r1 = max(int(4 / scale * blur + 0.5), 1); int r2 = max(int(25 / scale * blur + 0.5), 1); rtengine::guidedFilter(guide, abmask[i], abmask[i], r1, 0.001, multiThread); @@ -188,7 +188,7 @@ BENCHFUN auto &r = params->colorToning.labregions[i]; abca[i] = abcoord(r.a); abcb[i] = abcoord(r.b); - rs[i] = 1.f + r.saturation / (SGN(r.saturation) > 0 ? 50.f : 100.f); + rs[i] = 1.0 + r.saturation / (SGN(r.saturation) > 0 ? 50.0 : 100.0); slope[i] = r.slope; offset[i] = r.offset; power[i] = r.power; diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index 84f33482f..6768eca93 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -110,8 +110,8 @@ void mean_stddv2( float **dst, float &mean, float &stddv, int W_L, int H_L, floa for (int i = 0; i < H_L; i++ ) for (int j = 0; j < W_L; j++) { - sum += dst[i][j]; - vsquared += (dst[i][j] * dst[i][j]); + sum += static_cast(dst[i][j]); + vsquared += rtengine::SQR(dst[i][j]); lmax = dst[i][j] > lmax ? dst[i][j] : lmax; lmin = dst[i][j] < lmin ? dst[i][j] : lmin; @@ -128,8 +128,8 @@ void mean_stddv2( float **dst, float &mean, float &stddv, int W_L, int H_L, floa } mean = sum / (double) (W_L * H_L); vsquared /= (double) W_L * H_L; - stddv = ( vsquared - (mean * mean) ); - stddv = (float)sqrt(stddv); + stddv = vsquared - rtengine::SQR(mean); + stddv = std::sqrt(stddv); } } @@ -678,9 +678,9 @@ BENCHFUN float valparam; if(useHsl || useHslLin) { - valparam = shcurve->getVal(HH) - 0.5f; + valparam = shcurve->getVal(HH) - 0.5; } else { - valparam = shcurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5f; + valparam = shcurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5; } str *= (1.f + 2.f * valparam); diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index 5c5b6b324..5d5be57e9 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -46,7 +46,7 @@ void ImProcFunctions::shadowsHighlights(LabImage *lab) array2D mask(width, height); array2D L(width, height); - const float radius = float(params->sh.radius) * 10 / scale; + const float radius = params->sh.radius * 10 / scale; LUTf f(lab_mode ? 32768 : 65536); TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 7198b76c5..0e46cd596 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -103,7 +103,7 @@ void sharpenHaloCtrl (float** luminance, float** blurmap, float** base, float** void dcdamping (float** aI, float** aO, float damping, int W, int H) { - const float dampingFac = -2.0 / (damping * damping); + const float dampingFac = -2.f / (damping * damping); #ifdef __SSE2__ vfloat Iv, Ov, Uv, zerov, onev, fourv, fivev, dampingFacv, Tv, Wv, Lv; @@ -163,7 +163,7 @@ namespace rtengine void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, const float * const * blend, int W, int H, const procparams::SharpeningParams &sharpenParam, double Scale) { - if (sharpenParam.deconvamount == 0 && sharpenParam.blurradius < 0.25f) { + if (sharpenParam.deconvamount == 0 && sharpenParam.blurradius < 0.25) { return; } BENCHFUN @@ -180,7 +180,7 @@ BENCHFUN JaggedArray* blurbuffer = nullptr; - if (sharpenParam.blurradius >= 0.25f) { + if (sharpenParam.blurradius >= 0.25) { blurbuffer = new JaggedArray(W, H); JaggedArray &blur = *blurbuffer; #ifdef _OPENMP @@ -229,7 +229,7 @@ BENCHFUN } } - if (sharpenParam.blurradius >= 0.25f) { + if (sharpenParam.blurradius >= 0.25) { JaggedArray &blur = *blurbuffer; #ifdef _OPENMP #pragma omp for @@ -255,7 +255,7 @@ void ImProcFunctions::sharpening (LabImage* lab, const procparams::SharpeningPar // calculate contrast based blend factors to reduce sharpening in regions with low contrast JaggedArray blend(W, H); - float contrast = sharpenParam.contrast / 100.f; + float contrast = sharpenParam.contrast / 100.0; buildBlendMask(lab->L, blend, W, H, contrast); if(showMask) { @@ -292,7 +292,7 @@ BENCHFUN JaggedArray blur(W, H); - if (sharpenParam.blurradius >= 0.25f) { + if (sharpenParam.blurradius >= 0.25) { #ifdef _OPENMP #pragma omp parallel #endif @@ -372,7 +372,7 @@ BENCHFUN delete [] b3; } - if (sharpenParam.blurradius >= 0.25f) { + if (sharpenParam.blurradius >= 0.25) { #ifdef _OPENMP #pragma omp parallel for #endif @@ -385,241 +385,6 @@ BENCHFUN } -// To the extent possible under law, Manuel Llorens -// has waived all copyright and related or neighboring rights to this work. -// This work is published from: Spain. - -// Thanks to Manuel for this excellent job (Jacques Desmis JDC or frej83) -void ImProcFunctions::MLsharpen (LabImage* lab) -{ - // JD: this algorithm maximize clarity of images; it does not play on accutance. It can remove (partially) the effects of the AA filter) - // I think we can use this algorithm alone in most cases, or first to clarify image and if you want a very little USM (unsharp mask sharpening) after... - if (!params->sharpenEdge.enabled) { - return; - } - - MyTime t1e, t2e; - t1e.set(); - - int offset, c, i, j, p, width2; - int width = lab->W, height = lab->H; - float *L, lumH, lumV, lumD1, lumD2, v, contrast, s; - float difL, difR, difT, difB, difLT, difRB, difLB, difRT, wH, wV, wD1, wD2, chmax[3]; - float f1, f2, f3, f4; - float templab; - int iii, kkk; - width2 = 2 * width; - const float epsil = 0.01f; //prevent divide by zero - const float eps2 = 0.001f; //prevent divide by zero - float amount; - amount = params->sharpenEdge.amount / 100.0f; - - if (amount < 0.00001f) { - return; - } - - if (settings->verbose) { - printf ("SharpenEdge amount %f\n", amount); - } - - L = new float[width * height]; - - chmax[0] = 8.0f; - chmax[1] = 3.0f; - chmax[2] = 3.0f; - - int channels; - - if (params->sharpenEdge.threechannels) { - channels = 0; - } else { - channels = 2; - } - - if (settings->verbose) { - printf ("SharpenEdge channels %d\n", channels); - } - - int passes = params->sharpenEdge.passes; - - if (settings->verbose) { - printf ("SharpenEdge passes %d\n", passes); - } - - for (p = 0; p < passes; p++) - for (c = 0; c <= channels; c++) { // c=0 Luminance only - -#ifdef _OPENMP - #pragma omp parallel for private(offset) shared(L) -#endif - - for (offset = 0; offset < width * height; offset++) { - int ii = offset / width; - int kk = offset - ii * width; - - if (c == 0) { - L[offset] = lab->L[ii][kk] / 327.68f; // adjust to RT and to 0..100 - } else if (c == 1) { - L[offset] = lab->a[ii][kk] / 327.68f; - } else { /*if (c==2) */ - L[offset] = lab->b[ii][kk] / 327.68f; - } - } - -#ifdef _OPENMP - #pragma omp parallel for private(j,i,iii,kkk, templab,offset,wH,wV,wD1,wD2,s,lumH,lumV,lumD1,lumD2,v,contrast,f1,f2,f3,f4,difT,difB,difL,difR,difLT,difLB,difRT,difRB) shared(lab,L,amount) -#endif - - for(j = 2; j < height - 2; j++) - for(i = 2, offset = j * width + i; i < width - 2; i++, offset++) { - // weight functions - wH = eps2 + fabs(L[offset + 1] - L[offset - 1]); - wV = eps2 + fabs(L[offset + width] - L[offset - width]); - - s = 1.0f + fabs(wH - wV) / 2.0f; - wD1 = eps2 + fabs(L[offset + width + 1] - L[offset - width - 1]) / s; - wD2 = eps2 + fabs(L[offset + width - 1] - L[offset - width + 1]) / s; - s = wD1; - wD1 /= wD2; - wD2 /= s; - - // initial values - int ii = offset / width; - int kk = offset - ii * width; - - if (c == 0) { - lumH = lumV = lumD1 = lumD2 = v = lab->L[ii][kk] / 327.68f; - } else if (c == 1) { - lumH = lumV = lumD1 = lumD2 = v = lab->a[ii][kk] / 327.68f; - } else { /* if (c==2) */ - lumH = lumV = lumD1 = lumD2 = v = lab->b[ii][kk] / 327.68f; - } - - - // contrast detection - contrast = sqrt(fabs(L[offset + 1] - L[offset - 1]) * fabs(L[offset + 1] - L[offset - 1]) + fabs(L[offset + width] - L[offset - width]) * fabs(L[offset + width] - L[offset - width])) / chmax[c]; - - if (contrast > 1.0f) { - contrast = 1.0f; - } - - // new possible values - if (((L[offset] < L[offset - 1]) && (L[offset] > L[offset + 1])) || ((L[offset] > L[offset - 1]) && (L[offset] < L[offset + 1]))) { - f1 = fabs(L[offset - 2] - L[offset - 1]); - f2 = fabs(L[offset - 1] - L[offset]); - f3 = fabs(L[offset - 1] - L[offset - width]) * fabs(L[offset - 1] - L[offset + width]); - f4 = sqrt(fabs(L[offset - 1] - L[offset - width2]) * fabs(L[offset - 1] - L[offset + width2])); - difL = f1 * f2 * f2 * f3 * f3 * f4; - f1 = fabs(L[offset + 2] - L[offset + 1]); - f2 = fabs(L[offset + 1] - L[offset]); - f3 = fabs(L[offset + 1] - L[offset - width]) * fabs(L[offset + 1] - L[offset + width]); - f4 = sqrt(fabs(L[offset + 1] - L[offset - width2]) * fabs(L[offset + 1] - L[offset + width2])); - difR = f1 * f2 * f2 * f3 * f3 * f4; - - if ((difR > epsil) && (difL > epsil)) { - lumH = (L[offset - 1] * difR + L[offset + 1] * difL) / (difL + difR); - lumH = v * (1.f - contrast) + lumH * contrast; - } - } - - if (((L[offset] < L[offset - width]) && (L[offset] > L[offset + width])) || ((L[offset] > L[offset - width]) && (L[offset] < L[offset + width]))) { - f1 = fabs(L[offset - width2] - L[offset - width]); - f2 = fabs(L[offset - width] - L[offset]); - f3 = fabs(L[offset - width] - L[offset - 1]) * fabs(L[offset - width] - L[offset + 1]); - f4 = sqrt(fabs(L[offset - width] - L[offset - 2]) * fabs(L[offset - width] - L[offset + 2])); - difT = f1 * f2 * f2 * f3 * f3 * f4; - f1 = fabs(L[offset + width2] - L[offset + width]); - f2 = fabs(L[offset + width] - L[offset]); - f3 = fabs(L[offset + width] - L[offset - 1]) * fabs(L[offset + width] - L[offset + 1]); - f4 = sqrt(fabs(L[offset + width] - L[offset - 2]) * fabs(L[offset + width] - L[offset + 2])); - difB = f1 * f2 * f2 * f3 * f3 * f4; - - if ((difB > epsil) && (difT > epsil)) { - lumV = (L[offset - width] * difB + L[offset + width] * difT) / (difT + difB); - lumV = v * (1.f - contrast) + lumV * contrast; - } - } - - if (((L[offset] < L[offset - 1 - width]) && (L[offset] > L[offset + 1 + width])) || ((L[offset] > L[offset - 1 - width]) && (L[offset] < L[offset + 1 + width]))) { - f1 = fabs(L[offset - 2 - width2] - L[offset - 1 - width]); - f2 = fabs(L[offset - 1 - width] - L[offset]); - f3 = fabs(L[offset - 1 - width] - L[offset - width + 1]) * fabs(L[offset - 1 - width] - L[offset + width - 1]); - f4 = sqrt(fabs(L[offset - 1 - width] - L[offset - width2 + 2]) * fabs(L[offset - 1 - width] - L[offset + width2 - 2])); - difLT = f1 * f2 * f2 * f3 * f3 * f4; - f1 = fabs(L[offset + 2 + width2] - L[offset + 1 + width]); - f2 = fabs(L[offset + 1 + width] - L[offset]); - f3 = fabs(L[offset + 1 + width] - L[offset - width + 1]) * fabs(L[offset + 1 + width] - L[offset + width - 1]); - f4 = sqrt(fabs(L[offset + 1 + width] - L[offset - width2 + 2]) * fabs(L[offset + 1 + width] - L[offset + width2 - 2])); - difRB = f1 * f2 * f2 * f3 * f3 * f4; - - if ((difLT > epsil) && (difRB > epsil)) { - lumD1 = (L[offset - 1 - width] * difRB + L[offset + 1 + width] * difLT) / (difLT + difRB); - lumD1 = v * (1.f - contrast) + lumD1 * contrast; - } - } - - if (((L[offset] < L[offset + 1 - width]) && (L[offset] > L[offset - 1 + width])) || ((L[offset] > L[offset + 1 - width]) && (L[offset] < L[offset - 1 + width]))) { - f1 = fabs(L[offset - 2 + width2] - L[offset - 1 + width]); - f2 = fabs(L[offset - 1 + width] - L[offset]); - f3 = fabs(L[offset - 1 + width] - L[offset - width - 1]) * fabs(L[offset - 1 + width] - L[offset + width + 1]); - f4 = sqrt(fabs(L[offset - 1 + width] - L[offset - width2 - 2]) * fabs(L[offset - 1 + width] - L[offset + width2 + 2])); - difLB = f1 * f2 * f2 * f3 * f3 * f4; - f1 = fabs(L[offset + 2 - width2] - L[offset + 1 - width]); - f2 = fabs(L[offset + 1 - width] - L[offset]) * fabs(L[offset + 1 - width] - L[offset]); - f3 = fabs(L[offset + 1 - width] - L[offset + width + 1]) * fabs(L[offset + 1 - width] - L[offset - width - 1]); - f4 = sqrt(fabs(L[offset + 1 - width] - L[offset + width2 + 2]) * fabs(L[offset + 1 - width] - L[offset - width2 - 2])); - difRT = f1 * f2 * f2 * f3 * f3 * f4; - - if ((difLB > epsil) && (difRT > epsil)) { - lumD2 = (L[offset + 1 - width] * difLB + L[offset - 1 + width] * difRT) / (difLB + difRT); - lumD2 = v * (1.f - contrast) + lumD2 * contrast; - } - } - - s = amount; - - // avoid sharpening diagonals too much - if (((fabs(wH / wV) < 0.45f) && (fabs(wH / wV) > 0.05f)) || ((fabs(wV / wH) < 0.45f) && (fabs(wV / wH) > 0.05f))) { - s = amount / 3.0f; - } - - // final mix - if ((wH != 0.0f) && (wV != 0.0f) && (wD1 != 0.0f) && (wD2 != 0.0f)) { - iii = offset / width; - kkk = offset - iii * width; - float provL = lab->L[iii][kkk] / 327.68f; - - if(c == 0) { - if(provL < 92.f) { - templab = v * (1.f - s) + (lumH * wH + lumV * wV + lumD1 * wD1 + lumD2 * wD2) / (wH + wV + wD1 + wD2) * s; - } else { - templab = provL; - } - } else { - templab = v * (1.f - s) + (lumH * wH + lumV * wV + lumD1 * wD1 + lumD2 * wD2) / (wH + wV + wD1 + wD2) * s; - } - - if (c == 0) { - lab->L[iii][kkk] = fabs(327.68f * templab); // fabs because lab->L always >0 - } else if (c == 1) { - lab->a[iii][kkk] = 327.68f * templab ; - } else if (c == 2) { - lab->b[iii][kkk] = 327.68f * templab ; - } - } - - } - } - - delete [] L; - - t2e.set(); - - if (settings->verbose) { - printf("SharpenEdge gradient %d usec\n", t2e.etime(t1e)); - } -} - // To the extent possible under law, Manuel Llorens // has waived all copyright and related or neighboring rights to this work. // This code is licensed under CC0 v1.0, see license information at @@ -640,10 +405,10 @@ BENCHFUN // k=2 matrix 5x5 k=1 matrix 3x3 const int width = W, height = H; const int unif = params->sharpenMicro.uniformity; - const float amount = (k == 1 ? 2.7f : 1.f) * params->sharpenMicro.amount / 1500.0f; //amount 2000.0 quasi no artifacts ==> 1500 = maximum, after artifacts, 25/9 if 3x3 + const float amount = (k == 1 ? 2.7 : 1.) * params->sharpenMicro.amount / 1500.0; //amount 2000.0 quasi no artifacts ==> 1500 = maximum, after artifacts, 25/9 if 3x3 if (settings->verbose) { - printf ("Micro-contrast amount %f\n", amount); + printf ("Micro-contrast amount %f\n", static_cast(amount)); printf ("Micro-contrast uniformity %i\n", unif); } @@ -674,7 +439,7 @@ BENCHFUN // calculate contrast based blend factors to reduce sharpening in regions with low contrast JaggedArray blend(W, H); - float contrast = params->sharpenMicro.contrast / 100.f; + float contrast = params->sharpenMicro.contrast / 100.0; buildBlendMask(luminance, blend, W, H, contrast); #ifdef _OPENMP @@ -883,7 +648,7 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2, bool showMask) // calculate contrast based blend factors to reduce sharpening in regions with low contrast JaggedArray blend(W, H); - float contrast = params->sharpening.contrast / 100.f; + float contrast = params->sharpening.contrast / 100.0; buildBlendMask(ncie->sh_p, blend, W, H, contrast); if(showMask) { #ifdef _OPENMP diff --git a/rtengine/ipsharpenedges.cc b/rtengine/ipsharpenedges.cc new file mode 100644 index 000000000..6a44ee40a --- /dev/null +++ b/rtengine/ipsharpenedges.cc @@ -0,0 +1,217 @@ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2020 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 +#include "improcfun.h" +#include "labimage.h" +#include "procparams.h" +#include "rt_math.h" + +namespace { +#ifdef __SSE2__ +bool inintervalLoRo(float a, float b, float c) +{ + return a < std::max(b, c) && a > std::min(b, c); +} + +float selectweight(float a, float b, float low, float high) +{ + const float minVal = std::min(a,b); + const float maxVal = std::max(a,b); + const float res = (minVal < 0.45f * maxVal) ? low : high; + return (minVal > 0.05f * maxVal) ? res : high; +} + +#else +bool inintervalLoRo(float a, float b, float c) +{ + return (a < b && a > c) || (a < c && a > b); +} + +float selectweight(float a, float b, float low, float high) +{ + if ((a < 0.45f * b && a > 0.05f * b) || (b < 0.45f * a && b > 0.05f * a)) { + return low; + } else { + return high; + } +} + +#endif +} +namespace rtengine +{ + +// To the extent possible under law, Manuel Llorens +// has waived all copyright and related or neighboring rights to this work. +// This work is published from: Spain. + +// Thanks to Manuel for this excellent job (Jacques Desmis JDC or frej83) +void ImProcFunctions::MLsharpen (LabImage* lab) +{ + // JD: this algorithm maximize clarity of images; it does not play on accutance. It can remove (partially) the effects of the AA filter) + // I think we can use this algorithm alone in most cases, or first to clarify image and if you want a very little USM (unsharp mask sharpening) after... + if (!params->sharpenEdge.enabled || params->sharpenEdge.amount == 0) { + return; + } + + const int width = lab->W, height = lab->H; + constexpr float chmax[3] = {1.f / 8.f, 1.f / 3.f, 1.f / 3.f}; + const int width2 = 2 * width; + constexpr float eps2 = 0.001f; //prevent divide by zero + const float amount = params->sharpenEdge.amount / 100.0; + const float amountby3 = params->sharpenEdge.amount / 300.0; + + std::unique_ptr L(new float[width * height]); + + const int channels = params->sharpenEdge.threechannels ? 1 : 3; + const int passes = params->sharpenEdge.passes; + + for (int c = 0; c < channels; ++c) { // c=0 Luminance only + float** channel = c == 0 ? lab->L : c == 1 ? lab->a : lab->b; + for (int p = 0; p < passes; ++p) { +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int i = 0; i < height; ++i) { + for (int j = 0; j < width; ++j) { + L[i * width + j] = channel[i][j] / 327.68f; + } + } + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int j = 2; j < height - 2; j++) { + for (int i = 2, offset = j * width + i; i < width - 2; i++, offset++) { + // weight functions + const float wH = eps2 + std::fabs(L[offset + 1] - L[offset - 1]); + const float wV = eps2 + std::fabs(L[offset + width] - L[offset - width]); + + float s = 2.f / (2.f + std::fabs(wH - wV)); + float wD1 = eps2 + std::fabs(L[offset + width + 1] - L[offset - width - 1]) * s; + float wD2 = eps2 + std::fabs(L[offset + width - 1] - L[offset - width + 1]) * s; + s = wD1; + wD1 /= wD2; + wD2 /= s; + + const float v = L[offset]; + float lumH, lumV, lumD1, lumD2; + lumH = lumV = lumD1 = lumD2 = v; + + // contrast detection + const float contrast = std::min(std::sqrt(SQR(L[offset + 1] - L[offset - 1]) + SQR(L[offset + width] - L[offset - width])) * chmax[c], 1.f); + + // new possible values + if (inintervalLoRo(v, L[offset - 1], L[offset + 1])) { + float f1 = std::fabs(L[offset - 2] - L[offset - 1]); + float f2 = L[offset - 1] - v; + float f3 = (L[offset - 1] - L[offset - width]) * (L[offset - 1] - L[offset + width]); + float f4 = std::sqrt(std::fabs((L[offset - 1] - L[offset - width2]) * (L[offset - 1] - L[offset + width2]))); + const float difL = f1 * SQR(f2 * f3) * f4; + if (difL > 0.f) { + f1 = std::fabs(L[offset + 2] - L[offset + 1]); + f2 = L[offset + 1] - v; + f3 = (L[offset + 1] - L[offset - width]) * (L[offset + 1] - L[offset + width]); + f4 = std::sqrt(std::fabs((L[offset + 1] - L[offset - width2]) * (L[offset + 1] - L[offset + width2]))); + const float difR = f1 * SQR(f2 * f3) * f4; + if (difR > 0.f) { + lumH = (L[offset - 1] * difR + L[offset + 1] * difL) / (difL + difR); + lumH = intp(contrast, lumH, v); + } + } + } + + if (inintervalLoRo(v, L[offset - width], L[offset + width])) { + float f1 = std::fabs(L[offset - width2] - L[offset - width]); + float f2 = L[offset - width] - v; + float f3 = (L[offset - width] - L[offset - 1]) * (L[offset - width] - L[offset + 1]); + float f4 = std::sqrt(std::fabs((L[offset - width] - L[offset - 2]) * (L[offset - width] - L[offset + 2]))); + const float difT = f1 * SQR(f2 * f3) * f4; + if (difT > 0.f) { + f1 = std::fabs(L[offset + width2] - L[offset + width]); + f2 = L[offset + width] - v; + f3 = (L[offset + width] - L[offset - 1]) * (L[offset + width] - L[offset + 1]); + f4 = std::sqrt(std::fabs((L[offset + width] - L[offset - 2]) * (L[offset + width] - L[offset + 2]))); + const float difB = f1 * SQR(f2 * f3) * f4; + if (difB > 0.f) { + lumV = (L[offset - width] * difB + L[offset + width] * difT) / (difT + difB); + lumV = intp(contrast, lumV, v); + } + } + } + + if (inintervalLoRo(v, L[offset - 1 - width], L[offset + 1 + width])) { + float f1 = std::fabs(L[offset - 2 - width2] - L[offset - 1 - width]); + float f2 = L[offset - 1 - width] - v; + float f3 = (L[offset - 1 - width] - L[offset - width + 1]) * (L[offset - 1 - width] - L[offset + width - 1]); + float f4 = std::sqrt(std::fabs((L[offset - 1 - width] - L[offset - width2 + 2]) * (L[offset - 1 - width] - L[offset + width2 - 2]))); + const float difLT = f1 * SQR(f2 * f3) * f4; + if (difLT > 0.f) { + f1 = std::fabs(L[offset + 2 + width2] - L[offset + 1 + width]); + f2 = L[offset + 1 + width] - v; + f3 = (L[offset + 1 + width] - L[offset - width + 1]) * (L[offset + 1 + width] - L[offset + width - 1]); + f4 = std::sqrt(std::fabs((L[offset + 1 + width] - L[offset - width2 + 2]) * (L[offset + 1 + width] - L[offset + width2 - 2]))); + const float difRB = f1 * SQR(f2 * f3) * f4; + if (difRB > 0.f) { + lumD1 = (L[offset - 1 - width] * difRB + L[offset + 1 + width] * difLT) / (difLT + difRB); + lumD1 = intp(contrast, lumD1, v); + } + } + } + + if (inintervalLoRo(v, L[offset + 1 - width], L[offset - 1 + width])) { + float f1 = std::fabs(L[offset - 2 + width2] - L[offset - 1 + width]); + float f2 = L[offset - 1 + width] - v; + float f3 = (L[offset - 1 + width] - L[offset - width - 1]) * (L[offset - 1 + width] - L[offset + width + 1]); + float f4 = std::sqrt(std::fabs((L[offset - 1 + width] - L[offset - width2 - 2]) * (L[offset - 1 + width] - L[offset + width2 + 2]))); + const float difLB = f1 * SQR(f2 * f3) * f4; + if (difLB > 0.f) { + f1 = std::fabs(L[offset + 2 - width2] - L[offset + 1 - width]); + f2 = L[offset + 1 - width] - v; + f3 = (L[offset + 1 - width] - L[offset + width + 1]) * (L[offset + 1 - width] - L[offset - width - 1]); + f4 = std::sqrt(std::fabs((L[offset + 1 - width] - L[offset + width2 + 2]) * (L[offset + 1 - width] - L[offset - width2 - 2]))); + const float difRT = f1 * SQR(f2 * f3) * f4; + if (difRT > 0.f) { + lumD2 = (L[offset + 1 - width] * difLB + L[offset - 1 + width] * difRT) / (difLB + difRT); + lumD2 = intp(contrast, lumD2, v); + } + } + } + + // final mix + // avoid sharpening diagonals too much + const float weight = selectweight(wH, wV, amountby3, amount); + + if (c == 0) { + if (v < 92.f) { + channel[j][i] = std::fabs(327.68f * intp(weight, (lumH * wH + lumV * wV + lumD1 * wD1 + lumD2 * wD2) / (wH + wV + wD1 + wD2), v)); // fabs because lab->L always > 0 + } + } else { + channel[j][i] = 327.68f * intp(weight, (lumH * wH + lumV * wV + lumD1 * wD1 + lumD2 * wD2) / (wH + wV + wD1 + wD2), v); + } + } + } + } + } +} + +} diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index 9e7c61dcf..b0dc55b2f 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -689,11 +689,11 @@ static void calcGradientParams (int oW, int oH, const GradientParams& gradient, gp.ta = tan (gradient_angle); gp.xc = w * gradient_center_x; gp.yc = h * gradient_center_y; - gp.ys = sqrt ((float)h * h + (float)w * w) * (gradient_span / cos (gradient_angle)); - gp.ys_inv = 1.0 / gp.ys; - gp.top_edge_0 = gp.yc - gp.ys / 2.0; + gp.ys = rtengine::norm2(static_cast(h), static_cast(w)) * (gradient_span / cos(gradient_angle)); + gp.ys_inv = 1.f / gp.ys; + gp.top_edge_0 = gp.yc - gp.ys / 2.f; - if (gp.ys < 1.0 / h) { + if (h * gp.ys < 1.f) { gp.ys_inv = 0; gp.ys = 0; } @@ -723,7 +723,7 @@ static float calcGradientFactor (const struct grad_params& gp, int x, int y) val = 1.f - pow3 (xcosf (val)); } - return gp.scale + val * (1.0 - gp.scale); + return gp.scale + val * (1.f - gp.scale); } } else { int gy = gp.transpose ? x : y; @@ -747,7 +747,7 @@ static float calcGradientFactor (const struct grad_params& gp, int x, int y) val = 1.f - pow3 (xcosf (val)); } - return gp.scale + val * (1.0 - gp.scale); + return gp.scale + val * (1.f - gp.scale); } } } @@ -766,7 +766,7 @@ static void calcPCVignetteParams (int fW, int fH, int oW, int oH, const PCVignet { // ellipse formula: (x/a)^2 + (y/b)^2 = 1 - double roundness = pcvignette.roundness / 100.0; + float roundness = pcvignette.roundness / 100.f; pcv.feather = pcvignette.feather / 100.0; if (crop.enabled) { @@ -783,42 +783,40 @@ static void calcPCVignetteParams (int fW, int fH, int oW, int oH, const PCVignet pcv.h = oH; } - pcv.fadeout_mul = 1.0 / (0.05 * sqrtf (oW * oW + oH * oH)); + pcv.fadeout_mul = 20.0 / rtengine::norm2(static_cast(oW), static_cast(oW)); float short_side = (pcv.w < pcv.h) ? pcv.w : pcv.h; float long_side = (pcv.w > pcv.h) ? pcv.w : pcv.h; pcv.sep = 2; pcv.sepmix = 0; - pcv.oe_a = sqrt (2.0) * long_side * 0.5; + pcv.oe_a = std::sqrt(2.f) * long_side * 0.5f; pcv.oe_b = pcv.oe_a * short_side / long_side; - pcv.ie_mul = (1.0 / sqrt (2.0)) * (1.0 - pcv.feather); + pcv.ie_mul = (1.f - pcv.feather) / std::sqrt(2.f); pcv.is_super_ellipse_mode = false; pcv.is_portrait = (pcv.w < pcv.h); - if (roundness < 0.5) { + if (roundness < 0.5f) { // make super-ellipse of higher and higher degree pcv.is_super_ellipse_mode = true; - float sepf = 2 + 4 * powf (1.0 - 2 * roundness, 1.3); // gamma 1.3 used to balance the effect in the 0.0...0.5 roundness range + float sepf = 2 + 4 * std::pow(1.f - 2 * roundness, 1.3f); // gamma 1.3 used to balance the effect in the 0.0...0.5 roundness range pcv.sep = ((int)sepf) & ~0x1; - pcv.sepmix = (sepf - pcv.sep) * 0.5; // 0.0 to 1.0 - pcv.oe1_a = powf (2.0, 1.0 / pcv.sep) * long_side * 0.5; + pcv.sepmix = (sepf - pcv.sep) * 0.5f; // 0.0 to 1.0 + pcv.oe1_a = std::pow(2.f, 1.f / pcv.sep) * long_side * 0.5f; pcv.oe1_b = pcv.oe1_a * short_side / long_side; - pcv.ie1_mul = (1.0 / powf (2.0, 1.0 / pcv.sep)) * (1.0 - pcv.feather); - pcv.oe2_a = powf (2.0, 1.0 / (pcv.sep + 2)) * long_side * 0.5; + pcv.ie1_mul = (1.f - pcv.feather) / std::pow(2.f, 1.f / pcv.sep); + pcv.oe2_a = std::pow(2.f, 1.f / (pcv.sep + 2)) * long_side * 0.5f; pcv.oe2_b = pcv.oe2_a * short_side / long_side; - pcv.ie2_mul = (1.0 / powf (2.0, 1.0 / (pcv.sep + 2))) * (1.0 - pcv.feather); - } - - if (roundness > 0.5) { + pcv.ie2_mul = (1.f - pcv.feather) / std::pow(2.f, 1.f / (pcv.sep + 2)); + } else if (roundness > 0.5f) { // scale from fitted ellipse towards circle - float rad = sqrtf (pcv.w * pcv.w + pcv.h * pcv.h) / 2.0; + float rad = rtengine::norm2(static_cast(pcv.w), static_cast(pcv.h)) / 2.f; float diff_a = rad - pcv.oe_a; float diff_b = rad - pcv.oe_b; - pcv.oe_a = pcv.oe_a + diff_a * 2 * (roundness - 0.5); - pcv.oe_b = pcv.oe_b + diff_b * 2 * (roundness - 0.5); + pcv.oe_a = pcv.oe_a + diff_a * 2 * (roundness - 0.5f); + pcv.oe_b = pcv.oe_b + diff_b * 2 * (roundness - 0.5f); } - pcv.scale = powf (2, -pcvignette.strength); + pcv.scale = std::pow(2, -pcvignette.strength); if (pcvignette.strength >= 6.0) { pcv.scale = 0.0; @@ -954,23 +952,23 @@ void ImProcFunctions::transformLuminanceOnly (Imagefloat* original, Imagefloat* double r = sqrt (vig_x_d * vig_x_d + vig_y_d * vig_y_d); if (darkening) { - factor /= std::max (v + mul * tanh (b * (maxRadius - r) / maxRadius), 0.001); + factor /= std::max (v + mul * tanh(b * (maxRadius - r) / maxRadius), 0.001); } else { - factor = v + mul * tanh (b * (maxRadius - r) / maxRadius); + factor = v + mul * tanh(b * (maxRadius - r) / maxRadius); } } if (applyGradient) { - factor *= calcGradientFactor (gp, cx + x, cy + y); + factor *= static_cast(calcGradientFactor(gp, cx + x, cy + y)); } if (applyPCVignetting) { - factor *= calcPCVignetteFactor (pcv, cx + x, cy + y); + factor *= static_cast(calcPCVignetteFactor(pcv, cx + x, cy + y)); } - transformed->r (y, x) = original->r (y, x) * factor; - transformed->g (y, x) = original->g (y, x) * factor; - transformed->b (y, x) = original->b (y, x) * factor; + transformed->r(y, x) = static_cast(original->r(y, x)) * factor; + transformed->g(y, x) = static_cast(original->g(y, x)) * factor; + transformed->b(y, x) = static_cast(original->b(y, x)) * factor; } } } @@ -1147,11 +1145,11 @@ void ImProcFunctions::transformGeneral(bool highQuality, Imagefloat *original, I } if (enableGradient) { - vignmul *= calcGradientFactor(gp, cx + x, cy + y); + vignmul *= static_cast(calcGradientFactor(gp, cx + x, cy + y)); } if (enablePCVignetting) { - vignmul *= calcPCVignetteFactor(pcv, cx + x, cy + y); + vignmul *= static_cast(calcPCVignetteFactor(pcv, cx + x, cy + y)); } if (yc > 0 && yc < original->getHeight() - 2 && xc > 0 && xc < original->getWidth() - 2) { diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index 14e5f3c44..8636ecb95 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -48,7 +48,7 @@ void fillCurveArrayVib (DiagonalCurve* diagCurve, LUTf &outCurve) // change to [0,1] range // apply custom/parametric/NURBS curve, if any // and store result in a temporary array - outCurve[i] = 65535.f * diagCurve->getVal ( double (i) / 65535.0 ); + outCurve[i] = 65535.0 * diagCurve->getVal(i / 65535.0); } } else { outCurve.makeIdentity(); @@ -606,7 +606,7 @@ void ImProcFunctions::vibrance (LabImage* lab) bool inGamut; const float fyy = Color::c1By116 * Lprov + Color::c16By116; - const float yy_ = (Lprov > Color::epskap) ? fyy * fyy*fyy : Lprov / Color::kappaf; + const float yy_ = (Lprov > static_cast(Color::epskap)) ? fyy * fyy*fyy : Lprov / Color::kappaf; float ChprovOld = std::numeric_limits::min(); do { inGamut = true; diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 7c0dc368b..0e621b254 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -50,13 +50,6 @@ #include "cplx_wavelet_dec.h" -#define TS 64 // Tile size -#define offset 25 // shift between tiles -#define fTS ((TS/2+1)) // second dimension of Fourier tiles -#define blkrad 1 // radius of block averaging - -#define epsilon 0.001f/(TS*TS) //tolerance - namespace rtengine { @@ -904,10 +897,10 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const //init for edge and denoise float vari[4]; - vari[0] = 8.f * SQR((cp.lev0n / 125.0) * (1.0 + cp.lev0n / 25.0)); - vari[1] = 8.f * SQR((cp.lev1n / 125.0) * (1.0 + cp.lev1n / 25.0)); - vari[2] = 8.f * SQR((cp.lev2n / 125.0) * (1.0 + cp.lev2n / 25.0)); - vari[3] = 8.f * SQR((cp.lev3n / 125.0) * (1.0 + cp.lev3n / 25.0)); + vari[0] = 8.f * SQR((cp.lev0n / 125.f) * (1.f + cp.lev0n / 25.f)); + vari[1] = 8.f * SQR((cp.lev1n / 125.f) * (1.f + cp.lev1n / 25.f)); + vari[2] = 8.f * SQR((cp.lev2n / 125.f) * (1.f + cp.lev2n / 25.f)); + vari[3] = 8.f * SQR((cp.lev3n / 125.f) * (1.f + cp.lev3n / 25.f)); if((cp.lev0n > 0.1f || cp.lev1n > 0.1f || cp.lev2n > 0.1f || cp.lev3n > 0.1f) && cp.noiseena) { int edge = 1; @@ -1123,7 +1116,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const float Chprov1 = sqrtf(SQR(a) + SQR(b)); yBuffer[col] = (Chprov1 == 0.f) ? 1.f : a / Chprov1; xBuffer[col] = (Chprov1 == 0.f) ? 0.f : b / Chprov1; - chprovBuffer[col] = Chprov1 / 327.68; + chprovBuffer[col] = Chprov1 / 327.68f; } } @@ -1287,7 +1280,7 @@ void ImProcFunctions::Aver( float * RESTRICT DataList, int datalen, float &aver for(int i = 0; i < datalen; i++) { if(DataList[i] >= thres) { - averaP += DataList[i]; + averaP += static_cast(DataList[i]); if(DataList[i] > lmax) { lmax = DataList[i]; @@ -1295,7 +1288,7 @@ void ImProcFunctions::Aver( float * RESTRICT DataList, int datalen, float &aver countP++; } else if(DataList[i] < -thres) { - averaN += DataList[i]; + averaN += static_cast(DataList[i]); if(DataList[i] < lmin) { lmin = DataList[i]; @@ -1341,10 +1334,10 @@ void ImProcFunctions::Sigma( float * RESTRICT DataList, int datalen, float aver for(int i = 0; i < datalen; i++) { if(DataList[i] >= thres) { - variP += SQR(DataList[i] - averagePlus); + variP += static_cast(SQR(DataList[i] - averagePlus)); countP++; } else if(DataList[i] <= -thres) { - variN += SQR(DataList[i] - averageNeg); + variN += static_cast(SQR(DataList[i] - averageNeg)); countN++; } } @@ -1620,7 +1613,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * #endif for (int i = 0; i < W_L * H_L; i++) { - avedbl += WavCoeffs_L0[i]; + avedbl += static_cast(WavCoeffs_L0[i]); } #ifdef _OPENMP @@ -1709,7 +1702,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * #pragma omp parallel num_threads(wavNestedLevels) if(wavNestedLevels>1) #endif { - if(contrast != 0.f && cp.resena && max0 > 0.0) { // contrast = 0.f means that all will be multiplied by 1.f, so we can skip this step + if(contrast != 0.f && cp.resena && max0 > 0.f) { // contrast = 0.f means that all will be multiplied by 1.f, so we can skip this step { #ifdef _OPENMP #pragma omp for @@ -2018,7 +2011,7 @@ void ImProcFunctions::WaveletAandBAllAB(wavelet_decomposition &WaveletCoeffs_a, editWhatever->v(i,j) = valpar; } */ - float valparam = float((hhCurve->getVal(Color::huelab_to_huehsv2(hueR)) - 0.5f) * 1.7f) + hueR; //get H=f(H) 1.7 optimisation ! + float valparam = (static_cast(hhCurve->getVal(Color::huelab_to_huehsv2(hueR))) - 0.5f) * 1.7f + hueR; //get H=f(H) 1.7 optimisation ! float2 sincosval = xsincosf(valparam); WavCoeffs_a0[i * W_L + j] = chR * sincosval.y; WavCoeffs_b0[i * W_L + j] = chR * sincosval.x; @@ -3023,9 +3016,8 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit if(Chutili) { int i_i = i / W_L; int j_j = i - i_i * W_L; - double lr; float modhue2 = varhue[i_i][j_j]; - float valparam = float((ChCurve->getVal(lr = Color::huelab_to_huehsv2(modhue2)) - 0.5f)); //get valparam=f(H) + float valparam = static_cast(ChCurve->getVal(Color::huelab_to_huehsv2(modhue2))) - 0.5f; //get valparam=f(H) if(valparam > 0.f) { scale2 = 1.f + 3.f * valparam; //arbitrary value diff --git a/rtengine/jdatasrc.cc b/rtengine/jdatasrc.cc index 8c04a14a2..e461b60f5 100644 --- a/rtengine/jdatasrc.cc +++ b/rtengine/jdatasrc.cc @@ -25,11 +25,6 @@ #define JFREAD(file,buf,sizeofbuf) \ ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) -#define JFWRITE(file,buf,sizeofbuf) \ - ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) - - - /* Expanded data source object for stdio input */ namespace diff --git a/rtengine/klt/selectGoodFeatures.cc b/rtengine/klt/selectGoodFeatures.cc index 20e67fb2e..ccd7681db 100644 --- a/rtengine/klt/selectGoodFeatures.cc +++ b/rtengine/klt/selectGoodFeatures.cc @@ -9,7 +9,6 @@ #include /* fflush() */ #include /* memset() */ #include /* fsqrt() */ -#define fsqrt(X) sqrt(X) /* Our includes */ #include "base.h" diff --git a/rtengine/labimage.h b/rtengine/labimage.h index 79f003b07..7140d9de0 100644 --- a/rtengine/labimage.h +++ b/rtengine/labimage.h @@ -23,7 +23,7 @@ namespace rtengine { -class LabImage +class LabImage final { private: void allocLab(size_t w, size_t h); diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index c80a126f5..1826101e7 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -42,7 +42,6 @@ class rtengine::LCPProfile::LCPPersModel public: LCPPersModel(); bool hasModeData(LCPCorrectionMode mode) const; - void print() const; float focLen; float focDist; @@ -82,27 +81,18 @@ bool rtengine::LCPModelCommon::empty() const && param[2] == 0.0f; } -void rtengine::LCPModelCommon::print() const -{ - std::printf("focLen %g/%g; imgCenter %g/%g; scale %g; err %g\n", foc_len_x, foc_len_y, img_center_x, img_center_y, scale_factor, mean_error); - std::printf("xy0 %g/%g fxy %g/%g\n", x0, y0, fx, fy); - std::printf("param: %g/%g/%g/%g/%g\n", param[0], param[1], param[2], param[3], param[4]); -} - // weighted merge two parameters void rtengine::LCPModelCommon::merge(const LCPModelCommon& a, const LCPModelCommon& b, float facA) { - const float facB = 1.0f - facA; - - foc_len_x = facA * a.foc_len_x + facB * b.foc_len_x; - foc_len_y = facA * a.foc_len_y + facB * b.foc_len_y; - img_center_x = facA * a.img_center_x + facB * b.img_center_x; - img_center_y = facA * a.img_center_y + facB * b.img_center_y; - scale_factor = facA * a.scale_factor + facB * b.scale_factor; - mean_error = facA * a.mean_error + facB * b.mean_error; + foc_len_x = rtengine::intp(facA, a.foc_len_x, b.foc_len_x); + foc_len_y = rtengine::intp(facA, a.foc_len_y, b.foc_len_y); + img_center_x = rtengine::intp(facA, a.img_center_x, b.img_center_x); + img_center_y = rtengine::intp(facA, a.img_center_y, b.img_center_y); + scale_factor = rtengine::intp(facA, a.scale_factor, b.scale_factor); + mean_error = rtengine::intp(facA, a.mean_error, b.mean_error); for (int i = 0; i < 5; ++i) { - param[i] = facA * a.param[i] + facB * b.param[i]; + param[i] = rtengine::intp(facA, a.param[i], b.param[i]); } const float param0Sqr = param[0] * param[0]; @@ -152,7 +142,6 @@ void rtengine::LCPModelCommon::prepareParams( rfx = 1.0f / fx; rfy = 1.0f / fy; - //std::printf("FW %i /X0 %g FH %i /Y0 %g %g\n",fullWidth,x0,fullHeight,y0, imgYCenter); } rtengine::LCPProfile::LCPPersModel::LCPPersModel() : @@ -188,35 +177,6 @@ bool rtengine::LCPProfile::LCPPersModel::hasModeData(LCPCorrectionMode mode) con return false; } -void rtengine::LCPProfile::LCPPersModel::print() const -{ - std::printf("--- PersModel focLen %g; focDist %g; aperture %g\n", focLen, focDist, aperture); - std::printf("Base:\n"); - base.print(); - - if (!chromRG.empty()) { - std::printf("ChromRG:\n"); - chromRG.print(); - } - - if (!chromG.empty()) { - std::printf("ChromG:\n"); - chromG.print(); - } - - if (!chromBG.empty()) { - std::printf("ChromBG:\n"); - chromBG.print(); - } - - if (!vignette.empty()) { - std::printf("Vignette:\n"); - vignette.print(); - } - - std::printf("\n"); -} - rtengine::LCPProfile::LCPProfile(const Glib::ustring& fname) : isFisheye(false), sensorFormatFactor(1.f), @@ -522,7 +482,7 @@ void rtengine::LCPProfile::calcParams( ) { // Mix in aperture const float facAperLow = (pHigh->aperture - aperture) / (pHigh->aperture - pLow->aperture); - facLow = focLenOnSpot ? facAperLow : (0.5 * facLow + 0.5 * facAperLow); + facLow = focLenOnSpot ? facAperLow : (0.5f * (facLow + facAperLow)); } else if ( mode != LCPCorrectionMode::VIGNETTE @@ -532,7 +492,7 @@ void rtengine::LCPProfile::calcParams( ) { // focus distance for all else (if focus distance is given) const float facDistLow = (std::log(pHigh->focDist) + euler - focusDistLog) / (std::log(pHigh->focDist) - std::log(pLow->focDist)); - facLow = focLenOnSpot ? facDistLow : (0.8 * facLow + 0.2 * facDistLow); + facLow = focLenOnSpot ? facDistLow : (0.8f * facLow + 0.2f * facDistLow); } switch (mode) { @@ -555,7 +515,16 @@ void rtengine::LCPProfile::calcParams( } if (settings->verbose) { - std::printf("LCP mode=%i, dist: %g found frames: Fno %g-%g; FocLen %g-%g; Dist %g-%g with weight %g\n", toUnderlying(mode), focusDist, pLow->aperture, pHigh->aperture, pLow->focLen, pHigh->focLen, pLow->focDist, pHigh->focDist, facLow); + std::printf("LCP mode=%i, dist: %g found frames: Fno %g-%g; FocLen %g-%g; Dist %g-%g with weight %g\n", + toUnderlying(mode), + static_cast(focusDist), + static_cast(pLow->aperture), + static_cast(pHigh->aperture), + static_cast(pLow->focLen), + static_cast(pHigh->focLen), + static_cast(pLow->focDist), + static_cast(pHigh->focDist), + static_cast(facLow)); } } else { if (settings->verbose) { @@ -564,15 +533,6 @@ void rtengine::LCPProfile::calcParams( } } -void rtengine::LCPProfile::print() const -{ - std::printf("=== Profile %s\n", profileName.c_str()); - std::printf("Frames: %i, RAW: %i; Fisheye: %i; Sensorformat: %f\n", persModelCount, isRaw, isFisheye, sensorFormatFactor); - - for (int pm = 0; pm < persModelCount; ++pm) { - aPersModel[pm]->print(); - } -} // from all frames not marked as bad already, take average and filter out frames with higher deviation than this if there are enough values int rtengine::LCPProfile::filterBadFrames(LCPCorrectionMode mode, double maxAvgDevFac, int minFramesLeft) @@ -649,7 +609,7 @@ int rtengine::LCPProfile::filterBadFrames(LCPCorrectionMode mode, double maxAvgD } if (settings->verbose && count) { - std::printf("Filtered %.1f%% frames for maxAvgDevFac %g leaving %i\n", filtered * 100.f / count, maxAvgDevFac, count - filtered); + std::printf("Filtered %.1f%% frames for maxAvgDevFac %g leaving %i\n", filtered * 100.0 / count, maxAvgDevFac, count - filtered); } } @@ -1007,7 +967,7 @@ rtengine::LCPMapper::LCPMapper( const bool mirrorX = (rot == 90 || rot == 180); const bool mirrorY = (rot == 180 || rot == 270); if (settings->verbose) { - std::printf("Vign: %i, fullWidth: %i/%i, focLen %g SwapXY: %i / MirX/Y %i / %i on rot:%i from %i\n",vignette, fullWidth, fullHeight, focalLength, swapXY, mirrorX, mirrorY, rot, rawRotationDeg); + std::printf("Vign: %i, fullWidth: %i/%i, focLen %g SwapXY: %i / MirX/Y %i / %i on rot:%i from %i\n",vignette, fullWidth, fullHeight, static_cast(focalLength), swapXY, mirrorX, mirrorY, rot, rawRotationDeg); } pProf->calcParams(vignette ? LCPCorrectionMode::VIGNETTE : LCPCorrectionMode::DISTORTION, focalLength, focusDist, aperture, &mc, nullptr, nullptr); @@ -1038,8 +998,8 @@ void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy if (isFisheye) { const double u = x * scale; const double v = y * scale; - const double u0 = mc.x0 * scale; - const double v0 = mc.y0 * scale; + const double u0 = static_cast(mc.x0) * scale; + const double v0 = static_cast(mc.y0) * scale; const double du = (u - u0); const double dv = (v - v0); const double fx = mc.fx; @@ -1059,22 +1019,22 @@ void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy } else { x *= scale; y *= scale; - const double x0 = mc.x0 * scale; - const double y0 = mc.y0 * scale; - const double xd = (x - x0) / mc.fx, yd = (y - y0) / mc.fy; + const double x0 = static_cast(mc.x0) * scale; + const double y0 = static_cast(mc.y0) * scale; + const double xd = (x - x0) / static_cast(mc.fx), yd = (y - y0) / static_cast(mc.fy); - const LCPModelCommon::Param aDist = mc.param; + const auto& aDist = mc.param; const double rsqr = xd * xd + yd * yd; - const double xfac = aDist[swapXY ? 3 : 4], yfac = aDist[swapXY ? 4 : 3]; + const double xfac = static_cast(aDist[swapXY ? 3 : 4]), yfac = static_cast(aDist[swapXY ? 4 : 3]); - const double commonFac = (((aDist[2] * rsqr + aDist[1]) * rsqr + aDist[0]) * rsqr + 1.) + const double commonFac = (((static_cast(aDist[2]) * rsqr + static_cast(aDist[1])) * rsqr + static_cast(aDist[0])) * rsqr + 1.) + 2. * (yfac * yd + xfac * xd); const double xnew = xd * commonFac + xfac * rsqr; const double ynew = yd * commonFac + yfac * rsqr; - x = xnew * mc.fx + x0; - y = ynew * mc.fy + y0; + x = xnew * static_cast(mc.fx) + x0; + y = ynew * static_cast(mc.fy) + y0; } x -= cx * scale; @@ -1094,20 +1054,20 @@ void rtengine::LCPMapper::correctCA(double& x, double& y, int cx, int cy, int ch // First calc the green channel like normal distortion // the other are just deviations from it - double xd = (x - chrom[1].x0) / chrom[1].fx; - double yd = (y - chrom[1].y0) / chrom[1].fy; + double xd = (x - static_cast(chrom[1].x0)) / static_cast(chrom[1].fx); + double yd = (y - static_cast(chrom[1].y0)) / static_cast(chrom[1].fy); // Green contains main distortion, just like base if (useCADist) { - const LCPModelCommon::Param aDist = chrom[1].param; - double rsqr = xd * xd + yd * yd; - double xfac = aDist[swapXY ? 3 : 4], yfac = aDist[swapXY ? 4 : 3]; + const auto& aDist = chrom[1].param; + double rsqr = xd * xd + yd * yd; + double xfac = static_cast(aDist[swapXY ? 3 : 4]), yfac = static_cast(aDist[swapXY ? 4 : 3]); - double commonFac = (((aDist[2] * rsqr + aDist[1]) * rsqr + aDist[0]) * rsqr + 1.) + double commonFac = (((static_cast(aDist[2]) * rsqr + static_cast(aDist[1])) * rsqr + static_cast(aDist[0])) * rsqr + 1.) + 2. * (yfac * yd + xfac * xd); - xgreen = xd * commonFac + aDist[4] * rsqr; - ygreen = yd * commonFac + aDist[3] * rsqr; + xgreen = xd * commonFac + static_cast(aDist[4]) * rsqr; + ygreen = yd * commonFac + static_cast(aDist[3]) * rsqr; } else { xgreen = xd; ygreen = yd; @@ -1115,20 +1075,20 @@ void rtengine::LCPMapper::correctCA(double& x, double& y, int cx, int cy, int ch if (channel == 1) { // green goes directly - x = xgreen * chrom[1].fx + chrom[1].x0; - y = ygreen * chrom[1].fy + chrom[1].y0; + x = xgreen * static_cast(chrom[1].fx) + static_cast(chrom[1].x0); + y = ygreen * static_cast(chrom[1].fy) + static_cast(chrom[1].y0); } else { // others are diffs from green xd = xgreen; yd = ygreen; const double rsqr = xd * xd + yd * yd; - const LCPModelCommon::Param aCA = chrom[channel].param; - const double xfac = aCA[swapXY ? 3 : 4], yfac = aCA[swapXY ? 4 : 3]; - const double commonSum = 1. + rsqr * (aCA[0] + rsqr * (aCA[1] + aCA[2] * rsqr)) + 2. * (yfac * yd + xfac * xd); + const auto& aCA = chrom[channel].param; + const double xfac = static_cast(aCA[swapXY ? 3 : 4]), yfac = static_cast(aCA[swapXY ? 4 : 3]); + const double commonSum = 1. + rsqr * (static_cast(aCA[0]) + rsqr * (static_cast(aCA[1]) + static_cast(aCA[2] )* rsqr)) + 2. * (yfac * yd + xfac * xd); - x = (chrom[channel].scale_factor * ( xd * commonSum + xfac * rsqr )) * chrom[channel].fx + chrom[channel].x0; - y = (chrom[channel].scale_factor * ( yd * commonSum + yfac * rsqr )) * chrom[channel].fy + chrom[channel].y0; + x = (static_cast(chrom[channel].scale_factor) * ( xd * commonSum + xfac * rsqr )) * static_cast(chrom[channel].fx) + static_cast(chrom[channel].x0); + y = (static_cast(chrom[channel].scale_factor) * ( yd * commonSum + yfac * rsqr )) * static_cast(chrom[channel].fy) + static_cast(chrom[channel].y0); } x -= cx; diff --git a/rtengine/lcp.h b/rtengine/lcp.h index 2e36fe113..4c1e09865 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -54,7 +54,6 @@ public: LCPModelCommon(); bool empty() const; // is it empty - void print() const; // printf all values void merge(const LCPModelCommon& a, const LCPModelCommon& b, float facA); void prepareParams( int fullWidth, @@ -106,7 +105,6 @@ public: LCPModelCommon *pCorr3 ) const; // Interpolates between the persModels frames - void print() const; //private: // Common data diff --git a/rtengine/lmmse_demosaic.cc b/rtengine/lmmse_demosaic.cc index f4af1b801..5c4ddffed 100644 --- a/rtengine/lmmse_demosaic.cc +++ b/rtengine/lmmse_demosaic.cc @@ -334,7 +334,7 @@ void RawImageSource::lmmse_interpolate_omp(int winw, int winh, const array2D +* +* 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 "color.h" + +using namespace std; + +namespace rtengine +{ + +/* + * MunsellLch correction + * Copyright (c) 2012 Jacques Desmis + * Copyright (c) 2020 Ingo Weyrich + * + * Find the right LUT and calculate the correction + */ +void Color::MunsellLch (float lum, float hue, float chrom, float memChprov, float &correction, int zone, float &lbe, bool &correctL) +{ + + const int x = memChprov; + int y = chrom; + + //begin PB correction + sky + if (zone == 1) { + if (lum > 5.f) { + if (lum < 15.f) { + if (x <= 45 && (hue >= (_15PB10[x] - 0.035f)) && (hue < (_15PB10[x] + 0.052f))) { + if (y > 49) { + y = 49; + } + correction = _15PB10[y] - _15PB10[x] ; + lbe = _15PB10[y]; + correctL = true; + } else if (x <= 85 && (hue >= ( _3PB10[x] - 0.052f)) && (hue < (_45PB10[x] + _3PB10[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _3PB10[y] - _3PB10[x]; + lbe = _3PB10[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_45PB10[x] + _3PB10[x]) * 0.5f) && (hue < (_45PB10[x] + 0.052f))) { + if (y > 89) { + y = 89; + } + correction = _45PB10[y] - _45PB10[x] ; + lbe = _45PB10[y]; + correctL = true; + } else if ((hue >= (_6PB10[x] - 0.052f) && (hue < (_6PB10[x] + _75PB10[x]) * 0.5f))) { + correction = _6PB10[y] - _6PB10[x] ; + lbe = _6PB10[y]; + correctL = true; + } else if ((hue >= (_6PB10[x] + _75PB10[x]) * 0.5f) && (hue < (_9PB10[x] + _75PB10[x]) * 0.5f)) { + correction = _75PB10[y] - _75PB10[x] ; + lbe = _75PB10[y]; + correctL = true; + } else if ((hue >= (_9PB10[x] + _75PB10[x]) * 0.5f) && (hue < (_9PB10[x] + _10PB10[x]) * 0.5f)) { + correction = _9PB10[y] - _9PB10[x] ; + lbe = _9PB10[y]; + correctL = true; + } else if ((hue >= (_10PB10[x] + _9PB10[x]) * 0.5f) && (hue < (_1P10[x] + _10PB10[x]) * 0.5f)) { + correction = _10PB10[y] - _10PB10[x] ; + lbe = _10PB10[y]; + correctL = true; + } else if ((hue >= (_10PB10[x] + _1P10[x]) * 0.5f) && (hue < (_1P10[x] + _4P10[x]) * 0.5f)) { + correction = _1P10[y] - _1P10[x]; + lbe = _1P10[y]; + correctL = true; + } else if ((hue >= (_1P10[x] + _4P10[x]) * 0.5f) && (hue < (0.035f + _4P10[x]) * 0.5f)) { + correction = _4P10[y] - _4P10[x] ; + lbe = _4P10[y]; + correctL = true; + } + } else if (lum < 25.f) { + if (x <= 85 && (hue >= (_15PB20[x] - 0.035f)) && (hue < (_15PB20[x] + _3PB20[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _15PB20[y] - _15PB20[x] ; + lbe = _15PB20[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_15PB20[x] + _3PB20[x]) * 0.5f) && (hue < (_45PB20[x] + _3PB20[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _3PB20[y] - _3PB20[x] ; + lbe = _3PB20[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_45PB20[x] + _3PB20[x]) * 0.5f) && (hue < ( _45PB20[x] + 0.052f))) { + if (y > 89) { + y = 89; + } + correction = _45PB20[y] - _45PB20[x] ; + lbe = _45PB20[y]; + correctL = true; + } else if ((hue >= (_45PB20[x] + 0.052f)) && (hue < (_6PB20[x] + _75PB20[x]) * 0.5f)) { + correction = _6PB20[y] - _6PB20[x]; + lbe = _6PB20[y]; + correctL = true; + } else if ((hue >= (_6PB20[x] + _75PB20[x]) * 0.5f) && (hue < (_9PB20[x] + _75PB20[x]) * 0.5f)) { + correction = _75PB20[y] - _75PB20[x] ; + lbe = _75PB20[y]; + correctL = true; + } else if ((hue >= (_9PB20[x] + _75PB20[x]) * 0.5f) && (hue < (_9PB20[x] + _10PB20[x]) * 0.5f)) { + correction = _9PB20[y] - _9PB20[x] ; + lbe = _9PB20[y]; + correctL = true; + } else if ((hue >= (_10PB20[x] + _9PB20[x]) * 0.5f) && (hue < (_1P20[x] + _10PB20[x]) * 0.5f)) { + correction = _10PB20[y] - _10PB20[x] ; + lbe = _10PB20[y]; + correctL = true; + } else if ((hue >= (_10PB20[x] + _1P20[x]) * 0.5f) && (hue < (_1P20[x] + _4P20[x]) * 0.5f)) { + correction = _1P20[y] - _1P20[x] ; + lbe = _1P20[y]; + correctL = true; + } else if ((hue >= (_1P20[x] + _4P20[x]) * 0.5f) && (hue < (0.035f + _4P20[x]) * 0.5f)) { + correction = _4P20[y] - _4P20[x] ; + lbe = _4P20[y]; + correctL = true; + } + } else if (lum < 35.f) { + if (x <= 85 && (hue >= (_15PB30[x] - 0.035f)) && (hue < (_15PB30[x] + _3PB30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _15PB30[y] - _15PB30[x] ; + lbe = _15PB30[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_15PB30[x] + _3PB30[x]) * 0.5f) && (hue < (_45PB30[x] + _3PB30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _3PB30[y] - _3PB30[x] ; + lbe = _3PB30[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_45PB30[x] + _3PB30[x]) * 0.5f) && (hue < (_45PB30[x] + 0.052f))) { + if (y > 89) { + y = 89; + } + correction = _45PB30[y] - _45PB30[x] ; + lbe = _45PB30[y]; + correctL = true; + } else if ((hue >= ( _45PB30[x] + 0.052f)) && (hue < (_6PB30[x] + _75PB30[x]) * 0.5f)) { + correction = _6PB30[y] - _6PB30[x] ; + lbe = _6PB30[y]; + correctL = true; + } else if ((hue >= (_6PB30[x] + _75PB30[x]) * 0.5f) && (hue < (_9PB30[x] + _75PB30[x]) * 0.5f)) { + correction = _75PB30[y] - _75PB30[x] ; + lbe = _75PB30[y] ; + correctL = true; + } else if ((hue >= (_9PB30[x] + _75PB30[x]) * 0.5f) && (hue < (_9PB30[x] + _10PB30[x]) * 0.5f)) { + correction = _9PB30[y] - _9PB30[x] ; + lbe = _9PB30[y]; + correctL = true; + } else if ((hue >= (_10PB30[x] + _9PB30[x]) * 0.5f) && (hue < (_1P30[x] + _10PB30[x]) * 0.5f)) { + correction = _10PB30[y] - _10PB30[x] ; + lbe = _10PB30[y]; + correctL = true; + } else if ((hue >= (_10PB30[x] + _1P30[x]) * 0.5f) && (hue < (_1P30[x] + _4P30[x]) * 0.5f)) { + correction = _1P30[y] - _1P30[x] ; + lbe = _1P30[y]; + correctL = true; + } else if ((hue >= (_1P30[x] + _4P30[x]) * 0.5f) && (hue < (0.035f + _4P30[x]) * 0.5f)) { + correction = _4P30[y] - _4P30[x] ; + lbe = _4P30[y]; + correctL = true; + } + } else if (lum < 45.f) { + if (x < 75 && (hue <= (_05PB40[x] + _15PB40[x]) * 0.5f) && (hue > (_05PB40[x] + _10B40[x]) * 0.5f)) { + if (y > 75) { + y = 75; + } + correction = _05PB40[y] - _05PB40[x] ; + lbe = _05PB40[y]; + correctL = true; + } else if (x < 70 && (hue <= (_05PB40[x] + _10B40[x]) * 0.5f) && (hue > (_10B40[x] + _9B40[x]) * 0.5f)) { + if (y > 70) { + y = 70; + } + correction = _10B40[y] - _10B40[x] ; + lbe = _10B40[y]; + correctL = true; + } else if (x < 70 && (hue <= (_10B40[x] + _9B40[x]) * 0.5f) && (hue > (_9B40[x] + _7B40[x]) * 0.5f)) { + if (y > 70) { + y = 70; + } + correction = _9B40[y] - _9B40[x] ; + lbe = _9B40[y]; + correctL = true; + } else if (x < 70 && (hue <= (_9B40[x] + _7B40[x]) * 0.5f) && (hue > (_5B40[x] + _7B40[x]) * 0.5f)) { + if (y > 70) { + y = 70; + } + correction = _7B40[y] - _7B40[x] ; + lbe = _7B40[y]; + correctL = true; + } else if (x < 70 && (hue <= (_5B40[x] + _7B40[x]) * 0.5f) && (hue > (_5B40[x] - 0.035f))) { + if (y > 70) { + y = 70; // + } + correction = _5B40[y] - _5B40[x] ; + lbe = _5B40[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_15PB40[x] - 0.035f)) && (hue < (_15PB40[x] + _3PB40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _15PB40[y] - _15PB40[x] ; + lbe = _15PB40[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_15PB40[x] + _3PB40[x]) * 0.5f) && (hue < (_45PB40[x] + _3PB40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _3PB40[y] - _3PB40[x] ; + lbe = _3PB40[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_45PB40[x] + _3PB40[x]) * 0.5f) && (hue < (_45PB40[x] + 0.052f))) { + if (y > 89) { + y = 89; + } + correction = _45PB40[y] - _45PB40[x] ; + lbe = _45PB40[y] ; + correctL = true; + } else if ((hue >= (_45PB40[x] + 0.052f)) && (hue < (_6PB40[x] + _75PB40[x]) * 0.5f)) { + correction = _6PB40[y] - _6PB40[x] ; + lbe = _6PB40[y]; + correctL = true; + } else if ((hue >= (_6PB40[x] + _75PB40[x]) * 0.5f) && (hue < (_9PB40[x] + _75PB40[x]) * 0.5f)) { + correction = _75PB40[y] - _75PB40[x] ; + lbe = _75PB40[y]; + correctL = true; + } else if ((hue >= (_9PB40[x] + _75PB40[x]) * 0.5f) && (hue < (_9PB40[x] + _10PB40[x]) * 0.5f)) { + correction = _9PB40[y] - _9PB40[x] ; + lbe = _9PB40[y]; + correctL = true; + } else if ((hue >= (_10PB40[x] + _9PB40[x]) * 0.5f) && (hue < (_1P40[x] + _10PB40[x]) * 0.5f)) { + correction = _10PB40[y] - _10PB40[x] ; + lbe = _10PB40[y]; + correctL = true; + } else if ((hue >= (_10PB40[x] + _1P40[x]) * 0.5f) && (hue < (_1P40[x] + _4P40[x]) * 0.5f)) { + correction = _1P40[y] - _1P40[x] ; + lbe = _1P40[y]; + correctL = true; + } else if ((hue >= (_1P40[x] + _4P40[x]) * 0.5f) && (hue < (0.035f + _4P40[x]) * 0.5f)) { + correction = _4P40[y] - _4P40[x] ; + lbe = _4P40[y]; + correctL = true; + } + } else if (lum < 55.f) { + if (x < 79 && (hue <= (_05PB50[x] + _15PB50[x]) * 0.5f) && (hue > (_05PB50[x] + _10B50[x]) * 0.5f)) { + if (y > 79) { + y = 79; + } + correction = _05PB50[y] - _05PB50[x] ; + lbe = _05PB50[y]; + correctL = true; + } else if (x < 79 && (hue <= (_05PB50[x] + _10B50[x]) * 0.5f) && (hue > (_10B50[x] + _9B50[x]) * 0.5f)) { + if (y > 79) { + y = 79; + } + correction = _10B50[y] - _10B50[x] ; + lbe = _10B50[y]; + correctL = true; + } else if (x < 79 && (hue <= (_10B50[x] + _9B50[x]) * 0.5f) && (hue > (_9B50[x] + _7B50[x]) * 0.5f)) { + if (y > 79) { + y = 79; + } + correction = _9B50[y] - _9B50[x] ; + lbe = _9B50[y]; + correctL = true; + } else if (x < 79 && (hue <= (_9B50[x] + _7B50[x]) * 0.5f) && (hue > (_5B50[x] + _7B50[x]) * 0.5f)) { + if (y > 79) { + y = 79; + } + correction = _7B50[y] - _7B50[x] ; + lbe = _7B50[y]; + correctL = true; + } else if (x < 79 && (hue <= (_5B50[x] + _7B50[x]) * 0.5f) && (hue > (_5B50[x] - 0.035f))) { + if (y > 79) { + y = 79; // + } + correction = _5B50[y] - _5B50[x] ; + lbe = _5B50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_15PB50[x] - 0.035f)) && (hue < (_15PB50[x] + _3PB50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _15PB50[y] - _15PB50[x] ; + lbe = _15PB50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_15PB50[x] + _3PB50[x]) * 0.5f) && (hue < (_45PB50[x] + _3PB50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _3PB50[y] - _3PB50[x] ; + lbe = _3PB50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_45PB50[x] + _3PB50[x]) * 0.5f) && (hue < (_6PB50[x] + _45PB50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _45PB50[y] - _45PB50[x] ; + lbe = _45PB50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_6PB50[x] + _45PB50[x]) * 0.5f) && (hue < (_6PB50[x] + _75PB50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _6PB50[y] - _6PB50[x] ; + lbe = _6PB50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_6PB50[x] + _75PB50[x]) * 0.5f) && (hue < (_9PB50[x] + _75PB50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _75PB50[y] - _75PB50[x] ; + lbe = _75PB50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_9PB50[x] + _75PB50[x]) * 0.5f) && (hue < (_9PB50[x] + _10PB50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _9PB50[y] - _9PB50[x] ; + lbe = _9PB50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_10PB50[x] + _9PB50[x]) * 0.5f) && (hue < (_1P50[x] + _10PB50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10PB50[y] - _10PB50[x] ; + lbe = _10PB50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_10PB50[x] + _1P50[x]) * 0.5f) && (hue < (_1P50[x] + _4P50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _1P50[y] - _1P50[x] ; + lbe = _1P50[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_1P50[x] + _4P50[x]) * 0.5f) && (hue < (0.035f + _4P50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _4P50[y] - _4P50[x] ; + lbe = _4P50[y]; + correctL = true; + } + } else if (lum < 65.f) { + if (x < 79 && (hue <= (_05PB60[x] + _15PB60[x]) * 0.5f) && (hue > (_05PB60[x] + _10B60[x]) * 0.5f)) { + if (y > 79) { + y = 79; + } + correction = _05PB60[y] - _05PB60[x] ; + lbe = _05PB60[y]; + correctL = true; + } else if (x < 79 && (hue <= (_05PB60[x] + _10B60[x]) * 0.5f) && (hue > (_10B60[x] + _9B60[x]) * 0.5f)) { + if (y > 79) { + y = 79; + } + correction = _10B60[y] - _10B60[x] ; + lbe = _10B60[y]; + correctL = true; + } else if (x < 79 && (hue <= (_10B60[x] + _9B60[x]) * 0.5f) && (hue > (_9B60[x] + _7B60[x]) * 0.5f)) { + if (y > 79) { + y = 79; + } + correction = _9B60[y] - _9B60[x] ; + lbe = _9B60[y]; + correctL = true; + } else if (x < 79 && (hue <= (_9B60[x] + _7B60[x]) * 0.5f) && (hue > (_5B60[x] + _7B60[x]) * 0.5f)) { + if (y > 79) { + y = 79; + } + correction = _7B60[y] - _7B60[x] ; + lbe = _7B60[y]; + correctL = true; + } else if (x < 79 && (hue <= (_5B60[x] + _7B60[x]) * 0.5f) && (hue > (_5B60[x] - 0.035f))) { + if (y > 79) { + y = 79; // + } + correction = _5B60[y] - _5B60[x] ; + lbe = _5B60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_15PB60[x] - 0.035f)) && (hue < (_15PB60[x] + _3PB60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _15PB60[y] - _15PB60[x] ; + lbe = _15PB60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_15PB60[x] + _3PB60[x]) * 0.5f) && (hue < (_45PB60[x] + _3PB60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _3PB60[y] - _3PB60[x] ; + lbe = _3PB60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_45PB60[x] + _3PB60[x]) * 0.5f) && (hue < (_6PB60[x] + _45PB60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _45PB60[y] - _45PB60[x] ; + lbe = _45PB60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_6PB60[x] + _45PB60[x]) * 0.5f) && (hue < (_6PB60[x] + _75PB60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _6PB60[y] - _6PB60[x] ; + lbe = _6PB60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_6PB60[x] + _75PB60[x]) * 0.5f) && (hue < (_9PB60[x] + _75PB60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _75PB60[y] - _75PB60[x] ; + lbe = _75PB60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_9PB60[x] + _75PB60[x]) * 0.5f) && (hue < (_9PB60[x] + _10PB60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _9PB60[y] - _9PB60[x] ; + lbe = _9PB60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_10PB60[x] + _9PB60[x]) * 0.5f) && (hue < (_1P60[x] + _10PB60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10PB60[y] - _10PB60[x] ; + lbe = _10PB60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_10PB60[x] + _1P60[x]) * 0.5f) && (hue < (_1P60[x] + _4P60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _1P60[y] - _1P60[x] ; + lbe = _1P60[y]; + correctL = true; + } else if (x <= 85 && (hue >= (_1P60[x] + _4P60[x]) * 0.5f) && (hue < (0.035f + _4P60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _4P60[y] - _4P60[x] ; + lbe = _4P60[y]; + correctL = true; + } + } else if (lum < 75.f) { + if (x < 50 && (hue <= (_05PB70[x] + _15PB70[x]) * 0.5f) && (hue > (_05PB70[x] + _10B70[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _05PB70[y] - _05PB70[x] ; + lbe = _05PB70[y]; + correctL = true; + } else if (x < 50 && (hue <= (_05PB70[x] + _10B70[x]) * 0.5f) && (hue > (_10B70[x] + _9B70[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _10B70[y] - _10B70[x] ; + lbe = _10B70[y]; + correctL = true; + } else if (x < 50 && (hue <= (_10B70[x] + _9B70[x]) * 0.5f) && (hue > (_9B70[x] + _7B70[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _9B70[y] - _9B70[x] ; + lbe = _9B70[y]; + correctL = true; + } else if (x < 50 && (hue <= (_9B70[x] + _7B70[x]) * 0.5f) && (hue > (_5B70[x] + _7B70[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _7B70[y] - _7B70[x] ; + lbe = _7B70[y]; + correctL = true; + } else if (x < 50 && (hue <= (_5B70[x] + _7B70[x]) * 0.5f) && (hue > (_5B70[x] - 0.035f))) { + if (y > 49) { + y = 49; // + } + correction = _5B70[y] - _5B70[x] ; + lbe = _5B70[y]; + correctL = true; + } else if (x < 50 && (hue >= (_15PB70[x] - 0.035f)) && (hue < (_15PB70[x] + _3PB70[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _15PB70[y] - _15PB70[x] ; + lbe = _15PB70[y]; + correctL = true; + } else if (x < 50 && (hue >= (_45PB70[x] + _3PB70[x]) * 0.5f) && (hue < (_6PB70[x] + _45PB70[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _45PB70[y] - _45PB70[x] ; + lbe = _45PB70[y]; + correctL = true; + } else if (x < 50 && (hue >= (_6PB70[x] + _45PB70[x]) * 0.5f) && (hue < (_6PB70[x] + _75PB70[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _6PB70[y] - _6PB70[x] ; + lbe = _6PB70[y]; + correctL = true; + } else if (x < 50 && (hue >= (_6PB70[x] + _75PB70[x]) * 0.5f) && (hue < (_9PB70[x] + _75PB70[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _75PB70[y] - _75PB70[x] ; + lbe = _75PB70[y]; + correctL = true; + } else if (x < 50 && (hue >= (_9PB70[x] + _75PB70[x]) * 0.5f) && (hue < (_9PB70[x] + 0.035f))) { + if (y > 49) { + y = 49; + } + correction = _9PB70[y] - _9PB70[x] ; + lbe = _9PB70[y]; + correctL = true; + } + } else if (lum < 85.f) { + if (x < 40 && (hue <= (_05PB80[x] + _15PB80[x]) * 0.5f) && (hue > (_05PB80[x] + _10B80[x]) * 0.5f)) { + if (y > 39) { + y = 39; + } + correction = _05PB80[y] - _05PB80[x] ; + lbe = _05PB80[y] ; + correctL = true; + } else if (x < 40 && (hue <= (_05PB80[x] + _10B80[x]) * 0.5f) && (hue > (_10B80[x] + _9B80[x]) * 0.5f)) { + if (y > 39) { + y = 39; + } + correction = _10B80[y] - _10B80[x] ; + lbe = _10B80[y]; + correctL = true; + } else if (x < 40 && (hue <= (_10B80[x] + _9B80[x]) * 0.5f) && (hue > (_9B80[x] + _7B80[x]) * 0.5f)) { + if (y > 39) { + y = 39; + } + correction = _9B80[y] - _9B80[x] ; + lbe = _9B80[y]; + correctL = true; + } else if (x < 50 &&(hue <= (_9B80[x] + _7B80[x]) * 0.5f) && (hue > (_5B80[x] + _7B80[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _7B80[y] - _7B80[x] ; + lbe = _7B80[y]; + correctL = true; + } else if (x < 50 && (hue <= (_5B80[x] + _7B80[x]) * 0.5f) && (hue > (_5B80[x] - 0.035f))) { + if (y > 49) { + y = 49; // + } + correction = _5B80[y] - _5B80[x] ; + lbe = _5B80[y]; + correctL = true; + } else if (x < 50 && (hue >= (_15PB80[x] - 0.035f)) && (hue < (_15PB80[x] + _3PB80[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _15PB80[y] - _15PB80[x] ; + lbe = _15PB80[y]; + correctL = true; + } else if (x < 50 && (hue >= (_45PB80[x] + _3PB80[x]) * 0.5f) && (hue < (_6PB80[x] + _45PB80[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _45PB80[y] - _45PB80[x] ; + lbe = _45PB80[y]; + correctL = true; + } else if (x < 50 && (hue >= (_6PB80[x] + _45PB80[x]) * 0.5f) && (hue < (_6PB80[x] + _75PB80[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _6PB80[y] - _6PB80[x] ; + lbe = _6PB80[y]; + correctL = true; + } else if (x < 50 && (hue >= (_6PB80[x] + _75PB80[x]) * 0.5f) && (hue < (_9PB80[x] + _75PB80[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _75PB80[y] - _75PB80[x] ; + lbe = _75PB80[y]; + correctL = true; + } else if (x < 50 && (hue >= (_9PB80[x] + _75PB80[x]) * 0.5f) && (hue < (_9PB80[x] + 0.035f))) { + if (y > 49) { + y = 49; + } + correction = _9PB80[y] - _9PB80[x] ; + lbe = _9PB80[y]; + correctL = true; + } + } + } + } else if (zone == 2) { //red yellow correction + if (lum > 15.f) { + if (lum < 25.f) { + if (x <= 45 && (hue <= (_10YR20[x] + 0.035f)) && (hue > (_10YR20[x] + _85YR20[x]) * 0.5f)) { + if (y > 49) { + y = 49; + } + correction = _10YR20[y] - _10YR20[x] ; + lbe = _10YR20[y]; + correctL = true; + } else if (x <= 45 && (hue <= (_85YR20[x] + _10YR20[x]) * 0.5f) && (hue > (_85YR20[x] + 0.035f))) { + if (y > 49) { + y = 49; + } + correction = _85YR20[y] - _85YR20[x] ; + lbe = _85YR20[y]; + correctL = true; + } + } else if (lum < 35.f) { + if (x < 85 && (hue <= (_10YR30[x] + 0.035f)) && (hue > (_10YR30[x] + _85YR30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10YR30[y] - _10YR30[x] ; + lbe = _10YR30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10YR30[x] + _85YR30[x]) * 0.5f) && (hue > (_85YR30[x] + _7YR30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _85YR30[y] - _85YR30[x] ; + lbe = _85YR30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_85YR30[x] + _7YR30[x]) * 0.5f) && (hue > (_7YR30[x] + _55YR30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _7YR30[y] - _7YR30[x] ; + lbe = _7YR30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_7YR30[x] + _55YR30[x]) * 0.5f) && (hue > (_55YR30[x] + _4YR30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _55YR30[y] - _55YR30[x] ; + lbe = _55YR30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_55YR30[x] + _4YR30[x]) * 0.5f) && (hue > (_4YR30[x] + _25YR30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _4YR30[y] - _4YR30[x] ; + lbe = _4YR30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_4YR30[x] + _25YR30[x]) * 0.5f) && (hue > (_25YR30[x] + _10R30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _25YR30[y] - _25YR30[x] ; + lbe = _25YR30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_25YR30[x] + _10R30[x]) * 0.5f) && (hue > (_10R30[x] + _9R30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10R30[y] - _10R30[x] ; + lbe = _10R30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10R30[x] + _9R30[x]) * 0.5f) && (hue > (_9R30[x] + _7R30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _9R30[y] - _9R30[x] ; + lbe = _9R30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_9R30[x] + _7R30[x]) * 0.5f) && (hue > (_7R30[x] - 0.035f))) { + if (y > 89) { + y = 89; + } + + correction = _7R30[y] - _7R30[x] ; + lbe = _7R30[y] ; + correctL = true; + } + } else if (lum < 45.f) { + if (x < 85 && (hue <= (_10YR40[x] + 0.035f)) && (hue > (_10YR40[x] + _85YR40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10YR40[y] - _10YR40[x] ; + lbe = _10YR40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10YR40[x] + _85YR40[x]) * 0.5f) && (hue > (_85YR40[x] + _7YR40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _85YR40[y] - _85YR40[x] ; + lbe = _85YR40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_85YR40[x] + _7YR40[x]) * 0.5f) && (hue > (_7YR40[x] + _55YR40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _7YR40[y] - _7YR40[x] ; + lbe = _7YR40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_7YR40[x] + _55YR40[x]) * 0.5f) && (hue > (_55YR40[x] + _4YR40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _55YR40[y] - _55YR40[x] ; + lbe = _55YR40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_55YR40[x] + _4YR40[x]) * 0.5f) && (hue > (_4YR40[x] + _25YR40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _4YR40[y] - _4YR40[x] ; + lbe = _4YR40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_4YR40[x] + _25YR40[x]) * 0.5f) && (hue > (_25YR40[x] + _10R40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _25YR40[y] - _25YR40[x] ; + lbe = _25YR40[y] ; + correctL = true; + } else if (x < 85 && (hue <= (_25YR40[x] + _10R40[x]) * 0.5f) && (hue > (_10R40[x] + _9R40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10R40[y] - _10R40[x] ; + lbe = _10R40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10R40[x] + _9R40[x]) * 0.5f) && (hue > (_9R40[x] + _7R40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _9R40[y] - _9R40[x] ; + lbe = _9R40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_9R40[x] + _7R40[x]) * 0.5f) && (hue > (_7R40[x] - 0.035f))) { + if (y > 89) { + y = 89; + } + correction = _7R40[y] - _7R40[x] ; + lbe = _7R40[y]; + correctL = true; + } + } else if (lum < 55.f) { + if (x < 85 && (hue <= (_10YR50[x] + 0.035f)) && (hue > (_10YR50[x] + _85YR50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10YR50[y] - _10YR50[x] ; + lbe = _10YR50[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10YR50[x] + _85YR50[x]) * 0.5f) && (hue > (_85YR50[x] + _7YR50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _85YR50[y] - _85YR50[x] ; + lbe = _85YR50[y]; + correctL = true; + } else if (x < 85 && (hue <= (_85YR50[x] + _7YR50[x]) * 0.5f) && (hue > (_7YR50[x] + _55YR50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _7YR50[y] - _7YR50[x] ; + lbe = _7YR50[y]; + correctL = true; + } else if (x < 85 && (hue <= (_7YR50[x] + _55YR50[x]) * 0.5f) && (hue > (_55YR50[x] + _4YR50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _55YR50[y] - _55YR50[x] ; + lbe = _55YR50[y]; + correctL = true; + } else if (x < 85 && (hue <= (_55YR50[x] + _4YR50[x]) * 0.5f) && (hue > (_4YR50[x] + _25YR50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _4YR50[y] - _4YR50[x] ; + lbe = _4YR50[y]; + correctL = true; + } else if (x < 85 && (hue <= (_4YR50[x] + _25YR50[x]) * 0.5f) && (hue > (_25YR50[x] + _10R50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _25YR50[y] - _25YR50[x] ; + lbe = _25YR50[y]; + correctL = true; + } else if (x < 85 && (hue <= (_25YR50[x] + _10R50[x]) * 0.5f) && (hue > (_10R50[x] + _9R50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10R50[y] - _10R50[x] ; + lbe = _10R50[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10R50[x] + _9R50[x]) * 0.5f) && (hue > (_9R50[x] + _7R50[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _9R50[y] - _9R50[x] ; + lbe = _9R50[y]; + correctL = true; + } else if (x < 85 && (hue <= (_9R50[x] + _7R50[x]) * 0.5f) && (hue > (_7R50[x] - 0.035f))) { + if (y > 89) { + y = 89; + } + correction = _7R50[y] - _7R50[x] ; + lbe = _7R50[y]; + correctL = true; + } + } else if (lum < 65.f) { + if ((hue <= (_10YR60[x] + 0.035f)) && (hue > (_10YR60[x] + _85YR60[x]) * 0.5f)) { + correction = _10YR60[y] - _10YR60[x] ; + lbe = _10YR60[y]; + correctL = true; + } else if ((hue <= (_10YR60[x] + _85YR60[x]) * 0.5f) && (hue > (_85YR60[x] + _7YR60[x]) * 0.5f)) { + correction = _85YR60[y] - _85YR60[x] ; + lbe = _85YR60[y]; + correctL = true; + } else if ((hue <= (_85YR60[x] + _7YR60[x]) * 0.5f) && (hue > (_7YR60[x] + _55YR60[x]) * 0.5f)) { + correction = _7YR60[y] - _7YR60[x] ; + lbe = _7YR60[y]; + correctL = true; + } else if ((hue <= (_7YR60[x] + _55YR60[x]) * 0.5f) && (hue > (_55YR60[x] + _4YR60[x]) * 0.5f)) { + correction = _55YR60[y] - _55YR60[x] ; + lbe = _55YR60[y]; + correctL = true; + } else if ((hue <= (_55YR60[x] + _4YR60[x]) * 0.5f) && (hue > (_4YR60[x] + _25YR60[x]) * 0.5f)) { + correction = _4YR60[y] - _4YR60[x] ; + lbe = _4YR60[y]; + correctL = true; + } else if (x < 85 && (hue <= (_4YR60[x] + _25YR60[x]) * 0.5f) && (hue > (_25YR60[x] + _10R60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _25YR60[y] - _25YR60[x] ; + lbe = _25YR60[y]; + correctL = true; + } else if (x < 85 && (hue <= (_25YR60[x] + _10R60[x]) * 0.5f) && (hue > (_10R60[x] + _9R60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10R60[y] - _10R60[x] ; + lbe = _10R60[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10R60[x] + _9R60[x]) * 0.5f) && (hue > (_9R60[x] + _7R60[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _9R60[y] - _9R60[x] ; + lbe = _9R60[y]; + correctL = true; + } else if (x < 85 && (hue <= (_9R60[x] + _7R60[x]) * 0.5f) && (hue > (_7R60[x] - 0.035f))) { + if (y > 89) { + y = 89; + } + correction = _7R60[y] - _7R60[x] ; + lbe = _7R60[y]; + correctL = true; + } + } else if (lum < 75.f) { + if ((hue <= (_10YR70[x] + 0.035f)) && (hue > (_10YR70[x] + _85YR70[x]) * 0.5f)) { + correction = _10YR70[y] - _10YR70[x] ; + lbe = _10YR70[y]; + correctL = true; + } else if ((hue <= (_10YR70[x] + _85YR70[x]) * 0.5f) && (hue > (_85YR70[x] + _7YR70[x]) * 0.5f)) { + correction = _85YR70[y] - _85YR70[x] ; + lbe = _85YR70[y]; + correctL = true; + } else if ((hue <= (_85YR70[x] + _7YR70[x]) * 0.5f) && (hue > (_7YR70[x] + _55YR70[x]) * 0.5f)) { + correction = _7YR70[y] - _7YR70[x] ; + lbe = _7YR70[y]; + correctL = true; + } else if ((hue <= (_7YR70[x] + _55YR70[x]) * 0.5f) && (hue > (_55YR70[x] + _4YR70[x]) * 0.5f)) { + correction = _55YR70[y] - _55YR70[x] ; + lbe = _55YR70[y]; + correctL = true; + } else if ((hue <= (_55YR70[x] + _4YR70[x]) * 0.5f) && (hue > (_4YR70[x] + _25YR70[x]) * 0.5f)) { + correction = _4YR70[y] - _4YR70[x] ; + lbe = _4YR70[y]; + correctL = true; + } else if (x < 85 && (hue <= (_4YR70[x] + _25YR70[x]) * 0.5f) && (hue > (_25YR70[x] + _10R70[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _25YR70[y] - _25YR70[x] ; + lbe = _25YR70[y]; + correctL = true; + } else if (x < 85 && (hue <= (_25YR70[x] + _10R70[x]) * 0.5f) && (hue > (_10R70[x] + _9R70[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10R70[y] - _10R70[x] ; + lbe = _10R70[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10R70[x] + _9R70[x]) * 0.5f) && (hue > (_9R70[x] + _7R70[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _9R70[y] - _9R70[x] ; + lbe = _9R70[y] ; + correctL = true; + } else if (x < 85 && (hue <= (_9R70[x] + _7R70[x]) * 0.5f) && (hue > (_7R70[x] - 0.035f))) { + if (y > 89) { + y = 89; + } + correction = _7R70[y] - _7R70[x] ; + lbe = _7R70[y]; + correctL = true; + } + } else if (lum < 85.f) { + if ((hue <= (_10YR80[x] + 0.035f)) && (hue > (_10YR80[x] + _85YR80[x]) * 0.5f)) { + correction = _10YR80[y] - _10YR80[x] ; + lbe = _10YR80[y]; + correctL = true; + } else if ((hue <= (_10YR80[x] + _85YR80[x]) * 0.5f) && (hue > (_85YR80[x] + _7YR80[x]) * 0.5f)) { + correction = _85YR80[y] - _85YR80[x] ; + lbe = _85YR80[y]; + } else if (x < 85 && (hue <= (_85YR80[x] + _7YR80[x]) * 0.5f) && (hue > (_7YR80[x] + _55YR80[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _7YR80[y] - _7YR80[x] ; + lbe = _7YR80[y]; + correctL = true; + } else if (x < 45 && (hue <= (_7YR80[x] + _55YR80[x]) * 0.5f) && (hue > (_55YR80[x] + _4YR80[x]) * 0.5f)) { + correction = _55YR80[y] - _55YR80[x] ; + lbe = _55YR80[y]; + correctL = true; + } else if (x < 45 && (hue <= (_55YR80[x] + _4YR80[x]) * 0.5f) && (hue > (_4YR80[x] - 0.035f))) { + if (y > 49) { + y = 49; + } + correction = _4YR80[y] - _4YR80[x] ; + lbe = _4YR80[y] ; + correctL = true; + } + } else if (lum < 95.f) { + if (x < 85 && (hue <= (_10YR90[x] + 0.035f)) && (hue > (_10YR90[x] - 0.035f))) { + if (y > 89) { + y = 89; + } + correction = _10YR90[y] - _10YR90[x] ; + lbe = _10YR90[y]; + correctL = true; + } else if (x < 85 && hue <= (_85YR90[x] + 0.035f) && hue > (_85YR90[x] - 0.035f)) { + if (y > 89) { + y = 89; + } + correction = _85YR90[y] - _85YR90[x] ; + lbe = _85YR90[y]; + correctL = true; + } else if (x < 45 && (hue <= (_55YR90[x] + 0.035f) && (hue > (_55YR90[x] - 0.035f)))) { + if (y > 49) { + y = 49; + } + correction = _55YR90[y] - _55YR90[x] ; + lbe = _55YR90[y]; + correctL = true; + } + } + } + } else if (zone == 3) { // //Green yellow correction + if (lum >= 25.f) { + if (lum < 35.f) { + if ((hue <= (_7G30[x] + 0.035f)) && (hue > (_7G30[x] + _5G30[x]) * 0.5f)) { + correction = _7G30[y] - _7G30[x] ; + lbe = _7G30[y]; + correctL = true; + } else if ((hue <= (_7G30[x] + _5G30[x]) * 0.5f) && (hue > (_5G30[x] + _25G30[x]) * 0.5f)) { + correction = _5G30[y] - _5G30[x] ; + lbe = _5G30[y]; + correctL = true; + } else if ((hue <= (_25G30[x] + _5G30[x]) * 0.5f) && (hue > (_25G30[x] + _1G30[x]) * 0.5f)) { + correction = _25G30[y] - _25G30[x] ; + lbe = _25G30[y]; + correctL = true; + } else if ((hue <= (_1G30[x] + _25G30[x]) * 0.5f) && (hue > (_1G30[x] + _10GY30[x]) * 0.5f)) { + correction = _1G30[y] - _1G30[x] ; + lbe = _1G30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_1G30[x] + _10GY30[x]) * 0.5f) && (hue > (_10GY30[x] + _75GY30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10GY30[y] - _10GY30[x] ; + lbe = _10GY30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10GY30[x] + _75GY30[x]) * 0.5f) && (hue > (_75GY30[x] + _5GY30[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _75GY30[y] - _75GY30[x] ; + lbe = _75GY30[y]; + correctL = true; + } else if (x < 85 && (hue <= (_5GY30[x] + _75GY30[x]) * 0.5f) && (hue > (_5GY30[x] - 0.035f))) { + if (y > 89) { + y = 89; + } + correction = _5GY30[y] - _5GY30[x] ; + lbe = _5GY30[y] ; + correctL = true; + } + } else if (lum < 45.f) { + if ((hue <= (_7G40[x] + 0.035f)) && (hue > (_7G40[x] + _5G40[x]) * 0.5f)) { + correction = _7G40[y] - _7G40[x] ; + lbe = _7G40[y]; + correctL = true; + } else if ((hue <= (_7G40[x] + _5G40[x]) * 0.5f) && (hue > (_5G40[x] + _25G40[x]) * 0.5f)) { + correction = _5G40[y] - _5G40[x] ; + lbe = _5G40[y]; + correctL = true; + } else if ((hue <= (_25G40[x] + _5G40[x]) * 0.5f) && (hue > (_25G40[x] + _1G40[x]) * 0.5f)) { + correction = _25G40[y] - _25G40[x] ; + lbe = _25G40[y]; + correctL = true; + } else if ((hue <= (_1G40[x] + _25G40[x]) * 0.5f) && (hue > (_1G40[x] + _10GY40[x]) * 0.5f)) { + correction = _1G40[y] - _1G40[x] ; + lbe = _1G40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_1G40[x] + _10GY40[x]) * 0.5f) && (hue > (_10GY40[x] + _75GY40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _10GY40[y] - _10GY40[x] ; + lbe = _10GY40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_10GY40[x] + _75GY40[x]) * 0.5f) && (hue > (_75GY40[x] + _5GY40[x]) * 0.5f)) { + if (y > 89) { + y = 89; + } + correction = _75GY40[y] - _75GY40[x] ; + lbe = _75GY40[y]; + correctL = true; + } else if (x < 85 && (hue <= (_5GY40[x] + _75GY40[x]) * 0.5f) && (hue > (_5GY40[x] - 0.035f))) { + if (y > 89) { + y = 89; // + } + correction = _5GY40[y] - _5GY40[x] ; + lbe = _5GY40[y]; + correctL = true; + } + } else if (lum < 55.f) { + if ((hue <= (_7G50[x] + 0.035f)) && (hue > (_7G50[x] + _5G50[x]) * 0.5f)) { + correction = _7G50[y] - _7G50[x] ; + lbe = _7G50[y]; + correctL = true; + } else if ((hue <= (_7G50[x] + _5G50[x]) * 0.5f) && (hue > (_5G50[x] + _25G50[x]) * 0.5f)) { + correction = _5G50[y] - _5G50[x] ; + lbe = _5G50[y]; + correctL = true; + } else if ((hue <= (_25G50[x] + _5G50[x]) * 0.5f) && (hue > (_25G50[x] + _1G50[x]) * 0.5f)) { + correction = _25G50[y] - _25G50[x] ; + lbe = _25G50[y]; + correctL = true; + } else if ((hue <= (_1G50[x] + _25G50[x]) * 0.5f) && (hue > (_1G50[x] + _10GY50[x]) * 0.5f)) { + correction = _1G50[y] - _1G50[x] ; + lbe = _1G50[y]; + correctL = true; + } else if ((hue <= (_1G50[x] + _10GY50[x]) * 0.5f) && (hue > (_10GY50[x] + _75GY50[x]) * 0.5f)) { + correction = _10GY50[y] - _10GY50[x] ; + lbe = _10GY50[y]; + correctL = true; + } else if ((hue <= (_10GY50[x] + _75GY50[x]) * 0.5f) && (hue > (_75GY50[x] + _5GY50[x]) * 0.5f)) { + correction = _75GY50[y] - _75GY50[x] ; + lbe = _75GY50[y]; + correctL = true; + } else if ((hue <= (_5GY50[x] + _75GY50[x]) * 0.5f) && (hue > (_5GY50[x] - 0.035f))) { + correction = _5GY50[y] - _5GY50[x] ; + lbe = _5GY50[y]; + correctL = true; + } + } else if (lum < 65.f) { + if ((hue <= (_7G60[x] + 0.035f)) && (hue > (_7G60[x] + _5G60[x]) * 0.5f)) { + correction = _7G60[y] - _7G60[x] ; + lbe = _7G60[y]; + correctL = true; + } else if ((hue <= (_7G60[x] + _5G60[x]) * 0.5f) && (hue > (_5G60[x] + _25G60[x]) * 0.5f)) { + correction = _5G60[y] - _5G60[x] ; + lbe = _5G60[y]; + correctL = true; + } else if ((hue <= (_25G60[x] + _5G60[x]) * 0.5f) && (hue > (_25G60[x] + _1G60[x]) * 0.5f)) { + correction = _25G60[y] - _25G60[x] ; + lbe = _25G60[y]; + correctL = true; + } else if ((hue <= (_1G60[x] + _25G60[x]) * 0.5f) && (hue > (_1G60[x] + _10GY60[x]) * 0.5f)) { + correction = _1G60[y] - _1G60[x] ; + lbe = _1G60[y]; + correctL = true; + } else if ((hue <= (_1G60[x] + _10GY60[x]) * 0.5f) && (hue > (_10GY60[x] + _75GY60[x]) * 0.5f)) { + correction = _10GY60[y] - _10GY60[x] ; + lbe = _10GY60[y]; + correctL = true; + } else if ((hue <= (_10GY60[x] + _75GY60[x]) * 0.5f) && (hue > (_75GY60[x] + _5GY60[x]) * 0.5f)) { + correction = _75GY60[y] - _75GY60[x] ; + lbe = _75GY60[y] ; + correctL = true; + } else if ((hue <= (_5GY60[x] + _75GY60[x]) * 0.5f) && (hue > (_5GY60[x] - 0.035f))) { + correction = _5GY60[y] - _5GY60[x] ; + lbe = _5GY60[y]; + correctL = true; + } + } else if (lum < 75.f) { + if ((hue <= (_7G70[x] + 0.035f)) && (hue > (_7G70[x] + _5G70[x]) * 0.5f)) { + correction = _7G70[y] - _7G70[x] ; + lbe = _7G70[y]; + correctL = true; + } else if ((hue <= (_7G70[x] + _5G70[x]) * 0.5f) && (hue > (_5G70[x] + _25G70[x]) * 0.5f)) { + correction = _5G70[y] - _5G70[x] ; + lbe = _5G70[y]; + correctL = true; + } else if ((hue <= (_25G70[x] + _5G70[x]) * 0.5f) && (hue > (_25G70[x] + _1G70[x]) * 0.5f)) { + correction = _25G70[y] - _25G70[x] ; + lbe = _25G70[y]; + correctL = true; + } else if ((hue <= (_1G70[x] + _25G70[x]) * 0.5f) && (hue > (_1G70[x] + _10GY70[x]) * 0.5f)) { + correction = _1G70[y] - _1G70[x] ; + lbe = _1G70[y] ; + correctL = true; + } else if ((hue <= (_1G70[x] + _10GY70[x]) * 0.5f) && (hue > (_10GY70[x] + _75GY70[x]) * 0.5f)) { + correction = _10GY70[y] - _10GY70[x] ; + lbe = _10GY70[y]; + correctL = true; + } else if ((hue <= (_10GY70[x] + _75GY70[x]) * 0.5f) && (hue > (_75GY70[x] + _5GY70[x]) * 0.5f)) { + correction = _75GY70[y] - _75GY70[x] ; + lbe = _75GY70[y]; + correctL = true; + } else if ((hue <= (_5GY70[x] + _75GY70[x]) * 0.5f) && (hue > (_5GY70[x] - 0.035f))) { + correction = _5GY70[y] - _5GY70[x] ; + lbe = _5GY70[y]; + correctL = true; + } + } else if (lum < 85.f) { + if ((hue <= (_7G80[x] + 0.035f)) && (hue > (_7G80[x] + _5G80[x]) * 0.5f)) { + correction = _7G80[y] - _7G80[x] ; + lbe = _7G80[y]; + correctL = true; + } else if ((hue <= (_7G80[x] + _5G80[x]) * 0.5f) && (hue > (_5G80[x] + _25G80[x]) * 0.5f)) { + correction = _5G80[y] - _5G80[x] ; + lbe = _5G80[y]; + correctL = true; + } else if ((hue <= (_25G80[x] + _5G80[x]) * 0.5f) && (hue > (_25G80[x] + _1G80[x]) * 0.5f)) { + correction = _25G80[y] - _25G80[x] ; + lbe = _25G80[y]; + correctL = true; + } else if ((hue <= (_1G80[x] + _25G80[x]) * 0.5f) && (hue > (_1G80[x] + _10GY80[x]) * 0.5f)) { + correction = _1G80[y] - _1G80[x] ; + lbe = _1G80[y]; + correctL = true; + } else if ((hue <= (_1G80[x] + _10GY80[x]) * 0.5f) && (hue > (_10GY80[x] + _75GY80[x]) * 0.5f)) { + correction = _10GY80[y] - _10GY80[x] ; + lbe = _10GY80[y]; + correctL = true; + } else if ((hue <= (_10GY80[x] + _75GY80[x]) * 0.5f) && (hue > (_75GY80[x] + _5GY80[x]) * 0.5f)) { + correction = _75GY80[y] - _75GY80[x] ; + lbe = _75GY80[y]; + correctL = true; + } else if ((hue <= (_5GY80[x] + _75GY80[x]) * 0.5f) && (hue > (_5GY80[x] - 0.035f))) { + correction = _5GY80[y] - _5GY80[x] ; + lbe = _5GY80[y]; + correctL = true; + } + } + } + } else if (zone == 4) { //Red purple correction : only for L < 30 + if (lum > 5.f) { + if (lum < 15.f && x < 45) { + y = std::min(y, 44); + if ((hue <= (_5R10[x] + 0.035f)) && (hue > (_5R10[x] - 0.043f))) { + correction = _5R10[y] - _5R10[x] ; + lbe = _5R10[y]; + correctL = true; + } else if ((hue <= (_25R10[x] + 0.043f)) && (hue > (_25R10[x] + _10RP10[x]) * 0.5f)) { + correction = _25R10[y] - _25R10[x] ; + lbe = _25R10[y]; + correctL = true; + } else if ((hue <= (_25R10[x] + _10RP10[x]) * 0.5f) && (hue > (_10RP10[x] - 0.035f))) { + correction = _10RP10[y] - _10RP10[x] ; + lbe = _10RP10[y]; + correctL = true; + } + } else if (lum < 25.f && x < 70) { + y = std::min(y, 70); + if ((hue <= (_5R20[x] + 0.035f)) && (hue > (_5R20[x] + _25R20[x]) * 0.5f)) { + correction = _5R20[y] - _5R20[x] ; + lbe = _5R20[y]; + correctL = true; + } else if ((hue <= (_5R20[x] + _25R20[x]) * 0.5f) && (hue > (_10RP20[x] + _25R20[x]) * 0.5f)) { + correction = _25R20[y] - _25R20[x] ; + lbe = _25R20[y]; + correctL = true; + } else if ( (hue <= (_10RP20[x] + _25R20[x]) * 0.5f) && (hue > (_10RP20[x] - 0.035f))) { + correction = _10RP20[y] - _10RP20[x] ; + lbe = _10RP20[y]; + correctL = true; + } + } else if (lum < 35.f && x < 85) { + y = rtengine::min(y, 85); + if ((hue <= (_5R30[x] + 0.035f)) && (hue > (_5R30[x] + _25R30[x]) * 0.5f)) { + correction = _5R30[y] - _5R30[x] ; + lbe = _5R30[y]; + correctL = true; + } else if ((hue <= (_5R30[x] + _25R30[x]) * 0.5f) && (hue > (_10RP30[x] + _25R30[x]) * 0.5f)) { + correction = _25R30[y] - _25R30[x] ; + lbe = _25R30[y]; + correctL = true; + } else if ((hue <= (_10RP30[x] + _25R30[x]) * 0.5f) && (hue > (_10RP30[x] - 0.035f))) { + correction = _10RP30[y] - _10RP30[x] ; + lbe = _10RP30[y]; + correctL = true; + } + } + } + } + //end red purple +} +} diff --git a/rtengine/opthelper.h b/rtengine/opthelper.h index b65ede227..f431c0ec9 100644 --- a/rtengine/opthelper.h +++ b/rtengine/opthelper.h @@ -18,27 +18,24 @@ // along with this program. If not, see . // //////////////////////////////////////////////////////////////// +#pragma once -#ifndef OPTHELPER_H - #define OPTHELPER_H +#define pow_F(a,b) (xexpf(b*xlogf(a))) - #define pow_F(a,b) (xexpf(b*xlogf(a))) - - #ifdef __SSE2__ - #include "sleefsseavx.c" - #endif - - #ifdef __GNUC__ - #define RESTRICT __restrict__ - #define LIKELY(x) __builtin_expect (!!(x), 1) - #define UNLIKELY(x) __builtin_expect (!!(x), 0) - #define ALIGNED64 __attribute__ ((aligned (64))) - #define ALIGNED16 __attribute__ ((aligned (16))) - #else - #define RESTRICT - #define LIKELY(x) (x) - #define UNLIKELY(x) (x) - #define ALIGNED64 - #define ALIGNED16 - #endif +#ifdef __SSE2__ + #include "sleefsseavx.h" +#endif + +#ifdef __GNUC__ + #define RESTRICT __restrict__ + #define LIKELY(x) __builtin_expect (!!(x), 1) + #define UNLIKELY(x) __builtin_expect (!!(x), 0) + #define ALIGNED64 __attribute__ ((aligned (64))) + #define ALIGNED16 __attribute__ ((aligned (16))) +#else + #define RESTRICT + #define LIKELY(x) (x) + #define UNLIKELY(x) (x) + #define ALIGNED64 + #define ALIGNED16 #endif diff --git a/rtengine/previewimage.h b/rtengine/previewimage.h index e6c3ea070..2143509a3 100644 --- a/rtengine/previewimage.h +++ b/rtengine/previewimage.h @@ -18,10 +18,16 @@ */ #pragma once -#include #include +namespace Glib +{ + +class ustring; + +} + namespace rtengine { diff --git a/rtengine/processingjob.h b/rtengine/processingjob.h index 6cdc6bd7c..9c3846958 100644 --- a/rtengine/processingjob.h +++ b/rtengine/processingjob.h @@ -24,7 +24,7 @@ namespace rtengine { -class ProcessingJobImpl : public ProcessingJob +class ProcessingJobImpl final : public ProcessingJob { public: diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 99f4f4404..f6b139550 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -4289,7 +4289,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_key("Shadows & Highlights", "LocalContrast") && ppVersion < 329) { int lc = keyFile.get_integer("Shadows & Highlights", "LocalContrast"); - localContrast.amount = float(lc) / 30.; + localContrast.amount = float(lc) / 30.f; if (pedited) { pedited->localContrast.amount = true; @@ -4606,8 +4606,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) Glib::ustring temp; assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, temp, pedited->wavelet.Lmethod); - if (!temp.empty()) { + try { wavelet.Lmethod = std::stoi(temp); + } catch (...) { } } else { assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, wavelet.Lmethod, pedited->wavelet.Lmethod); diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 4421e4af4..34d5d961c 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -171,7 +171,7 @@ void RawImage::get_colorsCoeff( float *pre_mul_, float *scale_mul_, float *cblac } for (int c = 0; c < 4; c++) { - dsumthr[c] += sum[c]; + dsumthr[c] += static_cast(sum[c]); } skip_block2: @@ -195,7 +195,7 @@ skip_block2: } for(int c = 0; c < 4; c++) { - dsum[c] -= cblack_[c] * dsum[c + 4]; + dsum[c] -= static_cast(cblack_[c]) * dsum[c + 4]; } } else if(isXtrans()) { @@ -241,7 +241,7 @@ skip_block2: } for (int c = 0; c < 8; c++) { - dsumthr[c] += sum[c]; + dsumthr[c] += static_cast(sum[c]); } skip_block3: @@ -365,18 +365,14 @@ skip_block: } for (dmin = DBL_MAX, dmax = c = 0; c < 4; c++) { - if (dmin > pre_mul_[c]) { - dmin = pre_mul_[c]; - } - - if (dmax < pre_mul_[c]) { - dmax = pre_mul_[c]; - } + dmin = rtengine::min(dmin, pre_mul_[c]); + dmax = rtengine::max(dmax, pre_mul_[c]); } for (c = 0; c < 4; c++) { int sat = this->get_white(c) - cblack_[c]; - scale_mul_[c] = (pre_mul_[c] /= dmax) * 65535.0 / sat; + pre_mul_[c] /= static_cast(dmax); + scale_mul_[c] = pre_mul_[c] * 65535.f / sat; } if (settings->verbose) { @@ -387,25 +383,30 @@ skip_block: asn[c] = 0; } - if (asn[c] > dmax) { + if (asn[c] > static_cast(dmax)) { dmax = asn[c]; } } for (c = 0; c < 4; c++) { - asn[c] /= dmax; + asn[c] /= static_cast(dmax); } printf("cam_mul:[%f %f %f %f], AsShotNeutral:[%f %f %f %f]\n", - cam_mul[0], cam_mul[1], cam_mul[2], cam_mul[3], asn[0], asn[1], asn[2], asn[3]); + static_cast(cam_mul[0]), static_cast(cam_mul[1]), + static_cast(cam_mul[2]), static_cast(cam_mul[3]), + static_cast(asn[0]), static_cast(asn[1]), static_cast(asn[2]), static_cast(asn[3])); printf("pre_mul:[%f %f %f %f], scale_mul:[%f %f %f %f], cblack:[%f %f %f %f]\n", - pre_mul_[0], pre_mul_[1], pre_mul_[2], pre_mul_[3], - scale_mul_[0], scale_mul_[1], scale_mul_[2], scale_mul_[3], - cblack_[0], cblack_[1], cblack_[2], cblack_[3]); + static_cast(pre_mul_[0]), static_cast(pre_mul_[1]), + static_cast(pre_mul_[2]), static_cast(pre_mul_[3]), + static_cast(scale_mul_[0]), static_cast(scale_mul_[1]), + static_cast(scale_mul_[2]), static_cast(scale_mul_[3]), + static_cast(cblack_[0]), static_cast(cblack_[1]), + static_cast(cblack_[2]), static_cast(cblack_[3])); printf("rgb_cam:[ [ %f %f %f], [%f %f %f], [%f %f %f] ]%s\n", - rgb_cam[0][0], rgb_cam[1][0], rgb_cam[2][0], - rgb_cam[0][1], rgb_cam[1][1], rgb_cam[2][1], - rgb_cam[0][2], rgb_cam[1][2], rgb_cam[2][2], + static_cast(rgb_cam[0][0]), static_cast(rgb_cam[1][0]), static_cast(rgb_cam[2][0]), + static_cast(rgb_cam[0][1]), static_cast(rgb_cam[1][1]), static_cast(rgb_cam[2][1]), + static_cast(rgb_cam[0][2]), static_cast(rgb_cam[1][2]), static_cast(rgb_cam[2][2]), (!this->isBayer()) ? " (not bayer)" : ""); } diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 18fc18f58..fcc85f2c6 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include +#include #include #include "camconst.h" @@ -25,6 +26,7 @@ #include "dcp.h" #include "dfmanager.h" #include "ffmanager.h" +#include "iccmatrices.h" #include "iccstore.h" #include "imagefloat.h" #include "improcfun.h" @@ -49,10 +51,6 @@ #endif #include "opthelper.h" -#define clipretinex( val, minv, maxv ) (( val = (val < minv ? minv : val ) ) > maxv ? maxv : val ) - -#undef CLIPD -#define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f) namespace { @@ -101,7 +99,7 @@ void transLineFuji (const float* const red, const float* const green, const floa { // Fuji SuperCCD rotation + coarse rotation - int start = ABS(fw - i); + int start = std::abs(fw - i); int w = fw * 2 + 1; int h = (imheight - fw) * 2 + 1; int end = min(h + fw - i, w - fw + i); @@ -425,12 +423,6 @@ void transLineD1x (const float* const red, const float* const green, const float namespace rtengine { -#undef ABS -#undef DIST - -#define ABS(a) ((a)<0?-(a):(a)) -#define DIST(a,b) (ABS(a-b)) - RawImageSource::RawImageSource () : ImageSource() , W(0), H(0) @@ -620,7 +612,7 @@ float calculate_scale_mul(float scale_mul[4], const float pre_mul_[4], const flo { if (isMono || colors == 1) { for (int c = 0; c < 4; c++) { - scale_mul[c] = 65535.0 / (c_white[c] - c_black[c]); + scale_mul[c] = 65535.f / (c_white[c] - c_black[c]); } } else { float pre_mul[4]; @@ -636,7 +628,7 @@ float calculate_scale_mul(float scale_mul[4], const float pre_mul_[4], const flo float maxpremul = max(pre_mul[0], pre_mul[1], pre_mul[2], pre_mul[3]); for (int c = 0; c < 4; c++) { - scale_mul[c] = (pre_mul[c] / maxpremul) * 65535.0 / (c_white[c] - c_black[c]); + scale_mul[c] = (pre_mul[c] / maxpremul) * 65535.f / (c_white[c] - c_black[c]); } } @@ -675,7 +667,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima || (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO)); for (int i = 0; i < 4; ++i) { - c_white[i] = (ri->get_white(i) - cblacksom[i]) / raw.expos + cblacksom[i]; + c_white[i] = (ri->get_white(i) - cblacksom[i]) / static_cast(raw.expos) + cblacksom[i]; } float gain = calculate_scale_mul(new_scale_mul, new_pre_mul, c_white, cblacksom, isMono, ri->get_colors()); @@ -684,21 +676,21 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima bm = new_scale_mul[2] / scale_mul[2] * gain; //fprintf(stderr, "camera gain: %f, current wb gain: %f, diff in stops %f\n", camInitialGain, gain, log2(camInitialGain) - log2(gain)); } else { - // old scaling: used a fixed reference gain based on camera (as-shot) white balance - - // how much we need to scale each channel to get our new white balance - rm = refwb_red / rm; - gm = refwb_green / gm; - bm = refwb_blue / bm; - // normalize so larger multiplier becomes 1.0 - float minval = min(rm, gm, bm); - rm /= minval; - gm /= minval; - bm /= minval; - // multiply with reference gain, ie as-shot WB - rm *= camInitialGain; - gm *= camInitialGain; - bm *= camInitialGain; +// // old scaling: used a fixed reference gain based on camera (as-shot) white balance +// +// // how much we need to scale each channel to get our new white balance +// rm = refwb_red / rm; +// gm = refwb_green / gm; +// bm = refwb_blue / bm; +// // normalize so larger multiplier becomes 1.0 +// float minval = min(rm, gm, bm); +// rm /= minval; +// gm /= minval; +// bm /= minval; +// // multiply with reference gain, ie as-shot WB +// rm *= camInitialGain; +// gm *= camInitialGain; +// bm *= camInitialGain; } defGain = 0.0; @@ -877,13 +869,13 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima for (int i = 1; i < image->getHeight() - 1; i++) { for (int j = 2 - (a + i + 1) % 2; j < image->getWidth() - 1; j += 2) { // edge-adaptive interpolation - double dh = (ABS(image->r(i, j + 1) - image->r(i, j - 1)) + ABS(image->g(i, j + 1) - image->g(i, j - 1)) + ABS(image->b(i, j + 1) - image->b(i, j - 1))) / 1.0; - double dv = (ABS(image->r(i + 1, j) - image->r(i - 1, j)) + ABS(image->g(i + 1, j) - image->g(i - 1, j)) + ABS(image->b(i + 1, j) - image->b(i - 1, j))) / 1.0; - double eh = 1.0 / (1.0 + dh); - double ev = 1.0 / (1.0 + dv); - image->r(i, j) = (eh * (image->r(i, j + 1) + image->r(i, j - 1)) + ev * (image->r(i + 1, j) + image->r(i - 1, j))) / (2.0 * (eh + ev)); - image->g(i, j) = (eh * (image->g(i, j + 1) + image->g(i, j - 1)) + ev * (image->g(i + 1, j) + image->g(i - 1, j))) / (2.0 * (eh + ev)); - image->b(i, j) = (eh * (image->b(i, j + 1) + image->b(i, j - 1)) + ev * (image->b(i + 1, j) + image->b(i - 1, j))) / (2.0 * (eh + ev)); + float dh = (std::fabs(image->r(i, j + 1) - image->r(i, j - 1)) + std::fabs(image->g(i, j + 1) - image->g(i, j - 1)) + std::fabs(image->b(i, j + 1) - image->b(i, j - 1))); + float dv = (std::fabs(image->r(i + 1, j) - image->r(i - 1, j)) + std::fabs(image->g(i + 1, j) - image->g(i - 1, j)) + std::fabs(image->b(i + 1, j) - image->b(i - 1, j))); + float eh = 1.f / (1.f + dh); + float ev = 1.f / (1.f + dv); + image->r(i, j) = (eh * (image->r(i, j + 1) + image->r(i, j - 1)) + ev * (image->r(i + 1, j) + image->r(i - 1, j))) / (2.f * (eh + ev)); + image->g(i, j) = (eh * (image->g(i, j + 1) + image->g(i, j - 1)) + ev * (image->g(i + 1, j) + image->g(i - 1, j))) / (2.f * (eh + ev)); + image->b(i, j) = (eh * (image->b(i, j + 1) + image->b(i, j - 1)) + ev * (image->b(i + 1, j) + image->b(i - 1, j))) / (2.f * (eh + ev)); } // first pixel @@ -1547,7 +1539,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } } - if(prepareDenoise && dirpyrdenoiseExpComp == INFINITY) { + if(prepareDenoise && dirpyrdenoiseExpComp == RT_INFINITY) { LUTu aehist; int aehistcompr; double clip = 0; @@ -2916,7 +2908,7 @@ lab2ProphotoRgbD50(float L, float A, float B, float& r, float& g, float& b) float X; float Y; float Z; -#define CLIP01(a) ((a)>0?((a)<1?(a):1):0) + { // convert from Lab to XYZ float x, y, z, fx, fy, fz; @@ -2951,9 +2943,6 @@ lab2ProphotoRgbD50(float L, float A, float B, float& r, float& g, float& b) r = prophoto_xyz[0][0] * X + prophoto_xyz[0][1] * Y + prophoto_xyz[0][2] * Z; g = prophoto_xyz[1][0] * X + prophoto_xyz[1][1] * Y + prophoto_xyz[1][2] * Z; b = prophoto_xyz[2][0] * X + prophoto_xyz[2][1] * Y + prophoto_xyz[2][2] * Z; - // r = CLIP01(r); - // g = CLIP01(g); - // b = CLIP01(b); } // Converts raw image including ICC input profile to working space - floating point version @@ -3881,7 +3870,7 @@ void RawImageSource::getRowStartEnd (int x, int &start, int &end) { if (fuji) { int fw = ri->get_FujiWidth(); - start = ABS(fw - x) + border; + start = std::abs(fw - x) + border; end = min(H + W - fw - x, fw + x) - border; } else { start = border; @@ -3922,7 +3911,7 @@ void RawImageSource::getAutoWBMultipliers (double &rm, double &gm, double &bm) if (fuji) { for (int i = 32; i < H - 32; i++) { int fw = ri->get_FujiWidth(); - int start = ABS(fw - i) + 32; + int start = std::abs(fw - i) + 32; int end = min(H + W - fw - i, fw + i) - 32; for (int j = start; j < end; j++) { diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index bd460c61b..6be02f6d6 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -37,7 +37,7 @@ class DiagonalCurve; class RetinextransmissionCurve; class RetinexgaintransmissionCurve; -class RawImageSource : public ImageSource +class RawImageSource final : public ImageSource { private: static DiagonalCurve *phaseOneIccCurve; diff --git a/rtengine/rescale.h b/rtengine/rescale.h index 70974aa48..2138cd8e8 100644 --- a/rtengine/rescale.h +++ b/rtengine/rescale.h @@ -20,9 +20,12 @@ #pragma once -#include "array2D.h" #include "rt_math.h" +template +class array2D; + + namespace rtengine { diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 0473622c4..ca663c5bc 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -31,7 +31,6 @@ #include "imageformat.h" #include "procevents.h" #include "rawmetadatalocation.h" -#include "rt_math.h" #include "settings.h" #include "../rtgui/threadutils.h" diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 9da601e2a..4507f2b40 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -31,6 +31,7 @@ #include "colortemp.h" #include "curves.h" #include "dcp.h" +#include "iccmatrices.h" #include "iccstore.h" #include "image8.h" #include "improcfun.h" @@ -511,8 +512,6 @@ Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataL ((filter >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3)==0 || !filter) #define FISGREEN(filter,row,col) \ ((filter >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3)==1 || !filter) -#define FISBLUE(filter,row,col) \ - ((filter >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3)==2 || !filter) RawMetaDataLocation Thumbnail::loadMetaDataFromRaw (const Glib::ustring& fname) { @@ -2254,44 +2253,6 @@ bool Thumbnail::writeEmbProfile (const Glib::ustring& fname) return false; } -bool Thumbnail::readAEHistogram (const Glib::ustring& fname) -{ - - FILE* f = g_fopen(fname.c_str(), "rb"); - - if (!f) { - aeHistogram.reset(); - } else { - aeHistogram(65536 >> aeHistCompression); - const size_t histoBytes = (65536 >> aeHistCompression) * sizeof(aeHistogram[0]); - const size_t bytesRead = fread(&aeHistogram[0], 1, histoBytes, f); - fclose (f); - if (bytesRead != histoBytes) { - aeHistogram.reset(); - return false; - } - return true; - } - - return false; -} - -bool Thumbnail::writeAEHistogram (const Glib::ustring& fname) -{ - - if (aeHistogram) { - FILE* f = g_fopen (fname.c_str (), "wb"); - - if (f) { - fwrite (&aeHistogram[0], 1, (65536 >> aeHistCompression)*sizeof (aeHistogram[0]), f); - fclose (f); - return true; - } - } - - return false; -} - unsigned char* Thumbnail::getImage8Data() { if (thumbImg && thumbImg->getType() == rtengine::sImage8) { diff --git a/rtengine/rtthumbnail.h b/rtengine/rtthumbnail.h index dcc9596f6..ccca1c582 100644 --- a/rtengine/rtthumbnail.h +++ b/rtengine/rtthumbnail.h @@ -18,8 +18,6 @@ */ #pragma once -#include - #include #include "image16.h" @@ -30,6 +28,13 @@ #include "../rtgui/threadutils.h" +namespace Glib +{ + +class ustring; + +} + namespace rtengine { @@ -108,10 +113,6 @@ public: bool readEmbProfile (const Glib::ustring& fname); bool writeEmbProfile (const Glib::ustring& fname); - bool readAEHistogram (const Glib::ustring& fname); - bool writeAEHistogram (const Glib::ustring& fname); - - bool isAeValid() { return aeValid; }; unsigned char* getImage8Data(); // accessor to the 8bit image if it is one, which should be the case for the "Inspector" mode. // Hombre: ... let's hope that proper template can make this cleaner diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index abdcc42a4..306e30bdd 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -27,6 +27,37 @@ #undef THREAD_PRIORITY_NORMAL #include "opthelper.h" +namespace { + +void fillLuminance(rtengine::Imagefloat* img, float** luminance, const float lumi[3], int W, int H) // fill with luminance +{ + +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int i = 0; i < H; i++) + for (int j = 0; j < W; j++) { + luminance[i][j] = lumi[0] * std::max(img->r(i, j), 0.f) + lumi[1] * std::max(img->g(i, j), 0.f) + lumi[2] * std::max(img->b(i, j), 0.f); + } + +} + +void fillLuminanceL(float** L, float** luminance, int W, int H) // fill with luminance +{ + +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int i = 0; i < H; i++) + for (int j = 0; j < W; j++) { + luminance[i][j] = std::max(L[i][j], 0.f) ;//we can put here some enhancements Gamma, compression data,... + } + +} + +} namespace rtengine { @@ -51,39 +82,13 @@ SHMap::~SHMap () delete [] map; } -void SHMap::fillLuminance( Imagefloat * img, float **luminance, double lumi[3] ) // fill with luminance -{ - -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int i = 0; i < H; i++) - for (int j = 0; j < W; j++) { - luminance[i][j] = lumi[0] * std::max(img->r(i, j), 0.f) + lumi[1] * std::max(img->g(i, j), 0.f) + lumi[2] * std::max(img->b(i, j), 0.f); - } - -} - -void SHMap::fillLuminanceL( float ** L, float **luminance) // fill with luminance -{ - -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int i = 0; i < H; i++) - for (int j = 0; j < W; j++) { - luminance[i][j] = std::max(L[i][j], 0.f) ;//we can put here some enhancements Gamma, compression data,... - } - -} - void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int skip) { + const float lumif[3] = { static_cast(lumi[0]), static_cast(lumi[1]), static_cast(lumi[2]) }; + if (!hq) { - fillLuminance( img, map, lumi); + fillLuminance(img, map, lumif, W, H); const bool useBoxBlur = radius > 40.0; // boxblur is less prone to artifacts for large radi @@ -91,7 +96,7 @@ void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int #pragma omp parallel if (!useBoxBlur) #endif { - gaussianBlur (map, map, W, H, radius, useBoxBlur); + gaussianBlur(map, map, W, H, radius, useBoxBlur); } } @@ -99,7 +104,7 @@ void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //experimental dirpyr shmap - float thresh = (100.f * radius); //1000; + float thresh = 100.0 * radius; //1000; // set up range function // calculate size of Lookup table. That's possible because from a value k for all i>=k rangefn[i] will be exp(-10) @@ -142,7 +147,7 @@ void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int dirpyrlo[1] = buffer; } - fillLuminance( img, dirpyrlo[0], lumi); + fillLuminance(img, dirpyrlo[0], lumif, W, H); scale = 1; int level = 0; @@ -181,28 +186,18 @@ void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int for (int j = 0; j < W; j++) { _val = map[i][j]; - if (_val < _min_f) { - _min_f = _val; - } + _min_f = std::min(_min_f, _val); + _max_f = std::max(_max_f, _val); - if (_val > _max_f) { - _max_f = _val; - } - - _avg += _val; + _avg += static_cast(_val); } #ifdef _OPENMP #pragma omp critical #endif { - if(_min_f < min_f ) { - min_f = _min_f; - } - - if(_max_f > max_f ) { - max_f = _max_f; - } + min_f = std::min(min_f, _min_f); + max_f = std::max(max_f, _max_f); } } _avg /= ((H) * (W)); @@ -214,7 +209,7 @@ void SHMap::updateL (float** L, double radius, bool hq, int skip) { if (!hq) { - fillLuminanceL( L, map); + fillLuminanceL(L, map, W, H); #ifdef _OPENMP #pragma omp parallel #endif @@ -228,7 +223,7 @@ void SHMap::updateL (float** L, double radius, bool hq, int skip) { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //experimental dirpyr shmap - float thresh = (100.f * radius); //1000; + float thresh = 100.0 * radius; //1000; int levrad; // = 16; levrad = 2; //for retinex - otherwise levrad = 16 // set up range function @@ -274,7 +269,7 @@ void SHMap::updateL (float** L, double radius, bool hq, int skip) dirpyrlo[1] = buffer; } - fillLuminanceL( L, dirpyrlo[0]); + fillLuminanceL(L, dirpyrlo[0], W, H); scale = 1; int level = 0; @@ -313,28 +308,18 @@ void SHMap::updateL (float** L, double radius, bool hq, int skip) for (int j = 0; j < W; j++) { _val = map[i][j]; - if (_val < _min_f) { - _min_f = _val; - } + _min_f = std::min(_min_f, _val); + _max_f = std::max(_max_f, _val); - if (_val > _max_f) { - _max_f = _val; - } - - _avg += _val; + _avg += static_cast(_val); } #ifdef _OPENMP #pragma omp critical #endif { - if(_min_f < min_f ) { - min_f = _min_f; - } - - if(_max_f > max_f ) { - max_f = _max_f; - } + min_f = std::min(min_f, _min_f); + max_f = std::max(max_f, _max_f); } } _avg /= ((H) * (W)); diff --git a/rtengine/shmap.h b/rtengine/shmap.h index 68e352b23..b1b1e5eff 100644 --- a/rtengine/shmap.h +++ b/rtengine/shmap.h @@ -48,8 +48,6 @@ public: private: int W, H; - void fillLuminance( Imagefloat * img, float **luminance, double lumi[3] ); - void fillLuminanceL( float ** L, float **luminance ); void dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, const LUTf& rangefn, int level, int scale); }; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 1c1e46a65..c50e23d4b 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -994,7 +994,7 @@ private: ipf.rgbProc (baseImg, labView, nullptr, curve1, curve2, curve, params.toneCurve.saturation, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, expcomp, hlcompr, hlcomprthresh, dcpProf, as, histToneCurve, options.chunkSizeRGB, options.measure); if (settings->verbose) { - printf ("Output image / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", autor, autog, autob); + printf ("Output image / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", static_cast(autor), static_cast(autog), static_cast(autob)); } // if clut was used and size of clut cache == 1 we free the memory used by the clutstore (default clut cache size = 1 for 32 bit OS) @@ -1162,10 +1162,10 @@ private: adap = 2000.; }//if no exif data or wrong else { - float E_V = fcomp + log2 ((fnum * fnum) / fspeed / (fiso / 100.f)); + double E_V = fcomp + log2 ((fnum * fnum) / fspeed / (fiso / 100.f)); E_V += params.toneCurve.expcomp;// exposure compensation in tonecurve ==> direct EV - E_V += log2 (params.raw.expos); // exposure raw white point ; log2 ==> linear to EV - adap = powf (2.f, E_V - 3.f); //cd / m2 + E_V += log2(params.raw.expos); // exposure raw white point ; log2 ==> linear to EV + adap = std::pow(2.0, E_V - 3.0); //cd / m2 } LUTf CAMBrightCurveJ; diff --git a/rtengine/sleefsseavx.c b/rtengine/sleefsseavx.c deleted file mode 100644 index 0af516f9b..000000000 --- a/rtengine/sleefsseavx.c +++ /dev/null @@ -1,1483 +0,0 @@ -//////////////////////////////////////////////////////////////// -// -// this code was taken from http://shibatch.sourceforge.net/ -// Many thanks to the author of original version: Naoki Shibata -// -// This version contains modifications made by Ingo Weyrich -// -//////////////////////////////////////////////////////////////// - - -#ifndef SLEEFSSEAVX -#define SLEEFSSEAVX - -#include -#include "rt_math.h" -#ifdef __SSE2__ -#include "helpersse2.h" - -#ifdef ENABLE_AVX -#include "helperavx.h" -#endif - -#ifdef __GNUC__ -#define INLINE __inline -#else -#define INLINE inline -#endif - -#define PI4_A .7853981554508209228515625 -#define PI4_B .794662735614792836713604629039764404296875e-8 -#define PI4_C .306161699786838294306516483068750264552437361480769e-16 -#define M_4_PI 1.273239544735162542821171882678754627704620361328125 - -#define L2U .69314718055966295651160180568695068359375 -#define L2L .28235290563031577122588448175013436025525412068e-12 -#define R_LN2 1.442695040888963407359924681001892137426645954152985934135449406931 - -#define PI4_Af 0.78515625f -#define PI4_Bf 0.00024127960205078125f -#define PI4_Cf 6.3329935073852539062e-07f -#define PI4_Df 4.9604681473525147339e-10f - -#define L2Uf 0.693145751953125f -#define L2Lf 1.428606765330187045e-06f -#define R_LN2f 1.442695040888963407359924681001892137426645954152985934135449406931f - -#define INFINITYf ((float)rtengine::RT_INFINITY) -#define NANf ((float)rtengine::RT_NAN) - -static INLINE vdouble vadd3(vdouble v0, vdouble v1, vdouble v2) { - return vadd(vadd(v0, v1), v2); -} - -static INLINE vdouble vadd4(vdouble v0, vdouble v1, vdouble v2, vdouble v3) { - return vadd3(vadd(v0, v1), v2, v3); -} - -static INLINE vdouble vadd5(vdouble v0, vdouble v1, vdouble v2, vdouble v3, vdouble v4) { - return vadd4(vadd(v0, v1), v2, v3, v4); -} - -static INLINE vdouble vadd6(vdouble v0, vdouble v1, vdouble v2, vdouble v3, vdouble v4, vdouble v5) { - return vadd5(vadd(v0, v1), v2, v3, v4, v5); -} - -static INLINE vdouble vadd7(vdouble v0, vdouble v1, vdouble v2, vdouble v3, vdouble v4, vdouble v5, vdouble v6) { - return vadd6(vadd(v0, v1), v2, v3, v4, v5, v6); -} - -static INLINE vdouble vsub3(vdouble v0, vdouble v1, vdouble v2) { - return vsub(vsub(v0, v1), v2); -} - -static INLINE vdouble vsub4(vdouble v0, vdouble v1, vdouble v2, vdouble v3) { - return vsub3(vsub(v0, v1), v2, v3); -} - -static INLINE vdouble vsub5(vdouble v0, vdouble v1, vdouble v2, vdouble v3, vdouble v4) { - return vsub4(vsub(v0, v1), v2, v3, v4); -} - -// - -static INLINE vdouble2 normalize_d(vdouble2 t) { - vdouble2 s; - - s.x = vadd(t.x, t.y); - s.y = vadd(vsub(t.x, s.x), t.y); - - return s; -} - -static INLINE vdouble2 scale_d(vdouble2 d, vdouble s) { - vdouble2 r = {vmul(d.x, s), vmul(d.y, s)}; - return r; -} - -static INLINE vdouble2 add_ss(vdouble x, vdouble y) { - vdouble2 r; - - r.x = vadd(x, y); - r.y = vadd(vsub(x, r.x), y); - - return r; -} - -static INLINE vdouble2 add2_ss(vdouble x, vdouble y) { - vdouble2 r; - - r.x = vadd(x, y); - vdouble v = vsub(r.x, x); - r.y = vadd(vsub(x, vsub(r.x, v)), vsub(y, v)); - - return r; -} - -static INLINE vdouble2 add_ds(vdouble2 x, vdouble y) { - vdouble2 r; - - r.x = vadd(x.x, y); - r.y = vadd3(vsub(x.x, r.x), y, x.y); - - return r; -} - -static INLINE vdouble2 add2_ds(vdouble2 x, vdouble y) { - vdouble2 r; - - r.x = vadd(x.x, y); - vdouble v = vsub(r.x, x.x); - r.y = vadd(vsub(x.x, vsub(r.x, v)), vsub(y, v)); - r.y = vadd(r.y, x.y); - - return r; -} - -static INLINE vdouble2 add_sd(vdouble x, vdouble2 y) { - vdouble2 r; - - r.x = vadd(x, y.x); - r.y = vadd3(vsub(x, r.x), y.x, y.y); - - return r; -} - -static INLINE vdouble2 add_dd(vdouble2 x, vdouble2 y) { - // |x| >= |y| - - vdouble2 r; - - r.x = vadd(x.x, y.x); - r.y = vadd4(vsub(x.x, r.x), y.x, x.y, y.y); - - return r; -} - -static INLINE vdouble2 add2_dd(vdouble2 x, vdouble2 y) { - vdouble2 r; - - r.x = vadd(x.x, y.x); - vdouble v = vsub(r.x, x.x); - r.y = vadd(vsub(x.x, vsub(r.x, v)), vsub(y.x, v)); - r.y = vadd(r.y, vadd(x.y, y.y)); - - return r; -} - -static INLINE vdouble2 div_dd(vdouble2 n, vdouble2 d) { - vdouble t = vrec(d.x); - vdouble dh = vupper(d.x), dl = vsub(d.x, dh); - vdouble th = vupper(t ), tl = vsub(t , th); - vdouble nhh = vupper(n.x), nhl = vsub(n.x, nhh); - - vdouble2 q; - - q.x = vmul(n.x, t); - - vdouble u = vadd5(vsub(vmul(nhh, th), q.x), vmul(nhh, tl), vmul(nhl, th), vmul(nhl, tl), - vmul(q.x, vsub5(vcast_vd_d(1), vmul(dh, th), vmul(dh, tl), vmul(dl, th), vmul(dl, tl)))); - - q.y = vadd(vmul(t, vsub(n.y, vmul(q.x, d.y))), u); - - return q; -} - -static INLINE vdouble2 mul_ss(vdouble x, vdouble y) { - vdouble xh = vupper(x), xl = vsub(x, xh); - vdouble yh = vupper(y), yl = vsub(y, yh); - vdouble2 r; - - r.x = vmul(x, y); - r.y = vadd5(vmul(xh, yh), vneg(r.x), vmul(xl, yh), vmul(xh, yl), vmul(xl, yl)); - - return r; -} - -static INLINE vdouble2 mul_ds(vdouble2 x, vdouble y) { - vdouble xh = vupper(x.x), xl = vsub(x.x, xh); - vdouble yh = vupper(y ), yl = vsub(y , yh); - vdouble2 r; - - r.x = vmul(x.x, y); - r.y = vadd6(vmul(xh, yh), vneg(r.x), vmul(xl, yh), vmul(xh, yl), vmul(xl, yl), vmul(x.y, y)); - - return r; -} - -static INLINE vdouble2 mul_dd(vdouble2 x, vdouble2 y) { - vdouble xh = vupper(x.x), xl = vsub(x.x, xh); - vdouble yh = vupper(y.x), yl = vsub(y.x, yh); - vdouble2 r; - - r.x = vmul(x.x, y.x); - r.y = vadd7(vmul(xh, yh), vneg(r.x), vmul(xl, yh), vmul(xh, yl), vmul(xl, yl), vmul(x.x, y.y), vmul(x.y, y.x)); - - return r; -} - -static INLINE vdouble2 squ_d(vdouble2 x) { - vdouble xh = vupper(x.x), xl = vsub(x.x, xh); - vdouble2 r; - - r.x = vmul(x.x, x.x); - r.y = vadd5(vmul(xh, xh), vneg(r.x), vmul(vadd(xh, xh), xl), vmul(xl, xl), vmul(x.x, vadd(x.y, x.y))); - - return r; -} - -static INLINE vdouble2 rec_s(vdouble d) { - vdouble t = vrec(d); - vdouble dh = vupper(d), dl = vsub(d, dh); - vdouble th = vupper(t), tl = vsub(t, th); - vdouble2 q; - - q.x = t; - q.y = vmul(t, vsub5(vcast_vd_d(1), vmul(dh, th), vmul(dh, tl), vmul(dl, th), vmul(dl, tl))); - - return q; -} - -static INLINE vdouble2 sqrt_d(vdouble2 d) { - vdouble t = vsqrt(vadd(d.x, d.y)); - return scale_d(mul_dd(add2_dd(d, mul_ss(t, t)), rec_s(t)), vcast_vd_d(0.5)); -} - -// - -static INLINE vdouble xldexp(vdouble x, vint q) { return vldexp(x, q); } - -static INLINE vint xilogb(vdouble d) { - vdouble e = vcast_vd_vi(vsubi(vilogbp1(vabs(d)), vcast_vi_i(1))); - e = vsel(vmask_eq(d, vcast_vd_d(0)), vcast_vd_d(-2147483648.0), e); - e = vsel(vmask_eq(vabs(d), vcast_vd_d(rtengine::RT_INFINITY)), vcast_vd_d(2147483647), e); - return vrint_vi_vd(e); -} - -static INLINE vdouble xsin(vdouble d) { - vint q; - vdouble u, s; - - q = vrint_vi_vd(vmul(d, vcast_vd_d(rtengine::RT_1_PI))); - - u = vcast_vd_vi(q); - d = vadd(d, vmul(u, vcast_vd_d(-PI4_A*4))); - d = vadd(d, vmul(u, vcast_vd_d(-PI4_B*4))); - d = vadd(d, vmul(u, vcast_vd_d(-PI4_C*4))); - - s = vmul(d, d); - - d = vsel(vmaski_eq(vandi(q, vcast_vi_i(1)), vcast_vi_i(1)), vneg(d), d); - - u = vcast_vd_d(-7.97255955009037868891952e-18); - u = vmla(u, s, vcast_vd_d(2.81009972710863200091251e-15)); - u = vmla(u, s, vcast_vd_d(-7.64712219118158833288484e-13)); - u = vmla(u, s, vcast_vd_d(1.60590430605664501629054e-10)); - u = vmla(u, s, vcast_vd_d(-2.50521083763502045810755e-08)); - u = vmla(u, s, vcast_vd_d(2.75573192239198747630416e-06)); - u = vmla(u, s, vcast_vd_d(-0.000198412698412696162806809)); - u = vmla(u, s, vcast_vd_d(0.00833333333333332974823815)); - u = vmla(u, s, vcast_vd_d(-0.166666666666666657414808)); - - u = vmla(s, vmul(u, d), d); - - return u; -} - -static INLINE vdouble xcos(vdouble d) { - vint q; - vdouble u, s; - - q = vrint_vi_vd(vsub(vmul(d, vcast_vd_d(rtengine::RT_1_PI)), vcast_vd_d(0.5))); - q = vaddi(vaddi(q, q), vcast_vi_i(1)); - - u = vcast_vd_vi(q); - d = vadd(d, vmul(u, vcast_vd_d(-PI4_A*2))); - d = vadd(d, vmul(u, vcast_vd_d(-PI4_B*2))); - d = vadd(d, vmul(u, vcast_vd_d(-PI4_C*2))); - - s = vmul(d, d); - - d = vsel(vmaski_eq(vandi(q, vcast_vi_i(2)), vcast_vi_i(0)), vneg(d), d); - - u = vcast_vd_d(-7.97255955009037868891952e-18); - u = vmla(u, s, vcast_vd_d(2.81009972710863200091251e-15)); - u = vmla(u, s, vcast_vd_d(-7.64712219118158833288484e-13)); - u = vmla(u, s, vcast_vd_d(1.60590430605664501629054e-10)); - u = vmla(u, s, vcast_vd_d(-2.50521083763502045810755e-08)); - u = vmla(u, s, vcast_vd_d(2.75573192239198747630416e-06)); - u = vmla(u, s, vcast_vd_d(-0.000198412698412696162806809)); - u = vmla(u, s, vcast_vd_d(0.00833333333333332974823815)); - u = vmla(u, s, vcast_vd_d(-0.166666666666666657414808)); - - u = vmla(s, vmul(u, d), d); - - return u; -} - -static INLINE vdouble2 xsincos(vdouble d) { - vint q; - vmask m; - vdouble u, s, t, rx, ry; - vdouble2 r; - - q = vrint_vi_vd(vmul(d, vcast_vd_d(rtengine::RT_2_PI))); - - s = d; - - u = vcast_vd_vi(q); - s = vmla(u, vcast_vd_d(-PI4_A*2), s); - s = vmla(u, vcast_vd_d(-PI4_B*2), s); - s = vmla(u, vcast_vd_d(-PI4_C*2), s); - - t = s; - - s = vmul(s, s); - - u = vcast_vd_d(1.58938307283228937328511e-10); - u = vmla(u, s, vcast_vd_d(-2.50506943502539773349318e-08)); - u = vmla(u, s, vcast_vd_d(2.75573131776846360512547e-06)); - u = vmla(u, s, vcast_vd_d(-0.000198412698278911770864914)); - u = vmla(u, s, vcast_vd_d(0.0083333333333191845961746)); - u = vmla(u, s, vcast_vd_d(-0.166666666666666130709393)); - u = vmul(vmul(u, s), t); - - rx = vadd(t, u); - - u = vcast_vd_d(-1.13615350239097429531523e-11); - u = vmla(u, s, vcast_vd_d(2.08757471207040055479366e-09)); - u = vmla(u, s, vcast_vd_d(-2.75573144028847567498567e-07)); - u = vmla(u, s, vcast_vd_d(2.48015872890001867311915e-05)); - u = vmla(u, s, vcast_vd_d(-0.00138888888888714019282329)); - u = vmla(u, s, vcast_vd_d(0.0416666666666665519592062)); - u = vmla(u, s, vcast_vd_d(-0.5)); - - ry = vadd(vcast_vd_d(1), vmul(s, u)); - - m = vmaski_eq(vandi(q, vcast_vi_i(1)), vcast_vi_i(0)); - r.x = vsel(m, rx, ry); - r.y = vsel(m, ry, rx); - - m = vmaski_eq(vandi(q, vcast_vi_i(2)), vcast_vi_i(2)); - r.x = vreinterpret_vd_vm(vxorm(vandm(m, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(r.x))); - - m = vmaski_eq(vandi(vaddi(q, vcast_vi_i(1)), vcast_vi_i(2)), vcast_vi_i(2)); - r.y = vreinterpret_vd_vm(vxorm(vandm(m, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(r.y))); - - m = vmask_isinf(d); - r.x = vsel(m, vcast_vd_d(rtengine::RT_NAN), r.x); - r.y = vsel(m, vcast_vd_d(rtengine::RT_NAN), r.y); - - return r; -} - -static INLINE vdouble xtan(vdouble d) { - vint q; - vdouble u, s, x; - vmask m; - - q = vrint_vi_vd(vmul(d, vcast_vd_d(rtengine::RT_2_PI))); - - u = vcast_vd_vi(q); - x = vadd(d, vmul(u, vcast_vd_d(-PI4_A*2))); - x = vadd(x, vmul(u, vcast_vd_d(-PI4_B*2))); - x = vadd(x, vmul(u, vcast_vd_d(-PI4_C*2))); - - s = vmul(x, x); - - m = vmaski_eq(vandi(q, vcast_vi_i(1)), vcast_vi_i(1)); - x = vsel(m, vneg(x), x); - - u = vcast_vd_d(1.01419718511083373224408e-05); - u = vmla(u, s, vcast_vd_d(-2.59519791585924697698614e-05)); - u = vmla(u, s, vcast_vd_d(5.23388081915899855325186e-05)); - u = vmla(u, s, vcast_vd_d(-3.05033014433946488225616e-05)); - u = vmla(u, s, vcast_vd_d(7.14707504084242744267497e-05)); - u = vmla(u, s, vcast_vd_d(8.09674518280159187045078e-05)); - u = vmla(u, s, vcast_vd_d(0.000244884931879331847054404)); - u = vmla(u, s, vcast_vd_d(0.000588505168743587154904506)); - u = vmla(u, s, vcast_vd_d(0.00145612788922812427978848)); - u = vmla(u, s, vcast_vd_d(0.00359208743836906619142924)); - u = vmla(u, s, vcast_vd_d(0.00886323944362401618113356)); - u = vmla(u, s, vcast_vd_d(0.0218694882853846389592078)); - u = vmla(u, s, vcast_vd_d(0.0539682539781298417636002)); - u = vmla(u, s, vcast_vd_d(0.133333333333125941821962)); - u = vmla(u, s, vcast_vd_d(0.333333333333334980164153)); - - u = vmla(s, vmul(u, x), x); - - u = vsel(m, vrec(u), u); - - u = vsel(vmask_isinf(d), vcast_vd_d(rtengine::RT_NAN), u); - - return u; -} - -static INLINE vdouble atan2k(vdouble y, vdouble x) { - vdouble s, t, u; - vint q; - vmask p; - - q = vseli_lt(x, vcast_vd_d(0), vcast_vi_i(-2), vcast_vi_i(0)); - x = vabs(x); - - q = vseli_lt(x, y, vaddi(q, vcast_vi_i(1)), q); - p = vmask_lt(x, y); - s = vsel (p, vneg(x), y); - t = vmax (x, y); - - s = vdiv(s, t); - t = vmul(s, s); - - u = vcast_vd_d(-1.88796008463073496563746e-05); - u = vmla(u, t, vcast_vd_d(0.000209850076645816976906797)); - u = vmla(u, t, vcast_vd_d(-0.00110611831486672482563471)); - u = vmla(u, t, vcast_vd_d(0.00370026744188713119232403)); - u = vmla(u, t, vcast_vd_d(-0.00889896195887655491740809)); - u = vmla(u, t, vcast_vd_d(0.016599329773529201970117)); - u = vmla(u, t, vcast_vd_d(-0.0254517624932312641616861)); - u = vmla(u, t, vcast_vd_d(0.0337852580001353069993897)); - u = vmla(u, t, vcast_vd_d(-0.0407629191276836500001934)); - u = vmla(u, t, vcast_vd_d(0.0466667150077840625632675)); - u = vmla(u, t, vcast_vd_d(-0.0523674852303482457616113)); - u = vmla(u, t, vcast_vd_d(0.0587666392926673580854313)); - u = vmla(u, t, vcast_vd_d(-0.0666573579361080525984562)); - u = vmla(u, t, vcast_vd_d(0.0769219538311769618355029)); - u = vmla(u, t, vcast_vd_d(-0.090908995008245008229153)); - u = vmla(u, t, vcast_vd_d(0.111111105648261418443745)); - u = vmla(u, t, vcast_vd_d(-0.14285714266771329383765)); - u = vmla(u, t, vcast_vd_d(0.199999999996591265594148)); - u = vmla(u, t, vcast_vd_d(-0.333333333333311110369124)); - - t = vadd(s, vmul(s, vmul(t, u))); - t = vadd(t, vmul(vcast_vd_vi(q), vcast_vd_d(rtengine::RT_PI/2))); - - return t; -} - -static INLINE vdouble xatan2(vdouble y, vdouble x) { - vdouble r = atan2k(vabs(y), x); - - r = vmulsign(r, x); - r = vsel(vorm(vmask_isinf(x), vmask_eq(x, vcast_vd_d(0))), vsub(vcast_vd_d(rtengine::RT_PI/2), visinf2(x, vmulsign(vcast_vd_d(rtengine::RT_PI/2), x))), r); - r = vsel(vmask_isinf(y), vsub(vcast_vd_d(rtengine::RT_PI/2), visinf2(x, vmulsign(vcast_vd_d(rtengine::RT_PI/4), x))), r); - r = vsel(vmask_eq(y, vcast_vd_d(0)), vsel(vmask_eq(vsign(x), vcast_vd_d(-1.0)), vcast_vd_d(rtengine::RT_PI), vcast_vd_d(0)), r); - - return vsel(vorm(vmask_isnan(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_NAN), vmulsign(r, y)); -} - -static INLINE vdouble xasin(vdouble d) { - vdouble x, y; - x = vadd(vcast_vd_d(1), d); - y = vsub(vcast_vd_d(1), d); - x = vmul(x, y); - x = vsqrt(x); - x = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), atan2k(vabs(d), x)); - return vmulsign(x, d); -} - -static INLINE vdouble xacos(vdouble d) { - vdouble x, y; - x = vadd(vcast_vd_d(1), d); - y = vsub(vcast_vd_d(1), d); - x = vmul(x, y); - x = vsqrt(x); - x = vmulsign(atan2k(x, vabs(d)), d); - y = (vdouble)vandm(vmask_lt(d, vcast_vd_d(0)), (vmask)vcast_vd_d(rtengine::RT_PI)); - x = vadd(x, y); - return x; -} - -static INLINE vdouble xatan(vdouble s) { - vdouble t, u; - vint q; - - q = vseli_lt(s, vcast_vd_d(0), vcast_vi_i(2), vcast_vi_i(0)); - s = vabs(s); - - q = vseli_lt(vcast_vd_d(1), s, vaddi(q, vcast_vi_i(1)), q); - s = vsel(vmask_lt(vcast_vd_d(1), s), vdiv(vcast_vd_d(1), s), s); - - t = vmul(s, s); - - u = vcast_vd_d(-1.88796008463073496563746e-05); - u = vmla(u, t, vcast_vd_d(0.000209850076645816976906797)); - u = vmla(u, t, vcast_vd_d(-0.00110611831486672482563471)); - u = vmla(u, t, vcast_vd_d(0.00370026744188713119232403)); - u = vmla(u, t, vcast_vd_d(-0.00889896195887655491740809)); - u = vmla(u, t, vcast_vd_d(0.016599329773529201970117)); - u = vmla(u, t, vcast_vd_d(-0.0254517624932312641616861)); - u = vmla(u, t, vcast_vd_d(0.0337852580001353069993897)); - u = vmla(u, t, vcast_vd_d(-0.0407629191276836500001934)); - u = vmla(u, t, vcast_vd_d(0.0466667150077840625632675)); - u = vmla(u, t, vcast_vd_d(-0.0523674852303482457616113)); - u = vmla(u, t, vcast_vd_d(0.0587666392926673580854313)); - u = vmla(u, t, vcast_vd_d(-0.0666573579361080525984562)); - u = vmla(u, t, vcast_vd_d(0.0769219538311769618355029)); - u = vmla(u, t, vcast_vd_d(-0.090908995008245008229153)); - u = vmla(u, t, vcast_vd_d(0.111111105648261418443745)); - u = vmla(u, t, vcast_vd_d(-0.14285714266771329383765)); - u = vmla(u, t, vcast_vd_d(0.199999999996591265594148)); - u = vmla(u, t, vcast_vd_d(-0.333333333333311110369124)); - - t = vadd(s, vmul(s, vmul(t, u))); - - t = vsel(vmaski_eq(vandi(q, vcast_vi_i(1)), vcast_vi_i(1)), vsub(vcast_vd_d(rtengine::RT_PI/2), t), t); - t = vsel(vmaski_eq(vandi(q, vcast_vi_i(2)), vcast_vi_i(2)), vneg(t), t); - - return t; -} - -static INLINE vdouble xlog(vdouble d) { - vdouble x, x2; - vdouble t, m; - vint e; - - e = vilogbp1(vmul(d, vcast_vd_d(0.7071))); - m = vldexp(d, vsubi(vcast_vi_i(0), e)); - - x = vdiv(vadd(vcast_vd_d(-1), m), vadd(vcast_vd_d(1), m)); - x2 = vmul(x, x); - - t = vcast_vd_d(0.148197055177935105296783); - t = vmla(t, x2, vcast_vd_d(0.153108178020442575739679)); - t = vmla(t, x2, vcast_vd_d(0.181837339521549679055568)); - t = vmla(t, x2, vcast_vd_d(0.22222194152736701733275)); - t = vmla(t, x2, vcast_vd_d(0.285714288030134544449368)); - t = vmla(t, x2, vcast_vd_d(0.399999999989941956712869)); - t = vmla(t, x2, vcast_vd_d(0.666666666666685503450651)); - t = vmla(t, x2, vcast_vd_d(2)); - - x = vadd(vmul(x, t), vmul(vcast_vd_d(0.693147180559945286226764), vcast_vd_vi(e))); - - x = vsel(vmask_ispinf(d), vcast_vd_d(rtengine::RT_INFINITY), x); - x = vsel(vmask_gt(vcast_vd_d(0), d), vcast_vd_d(rtengine::RT_NAN), x); - x = vsel(vmask_eq(d, vcast_vd_d(0)), vcast_vd_d(-rtengine::RT_INFINITY), x); - - return x; -} - -static INLINE vdouble xexp(vdouble d) { - vint q = vrint_vi_vd(vmul(d, vcast_vd_d(R_LN2))); - vdouble s, u; - - s = vadd(d, vmul(vcast_vd_vi(q), vcast_vd_d(-L2U))); - s = vadd(s, vmul(vcast_vd_vi(q), vcast_vd_d(-L2L))); - - u = vcast_vd_d(2.08860621107283687536341e-09); - u = vmla(u, s, vcast_vd_d(2.51112930892876518610661e-08)); - u = vmla(u, s, vcast_vd_d(2.75573911234900471893338e-07)); - u = vmla(u, s, vcast_vd_d(2.75572362911928827629423e-06)); - u = vmla(u, s, vcast_vd_d(2.4801587159235472998791e-05)); - u = vmla(u, s, vcast_vd_d(0.000198412698960509205564975)); - u = vmla(u, s, vcast_vd_d(0.00138888888889774492207962)); - u = vmla(u, s, vcast_vd_d(0.00833333333331652721664984)); - u = vmla(u, s, vcast_vd_d(0.0416666666666665047591422)); - u = vmla(u, s, vcast_vd_d(0.166666666666666851703837)); - u = vmla(u, s, vcast_vd_d(0.5)); - - u = vadd(vcast_vd_d(1), vadd(s, vmul(vmul(s, s), u))); - - u = vldexp(u, q); - - u = vsel(vmask_isminf(d), vcast_vd_d(0), u); - - return u; -} - -static INLINE vdouble2 logk(vdouble d) { - vdouble2 x, x2; - vdouble t, m; - vint e; - - e = vilogbp1(vmul(d, vcast_vd_d(0.7071))); - m = vldexp(d, vsubi(vcast_vi_i(0), e)); - - x = div_dd(add2_ss(vcast_vd_d(-1), m), add2_ss(vcast_vd_d(1), m)); - x2 = squ_d(x); - x2 = normalize_d(x2); - - t = vcast_vd_d(0.134601987501262130076155); - t = vmla(t, x2.x, vcast_vd_d(0.132248509032032670243288)); - t = vmla(t, x2.x, vcast_vd_d(0.153883458318096079652524)); - t = vmla(t, x2.x, vcast_vd_d(0.181817427573705403298686)); - t = vmla(t, x2.x, vcast_vd_d(0.222222231326187414840781)); - t = vmla(t, x2.x, vcast_vd_d(0.285714285651261412873718)); - t = vmla(t, x2.x, vcast_vd_d(0.400000000000222439910458)); - t = vmla(t, x2.x, vcast_vd_d(0.666666666666666371239645)); - - return add2_dd(mul_ds(dd(vcast_vd_d(0.693147180559945286226764), vcast_vd_d(2.319046813846299558417771e-17)), - vcast_vd_vi(e)), - add2_dd(scale_d(x, vcast_vd_d(2)), mul_ds(mul_dd(x2, x), t))); -} - -static INLINE vdouble expk(vdouble2 d) { - vdouble u = vmul(vadd(d.x, d.y), vcast_vd_d(R_LN2)); - vint q = vrint_vi_vd(u); - vdouble2 s, t; - - s = add2_ds(d, vmul(vcast_vd_vi(q), vcast_vd_d(-L2U))); - s = add2_ds(s, vmul(vcast_vd_vi(q), vcast_vd_d(-L2L))); - - q = vrint_vi_vd(vmin(vmax(vcast_vd_d(-2047.49), u), vcast_vd_d(2047.49))); - - s = normalize_d(s); - - u = vcast_vd_d(2.51069683420950419527139e-08); - u = vmla(u, s.x, vcast_vd_d(2.76286166770270649116855e-07)); - u = vmla(u, s.x, vcast_vd_d(2.75572496725023574143864e-06)); - u = vmla(u, s.x, vcast_vd_d(2.48014973989819794114153e-05)); - u = vmla(u, s.x, vcast_vd_d(0.000198412698809069797676111)); - u = vmla(u, s.x, vcast_vd_d(0.0013888888939977128960529)); - u = vmla(u, s.x, vcast_vd_d(0.00833333333332371417601081)); - u = vmla(u, s.x, vcast_vd_d(0.0416666666665409524128449)); - u = vmla(u, s.x, vcast_vd_d(0.166666666666666740681535)); - u = vmla(u, s.x, vcast_vd_d(0.500000000000000999200722)); - - t = add_dd(s, mul_ds(squ_d(s), u)); - - t = add_sd(vcast_vd_d(1), t); - u = vadd(t.x, t.y); - u = vldexp(u, q); - - return u; -} - -static INLINE vdouble xpow(vdouble x, vdouble y) { -#if 1 - vmask yisint = vmask_eq(vcast_vd_vi(vrint_vi_vd(y)), y); - vmask yisodd = vandm(vmaski_eq(vandi(vrint_vi_vd(y), vcast_vi_i(1)), vcast_vi_i(1)), yisint); - - vdouble result = expk(mul_ds(logk(vabs(x)), y)); - - //result = vsel(vmask_isnan(result), vcast_vd_d(rtengine::RT_INFINITY), result); - - result = vmul(result, - vsel(vmask_gt(x, vcast_vd_d(0)), - vcast_vd_d(1), - vsel(yisint, - vsel(yisodd, - vcast_vd_d(-1), - vcast_vd_d(1)), - vcast_vd_d(rtengine::RT_NAN)))); - - vdouble efx = vreinterpret_vd_vm(vxorm(vreinterpret_vm_vd(vsub(vabs(x), vcast_vd_d(1))), vsignbit(y))); - - result = vsel(vmask_isinf(y), - vsel(vmask_lt(efx, vcast_vd_d(0)), - vcast_vd_d(0), - vsel(vmask_eq(efx, vcast_vd_d(0)), - vcast_vd_d(1.0), - vcast_vd_d(rtengine::RT_INFINITY))), - result); - - result = vsel(vorm(vmask_isinf(x), vmask_eq(x, vcast_vd_d(0))), - vmul(vsel(yisodd, vsign(x), vcast_vd_d(1)), - vsel(vmask_lt(vsel(vmask_eq(x, vcast_vd_d(0)), vneg(y), y), vcast_vd_d(0)), - vcast_vd_d(0), - vcast_vd_d(rtengine::RT_INFINITY))), - result); - - result = vsel(vorm(vmask_isnan(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_NAN), result); - - result = vsel(vorm(vmask_eq(y, vcast_vd_d(0)), vmask_eq(x, vcast_vd_d(1))), vcast_vd_d(1), result); - - return result; -#else - return expk(mul_ds(logk(x), y)); -#endif -} - -static INLINE vdouble2 expk2(vdouble2 d) { - vdouble u = vmul(vadd(d.x, d.y), vcast_vd_d(R_LN2)); - vint q = vrint_vi_vd(u); - vdouble2 s, t; - - s = add2_ds(d, vmul(vcast_vd_vi(q), vcast_vd_d(-L2U))); - s = add2_ds(s, vmul(vcast_vd_vi(q), vcast_vd_d(-L2L))); - - q = vrint_vi_vd(vmin(vmax(vcast_vd_d(-2047.49), u), vcast_vd_d(2047.49))); - - s = normalize_d(s); - - u = vcast_vd_d(2.51069683420950419527139e-08); - u = vmla(u, s.x, vcast_vd_d(2.76286166770270649116855e-07)); - u = vmla(u, s.x, vcast_vd_d(2.75572496725023574143864e-06)); - u = vmla(u, s.x, vcast_vd_d(2.48014973989819794114153e-05)); - u = vmla(u, s.x, vcast_vd_d(0.000198412698809069797676111)); - u = vmla(u, s.x, vcast_vd_d(0.0013888888939977128960529)); - u = vmla(u, s.x, vcast_vd_d(0.00833333333332371417601081)); - u = vmla(u, s.x, vcast_vd_d(0.0416666666665409524128449)); - u = vmla(u, s.x, vcast_vd_d(0.166666666666666740681535)); - u = vmla(u, s.x, vcast_vd_d(0.500000000000000999200722)); - - t = add_dd(s, mul_ds(squ_d(s), u)); - - t = add_sd(vcast_vd_d(1), t); - - return dd(vldexp(t.x, q), vldexp(t.y, q)); -} - -static INLINE vdouble xsinh(vdouble x) { - vdouble y = vabs(x); - vdouble2 d = expk2(dd(y, vcast_vd_d(0))); - d = add2_dd(d, div_dd(dd(vcast_vd_d(-1), vcast_vd_d(0)), d)); - y = vmul(vadd(d.x, d.y), vcast_vd_d(0.5)); - - y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_INFINITY), y); - y = vmulsign(y, x); - y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); - - return y; -} - -static INLINE vdouble xcosh(vdouble x) { - vdouble2 d = expk2(dd(x, vcast_vd_d(0))); - d = add2_dd(d, div_dd(dd(vcast_vd_d(1), vcast_vd_d(0)), d)); - vdouble y = vmul(vadd(d.x, d.y), vcast_vd_d(0.5)); - - y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_INFINITY), y); - y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); - - return y; -} - -static INLINE vdouble xtanh(vdouble x) { - vdouble y = vabs(x); - vdouble2 d = expk2(dd(y, vcast_vd_d(0))); - vdouble2 e = div_dd(dd(vcast_vd_d(1), vcast_vd_d(0)), d); - d = div_dd(add2_dd(d, scale_d(e, vcast_vd_d(-1))), add2_dd(d, e)); - y = d.x + d.y; - - y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(1.0), y); - y = vmulsign(y, x); - y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); - - return y; -} - -static INLINE vdouble2 logk2(vdouble2 d) { - vdouble2 x, x2, m; - vdouble t; - vint e; - - d = normalize_d(d); - e = vilogbp1(vmul(d.x, vcast_vd_d(0.7071))); - m = scale_d(d, vldexp(vcast_vd_d(1), vsubi(vcast_vi_i(0), e))); - - x = div_dd(add2_ds(m, vcast_vd_d(-1)), add2_ds(m, vcast_vd_d(1))); - x2 = squ_d(x); - x2 = normalize_d(x2); - - t = vcast_vd_d(0.134601987501262130076155); - t = vmla(t, x2.x, vcast_vd_d(0.132248509032032670243288)); - t = vmla(t, x2.x, vcast_vd_d(0.153883458318096079652524)); - t = vmla(t, x2.x, vcast_vd_d(0.181817427573705403298686)); - t = vmla(t, x2.x, vcast_vd_d(0.222222231326187414840781)); - t = vmla(t, x2.x, vcast_vd_d(0.285714285651261412873718)); - t = vmla(t, x2.x, vcast_vd_d(0.400000000000222439910458)); - t = vmla(t, x2.x, vcast_vd_d(0.666666666666666371239645)); - - return add2_dd(mul_ds(dd(vcast_vd_d(0.693147180559945286226764), vcast_vd_d(2.319046813846299558417771e-17)), - vcast_vd_vi(e)), - add2_dd(scale_d(x, vcast_vd_d(2)), mul_ds(mul_dd(x2, x), t))); -} - -static INLINE vdouble xasinh(vdouble x) { - vdouble y = vabs(x); - vdouble2 d = logk2(add2_ds(sqrt_d(add2_ds(mul_ss(y, y), vcast_vd_d(1))), y)); - y = vadd(d.x, d.y); - - y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_INFINITY), y); - y = vmulsign(y, x); - y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); - - return y; -} - -static INLINE vdouble xacosh(vdouble x) { - vdouble2 d = logk2(add2_ds(sqrt_d(add2_ds(mul_ss(x, x), vcast_vd_d(-1))), x)); - vdouble y = vadd(d.x, d.y); - - y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_INFINITY), y); - y = vsel(vmask_eq(x, vcast_vd_d(1.0)), vcast_vd_d(0.0), y); - y = vsel(vmask_lt(x, vcast_vd_d(1.0)), vcast_vd_d(rtengine::RT_NAN), y); - y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); - - return y; -} - -static INLINE vdouble xatanh(vdouble x) { - vdouble y = vabs(x); - vdouble2 d = logk2(div_dd(add2_ss(vcast_vd_d(1), y), add2_ss(vcast_vd_d(1), -y))); - y = vsel(vmask_gt(y, vcast_vd_d(1.0)), vcast_vd_d(rtengine::RT_NAN), vsel(vmask_eq(y, vcast_vd_d(1.0)), vcast_vd_d(rtengine::RT_INFINITY), vmul(vadd(d.x, d.y), vcast_vd_d(0.5)))); - - y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_NAN), y); - y = vmulsign(y, x); - y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); - - return y; -} - -static INLINE vdouble xcbrt(vdouble d) { - vdouble x, y, q = vcast_vd_d(1.0); - vint e, qu, re; - vdouble t; - - e = vilogbp1(vabs(d)); - d = vldexp(d, vsubi(vcast_vi_i(0), e)); - - t = vadd(vcast_vd_vi(e), vcast_vd_d(6144)); - qu = vtruncate_vi_vd(vdiv(t, vcast_vd_d(3))); - re = vtruncate_vi_vd(vsub(t, vmul(vcast_vd_vi(qu), vcast_vd_d(3)))); - - q = vsel(vmaski_eq(re, vcast_vi_i(1)), vcast_vd_d(1.2599210498948731647672106), q); - q = vsel(vmaski_eq(re, vcast_vi_i(2)), vcast_vd_d(1.5874010519681994747517056), q); - q = vldexp(q, vsubi(qu, vcast_vi_i(2048))); - - q = vmulsign(q, d); - - d = vabs(d); - - x = vcast_vd_d(-0.640245898480692909870982); - x = vmla(x, d, vcast_vd_d(2.96155103020039511818595)); - x = vmla(x, d, vcast_vd_d(-5.73353060922947843636166)); - x = vmla(x, d, vcast_vd_d(6.03990368989458747961407)); - x = vmla(x, d, vcast_vd_d(-3.85841935510444988821632)); - x = vmla(x, d, vcast_vd_d(2.2307275302496609725722)); - - y = vmul(x, x); y = vmul(y, y); x = vsub(x, vmul(vmla(d, y, vneg(x)), vcast_vd_d(1.0 / 3.0))); - y = vmul(vmul(d, x), x); - y = vmul(vsub(y, vmul(vmul(vcast_vd_d(2.0 / 3.0), y), vmla(y, x, vcast_vd_d(-1.0)))), q); - - return y; -} - -static INLINE vdouble xexp2(vdouble a) { - vdouble u = expk(mul_ds(dd(vcast_vd_d(0.69314718055994528623), vcast_vd_d(2.3190468138462995584e-17)), a)); - u = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), u); - u = vsel(vmask_isminf(a), vcast_vd_d(0), u); - return u; -} - -static INLINE vdouble xexp10(vdouble a) { - vdouble u = expk(mul_ds(dd(vcast_vd_d(2.3025850929940459011), vcast_vd_d(-2.1707562233822493508e-16)), a)); - u = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), u); - u = vsel(vmask_isminf(a), vcast_vd_d(0), u); - return u; -} - -static INLINE vdouble xexpm1(vdouble a) { - vdouble2 d = add2_ds(expk2(dd(a, vcast_vd_d(0))), vcast_vd_d(-1.0)); - vdouble x = d.x + d.y; - x = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), x); - x = vsel(vmask_isminf(a), vcast_vd_d(-1), x); - return x; -} - -static INLINE vdouble xlog10(vdouble a) { - vdouble2 d = mul_dd(logk(a), dd(vcast_vd_d(0.43429448190325176116), vcast_vd_d(6.6494347733425473126e-17))); - vdouble x = d.x + d.y; - - x = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), x); - x = vsel(vmask_gt(vcast_vd_d(0), a), vcast_vd_d(rtengine::RT_NAN), x); - x = vsel(vmask_eq(a, vcast_vd_d(0)), vcast_vd_d(-rtengine::RT_INFINITY), x); - - return x; -} - -static INLINE vdouble xlog1p(vdouble a) { - vdouble2 d = logk2(add2_ss(a, vcast_vd_d(1))); - vdouble x = d.x + d.y; - - x = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), x); - x = vsel(vmask_gt(vcast_vd_d(-1), a), vcast_vd_d(rtengine::RT_NAN), x); - x = vsel(vmask_eq(a, vcast_vd_d(-1)), vcast_vd_d(-rtengine::RT_INFINITY), x); - - return x; -} - -// - -typedef struct { - vfloat x, y; -} vfloat2; - -static INLINE vfloat vabsf(vfloat f) { return (vfloat)vandnotm((vmask)vcast_vf_f(-0.0f), (vmask)f); } -static INLINE vfloat vnegf(vfloat f) { return (vfloat)vxorm((vmask)f, (vmask)vcast_vf_f(-0.0f)); } - -#ifdef __SSE4_1__ -// only one instruction when using SSE4.1 -static INLINE vfloat vself(vmask mask, vfloat x, vfloat y) { - return _mm_blendv_ps(y,x,(vfloat)mask); -} - -static INLINE vint vselc(vmask mask, vint x, vint y) { - return _mm_blendv_epi8(y,x,mask); -} - -#else -// three instructions when using SSE2 -static INLINE vfloat vself(vmask mask, vfloat x, vfloat y) { - return (vfloat)vorm(vandm(mask, (vmask)x), vandnotm(mask, (vmask)y)); -} - -static INLINE vint vselc(vmask mask, vint x, vint y) { - return vorm(vandm(mask, (vmask)x), vandnotm(mask, (vmask)y)); -} -#endif - -static INLINE vfloat vselfzero(vmask mask, vfloat x) { - // returns value of x if corresponding mask bits are 1, else returns 0 - // faster than vself(mask, x, ZEROV) - return _mm_and_ps((vfloat)mask, x); -} -static INLINE vfloat vselfnotzero(vmask mask, vfloat x) { - // returns value of x if corresponding mask bits are 0, else returns 0 - // faster than vself(mask, ZEROV, x) - return _mm_andnot_ps((vfloat)mask, x); -} - -static INLINE vint vselizero(vmask mask, vint x) { - // returns value of x if corresponding mask bits are 1, else returns 0 - // faster than vselc(mask, x, ZEROV) - return _mm_and_si128(mask, x); -} -static INLINE vint vselinotzero(vmask mask, vint x) { - // returns value of x if corresponding mask bits are 0, else returns 0 - // faster than vselc(mask, ZEROV, x) - return _mm_andnot_si128(mask, x); -} - -static INLINE vint2 vseli2_lt(vfloat f0, vfloat f1, vint2 x, vint2 y) { - vint2 m2 = vcast_vi2_vm(vmaskf_lt(f0, f1)); - return vori2(vandi2(m2, x), vandnoti2(m2, y)); -} - -static INLINE vmask vsignbitf(vfloat f) { - return vandm((vmask)f, (vmask)vcast_vf_f(-0.0f)); -} - -static INLINE vfloat vmulsignf(vfloat x, vfloat y) { - return (vfloat)vxorm((vmask)x, vsignbitf(y)); -} - -static INLINE vfloat vsignf(vfloat f) { - return (vfloat)vorm((vmask)vcast_vf_f(1.0f), vandm((vmask)vcast_vf_f(-0.0f), (vmask)f)); -} - -static INLINE vmask vmaskf_isinf(vfloat d) { return vmaskf_eq(vabsf(d), vcast_vf_f(INFINITYf)); } -static INLINE vmask vmaskf_ispinf(vfloat d) { return vmaskf_eq(d, vcast_vf_f(INFINITYf)); } -static INLINE vmask vmaskf_isminf(vfloat d) { return vmaskf_eq(d, vcast_vf_f(-INFINITYf)); } -static INLINE vmask vmaskf_isnan(vfloat d) { return vmaskf_neq(d, d); } -// the following is equivalent to vorm(vmaskf_isnan(a), vmaskf_isnan(b)), but faster -static INLINE vmask vmaskf_isnan(vfloat a, vfloat b) { return (vmask)_mm_cmpunord_ps(a, b); } -static INLINE vfloat visinf2f(vfloat d, vfloat m) { return (vfloat)vandm(vmaskf_isinf(d), vorm(vsignbitf(d), (vmask)m)); } -static INLINE vfloat visinff(vfloat d) { return visinf2f(d, vcast_vf_f(1.0f)); } - -static INLINE vint2 vilogbp1f(vfloat d) { - vmask m = vmaskf_lt(d, vcast_vf_f(5.421010862427522E-20f)); - d = vself(m, vmulf(vcast_vf_f(1.8446744073709552E19f), d), d); - vint2 q = vandi2(vsrli2(vcast_vi2_vm(vreinterpret_vm_vf(d)), 23), vcast_vi2_i(0xff)); - q = vsubi2(q, vseli2(m, vcast_vi2_i(64 + 0x7e), vcast_vi2_i(0x7e))); - return q; -} - -static INLINE vfloat vldexpf(vfloat x, vint2 q) { - vfloat u; - vint2 m = vsrai2(q, 31); - m = vslli2(vsubi2(vsrai2(vaddi2(m, q), 6), m), 4); - q = vsubi2(q, vslli2(m, 2)); - u = vreinterpret_vf_vm(vcast_vm_vi2(vslli2(vaddi2(m, vcast_vi2_i(0x7f)), 23))); - x = vmulf(vmulf(vmulf(vmulf(x, u), u), u), u); - u = vreinterpret_vf_vm(vcast_vm_vi2(vslli2(vaddi2(q, vcast_vi2_i(0x7f)), 23))); - return vmulf(x, u); -} - -static INLINE vfloat xsinf(vfloat d) { - vint2 q; - vfloat u, s; - - q = vrint_vi2_vf(vmulf(d, vcast_vf_f((float)rtengine::RT_1_PI))); - - u = vcast_vf_vi2(q); - d = vmlaf(u, vcast_vf_f(-PI4_Af*4), d); - d = vmlaf(u, vcast_vf_f(-PI4_Bf*4), d); - d = vmlaf(u, vcast_vf_f(-PI4_Cf*4), d); - d = vmlaf(u, vcast_vf_f(-PI4_Df*4), d); - - s = vmulf(d, d); - - d = vself(vmaski2_eq(vandi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vnegf(d), d); - - u = vcast_vf_f(2.6083159809786593541503e-06f); - u = vmlaf(u, s, vcast_vf_f(-0.0001981069071916863322258f)); - u = vmlaf(u, s, vcast_vf_f(0.00833307858556509017944336f)); - u = vmlaf(u, s, vcast_vf_f(-0.166666597127914428710938f)); - - u = vmlaf(s, vmulf(u, d), d); - - return u; -} - -static INLINE vfloat xcosf(vfloat d) { - vint2 q; - vfloat u, s; - - q = vrint_vi2_vf(vsubf(vmulf(d, vcast_vf_f((float)rtengine::RT_1_PI)), vcast_vf_f(0.5f))); - q = vaddi2(vaddi2(q, q), vcast_vi2_i(1)); - - u = vcast_vf_vi2(q); - d = vmlaf(u, vcast_vf_f(-PI4_Af*2), d); - d = vmlaf(u, vcast_vf_f(-PI4_Bf*2), d); - d = vmlaf(u, vcast_vf_f(-PI4_Cf*2), d); - d = vmlaf(u, vcast_vf_f(-PI4_Df*2), d); - - s = vmulf(d, d); - - d = vself(vmaski2_eq(vandi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)), d, vnegf(d)); - - u = vcast_vf_f(2.6083159809786593541503e-06f); - u = vmlaf(u, s, vcast_vf_f(-0.0001981069071916863322258f)); - u = vmlaf(u, s, vcast_vf_f(0.00833307858556509017944336f)); - u = vmlaf(u, s, vcast_vf_f(-0.166666597127914428710938f)); - - u = vmlaf(s, vmulf(u, d), d); - - return u; -} - -static INLINE vfloat2 xsincosf(vfloat d) { - vint2 q; - vmask m; - vfloat u, s, t, rx, ry; - vfloat2 r; - - q = vrint_vi2_vf(vmulf(d, vcast_vf_f((float)rtengine::RT_2_PI))); - - s = d; - - u = vcast_vf_vi2(q); - s = vmlaf(u, vcast_vf_f(-PI4_Af*2), s); - s = vmlaf(u, vcast_vf_f(-PI4_Bf*2), s); - s = vmlaf(u, vcast_vf_f(-PI4_Cf*2), s); - s = vmlaf(u, vcast_vf_f(-PI4_Df*2), s); - - t = s; - - s = vmulf(s, s); - - u = vcast_vf_f(-0.000195169282960705459117889f); - u = vmlaf(u, s, vcast_vf_f(0.00833215750753879547119141f)); - u = vmlaf(u, s, vcast_vf_f(-0.166666537523269653320312f)); - u = vmulf(vmulf(u, s), t); - - rx = vaddf(t, u); - - u = vcast_vf_f(-2.71811842367242206819355e-07f); - u = vmlaf(u, s, vcast_vf_f(2.47990446951007470488548e-05f)); - u = vmlaf(u, s, vcast_vf_f(-0.00138888787478208541870117f)); - u = vmlaf(u, s, vcast_vf_f(0.0416666641831398010253906f)); - u = vmlaf(u, s, vcast_vf_f(-0.5)); - - ry = vaddf(vcast_vf_f(1), vmulf(s, u)); - - m = vmaski2_eq(vandi2(q, vcast_vi2_i(1)), vcast_vi2_i(0)); - r.x = vself(m, rx, ry); - r.y = vself(m, ry, rx); - - m = vmaski2_eq(vandi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)); - r.x = vreinterpret_vf_vm(vxorm(vandm(m, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(r.x))); - - m = vmaski2_eq(vandi2(vaddi2(q, vcast_vi2_i(1)), vcast_vi2_i(2)), vcast_vi2_i(2)); - r.y = vreinterpret_vf_vm(vxorm(vandm(m, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(r.y))); - - m = vmaskf_isinf(d); - r.x = vself(m, vcast_vf_f(rtengine::RT_NAN), r.x); - r.y = vself(m, vcast_vf_f(rtengine::RT_NAN), r.y); - - return r; -} - -static INLINE vfloat xtanf(vfloat d) { - vint2 q; - vmask m; - vfloat u, s, x; - - q = vrint_vi2_vf(vmulf(d, vcast_vf_f((float)(2 * rtengine::RT_1_PI)))); - - x = d; - - u = vcast_vf_vi2(q); - x = vmlaf(u, vcast_vf_f(-PI4_Af*2), x); - x = vmlaf(u, vcast_vf_f(-PI4_Bf*2), x); - x = vmlaf(u, vcast_vf_f(-PI4_Cf*2), x); - x = vmlaf(u, vcast_vf_f(-PI4_Df*2), x); - - s = vmulf(x, x); - - m = vmaski2_eq(vandi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)); - x = vself(m, vnegf(x), x); - - u = vcast_vf_f(0.00927245803177356719970703f); - u = vmlaf(u, s, vcast_vf_f(0.00331984995864331722259521f)); - u = vmlaf(u, s, vcast_vf_f(0.0242998078465461730957031f)); - u = vmlaf(u, s, vcast_vf_f(0.0534495301544666290283203f)); - u = vmlaf(u, s, vcast_vf_f(0.133383005857467651367188f)); - u = vmlaf(u, s, vcast_vf_f(0.333331853151321411132812f)); - - u = vmlaf(s, vmulf(u, x), x); - - u = vself(m, vrecf(u), u); - - u = vself(vmaskf_isinf(d), vcast_vf_f(NANf), u); - - return u; -} - -static INLINE vfloat xatanf(vfloat s) { - vfloat t, u; - vint2 q; - - q = vseli2_lt(s, vcast_vf_f(0.0f), vcast_vi2_i(2), vcast_vi2_i(0)); - s = vabsf(s); - - q = vseli2_lt(vcast_vf_f(1.0f), s, vaddi2(q, vcast_vi2_i(1)), q); - s = vself(vmaskf_lt(vcast_vf_f(1.0f), s), vdivf(vcast_vf_f(1.0f), s), s); - - t = vmulf(s, s); - - u = vcast_vf_f(0.00282363896258175373077393f); - u = vmlaf(u, t, vcast_vf_f(-0.0159569028764963150024414f)); - u = vmlaf(u, t, vcast_vf_f(0.0425049886107444763183594f)); - u = vmlaf(u, t, vcast_vf_f(-0.0748900920152664184570312f)); - u = vmlaf(u, t, vcast_vf_f(0.106347933411598205566406f)); - u = vmlaf(u, t, vcast_vf_f(-0.142027363181114196777344f)); - u = vmlaf(u, t, vcast_vf_f(0.199926957488059997558594f)); - u = vmlaf(u, t, vcast_vf_f(-0.333331018686294555664062f)); - - t = vaddf(s, vmulf(s, vmulf(t, u))); - - t = vself(vmaski2_eq(vandi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vsubf(vcast_vf_f((float)(rtengine::RT_PI/2)), t), t); - t = vself(vmaski2_eq(vandi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)), vnegf(t), t); - - return t; -} - -static INLINE vfloat atan2kf(vfloat y, vfloat x) { - vfloat s, t, u; - vint2 q; - vmask p; - - q = vseli2_lt(x, vcast_vf_f(0.0f), vcast_vi2_i(-2), vcast_vi2_i(0)); - x = vabsf(x); - - q = vseli2_lt(x, y, vaddi2(q, vcast_vi2_i(1)), q); - p = vmaskf_lt(x, y); - s = vself(p, vnegf(x), y); - t = vmaxf(x, y); - - s = vdivf(s, t); - t = vmulf(s, s); - - u = vcast_vf_f(0.00282363896258175373077393f); - u = vmlaf(u, t, vcast_vf_f(-0.0159569028764963150024414f)); - u = vmlaf(u, t, vcast_vf_f(0.0425049886107444763183594f)); - u = vmlaf(u, t, vcast_vf_f(-0.0748900920152664184570312f)); - u = vmlaf(u, t, vcast_vf_f(0.106347933411598205566406f)); - u = vmlaf(u, t, vcast_vf_f(-0.142027363181114196777344f)); - u = vmlaf(u, t, vcast_vf_f(0.199926957488059997558594f)); - u = vmlaf(u, t, vcast_vf_f(-0.333331018686294555664062f)); - - t = vaddf(s, vmulf(s, vmulf(t, u))); - t = vaddf(t, vmulf(vcast_vf_vi2(q), vcast_vf_f((float)(rtengine::RT_PI/2)))); - - return t; -} - -static INLINE vfloat xatan2f(vfloat y, vfloat x) { - vfloat r = atan2kf(vabsf(y), x); - - r = vmulsignf(r, x); - r = vself(vorm(vmaskf_isinf(x), vmaskf_eq(x, vcast_vf_f(0.0f))), vsubf(vcast_vf_f((float)(rtengine::RT_PI/2)), visinf2f(x, vmulsignf(vcast_vf_f((float)(rtengine::RT_PI/2)), x))), r); - r = vself(vmaskf_isinf(y), vsubf(vcast_vf_f((float)(rtengine::RT_PI/2)), visinf2f(x, vmulsignf(vcast_vf_f((float)(rtengine::RT_PI/4)), x))), r); - r = vself(vmaskf_eq(y, vcast_vf_f(0.0f)), vselfzero(vmaskf_eq(vsignf(x), vcast_vf_f(-1.0f)), vcast_vf_f((float)rtengine::RT_PI)), r); - - return vself(vmaskf_isnan(x, y), vcast_vf_f(NANf), vmulsignf(r, y)); -} - -static INLINE vfloat xasinf(vfloat d) { - vfloat x, y; - x = vaddf(vcast_vf_f(1.0f), d); - y = vsubf(vcast_vf_f(1.0f), d); - x = vmulf(x, y); - x = vsqrtf(x); - x = vself(vmaskf_isnan(x), vcast_vf_f(NANf), atan2kf(vabsf(d), x)); - return vmulsignf(x, d); -} - -static INLINE vfloat xacosf(vfloat d) { - vfloat x, y; - x = vaddf(vcast_vf_f(1.0f), d); - y = vsubf(vcast_vf_f(1.0f), d); - x = vmulf(x, y); - x = vsqrtf(x); - x = vmulsignf(atan2kf(x, vabsf(d)), d); - y = (vfloat)vandm(vmaskf_lt(d, vcast_vf_f(0.0f)), (vmask)vcast_vf_f((float)rtengine::RT_PI)); - x = vaddf(x, y); - return x; -} - -static INLINE vfloat xlogf(vfloat d) { - vfloat x, x2, t, m; - vint2 e; - - e = vilogbp1f(vmulf(d, vcast_vf_f(0.7071f))); - m = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); - - x = vdivf(vaddf(vcast_vf_f(-1.0f), m), vaddf(vcast_vf_f(1.0f), m)); - x2 = vmulf(x, x); - - t = vcast_vf_f(0.2371599674224853515625f); - t = vmlaf(t, x2, vcast_vf_f(0.285279005765914916992188f)); - t = vmlaf(t, x2, vcast_vf_f(0.400005519390106201171875f)); - t = vmlaf(t, x2, vcast_vf_f(0.666666567325592041015625f)); - t = vmlaf(t, x2, vcast_vf_f(2.0f)); - - x = vaddf(vmulf(x, t), vmulf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); - - x = vself(vmaskf_ispinf(d), vcast_vf_f(INFINITYf), x); - x = vself(vmaskf_gt(vcast_vf_f(0), d), vcast_vf_f(NANf), x); - x = vself(vmaskf_eq(d, vcast_vf_f(0)), vcast_vf_f(-INFINITYf), x); - - return x; -} - -static INLINE vfloat xlogf1(vfloat d) { // does xlogf(vmaxf(d, 1.f)) but faster - vfloat x, x2, t, m; - vint2 e; - - e = vilogbp1f(vmulf(d, vcast_vf_f(0.7071f))); - m = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); - - x = vdivf(vaddf(vcast_vf_f(-1.0f), m), vaddf(vcast_vf_f(1.0f), m)); - x2 = vmulf(x, x); - - t = vcast_vf_f(0.2371599674224853515625f); - t = vmlaf(t, x2, vcast_vf_f(0.285279005765914916992188f)); - t = vmlaf(t, x2, vcast_vf_f(0.400005519390106201171875f)); - t = vmlaf(t, x2, vcast_vf_f(0.666666567325592041015625f)); - t = vmlaf(t, x2, vcast_vf_f(2.0f)); - - x = vaddf(vmulf(x, t), vmulf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); - - x = vself(vmaskf_ispinf(d), vcast_vf_f(INFINITYf), x); - x = vselfnotzero(vmaskf_le(d, vcast_vf_f(1.f)), x); - - return x; -} - -static INLINE vfloat xlogf0(vfloat d) { - vfloat x, x2, t, m; - vint2 e; - - e = vilogbp1f(vmulf(d, vcast_vf_f(0.7071f))); - m = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); - - x = vdivf(vaddf(vcast_vf_f(-1.0f), m), vaddf(vcast_vf_f(1.0f), m)); - x2 = vmulf(x, x); - - t = vcast_vf_f(0.2371599674224853515625f); - t = vmlaf(t, x2, vcast_vf_f(0.285279005765914916992188f)); - t = vmlaf(t, x2, vcast_vf_f(0.400005519390106201171875f)); - t = vmlaf(t, x2, vcast_vf_f(0.666666567325592041015625f)); - t = vmlaf(t, x2, vcast_vf_f(2.0f)); - - x = vaddf(vmulf(x, t), vmulf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); - - x = vself(vmaskf_ispinf(d), vcast_vf_f(0), x); - x = vself(vmaskf_gt(vcast_vf_f(0), d), vcast_vf_f(0), x); - x = vself(vmaskf_eq(d, vcast_vf_f(0)), vcast_vf_f(0), x); - - return x; -} - -static INLINE vfloat xlogfNoCheck(vfloat d) { // this version does not check input values. Use it only when you know the input values are > 0 e.g. when filling a lookup table - vfloat x, x2, t, m; - vint2 e; - - e = vilogbp1f(vmulf(d, vcast_vf_f(0.7071f))); - m = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); - - x = vdivf(vaddf(vcast_vf_f(-1.0f), m), vaddf(vcast_vf_f(1.0f), m)); - x2 = vmulf(x, x); - - t = vcast_vf_f(0.2371599674224853515625f); - t = vmlaf(t, x2, vcast_vf_f(0.285279005765914916992188f)); - t = vmlaf(t, x2, vcast_vf_f(0.400005519390106201171875f)); - t = vmlaf(t, x2, vcast_vf_f(0.666666567325592041015625f)); - t = vmlaf(t, x2, vcast_vf_f(2.0f)); - - return vaddf(vmulf(x, t), vmulf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); - -} - -static INLINE vfloat xexpf(vfloat d) { - vint2 q = vrint_vi2_vf(vmulf(d, vcast_vf_f(R_LN2f))); - vfloat s, u; - - s = vmlaf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf),d); - s = vmlaf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf),s); - - u = vcast_vf_f(0.00136324646882712841033936f); - u = vmlaf(u, s, vcast_vf_f(0.00836596917361021041870117f)); - u = vmlaf(u, s, vcast_vf_f(0.0416710823774337768554688f)); - u = vmlaf(u, s, vcast_vf_f(0.166665524244308471679688f)); - u = vmlaf(u, s, vcast_vf_f(0.499999850988388061523438f)); - - u = vaddf(vcast_vf_f(1.0f), vmlaf(vmulf(s, s), u, s)); - - u = vldexpf(u, q); - - // -104.0 - return vselfnotzero(vmaskf_gt(vcast_vf_f(-104.f), d), u); -} - -static INLINE vfloat xexpfNoCheck(vfloat d) { // this version does not check input values. Use it only when you know the input values are > -104.f e.g. when filling a lookup table - vint2 q = vrint_vi2_vf(vmulf(d, vcast_vf_f(R_LN2f))); - vfloat s, u; - - s = vmlaf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf),d); - s = vmlaf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf),s); - - u = vcast_vf_f(0.00136324646882712841033936f); - u = vmlaf(u, s, vcast_vf_f(0.00836596917361021041870117f)); - u = vmlaf(u, s, vcast_vf_f(0.0416710823774337768554688f)); - u = vmlaf(u, s, vcast_vf_f(0.166665524244308471679688f)); - u = vmlaf(u, s, vcast_vf_f(0.499999850988388061523438f)); - - u = vaddf(vcast_vf_f(1.0f), vmlaf(vmulf(s, s), u, s)); - - return vldexpf(u, q); -} - -static INLINE vfloat xcbrtf(vfloat d) { - vfloat x, y, q = vcast_vf_f(1.0), t; - vint2 e, qu, re; - - e = vilogbp1f(vabsf(d)); - d = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); - - t = vaddf(vcast_vf_vi2(e), vcast_vf_f(6144)); - qu = vtruncate_vi2_vf(vdivf(t, vcast_vf_f(3))); - re = vtruncate_vi2_vf(vsubf(t, vmulf(vcast_vf_vi2(qu), vcast_vf_f(3)))); - - q = vself(vmaski2_eq(re, vcast_vi2_i(1)), vcast_vf_f(1.2599210498948731647672106f), q); - q = vself(vmaski2_eq(re, vcast_vi2_i(2)), vcast_vf_f(1.5874010519681994747517056f), q); - q = vldexpf(q, vsubi2(qu, vcast_vi2_i(2048))); - - q = vmulsignf(q, d); - d = vabsf(d); - - x = vcast_vf_f(-0.601564466953277587890625f); - x = vmlaf(x, d, vcast_vf_f(2.8208892345428466796875f)); - x = vmlaf(x, d, vcast_vf_f(-5.532182216644287109375f)); - x = vmlaf(x, d, vcast_vf_f(5.898262500762939453125f)); - x = vmlaf(x, d, vcast_vf_f(-3.8095417022705078125f)); - x = vmlaf(x, d, vcast_vf_f(2.2241256237030029296875f)); - - y = vmulf(vmulf(d, x), x); - y = vmulf(vsubf(y, vmulf(vmulf(vcast_vf_f(2.0f / 3.0f), y), vmlaf(y, x, vcast_vf_f(-1.0f)))), q); - - return y; -} - -static INLINE vfloat vclampf(vfloat value, vfloat low, vfloat high) { - // clamps value in [low;high], returns low if value is NaN - return vmaxf(vminf(high, value), low); -} - -static INLINE vfloat SQRV(vfloat a){ - return a * a; -} - -static inline void vswap( vmask condition, vfloat &a, vfloat &b) { - // conditional swap the elements of two vfloats - vfloat temp = vself(condition, a, b); // the values which fit to condition - a = vself(condition, b, a); // the values which fit to inverted condition - b = temp; -} - -static inline float vhadd( vfloat a ) { - // returns a[0] + a[1] + a[2] + a[3] - a += _mm_movehl_ps(a, a); - return _mm_cvtss_f32(_mm_add_ss(a, _mm_shuffle_ps(a, a, 1))); -} - -static inline float vhmin(vfloat a) { - // returns min(a[0], a[1], a[2], a[3]) - a = vminf(a, _mm_movehl_ps(a, a)); - return _mm_cvtss_f32(vminf(a, _mm_shuffle_ps(a, a, 1))); -} - -static inline float vhmax(vfloat a) { - // returns max(a[0], a[1], a[2], a[3]) - a = vmaxf(a, _mm_movehl_ps(a, a)); - return _mm_cvtss_f32(vmaxf(a, _mm_shuffle_ps(a, a, 1))); -} - -static INLINE vfloat vmul2f(vfloat a){ - // fastest way to multiply by 2 - return a + a; -} - -static INLINE vfloat vintpf(vfloat a, vfloat b, vfloat c) { - // calculate a * b + (1 - a) * c (interpolate two values) - // following is valid: - // vintpf(a, b+x, c+x) = vintpf(a, b, c) + x - // vintpf(a, b*x, c*x) = vintpf(a, b, c) * x - return a * (b-c) + c; -} - -static INLINE vfloat vdup(vfloat a){ - // returns { a[0],a[0],a[1],a[1] } - return _mm_unpacklo_ps( a, a ); -} - -static INLINE vfloat vaddc2vfu(float &a) -{ - // loads a[0]..a[7] and returns { a[0]+a[1], a[2]+a[3], a[4]+a[5], a[6]+a[7] } - vfloat a1 = _mm_loadu_ps( &a ); - vfloat a2 = _mm_loadu_ps( (&a) + 4 ); - return _mm_shuffle_ps(a1,a2,_MM_SHUFFLE( 2,0,2,0 )) + _mm_shuffle_ps(a1,a2,_MM_SHUFFLE( 3,1,3,1 )); -} - -static INLINE vfloat vadivapb (vfloat a, vfloat b) { - return a / (a+b); -} - -static INLINE void vconvertrgbrgbrgbrgb2rrrrggggbbbb (const float * src, vfloat &rv, vfloat &gv, vfloat &bv) { // cool function name, isn't it ? :P - // converts a sequence of 4 float RGB triplets to 3 red, green and blue quadruples - rv = _mm_setr_ps(src[0],src[3],src[6],src[9]); - gv = _mm_setr_ps(src[1],src[4],src[7],src[10]); - bv = _mm_setr_ps(src[2],src[5],src[8],src[11]); -} - -#if defined( __SSE4_1__ ) && defined( __x86_64__ ) -static INLINE vfloat vceilf(vfloat x) { - return _mm_round_ps(x, _MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC); -} - -#else - -static INLINE vfloat vceilf(vfloat x) { - __m128i zerov = _mm_setzero_si128(); - zerov = _mm_cmpeq_epi32(zerov, zerov); - const vfloat onev = (vfloat)_mm_slli_epi32(_mm_srli_epi32(zerov, 25), 23); //create vector 1.0f - const vfloat xi = _mm_cvtepi32_ps(_mm_cvttps_epi32(x)); - return xi + _mm_and_ps(_mm_cmplt_ps(xi, x), onev); -} -#endif - -#endif // __SSE2__ -#endif // SLEEFSSEAVX diff --git a/rtengine/sleefsseavx.h b/rtengine/sleefsseavx.h index 8fe20c54b..c10f4a0c2 100644 --- a/rtengine/sleefsseavx.h +++ b/rtengine/sleefsseavx.h @@ -1,124 +1,897 @@ -#include -#include +//////////////////////////////////////////////////////////////// +// +// this code was taken from http://shibatch.sourceforge.net/ +// Many thanks to the author of original version: Naoki Shibata +// +// This version contains modifications made by Ingo Weyrich +// +//////////////////////////////////////////////////////////////// +#pragma once +#include "rt_math.h" #ifdef __SSE2__ -#define VECTLENDP 2 -#define VECTLENSP 4 - -typedef __m128d vdouble; -typedef __m128i vint; - -typedef __m128 vfloat; -typedef __m128i vint2; -typedef __m128i vmask; - -static vdouble vloadu(double *p) -{ - return _mm_loadu_pd(p); -} -static void vstoreu(double *p, vdouble v) -{ - _mm_storeu_pd(p, v); -} - -static vfloat vloaduf(float *p) -{ - return _mm_loadu_ps(p); -} -static void vstoreuf(float *p, vfloat v) -{ - _mm_storeu_ps(p, v); -} - -static vint2 vloadui2(int32_t *p) -{ - return (vint2)_mm_loadu_si128((__m128i *)p); -} -static void vstoreui2(int32_t *p, vint2 v) -{ - _mm_storeu_si128((__m128i *)p, (__m128i)v); -} -#endif +#include "helpersse2.h" #ifdef ENABLE_AVX -#define VECTLENDP 4 -#define VECTLENSP 8 +#include "helperavx.h" +#endif -typedef __m256d vdouble; -typedef __m128i vint; +#ifdef __GNUC__ +#define INLINE __inline +#else +#define INLINE inline +#endif +#define PI4_A .7853981554508209228515625 +#define PI4_B .794662735614792836713604629039764404296875e-8 +#define PI4_C .306161699786838294306516483068750264552437361480769e-16 +#define M_4_PI 1.273239544735162542821171882678754627704620361328125 -typedef __m256 vfloat; -typedef struct { - vint x, y; -} vint2; +#define L2U .69314718055966295651160180568695068359375 +#define L2L .28235290563031577122588448175013436025525412068e-12 +#define R_LN2 1.442695040888963407359924681001892137426645954152985934135449406931 -static vdouble vloadu(double *p) -{ - return _mm256_loadu_pd(p); -} -static void vstoreu(double *p, vdouble v) -{ - return _mm256_storeu_pd(p, v); +#define PI4_Af 0.78515625f +#define PI4_Bf 0.00024127960205078125f +#define PI4_Cf 6.3329935073852539062e-07f +#define PI4_Df 4.9604681473525147339e-10f + +#define L2Uf 0.693145751953125f +#define L2Lf 1.428606765330187045e-06f +#define R_LN2f 1.442695040888963407359924681001892137426645954152985934135449406931f + +#define INFINITYf ((float)rtengine::RT_INFINITY) +#define NANf ((float)rtengine::RT_NAN) + +static INLINE vdouble vadd3(vdouble v0, vdouble v1, vdouble v2) { + return vadd(vadd(v0, v1), v2); } -static vfloat vloaduf(float *p) -{ - return _mm256_loadu_ps(p); -} -static void vstoreuf(float *p, vfloat v) -{ - return _mm256_storeu_ps(p, v); +static INLINE vdouble vadd4(vdouble v0, vdouble v1, vdouble v2, vdouble v3) { + return vadd3(vadd(v0, v1), v2, v3); } -static vint2 vloadui2(int32_t *p) -{ - vint2 r; - r.x = _mm_loadu_si128((__m128i *) p ); - r.y = _mm_loadu_si128((__m128i *)(p + 4)); +static INLINE vdouble vadd5(vdouble v0, vdouble v1, vdouble v2, vdouble v3, vdouble v4) { + return vadd4(vadd(v0, v1), v2, v3, v4); +} + +static INLINE vdouble vadd6(vdouble v0, vdouble v1, vdouble v2, vdouble v3, vdouble v4, vdouble v5) { + return vadd5(vadd(v0, v1), v2, v3, v4, v5); +} + +static INLINE vdouble vadd7(vdouble v0, vdouble v1, vdouble v2, vdouble v3, vdouble v4, vdouble v5, vdouble v6) { + return vadd6(vadd(v0, v1), v2, v3, v4, v5, v6); +} + +static INLINE vdouble vsub3(vdouble v0, vdouble v1, vdouble v2) { + return vsub(vsub(v0, v1), v2); +} + +static INLINE vdouble vsub4(vdouble v0, vdouble v1, vdouble v2, vdouble v3) { + return vsub3(vsub(v0, v1), v2, v3); +} + +static INLINE vdouble vsub5(vdouble v0, vdouble v1, vdouble v2, vdouble v3, vdouble v4) { + return vsub4(vsub(v0, v1), v2, v3, v4); +} + +// + +static INLINE vdouble2 normalize_d(vdouble2 t) { + vdouble2 s; + + s.x = vadd(t.x, t.y); + s.y = vadd(vsub(t.x, s.x), t.y); + + return s; +} + +static INLINE vdouble2 scale_d(vdouble2 d, vdouble s) { + vdouble2 r = {vmul(d.x, s), vmul(d.y, s)}; return r; } -static void vstoreui2(int32_t *p, vint2 v) -{ - _mm_storeu_si128((__m128i *) p , v.x); - _mm_storeu_si128((__m128i *)(p + 4), v.y); +static INLINE vdouble2 add_ss(vdouble x, vdouble y) { + vdouble2 r; + + r.x = vadd(x, y); + r.y = vadd(vsub(x, r.x), y); + + return r; } -#endif -typedef struct { +static INLINE vdouble2 add2_ss(vdouble x, vdouble y) { + vdouble2 r; + + r.x = vadd(x, y); + vdouble v = vsub(r.x, x); + r.y = vadd(vsub(x, vsub(r.x, v)), vsub(y, v)); + + return r; +} + +static INLINE vdouble2 add_ds(vdouble2 x, vdouble y) { + vdouble2 r; + + r.x = vadd(x.x, y); + r.y = vadd3(vsub(x.x, r.x), y, x.y); + + return r; +} + +static INLINE vdouble2 add2_ds(vdouble2 x, vdouble y) { + vdouble2 r; + + r.x = vadd(x.x, y); + vdouble v = vsub(r.x, x.x); + r.y = vadd(vsub(x.x, vsub(r.x, v)), vsub(y, v)); + r.y = vadd(r.y, x.y); + + return r; +} + +static INLINE vdouble2 add_sd(vdouble x, vdouble2 y) { + vdouble2 r; + + r.x = vadd(x, y.x); + r.y = vadd3(vsub(x, r.x), y.x, y.y); + + return r; +} + +static INLINE vdouble2 add_dd(vdouble2 x, vdouble2 y) { + // |x| >= |y| + + vdouble2 r; + + r.x = vadd(x.x, y.x); + r.y = vadd4(vsub(x.x, r.x), y.x, x.y, y.y); + + return r; +} + +static INLINE vdouble2 add2_dd(vdouble2 x, vdouble2 y) { + vdouble2 r; + + r.x = vadd(x.x, y.x); + vdouble v = vsub(r.x, x.x); + r.y = vadd(vsub(x.x, vsub(r.x, v)), vsub(y.x, v)); + r.y = vadd(r.y, vadd(x.y, y.y)); + + return r; +} + +static INLINE vdouble2 div_dd(vdouble2 n, vdouble2 d) { + vdouble t = vrec(d.x); + vdouble dh = vupper(d.x), dl = vsub(d.x, dh); + vdouble th = vupper(t ), tl = vsub(t , th); + vdouble nhh = vupper(n.x), nhl = vsub(n.x, nhh); + + vdouble2 q; + + q.x = vmul(n.x, t); + + vdouble u = vadd5(vsub(vmul(nhh, th), q.x), vmul(nhh, tl), vmul(nhl, th), vmul(nhl, tl), + vmul(q.x, vsub5(vcast_vd_d(1), vmul(dh, th), vmul(dh, tl), vmul(dl, th), vmul(dl, tl)))); + + q.y = vadd(vmul(t, vsub(n.y, vmul(q.x, d.y))), u); + + return q; +} + +static INLINE vdouble2 mul_ss(vdouble x, vdouble y) { + vdouble xh = vupper(x), xl = vsub(x, xh); + vdouble yh = vupper(y), yl = vsub(y, yh); + vdouble2 r; + + r.x = vmul(x, y); + r.y = vadd5(vmul(xh, yh), vneg(r.x), vmul(xl, yh), vmul(xh, yl), vmul(xl, yl)); + + return r; +} + +static INLINE vdouble2 mul_ds(vdouble2 x, vdouble y) { + vdouble xh = vupper(x.x), xl = vsub(x.x, xh); + vdouble yh = vupper(y ), yl = vsub(y , yh); + vdouble2 r; + + r.x = vmul(x.x, y); + r.y = vadd6(vmul(xh, yh), vneg(r.x), vmul(xl, yh), vmul(xh, yl), vmul(xl, yl), vmul(x.y, y)); + + return r; +} + +static INLINE vdouble2 mul_dd(vdouble2 x, vdouble2 y) { + vdouble xh = vupper(x.x), xl = vsub(x.x, xh); + vdouble yh = vupper(y.x), yl = vsub(y.x, yh); + vdouble2 r; + + r.x = vmul(x.x, y.x); + r.y = vadd7(vmul(xh, yh), vneg(r.x), vmul(xl, yh), vmul(xh, yl), vmul(xl, yl), vmul(x.x, y.y), vmul(x.y, y.x)); + + return r; +} + +static INLINE vdouble2 squ_d(vdouble2 x) { + vdouble xh = vupper(x.x), xl = vsub(x.x, xh); + vdouble2 r; + + r.x = vmul(x.x, x.x); + r.y = vadd5(vmul(xh, xh), vneg(r.x), vmul(vadd(xh, xh), xl), vmul(xl, xl), vmul(x.x, vadd(x.y, x.y))); + + return r; +} + +static INLINE vdouble2 rec_s(vdouble d) { + vdouble t = vrec(d); + vdouble dh = vupper(d), dl = vsub(d, dh); + vdouble th = vupper(t), tl = vsub(t, th); + vdouble2 q; + + q.x = t; + q.y = vmul(t, vsub5(vcast_vd_d(1), vmul(dh, th), vmul(dh, tl), vmul(dl, th), vmul(dl, tl))); + + return q; +} + +static INLINE vdouble2 sqrt_d(vdouble2 d) { + vdouble t = vsqrt(vadd(d.x, d.y)); + return scale_d(mul_dd(add2_dd(d, mul_ss(t, t)), rec_s(t)), vcast_vd_d(0.5)); +} + +// + +static INLINE vdouble xldexp(vdouble x, vint q) { return vldexp(x, q); } + +static INLINE vint xilogb(vdouble d) { + vdouble e = vcast_vd_vi(vsubi(vilogbp1(vabs(d)), vcast_vi_i(1))); + e = vsel(vmask_eq(d, vcast_vd_d(0)), vcast_vd_d(-2147483648.0), e); + e = vsel(vmask_eq(vabs(d), vcast_vd_d(rtengine::RT_INFINITY)), vcast_vd_d(2147483647), e); + return vrint_vi_vd(e); +} + +static INLINE vdouble xsin(vdouble d) { + vint q; + vdouble u, s; + + q = vrint_vi_vd(vmul(d, vcast_vd_d(rtengine::RT_1_PI))); + + u = vcast_vd_vi(q); + d = vadd(d, vmul(u, vcast_vd_d(-PI4_A*4))); + d = vadd(d, vmul(u, vcast_vd_d(-PI4_B*4))); + d = vadd(d, vmul(u, vcast_vd_d(-PI4_C*4))); + + s = vmul(d, d); + + d = vsel(vmaski_eq(vandi(q, vcast_vi_i(1)), vcast_vi_i(1)), vneg(d), d); + + u = vcast_vd_d(-7.97255955009037868891952e-18); + u = vmla(u, s, vcast_vd_d(2.81009972710863200091251e-15)); + u = vmla(u, s, vcast_vd_d(-7.64712219118158833288484e-13)); + u = vmla(u, s, vcast_vd_d(1.60590430605664501629054e-10)); + u = vmla(u, s, vcast_vd_d(-2.50521083763502045810755e-08)); + u = vmla(u, s, vcast_vd_d(2.75573192239198747630416e-06)); + u = vmla(u, s, vcast_vd_d(-0.000198412698412696162806809)); + u = vmla(u, s, vcast_vd_d(0.00833333333333332974823815)); + u = vmla(u, s, vcast_vd_d(-0.166666666666666657414808)); + + u = vmla(s, vmul(u, d), d); + + return u; +} + +static INLINE vdouble xcos(vdouble d) { + vint q; + vdouble u, s; + + q = vrint_vi_vd(vsub(vmul(d, vcast_vd_d(rtengine::RT_1_PI)), vcast_vd_d(0.5))); + q = vaddi(vaddi(q, q), vcast_vi_i(1)); + + u = vcast_vd_vi(q); + d = vadd(d, vmul(u, vcast_vd_d(-PI4_A*2))); + d = vadd(d, vmul(u, vcast_vd_d(-PI4_B*2))); + d = vadd(d, vmul(u, vcast_vd_d(-PI4_C*2))); + + s = vmul(d, d); + + d = vsel(vmaski_eq(vandi(q, vcast_vi_i(2)), vcast_vi_i(0)), vneg(d), d); + + u = vcast_vd_d(-7.97255955009037868891952e-18); + u = vmla(u, s, vcast_vd_d(2.81009972710863200091251e-15)); + u = vmla(u, s, vcast_vd_d(-7.64712219118158833288484e-13)); + u = vmla(u, s, vcast_vd_d(1.60590430605664501629054e-10)); + u = vmla(u, s, vcast_vd_d(-2.50521083763502045810755e-08)); + u = vmla(u, s, vcast_vd_d(2.75573192239198747630416e-06)); + u = vmla(u, s, vcast_vd_d(-0.000198412698412696162806809)); + u = vmla(u, s, vcast_vd_d(0.00833333333333332974823815)); + u = vmla(u, s, vcast_vd_d(-0.166666666666666657414808)); + + u = vmla(s, vmul(u, d), d); + + return u; +} + +static INLINE vdouble2 xsincos(vdouble d) { + vint q; + vmask m; + vdouble u, s, t, rx, ry; + vdouble2 r; + + q = vrint_vi_vd(vmul(d, vcast_vd_d(rtengine::RT_2_PI))); + + s = d; + + u = vcast_vd_vi(q); + s = vmla(u, vcast_vd_d(-PI4_A*2), s); + s = vmla(u, vcast_vd_d(-PI4_B*2), s); + s = vmla(u, vcast_vd_d(-PI4_C*2), s); + + t = s; + + s = vmul(s, s); + + u = vcast_vd_d(1.58938307283228937328511e-10); + u = vmla(u, s, vcast_vd_d(-2.50506943502539773349318e-08)); + u = vmla(u, s, vcast_vd_d(2.75573131776846360512547e-06)); + u = vmla(u, s, vcast_vd_d(-0.000198412698278911770864914)); + u = vmla(u, s, vcast_vd_d(0.0083333333333191845961746)); + u = vmla(u, s, vcast_vd_d(-0.166666666666666130709393)); + u = vmul(vmul(u, s), t); + + rx = vadd(t, u); + + u = vcast_vd_d(-1.13615350239097429531523e-11); + u = vmla(u, s, vcast_vd_d(2.08757471207040055479366e-09)); + u = vmla(u, s, vcast_vd_d(-2.75573144028847567498567e-07)); + u = vmla(u, s, vcast_vd_d(2.48015872890001867311915e-05)); + u = vmla(u, s, vcast_vd_d(-0.00138888888888714019282329)); + u = vmla(u, s, vcast_vd_d(0.0416666666666665519592062)); + u = vmla(u, s, vcast_vd_d(-0.5)); + + ry = vadd(vcast_vd_d(1), vmul(s, u)); + + m = vmaski_eq(vandi(q, vcast_vi_i(1)), vcast_vi_i(0)); + r.x = vsel(m, rx, ry); + r.y = vsel(m, ry, rx); + + m = vmaski_eq(vandi(q, vcast_vi_i(2)), vcast_vi_i(2)); + r.x = vreinterpret_vd_vm(vxorm(vandm(m, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(r.x))); + + m = vmaski_eq(vandi(vaddi(q, vcast_vi_i(1)), vcast_vi_i(2)), vcast_vi_i(2)); + r.y = vreinterpret_vd_vm(vxorm(vandm(m, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(r.y))); + + m = vmask_isinf(d); + r.x = vsel(m, vcast_vd_d(rtengine::RT_NAN), r.x); + r.y = vsel(m, vcast_vd_d(rtengine::RT_NAN), r.y); + + return r; +} + +static INLINE vdouble xtan(vdouble d) { + vint q; + vdouble u, s, x; + vmask m; + + q = vrint_vi_vd(vmul(d, vcast_vd_d(rtengine::RT_2_PI))); + + u = vcast_vd_vi(q); + x = vadd(d, vmul(u, vcast_vd_d(-PI4_A*2))); + x = vadd(x, vmul(u, vcast_vd_d(-PI4_B*2))); + x = vadd(x, vmul(u, vcast_vd_d(-PI4_C*2))); + + s = vmul(x, x); + + m = vmaski_eq(vandi(q, vcast_vi_i(1)), vcast_vi_i(1)); + x = vsel(m, vneg(x), x); + + u = vcast_vd_d(1.01419718511083373224408e-05); + u = vmla(u, s, vcast_vd_d(-2.59519791585924697698614e-05)); + u = vmla(u, s, vcast_vd_d(5.23388081915899855325186e-05)); + u = vmla(u, s, vcast_vd_d(-3.05033014433946488225616e-05)); + u = vmla(u, s, vcast_vd_d(7.14707504084242744267497e-05)); + u = vmla(u, s, vcast_vd_d(8.09674518280159187045078e-05)); + u = vmla(u, s, vcast_vd_d(0.000244884931879331847054404)); + u = vmla(u, s, vcast_vd_d(0.000588505168743587154904506)); + u = vmla(u, s, vcast_vd_d(0.00145612788922812427978848)); + u = vmla(u, s, vcast_vd_d(0.00359208743836906619142924)); + u = vmla(u, s, vcast_vd_d(0.00886323944362401618113356)); + u = vmla(u, s, vcast_vd_d(0.0218694882853846389592078)); + u = vmla(u, s, vcast_vd_d(0.0539682539781298417636002)); + u = vmla(u, s, vcast_vd_d(0.133333333333125941821962)); + u = vmla(u, s, vcast_vd_d(0.333333333333334980164153)); + + u = vmla(s, vmul(u, x), x); + + u = vsel(m, vrec(u), u); + + u = vsel(vmask_isinf(d), vcast_vd_d(rtengine::RT_NAN), u); + + return u; +} + +static INLINE vdouble atan2k(vdouble y, vdouble x) { + vdouble s, t, u; + vint q; + vmask p; + + q = vseli_lt(x, vcast_vd_d(0), vcast_vi_i(-2), vcast_vi_i(0)); + x = vabs(x); + + q = vseli_lt(x, y, vaddi(q, vcast_vi_i(1)), q); + p = vmask_lt(x, y); + s = vsel (p, vneg(x), y); + t = vmax (x, y); + + s = vdiv(s, t); + t = vmul(s, s); + + u = vcast_vd_d(-1.88796008463073496563746e-05); + u = vmla(u, t, vcast_vd_d(0.000209850076645816976906797)); + u = vmla(u, t, vcast_vd_d(-0.00110611831486672482563471)); + u = vmla(u, t, vcast_vd_d(0.00370026744188713119232403)); + u = vmla(u, t, vcast_vd_d(-0.00889896195887655491740809)); + u = vmla(u, t, vcast_vd_d(0.016599329773529201970117)); + u = vmla(u, t, vcast_vd_d(-0.0254517624932312641616861)); + u = vmla(u, t, vcast_vd_d(0.0337852580001353069993897)); + u = vmla(u, t, vcast_vd_d(-0.0407629191276836500001934)); + u = vmla(u, t, vcast_vd_d(0.0466667150077840625632675)); + u = vmla(u, t, vcast_vd_d(-0.0523674852303482457616113)); + u = vmla(u, t, vcast_vd_d(0.0587666392926673580854313)); + u = vmla(u, t, vcast_vd_d(-0.0666573579361080525984562)); + u = vmla(u, t, vcast_vd_d(0.0769219538311769618355029)); + u = vmla(u, t, vcast_vd_d(-0.090908995008245008229153)); + u = vmla(u, t, vcast_vd_d(0.111111105648261418443745)); + u = vmla(u, t, vcast_vd_d(-0.14285714266771329383765)); + u = vmla(u, t, vcast_vd_d(0.199999999996591265594148)); + u = vmla(u, t, vcast_vd_d(-0.333333333333311110369124)); + + t = vadd(s, vmul(s, vmul(t, u))); + t = vadd(t, vmul(vcast_vd_vi(q), vcast_vd_d(rtengine::RT_PI/2))); + + return t; +} + +static INLINE vdouble xatan2(vdouble y, vdouble x) { + vdouble r = atan2k(vabs(y), x); + + r = vmulsign(r, x); + r = vsel(vorm(vmask_isinf(x), vmask_eq(x, vcast_vd_d(0))), vsub(vcast_vd_d(rtengine::RT_PI/2), visinf2(x, vmulsign(vcast_vd_d(rtengine::RT_PI/2), x))), r); + r = vsel(vmask_isinf(y), vsub(vcast_vd_d(rtengine::RT_PI/2), visinf2(x, vmulsign(vcast_vd_d(rtengine::RT_PI/4), x))), r); + r = vsel(vmask_eq(y, vcast_vd_d(0)), vsel(vmask_eq(vsign(x), vcast_vd_d(-1.0)), vcast_vd_d(rtengine::RT_PI), vcast_vd_d(0)), r); + + return vsel(vorm(vmask_isnan(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_NAN), vmulsign(r, y)); +} + +static INLINE vdouble xasin(vdouble d) { vdouble x, y; -} vdouble2; + x = vadd(vcast_vd_d(1), d); + y = vsub(vcast_vd_d(1), d); + x = vmul(x, y); + x = vsqrt(x); + x = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), atan2k(vabs(d), x)); + return vmulsign(x, d); +} -vdouble xldexp(vdouble x, vint q); -vint xilogb(vdouble d); +static INLINE vdouble xacos(vdouble d) { + vdouble x, y; + x = vadd(vcast_vd_d(1), d); + y = vsub(vcast_vd_d(1), d); + x = vmul(x, y); + x = vsqrt(x); + x = vmulsign(atan2k(x, vabs(d)), d); + y = (vdouble)vandm(vmask_lt(d, vcast_vd_d(0)), (vmask)vcast_vd_d(rtengine::RT_PI)); + x = vadd(x, y); + return x; +} -vdouble xsin(vdouble d); -vdouble xcos(vdouble d); -vdouble2 xsincos(vdouble d); -vdouble xtan(vdouble d); -vdouble xasin(vdouble s); -vdouble xacos(vdouble s); -vdouble xatan(vdouble s); -vdouble xatan2(vdouble y, vdouble x); -vdouble xlog(vdouble d); -vdouble xexp(vdouble d); -vdouble xpow(vdouble x, vdouble y); +static INLINE vdouble xatan(vdouble s) { + vdouble t, u; + vint q; -vdouble xsinh(vdouble d); -vdouble xcosh(vdouble d); -vdouble xtanh(vdouble d); -vdouble xasinh(vdouble s); -vdouble xacosh(vdouble s); -vdouble xatanh(vdouble s); + q = vseli_lt(s, vcast_vd_d(0), vcast_vi_i(2), vcast_vi_i(0)); + s = vabs(s); -vdouble xcbrt(vdouble d); + q = vseli_lt(vcast_vd_d(1), s, vaddi(q, vcast_vi_i(1)), q); + s = vsel(vmask_lt(vcast_vd_d(1), s), vdiv(vcast_vd_d(1), s), s); -vdouble xexp2(vdouble a); -vdouble xexp10(vdouble a); -vdouble xexpm1(vdouble a); -vdouble xlog10(vdouble a); -vdouble xlog1p(vdouble a); + t = vmul(s, s); + + u = vcast_vd_d(-1.88796008463073496563746e-05); + u = vmla(u, t, vcast_vd_d(0.000209850076645816976906797)); + u = vmla(u, t, vcast_vd_d(-0.00110611831486672482563471)); + u = vmla(u, t, vcast_vd_d(0.00370026744188713119232403)); + u = vmla(u, t, vcast_vd_d(-0.00889896195887655491740809)); + u = vmla(u, t, vcast_vd_d(0.016599329773529201970117)); + u = vmla(u, t, vcast_vd_d(-0.0254517624932312641616861)); + u = vmla(u, t, vcast_vd_d(0.0337852580001353069993897)); + u = vmla(u, t, vcast_vd_d(-0.0407629191276836500001934)); + u = vmla(u, t, vcast_vd_d(0.0466667150077840625632675)); + u = vmla(u, t, vcast_vd_d(-0.0523674852303482457616113)); + u = vmla(u, t, vcast_vd_d(0.0587666392926673580854313)); + u = vmla(u, t, vcast_vd_d(-0.0666573579361080525984562)); + u = vmla(u, t, vcast_vd_d(0.0769219538311769618355029)); + u = vmla(u, t, vcast_vd_d(-0.090908995008245008229153)); + u = vmla(u, t, vcast_vd_d(0.111111105648261418443745)); + u = vmla(u, t, vcast_vd_d(-0.14285714266771329383765)); + u = vmla(u, t, vcast_vd_d(0.199999999996591265594148)); + u = vmla(u, t, vcast_vd_d(-0.333333333333311110369124)); + + t = vadd(s, vmul(s, vmul(t, u))); + + t = vsel(vmaski_eq(vandi(q, vcast_vi_i(1)), vcast_vi_i(1)), vsub(vcast_vd_d(rtengine::RT_PI/2), t), t); + t = vsel(vmaski_eq(vandi(q, vcast_vi_i(2)), vcast_vi_i(2)), vneg(t), t); + + return t; +} + +static INLINE vdouble xlog(vdouble d) { + vdouble x, x2; + vdouble t, m; + vint e; + + e = vilogbp1(vmul(d, vcast_vd_d(0.7071))); + m = vldexp(d, vsubi(vcast_vi_i(0), e)); + + x = vdiv(vadd(vcast_vd_d(-1), m), vadd(vcast_vd_d(1), m)); + x2 = vmul(x, x); + + t = vcast_vd_d(0.148197055177935105296783); + t = vmla(t, x2, vcast_vd_d(0.153108178020442575739679)); + t = vmla(t, x2, vcast_vd_d(0.181837339521549679055568)); + t = vmla(t, x2, vcast_vd_d(0.22222194152736701733275)); + t = vmla(t, x2, vcast_vd_d(0.285714288030134544449368)); + t = vmla(t, x2, vcast_vd_d(0.399999999989941956712869)); + t = vmla(t, x2, vcast_vd_d(0.666666666666685503450651)); + t = vmla(t, x2, vcast_vd_d(2)); + + x = vadd(vmul(x, t), vmul(vcast_vd_d(0.693147180559945286226764), vcast_vd_vi(e))); + + x = vsel(vmask_ispinf(d), vcast_vd_d(rtengine::RT_INFINITY), x); + x = vsel(vmask_gt(vcast_vd_d(0), d), vcast_vd_d(rtengine::RT_NAN), x); + x = vsel(vmask_eq(d, vcast_vd_d(0)), vcast_vd_d(-rtengine::RT_INFINITY), x); + + return x; +} + +static INLINE vdouble xexp(vdouble d) { + vint q = vrint_vi_vd(vmul(d, vcast_vd_d(R_LN2))); + vdouble s, u; + + s = vadd(d, vmul(vcast_vd_vi(q), vcast_vd_d(-L2U))); + s = vadd(s, vmul(vcast_vd_vi(q), vcast_vd_d(-L2L))); + + u = vcast_vd_d(2.08860621107283687536341e-09); + u = vmla(u, s, vcast_vd_d(2.51112930892876518610661e-08)); + u = vmla(u, s, vcast_vd_d(2.75573911234900471893338e-07)); + u = vmla(u, s, vcast_vd_d(2.75572362911928827629423e-06)); + u = vmla(u, s, vcast_vd_d(2.4801587159235472998791e-05)); + u = vmla(u, s, vcast_vd_d(0.000198412698960509205564975)); + u = vmla(u, s, vcast_vd_d(0.00138888888889774492207962)); + u = vmla(u, s, vcast_vd_d(0.00833333333331652721664984)); + u = vmla(u, s, vcast_vd_d(0.0416666666666665047591422)); + u = vmla(u, s, vcast_vd_d(0.166666666666666851703837)); + u = vmla(u, s, vcast_vd_d(0.5)); + + u = vadd(vcast_vd_d(1), vadd(s, vmul(vmul(s, s), u))); + + u = vldexp(u, q); + + u = vsel(vmask_isminf(d), vcast_vd_d(0), u); + + return u; +} + +static INLINE vdouble2 logk(vdouble d) { + vdouble2 x, x2; + vdouble t, m; + vint e; + + e = vilogbp1(vmul(d, vcast_vd_d(0.7071))); + m = vldexp(d, vsubi(vcast_vi_i(0), e)); + + x = div_dd(add2_ss(vcast_vd_d(-1), m), add2_ss(vcast_vd_d(1), m)); + x2 = squ_d(x); + x2 = normalize_d(x2); + + t = vcast_vd_d(0.134601987501262130076155); + t = vmla(t, x2.x, vcast_vd_d(0.132248509032032670243288)); + t = vmla(t, x2.x, vcast_vd_d(0.153883458318096079652524)); + t = vmla(t, x2.x, vcast_vd_d(0.181817427573705403298686)); + t = vmla(t, x2.x, vcast_vd_d(0.222222231326187414840781)); + t = vmla(t, x2.x, vcast_vd_d(0.285714285651261412873718)); + t = vmla(t, x2.x, vcast_vd_d(0.400000000000222439910458)); + t = vmla(t, x2.x, vcast_vd_d(0.666666666666666371239645)); + + return add2_dd(mul_ds(dd(vcast_vd_d(0.693147180559945286226764), vcast_vd_d(2.319046813846299558417771e-17)), + vcast_vd_vi(e)), + add2_dd(scale_d(x, vcast_vd_d(2)), mul_ds(mul_dd(x2, x), t))); +} + +static INLINE vdouble expk(vdouble2 d) { + vdouble u = vmul(vadd(d.x, d.y), vcast_vd_d(R_LN2)); + vint q = vrint_vi_vd(u); + vdouble2 s, t; + + s = add2_ds(d, vmul(vcast_vd_vi(q), vcast_vd_d(-L2U))); + s = add2_ds(s, vmul(vcast_vd_vi(q), vcast_vd_d(-L2L))); + + q = vrint_vi_vd(vmin(vmax(vcast_vd_d(-2047.49), u), vcast_vd_d(2047.49))); + + s = normalize_d(s); + + u = vcast_vd_d(2.51069683420950419527139e-08); + u = vmla(u, s.x, vcast_vd_d(2.76286166770270649116855e-07)); + u = vmla(u, s.x, vcast_vd_d(2.75572496725023574143864e-06)); + u = vmla(u, s.x, vcast_vd_d(2.48014973989819794114153e-05)); + u = vmla(u, s.x, vcast_vd_d(0.000198412698809069797676111)); + u = vmla(u, s.x, vcast_vd_d(0.0013888888939977128960529)); + u = vmla(u, s.x, vcast_vd_d(0.00833333333332371417601081)); + u = vmla(u, s.x, vcast_vd_d(0.0416666666665409524128449)); + u = vmla(u, s.x, vcast_vd_d(0.166666666666666740681535)); + u = vmla(u, s.x, vcast_vd_d(0.500000000000000999200722)); + + t = add_dd(s, mul_ds(squ_d(s), u)); + + t = add_sd(vcast_vd_d(1), t); + u = vadd(t.x, t.y); + u = vldexp(u, q); + + return u; +} + +static INLINE vdouble xpow(vdouble x, vdouble y) { +#if 1 + vmask yisint = vmask_eq(vcast_vd_vi(vrint_vi_vd(y)), y); + vmask yisodd = vandm(vmaski_eq(vandi(vrint_vi_vd(y), vcast_vi_i(1)), vcast_vi_i(1)), yisint); + + vdouble result = expk(mul_ds(logk(vabs(x)), y)); + + //result = vsel(vmask_isnan(result), vcast_vd_d(rtengine::RT_INFINITY), result); + + result = vmul(result, + vsel(vmask_gt(x, vcast_vd_d(0)), + vcast_vd_d(1), + vsel(yisint, + vsel(yisodd, + vcast_vd_d(-1), + vcast_vd_d(1)), + vcast_vd_d(rtengine::RT_NAN)))); + + vdouble efx = vreinterpret_vd_vm(vxorm(vreinterpret_vm_vd(vsub(vabs(x), vcast_vd_d(1))), vsignbit(y))); + + result = vsel(vmask_isinf(y), + vsel(vmask_lt(efx, vcast_vd_d(0)), + vcast_vd_d(0), + vsel(vmask_eq(efx, vcast_vd_d(0)), + vcast_vd_d(1.0), + vcast_vd_d(rtengine::RT_INFINITY))), + result); + + result = vsel(vorm(vmask_isinf(x), vmask_eq(x, vcast_vd_d(0))), + vmul(vsel(yisodd, vsign(x), vcast_vd_d(1)), + vsel(vmask_lt(vsel(vmask_eq(x, vcast_vd_d(0)), vneg(y), y), vcast_vd_d(0)), + vcast_vd_d(0), + vcast_vd_d(rtengine::RT_INFINITY))), + result); + + result = vsel(vorm(vmask_isnan(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_NAN), result); + + result = vsel(vorm(vmask_eq(y, vcast_vd_d(0)), vmask_eq(x, vcast_vd_d(1))), vcast_vd_d(1), result); + + return result; +#else + return expk(mul_ds(logk(x), y)); +#endif +} + +static INLINE vdouble2 expk2(vdouble2 d) { + vdouble u = vmul(vadd(d.x, d.y), vcast_vd_d(R_LN2)); + vint q = vrint_vi_vd(u); + vdouble2 s, t; + + s = add2_ds(d, vmul(vcast_vd_vi(q), vcast_vd_d(-L2U))); + s = add2_ds(s, vmul(vcast_vd_vi(q), vcast_vd_d(-L2L))); + + q = vrint_vi_vd(vmin(vmax(vcast_vd_d(-2047.49), u), vcast_vd_d(2047.49))); + + s = normalize_d(s); + + u = vcast_vd_d(2.51069683420950419527139e-08); + u = vmla(u, s.x, vcast_vd_d(2.76286166770270649116855e-07)); + u = vmla(u, s.x, vcast_vd_d(2.75572496725023574143864e-06)); + u = vmla(u, s.x, vcast_vd_d(2.48014973989819794114153e-05)); + u = vmla(u, s.x, vcast_vd_d(0.000198412698809069797676111)); + u = vmla(u, s.x, vcast_vd_d(0.0013888888939977128960529)); + u = vmla(u, s.x, vcast_vd_d(0.00833333333332371417601081)); + u = vmla(u, s.x, vcast_vd_d(0.0416666666665409524128449)); + u = vmla(u, s.x, vcast_vd_d(0.166666666666666740681535)); + u = vmla(u, s.x, vcast_vd_d(0.500000000000000999200722)); + + t = add_dd(s, mul_ds(squ_d(s), u)); + + t = add_sd(vcast_vd_d(1), t); + + return dd(vldexp(t.x, q), vldexp(t.y, q)); +} + +static INLINE vdouble xsinh(vdouble x) { + vdouble y = vabs(x); + vdouble2 d = expk2(dd(y, vcast_vd_d(0))); + d = add2_dd(d, div_dd(dd(vcast_vd_d(-1), vcast_vd_d(0)), d)); + y = vmul(vadd(d.x, d.y), vcast_vd_d(0.5)); + + y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_INFINITY), y); + y = vmulsign(y, x); + y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); + + return y; +} + +static INLINE vdouble xcosh(vdouble x) { + vdouble2 d = expk2(dd(x, vcast_vd_d(0))); + d = add2_dd(d, div_dd(dd(vcast_vd_d(1), vcast_vd_d(0)), d)); + vdouble y = vmul(vadd(d.x, d.y), vcast_vd_d(0.5)); + + y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_INFINITY), y); + y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); + + return y; +} + +static INLINE vdouble xtanh(vdouble x) { + vdouble y = vabs(x); + vdouble2 d = expk2(dd(y, vcast_vd_d(0))); + vdouble2 e = div_dd(dd(vcast_vd_d(1), vcast_vd_d(0)), d); + d = div_dd(add2_dd(d, scale_d(e, vcast_vd_d(-1))), add2_dd(d, e)); + y = d.x + d.y; + + y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(1.0), y); + y = vmulsign(y, x); + y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); + + return y; +} + +static INLINE vdouble2 logk2(vdouble2 d) { + vdouble2 x, x2, m; + vdouble t; + vint e; + + d = normalize_d(d); + e = vilogbp1(vmul(d.x, vcast_vd_d(0.7071))); + m = scale_d(d, vldexp(vcast_vd_d(1), vsubi(vcast_vi_i(0), e))); + + x = div_dd(add2_ds(m, vcast_vd_d(-1)), add2_ds(m, vcast_vd_d(1))); + x2 = squ_d(x); + x2 = normalize_d(x2); + + t = vcast_vd_d(0.134601987501262130076155); + t = vmla(t, x2.x, vcast_vd_d(0.132248509032032670243288)); + t = vmla(t, x2.x, vcast_vd_d(0.153883458318096079652524)); + t = vmla(t, x2.x, vcast_vd_d(0.181817427573705403298686)); + t = vmla(t, x2.x, vcast_vd_d(0.222222231326187414840781)); + t = vmla(t, x2.x, vcast_vd_d(0.285714285651261412873718)); + t = vmla(t, x2.x, vcast_vd_d(0.400000000000222439910458)); + t = vmla(t, x2.x, vcast_vd_d(0.666666666666666371239645)); + + return add2_dd(mul_ds(dd(vcast_vd_d(0.693147180559945286226764), vcast_vd_d(2.319046813846299558417771e-17)), + vcast_vd_vi(e)), + add2_dd(scale_d(x, vcast_vd_d(2)), mul_ds(mul_dd(x2, x), t))); +} + +static INLINE vdouble xasinh(vdouble x) { + vdouble y = vabs(x); + vdouble2 d = logk2(add2_ds(sqrt_d(add2_ds(mul_ss(y, y), vcast_vd_d(1))), y)); + y = vadd(d.x, d.y); + + y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_INFINITY), y); + y = vmulsign(y, x); + y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); + + return y; +} + +static INLINE vdouble xacosh(vdouble x) { + vdouble2 d = logk2(add2_ds(sqrt_d(add2_ds(mul_ss(x, x), vcast_vd_d(-1))), x)); + vdouble y = vadd(d.x, d.y); + + y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_INFINITY), y); + y = vsel(vmask_eq(x, vcast_vd_d(1.0)), vcast_vd_d(0.0), y); + y = vsel(vmask_lt(x, vcast_vd_d(1.0)), vcast_vd_d(rtengine::RT_NAN), y); + y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); + + return y; +} + +static INLINE vdouble xatanh(vdouble x) { + vdouble y = vabs(x); + vdouble2 d = logk2(div_dd(add2_ss(vcast_vd_d(1), y), add2_ss(vcast_vd_d(1), -y))); + y = vsel(vmask_gt(y, vcast_vd_d(1.0)), vcast_vd_d(rtengine::RT_NAN), vsel(vmask_eq(y, vcast_vd_d(1.0)), vcast_vd_d(rtengine::RT_INFINITY), vmul(vadd(d.x, d.y), vcast_vd_d(0.5)))); + + y = vsel(vorm(vmask_isinf(x), vmask_isnan(y)), vcast_vd_d(rtengine::RT_NAN), y); + y = vmulsign(y, x); + y = vsel(vmask_isnan(x), vcast_vd_d(rtengine::RT_NAN), y); + + return y; +} + +static INLINE vdouble xcbrt(vdouble d) { + vdouble x, y, q = vcast_vd_d(1.0); + vint e, qu, re; + vdouble t; + + e = vilogbp1(vabs(d)); + d = vldexp(d, vsubi(vcast_vi_i(0), e)); + + t = vadd(vcast_vd_vi(e), vcast_vd_d(6144)); + qu = vtruncate_vi_vd(vdiv(t, vcast_vd_d(3))); + re = vtruncate_vi_vd(vsub(t, vmul(vcast_vd_vi(qu), vcast_vd_d(3)))); + + q = vsel(vmaski_eq(re, vcast_vi_i(1)), vcast_vd_d(1.2599210498948731647672106), q); + q = vsel(vmaski_eq(re, vcast_vi_i(2)), vcast_vd_d(1.5874010519681994747517056), q); + q = vldexp(q, vsubi(qu, vcast_vi_i(2048))); + + q = vmulsign(q, d); + + d = vabs(d); + + x = vcast_vd_d(-0.640245898480692909870982); + x = vmla(x, d, vcast_vd_d(2.96155103020039511818595)); + x = vmla(x, d, vcast_vd_d(-5.73353060922947843636166)); + x = vmla(x, d, vcast_vd_d(6.03990368989458747961407)); + x = vmla(x, d, vcast_vd_d(-3.85841935510444988821632)); + x = vmla(x, d, vcast_vd_d(2.2307275302496609725722)); + + y = vmul(x, x); y = vmul(y, y); x = vsub(x, vmul(vmla(d, y, vneg(x)), vcast_vd_d(1.0 / 3.0))); + y = vmul(vmul(d, x), x); + y = vmul(vsub(y, vmul(vmul(vcast_vd_d(2.0 / 3.0), y), vmla(y, x, vcast_vd_d(-1.0)))), q); + + return y; +} + +static INLINE vdouble xexp2(vdouble a) { + vdouble u = expk(mul_ds(dd(vcast_vd_d(0.69314718055994528623), vcast_vd_d(2.3190468138462995584e-17)), a)); + u = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), u); + u = vsel(vmask_isminf(a), vcast_vd_d(0), u); + return u; +} + +static INLINE vdouble xexp10(vdouble a) { + vdouble u = expk(mul_ds(dd(vcast_vd_d(2.3025850929940459011), vcast_vd_d(-2.1707562233822493508e-16)), a)); + u = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), u); + u = vsel(vmask_isminf(a), vcast_vd_d(0), u); + return u; +} + +static INLINE vdouble xexpm1(vdouble a) { + vdouble2 d = add2_ds(expk2(dd(a, vcast_vd_d(0))), vcast_vd_d(-1.0)); + vdouble x = d.x + d.y; + x = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), x); + x = vsel(vmask_isminf(a), vcast_vd_d(-1), x); + return x; +} + +static INLINE vdouble xlog10(vdouble a) { + vdouble2 d = mul_dd(logk(a), dd(vcast_vd_d(0.43429448190325176116), vcast_vd_d(6.6494347733425473126e-17))); + vdouble x = d.x + d.y; + + x = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), x); + x = vsel(vmask_gt(vcast_vd_d(0), a), vcast_vd_d(rtengine::RT_NAN), x); + x = vsel(vmask_eq(a, vcast_vd_d(0)), vcast_vd_d(-rtengine::RT_INFINITY), x); + + return x; +} + +static INLINE vdouble xlog1p(vdouble a) { + vdouble2 d = logk2(add2_ss(a, vcast_vd_d(1))); + vdouble x = d.x + d.y; + + x = vsel(vmask_ispinf(a), vcast_vd_d(rtengine::RT_INFINITY), x); + x = vsel(vmask_gt(vcast_vd_d(-1), a), vcast_vd_d(rtengine::RT_NAN), x); + x = vsel(vmask_eq(a, vcast_vd_d(-1)), vcast_vd_d(-rtengine::RT_INFINITY), x); + + return x; +} // @@ -126,15 +899,580 @@ typedef struct { vfloat x, y; } vfloat2; -vfloat xsinf(vfloat d); -vfloat xcosf(vfloat d); -vfloat2 xsincosf(vfloat d); -vfloat xtanf(vfloat d); -vfloat xasinf(vfloat s); -vfloat xacosf(vfloat s); -vfloat xatanf(vfloat s); -vfloat xatan2f(vfloat y, vfloat x); -vfloat xlogf(vfloat d); -vfloat xlogf0(vfloat d); -vfloat xexpf(vfloat d); -vfloat xcbrtf(vfloat s); +static INLINE vfloat vabsf(vfloat f) { return (vfloat)vandnotm((vmask)vcast_vf_f(-0.0f), (vmask)f); } +static INLINE vfloat vnegf(vfloat f) { return (vfloat)vxorm((vmask)f, (vmask)vcast_vf_f(-0.0f)); } + +#ifdef __SSE4_1__ +// only one instruction when using SSE4.1 +static INLINE vfloat vself(vmask mask, vfloat x, vfloat y) { + return _mm_blendv_ps(y,x,(vfloat)mask); +} + +static INLINE vint vselc(vmask mask, vint x, vint y) { + return _mm_blendv_epi8(y,x,mask); +} + +#else +// three instructions when using SSE2 +static INLINE vfloat vself(vmask mask, vfloat x, vfloat y) { + return (vfloat)vorm(vandm(mask, (vmask)x), vandnotm(mask, (vmask)y)); +} + +static INLINE vint vselc(vmask mask, vint x, vint y) { + return vorm(vandm(mask, (vmask)x), vandnotm(mask, (vmask)y)); +} +#endif + +static INLINE vfloat vselfzero(vmask mask, vfloat x) { + // returns value of x if corresponding mask bits are 1, else returns 0 + // faster than vself(mask, x, ZEROV) + return _mm_and_ps((vfloat)mask, x); +} +static INLINE vfloat vselfnotzero(vmask mask, vfloat x) { + // returns value of x if corresponding mask bits are 0, else returns 0 + // faster than vself(mask, ZEROV, x) + return _mm_andnot_ps((vfloat)mask, x); +} + +static INLINE vint vselizero(vmask mask, vint x) { + // returns value of x if corresponding mask bits are 1, else returns 0 + // faster than vselc(mask, x, ZEROV) + return _mm_and_si128(mask, x); +} +static INLINE vint vselinotzero(vmask mask, vint x) { + // returns value of x if corresponding mask bits are 0, else returns 0 + // faster than vselc(mask, ZEROV, x) + return _mm_andnot_si128(mask, x); +} + +static INLINE vint2 vseli2_lt(vfloat f0, vfloat f1, vint2 x, vint2 y) { + vint2 m2 = vcast_vi2_vm(vmaskf_lt(f0, f1)); + return vori2(vandi2(m2, x), vandnoti2(m2, y)); +} + +static INLINE vmask vsignbitf(vfloat f) { + return vandm((vmask)f, (vmask)vcast_vf_f(-0.0f)); +} + +static INLINE vfloat vmulsignf(vfloat x, vfloat y) { + return (vfloat)vxorm((vmask)x, vsignbitf(y)); +} + +static INLINE vfloat vsignf(vfloat f) { + return (vfloat)vorm((vmask)vcast_vf_f(1.0f), vandm((vmask)vcast_vf_f(-0.0f), (vmask)f)); +} + +static INLINE vmask vmaskf_isinf(vfloat d) { return vmaskf_eq(vabsf(d), vcast_vf_f(INFINITYf)); } +static INLINE vmask vmaskf_ispinf(vfloat d) { return vmaskf_eq(d, vcast_vf_f(INFINITYf)); } +static INLINE vmask vmaskf_isminf(vfloat d) { return vmaskf_eq(d, vcast_vf_f(-INFINITYf)); } +static INLINE vmask vmaskf_isnan(vfloat d) { return vmaskf_neq(d, d); } +// the following is equivalent to vorm(vmaskf_isnan(a), vmaskf_isnan(b)), but faster +static INLINE vmask vmaskf_isnan(vfloat a, vfloat b) { return (vmask)_mm_cmpunord_ps(a, b); } +static INLINE vfloat visinf2f(vfloat d, vfloat m) { return (vfloat)vandm(vmaskf_isinf(d), vorm(vsignbitf(d), (vmask)m)); } +static INLINE vfloat visinff(vfloat d) { return visinf2f(d, vcast_vf_f(1.0f)); } + +static INLINE vint2 vilogbp1f(vfloat d) { + vmask m = vmaskf_lt(d, vcast_vf_f(5.421010862427522E-20f)); + d = vself(m, vmulf(vcast_vf_f(1.8446744073709552E19f), d), d); + vint2 q = vandi2(vsrli2(vcast_vi2_vm(vreinterpret_vm_vf(d)), 23), vcast_vi2_i(0xff)); + q = vsubi2(q, vseli2(m, vcast_vi2_i(64 + 0x7e), vcast_vi2_i(0x7e))); + return q; +} + +static INLINE vfloat vldexpf(vfloat x, vint2 q) { + vfloat u; + vint2 m = vsrai2(q, 31); + m = vslli2(vsubi2(vsrai2(vaddi2(m, q), 6), m), 4); + q = vsubi2(q, vslli2(m, 2)); + u = vreinterpret_vf_vm(vcast_vm_vi2(vslli2(vaddi2(m, vcast_vi2_i(0x7f)), 23))); + x = vmulf(vmulf(vmulf(vmulf(x, u), u), u), u); + u = vreinterpret_vf_vm(vcast_vm_vi2(vslli2(vaddi2(q, vcast_vi2_i(0x7f)), 23))); + return vmulf(x, u); +} + +static INLINE vfloat xsinf(vfloat d) { + vint2 q; + vfloat u, s; + + q = vrint_vi2_vf(vmulf(d, vcast_vf_f((float)rtengine::RT_1_PI))); + + u = vcast_vf_vi2(q); + d = vmlaf(u, vcast_vf_f(-PI4_Af*4), d); + d = vmlaf(u, vcast_vf_f(-PI4_Bf*4), d); + d = vmlaf(u, vcast_vf_f(-PI4_Cf*4), d); + d = vmlaf(u, vcast_vf_f(-PI4_Df*4), d); + + s = vmulf(d, d); + + d = vself(vmaski2_eq(vandi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vnegf(d), d); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmlaf(u, s, vcast_vf_f(-0.0001981069071916863322258f)); + u = vmlaf(u, s, vcast_vf_f(0.00833307858556509017944336f)); + u = vmlaf(u, s, vcast_vf_f(-0.166666597127914428710938f)); + + u = vmlaf(s, vmulf(u, d), d); + + return u; +} + +static INLINE vfloat xcosf(vfloat d) { + vint2 q; + vfloat u, s; + + q = vrint_vi2_vf(vsubf(vmulf(d, vcast_vf_f((float)rtengine::RT_1_PI)), vcast_vf_f(0.5f))); + q = vaddi2(vaddi2(q, q), vcast_vi2_i(1)); + + u = vcast_vf_vi2(q); + d = vmlaf(u, vcast_vf_f(-PI4_Af*2), d); + d = vmlaf(u, vcast_vf_f(-PI4_Bf*2), d); + d = vmlaf(u, vcast_vf_f(-PI4_Cf*2), d); + d = vmlaf(u, vcast_vf_f(-PI4_Df*2), d); + + s = vmulf(d, d); + + d = vself(vmaski2_eq(vandi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)), d, vnegf(d)); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmlaf(u, s, vcast_vf_f(-0.0001981069071916863322258f)); + u = vmlaf(u, s, vcast_vf_f(0.00833307858556509017944336f)); + u = vmlaf(u, s, vcast_vf_f(-0.166666597127914428710938f)); + + u = vmlaf(s, vmulf(u, d), d); + + return u; +} + +static INLINE vfloat2 xsincosf(vfloat d) { + vint2 q; + vmask m; + vfloat u, s, t, rx, ry; + vfloat2 r; + + q = vrint_vi2_vf(vmulf(d, vcast_vf_f((float)rtengine::RT_2_PI))); + + s = d; + + u = vcast_vf_vi2(q); + s = vmlaf(u, vcast_vf_f(-PI4_Af*2), s); + s = vmlaf(u, vcast_vf_f(-PI4_Bf*2), s); + s = vmlaf(u, vcast_vf_f(-PI4_Cf*2), s); + s = vmlaf(u, vcast_vf_f(-PI4_Df*2), s); + + t = s; + + s = vmulf(s, s); + + u = vcast_vf_f(-0.000195169282960705459117889f); + u = vmlaf(u, s, vcast_vf_f(0.00833215750753879547119141f)); + u = vmlaf(u, s, vcast_vf_f(-0.166666537523269653320312f)); + u = vmulf(vmulf(u, s), t); + + rx = vaddf(t, u); + + u = vcast_vf_f(-2.71811842367242206819355e-07f); + u = vmlaf(u, s, vcast_vf_f(2.47990446951007470488548e-05f)); + u = vmlaf(u, s, vcast_vf_f(-0.00138888787478208541870117f)); + u = vmlaf(u, s, vcast_vf_f(0.0416666641831398010253906f)); + u = vmlaf(u, s, vcast_vf_f(-0.5)); + + ry = vaddf(vcast_vf_f(1), vmulf(s, u)); + + m = vmaski2_eq(vandi2(q, vcast_vi2_i(1)), vcast_vi2_i(0)); + r.x = vself(m, rx, ry); + r.y = vself(m, ry, rx); + + m = vmaski2_eq(vandi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)); + r.x = vreinterpret_vf_vm(vxorm(vandm(m, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(r.x))); + + m = vmaski2_eq(vandi2(vaddi2(q, vcast_vi2_i(1)), vcast_vi2_i(2)), vcast_vi2_i(2)); + r.y = vreinterpret_vf_vm(vxorm(vandm(m, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(r.y))); + + m = vmaskf_isinf(d); + r.x = vself(m, vcast_vf_f(rtengine::RT_NAN), r.x); + r.y = vself(m, vcast_vf_f(rtengine::RT_NAN), r.y); + + return r; +} + +static INLINE vfloat xtanf(vfloat d) { + vint2 q; + vmask m; + vfloat u, s, x; + + q = vrint_vi2_vf(vmulf(d, vcast_vf_f((float)(2 * rtengine::RT_1_PI)))); + + x = d; + + u = vcast_vf_vi2(q); + x = vmlaf(u, vcast_vf_f(-PI4_Af*2), x); + x = vmlaf(u, vcast_vf_f(-PI4_Bf*2), x); + x = vmlaf(u, vcast_vf_f(-PI4_Cf*2), x); + x = vmlaf(u, vcast_vf_f(-PI4_Df*2), x); + + s = vmulf(x, x); + + m = vmaski2_eq(vandi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)); + x = vself(m, vnegf(x), x); + + u = vcast_vf_f(0.00927245803177356719970703f); + u = vmlaf(u, s, vcast_vf_f(0.00331984995864331722259521f)); + u = vmlaf(u, s, vcast_vf_f(0.0242998078465461730957031f)); + u = vmlaf(u, s, vcast_vf_f(0.0534495301544666290283203f)); + u = vmlaf(u, s, vcast_vf_f(0.133383005857467651367188f)); + u = vmlaf(u, s, vcast_vf_f(0.333331853151321411132812f)); + + u = vmlaf(s, vmulf(u, x), x); + + u = vself(m, vrecf(u), u); + + u = vself(vmaskf_isinf(d), vcast_vf_f(NANf), u); + + return u; +} + +static INLINE vfloat xatanf(vfloat s) { + vfloat t, u; + vint2 q; + + q = vseli2_lt(s, vcast_vf_f(0.0f), vcast_vi2_i(2), vcast_vi2_i(0)); + s = vabsf(s); + + q = vseli2_lt(vcast_vf_f(1.0f), s, vaddi2(q, vcast_vi2_i(1)), q); + s = vself(vmaskf_lt(vcast_vf_f(1.0f), s), vdivf(vcast_vf_f(1.0f), s), s); + + t = vmulf(s, s); + + u = vcast_vf_f(0.00282363896258175373077393f); + u = vmlaf(u, t, vcast_vf_f(-0.0159569028764963150024414f)); + u = vmlaf(u, t, vcast_vf_f(0.0425049886107444763183594f)); + u = vmlaf(u, t, vcast_vf_f(-0.0748900920152664184570312f)); + u = vmlaf(u, t, vcast_vf_f(0.106347933411598205566406f)); + u = vmlaf(u, t, vcast_vf_f(-0.142027363181114196777344f)); + u = vmlaf(u, t, vcast_vf_f(0.199926957488059997558594f)); + u = vmlaf(u, t, vcast_vf_f(-0.333331018686294555664062f)); + + t = vaddf(s, vmulf(s, vmulf(t, u))); + + t = vself(vmaski2_eq(vandi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vsubf(vcast_vf_f((float)(rtengine::RT_PI/2)), t), t); + t = vself(vmaski2_eq(vandi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)), vnegf(t), t); + + return t; +} + +static INLINE vfloat atan2kf(vfloat y, vfloat x) { + vfloat s, t, u; + vint2 q; + vmask p; + + q = vseli2_lt(x, vcast_vf_f(0.0f), vcast_vi2_i(-2), vcast_vi2_i(0)); + x = vabsf(x); + + q = vseli2_lt(x, y, vaddi2(q, vcast_vi2_i(1)), q); + p = vmaskf_lt(x, y); + s = vself(p, vnegf(x), y); + t = vmaxf(x, y); + + s = vdivf(s, t); + t = vmulf(s, s); + + u = vcast_vf_f(0.00282363896258175373077393f); + u = vmlaf(u, t, vcast_vf_f(-0.0159569028764963150024414f)); + u = vmlaf(u, t, vcast_vf_f(0.0425049886107444763183594f)); + u = vmlaf(u, t, vcast_vf_f(-0.0748900920152664184570312f)); + u = vmlaf(u, t, vcast_vf_f(0.106347933411598205566406f)); + u = vmlaf(u, t, vcast_vf_f(-0.142027363181114196777344f)); + u = vmlaf(u, t, vcast_vf_f(0.199926957488059997558594f)); + u = vmlaf(u, t, vcast_vf_f(-0.333331018686294555664062f)); + + t = vaddf(s, vmulf(s, vmulf(t, u))); + t = vaddf(t, vmulf(vcast_vf_vi2(q), vcast_vf_f((float)(rtengine::RT_PI/2)))); + + return t; +} + +static INLINE vfloat xatan2f(vfloat y, vfloat x) { + vfloat r = atan2kf(vabsf(y), x); + + r = vmulsignf(r, x); + r = vself(vorm(vmaskf_isinf(x), vmaskf_eq(x, vcast_vf_f(0.0f))), vsubf(vcast_vf_f((float)(rtengine::RT_PI/2)), visinf2f(x, vmulsignf(vcast_vf_f((float)(rtengine::RT_PI/2)), x))), r); + r = vself(vmaskf_isinf(y), vsubf(vcast_vf_f((float)(rtengine::RT_PI/2)), visinf2f(x, vmulsignf(vcast_vf_f((float)(rtengine::RT_PI/4)), x))), r); + r = vself(vmaskf_eq(y, vcast_vf_f(0.0f)), vselfzero(vmaskf_eq(vsignf(x), vcast_vf_f(-1.0f)), vcast_vf_f((float)rtengine::RT_PI)), r); + + return vself(vmaskf_isnan(x, y), vcast_vf_f(NANf), vmulsignf(r, y)); +} + +static INLINE vfloat xasinf(vfloat d) { + vfloat x, y; + x = vaddf(vcast_vf_f(1.0f), d); + y = vsubf(vcast_vf_f(1.0f), d); + x = vmulf(x, y); + x = vsqrtf(x); + x = vself(vmaskf_isnan(x), vcast_vf_f(NANf), atan2kf(vabsf(d), x)); + return vmulsignf(x, d); +} + +static INLINE vfloat xacosf(vfloat d) { + vfloat x, y; + x = vaddf(vcast_vf_f(1.0f), d); + y = vsubf(vcast_vf_f(1.0f), d); + x = vmulf(x, y); + x = vsqrtf(x); + x = vmulsignf(atan2kf(x, vabsf(d)), d); + y = (vfloat)vandm(vmaskf_lt(d, vcast_vf_f(0.0f)), (vmask)vcast_vf_f((float)rtengine::RT_PI)); + x = vaddf(x, y); + return x; +} + +static INLINE vfloat xlogf(vfloat d) { + vfloat x, x2, t, m; + vint2 e; + + e = vilogbp1f(vmulf(d, vcast_vf_f(0.7071f))); + m = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); + + x = vdivf(vaddf(vcast_vf_f(-1.0f), m), vaddf(vcast_vf_f(1.0f), m)); + x2 = vmulf(x, x); + + t = vcast_vf_f(0.2371599674224853515625f); + t = vmlaf(t, x2, vcast_vf_f(0.285279005765914916992188f)); + t = vmlaf(t, x2, vcast_vf_f(0.400005519390106201171875f)); + t = vmlaf(t, x2, vcast_vf_f(0.666666567325592041015625f)); + t = vmlaf(t, x2, vcast_vf_f(2.0f)); + + x = vaddf(vmulf(x, t), vmulf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); + + x = vself(vmaskf_ispinf(d), vcast_vf_f(INFINITYf), x); + x = vself(vmaskf_gt(vcast_vf_f(0), d), vcast_vf_f(NANf), x); + x = vself(vmaskf_eq(d, vcast_vf_f(0)), vcast_vf_f(-INFINITYf), x); + + return x; +} + +static INLINE vfloat xlogf1(vfloat d) { // does xlogf(vmaxf(d, 1.f)) but faster + vfloat x, x2, t, m; + vint2 e; + + e = vilogbp1f(vmulf(d, vcast_vf_f(0.7071f))); + m = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); + + x = vdivf(vaddf(vcast_vf_f(-1.0f), m), vaddf(vcast_vf_f(1.0f), m)); + x2 = vmulf(x, x); + + t = vcast_vf_f(0.2371599674224853515625f); + t = vmlaf(t, x2, vcast_vf_f(0.285279005765914916992188f)); + t = vmlaf(t, x2, vcast_vf_f(0.400005519390106201171875f)); + t = vmlaf(t, x2, vcast_vf_f(0.666666567325592041015625f)); + t = vmlaf(t, x2, vcast_vf_f(2.0f)); + + x = vaddf(vmulf(x, t), vmulf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); + + x = vself(vmaskf_ispinf(d), vcast_vf_f(INFINITYf), x); + x = vselfnotzero(vmaskf_le(d, vcast_vf_f(1.f)), x); + + return x; +} + +static INLINE vfloat xlogf0(vfloat d) { + vfloat x, x2, t, m; + vint2 e; + + e = vilogbp1f(vmulf(d, vcast_vf_f(0.7071f))); + m = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); + + x = vdivf(vaddf(vcast_vf_f(-1.0f), m), vaddf(vcast_vf_f(1.0f), m)); + x2 = vmulf(x, x); + + t = vcast_vf_f(0.2371599674224853515625f); + t = vmlaf(t, x2, vcast_vf_f(0.285279005765914916992188f)); + t = vmlaf(t, x2, vcast_vf_f(0.400005519390106201171875f)); + t = vmlaf(t, x2, vcast_vf_f(0.666666567325592041015625f)); + t = vmlaf(t, x2, vcast_vf_f(2.0f)); + + x = vaddf(vmulf(x, t), vmulf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); + + x = vself(vmaskf_ispinf(d), vcast_vf_f(0), x); + x = vself(vmaskf_gt(vcast_vf_f(0), d), vcast_vf_f(0), x); + x = vself(vmaskf_eq(d, vcast_vf_f(0)), vcast_vf_f(0), x); + + return x; +} + +static INLINE vfloat xlogfNoCheck(vfloat d) { // this version does not check input values. Use it only when you know the input values are > 0 e.g. when filling a lookup table + vfloat x, x2, t, m; + vint2 e; + + e = vilogbp1f(vmulf(d, vcast_vf_f(0.7071f))); + m = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); + + x = vdivf(vaddf(vcast_vf_f(-1.0f), m), vaddf(vcast_vf_f(1.0f), m)); + x2 = vmulf(x, x); + + t = vcast_vf_f(0.2371599674224853515625f); + t = vmlaf(t, x2, vcast_vf_f(0.285279005765914916992188f)); + t = vmlaf(t, x2, vcast_vf_f(0.400005519390106201171875f)); + t = vmlaf(t, x2, vcast_vf_f(0.666666567325592041015625f)); + t = vmlaf(t, x2, vcast_vf_f(2.0f)); + + return vaddf(vmulf(x, t), vmulf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); + +} + +static INLINE vfloat xexpf(vfloat d) { + vint2 q = vrint_vi2_vf(vmulf(d, vcast_vf_f(R_LN2f))); + vfloat s, u; + + s = vmlaf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf),d); + s = vmlaf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf),s); + + u = vcast_vf_f(0.00136324646882712841033936f); + u = vmlaf(u, s, vcast_vf_f(0.00836596917361021041870117f)); + u = vmlaf(u, s, vcast_vf_f(0.0416710823774337768554688f)); + u = vmlaf(u, s, vcast_vf_f(0.166665524244308471679688f)); + u = vmlaf(u, s, vcast_vf_f(0.499999850988388061523438f)); + + u = vaddf(vcast_vf_f(1.0f), vmlaf(vmulf(s, s), u, s)); + + u = vldexpf(u, q); + + // -104.0 + return vselfnotzero(vmaskf_gt(vcast_vf_f(-104.f), d), u); +} + +static INLINE vfloat xexpfNoCheck(vfloat d) { // this version does not check input values. Use it only when you know the input values are > -104.f e.g. when filling a lookup table + vint2 q = vrint_vi2_vf(vmulf(d, vcast_vf_f(R_LN2f))); + vfloat s, u; + + s = vmlaf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf),d); + s = vmlaf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf),s); + + u = vcast_vf_f(0.00136324646882712841033936f); + u = vmlaf(u, s, vcast_vf_f(0.00836596917361021041870117f)); + u = vmlaf(u, s, vcast_vf_f(0.0416710823774337768554688f)); + u = vmlaf(u, s, vcast_vf_f(0.166665524244308471679688f)); + u = vmlaf(u, s, vcast_vf_f(0.499999850988388061523438f)); + + u = vaddf(vcast_vf_f(1.0f), vmlaf(vmulf(s, s), u, s)); + + return vldexpf(u, q); +} + +static INLINE vfloat xcbrtf(vfloat d) { + vfloat x, y, q = vcast_vf_f(1.0), t; + vint2 e, qu, re; + + e = vilogbp1f(vabsf(d)); + d = vldexpf(d, vsubi2(vcast_vi2_i(0), e)); + + t = vaddf(vcast_vf_vi2(e), vcast_vf_f(6144)); + qu = vtruncate_vi2_vf(vdivf(t, vcast_vf_f(3))); + re = vtruncate_vi2_vf(vsubf(t, vmulf(vcast_vf_vi2(qu), vcast_vf_f(3)))); + + q = vself(vmaski2_eq(re, vcast_vi2_i(1)), vcast_vf_f(1.2599210498948731647672106f), q); + q = vself(vmaski2_eq(re, vcast_vi2_i(2)), vcast_vf_f(1.5874010519681994747517056f), q); + q = vldexpf(q, vsubi2(qu, vcast_vi2_i(2048))); + + q = vmulsignf(q, d); + d = vabsf(d); + + x = vcast_vf_f(-0.601564466953277587890625f); + x = vmlaf(x, d, vcast_vf_f(2.8208892345428466796875f)); + x = vmlaf(x, d, vcast_vf_f(-5.532182216644287109375f)); + x = vmlaf(x, d, vcast_vf_f(5.898262500762939453125f)); + x = vmlaf(x, d, vcast_vf_f(-3.8095417022705078125f)); + x = vmlaf(x, d, vcast_vf_f(2.2241256237030029296875f)); + + y = vmulf(vmulf(d, x), x); + y = vmulf(vsubf(y, vmulf(vmulf(vcast_vf_f(2.0f / 3.0f), y), vmlaf(y, x, vcast_vf_f(-1.0f)))), q); + + return y; +} + +static INLINE vfloat vclampf(vfloat value, vfloat low, vfloat high) { + // clamps value in [low;high], returns low if value is NaN + return vmaxf(vminf(high, value), low); +} + +static INLINE vfloat SQRV(vfloat a){ + return a * a; +} + +static inline void vswap( vmask condition, vfloat &a, vfloat &b) { + // conditional swap the elements of two vfloats + vfloat temp = vself(condition, a, b); // the values which fit to condition + a = vself(condition, b, a); // the values which fit to inverted condition + b = temp; +} + +static inline float vhadd( vfloat a ) { + // returns a[0] + a[1] + a[2] + a[3] + a += _mm_movehl_ps(a, a); + return _mm_cvtss_f32(_mm_add_ss(a, _mm_shuffle_ps(a, a, 1))); +} + +static inline float vhmin(vfloat a) { + // returns min(a[0], a[1], a[2], a[3]) + a = vminf(a, _mm_movehl_ps(a, a)); + return _mm_cvtss_f32(vminf(a, _mm_shuffle_ps(a, a, 1))); +} + +static inline float vhmax(vfloat a) { + // returns max(a[0], a[1], a[2], a[3]) + a = vmaxf(a, _mm_movehl_ps(a, a)); + return _mm_cvtss_f32(vmaxf(a, _mm_shuffle_ps(a, a, 1))); +} + +static INLINE vfloat vmul2f(vfloat a){ + // fastest way to multiply by 2 + return a + a; +} + +static INLINE vfloat vintpf(vfloat a, vfloat b, vfloat c) { + // calculate a * b + (1 - a) * c (interpolate two values) + // following is valid: + // vintpf(a, b+x, c+x) = vintpf(a, b, c) + x + // vintpf(a, b*x, c*x) = vintpf(a, b, c) * x + return a * (b-c) + c; +} + +static INLINE vfloat vdup(vfloat a){ + // returns { a[0],a[0],a[1],a[1] } + return _mm_unpacklo_ps( a, a ); +} + +static INLINE vfloat vaddc2vfu(float &a) +{ + // loads a[0]..a[7] and returns { a[0]+a[1], a[2]+a[3], a[4]+a[5], a[6]+a[7] } + vfloat a1 = _mm_loadu_ps( &a ); + vfloat a2 = _mm_loadu_ps( (&a) + 4 ); + return _mm_shuffle_ps(a1,a2,_MM_SHUFFLE( 2,0,2,0 )) + _mm_shuffle_ps(a1,a2,_MM_SHUFFLE( 3,1,3,1 )); +} + +static INLINE vfloat vadivapb (vfloat a, vfloat b) { + return a / (a+b); +} + +static INLINE void vconvertrgbrgbrgbrgb2rrrrggggbbbb (const float * src, vfloat &rv, vfloat &gv, vfloat &bv) { // cool function name, isn't it ? :P + // converts a sequence of 4 float RGB triplets to 3 red, green and blue quadruples + rv = _mm_setr_ps(src[0],src[3],src[6],src[9]); + gv = _mm_setr_ps(src[1],src[4],src[7],src[10]); + bv = _mm_setr_ps(src[2],src[5],src[8],src[11]); +} + +#if defined( __SSE4_1__ ) && defined( __x86_64__ ) +static INLINE vfloat vceilf(vfloat x) { + return _mm_round_ps(x, _MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC); +} + +#else + +static INLINE vfloat vceilf(vfloat x) { + __m128i zerov = _mm_setzero_si128(); + zerov = _mm_cmpeq_epi32(zerov, zerov); + const vfloat onev = (vfloat)_mm_slli_epi32(_mm_srli_epi32(zerov, 25), 23); //create vector 1.0f + const vfloat xi = _mm_cvtepi32_ps(_mm_cvttps_epi32(x)); + return xi + _mm_and_ps(_mm_cmplt_ps(xi, x), onev); +} +#endif + +#endif // __SSE2__ diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 1cb11e94d..271818303 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -53,7 +53,6 @@ template T** allocArray (int W, int H) return t; } -#define HR_SCALE 2 StdImageSource::StdImageSource () : ImageSource(), img(nullptr), plistener(nullptr), full(false), max{}, rgbSourceModified(false) { diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index feba5c95f..cee57c851 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -308,7 +308,7 @@ float calculateGradients (Array2Df* H, Array2Df* G, int k, bool multithread) // however, the impact is not visible so we ignore this here (*G) (x, y) = sqrt (gx * gx + gy * gy) / divider; - avgGrad += (*G) (x, y); + avgGrad += static_cast((*G) (x, y)); } } @@ -381,7 +381,7 @@ void calculateFiMatrix (Array2Df* FI, Array2Df* gradients[], #endif for ( int y = 0; y < height; y++ ) { for ( int x = 0; x < width; x++ ) { - float grad = ((*gradients[k]) (x, y) < 1e-4f) ? 1e-4 : (*gradients[k]) (x, y); + float grad = ((*gradients[k]) (x, y) < 1e-4f) ? 1e-4f : (*gradients[k]) (x, y); float a = alfa * avgGrad[k]; float value = pow ((grad + noise) / a, beta - 1.0f); @@ -603,8 +603,8 @@ void tmo_fattal02 (size_t width, // sets index+1 based on the boundary assumption H(N+1)=H(N-1) unsigned int xp1 = (x + 1 >= width ? width - 2 : x + 1); // forward differences in H, so need to use between-points approx of FI - (*Gx) (x, y) = ((*H) (xp1, y) - (*H) (x, y)) * 0.5 * ((*FI) (xp1, y) + (*FI) (x, y)); - (*Gy) (x, y) = ((*H) (x, yp1) - (*H) (x, y)) * 0.5 * ((*FI) (x, yp1) + (*FI) (x, y)); + (*Gx) (x, y) = ((*H) (xp1, y) - (*H) (x, y)) * 0.5f * ((*FI) (xp1, y) + (*FI) (x, y)); + (*Gy) (x, y) = ((*H) (x, yp1) - (*H) (x, y)) * 0.5f * ((*FI) (x, yp1) + (*FI) (x, y)); } } @@ -747,7 +747,7 @@ void transform_ev2normal (Array2Df *A, Array2Df *T, bool multithread) } for (int y = 1 ; y < height - 1 ; y++ ) { - (*A) (0, y) *= 0.5; + (*A) (0, y) *= 0.5f; (*A) (width - 1, y) *= 0.5f; } @@ -912,7 +912,7 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/* for (int y = 0 ; y < height ; y++ ) { for (int x = 0 ; x < width ; x++ ) { - (*F_tr) (x, y) = (*F_tr) (x, y) / (l1[y] + l2[x]); + (*F_tr) (x, y) = static_cast((*F_tr) (x, y)) / (l1[y] + l2[x]); } } diff --git a/rtengine/utils.cc b/rtengine/utils.cc index a07a1235f..0674c9806 100644 --- a/rtengine/utils.cc +++ b/rtengine/utils.cc @@ -22,7 +22,6 @@ #include "rt_math.h" #include "utils.h" -#include "rt_math.h" using namespace std; diff --git a/rtengine/xtrans_demosaic.cc b/rtengine/xtrans_demosaic.cc index cb1315ed0..b01b0ac1c 100644 --- a/rtengine/xtrans_demosaic.cc +++ b/rtengine/xtrans_demosaic.cc @@ -31,7 +31,7 @@ namespace rtengine { -const double xyz_rgb[3][3] = { // XYZ from RGB +const float xyz_rgb[3][3] = { // XYZ from RGB { 0.412453, 0.357580, 0.180423 }, { 0.212671, 0.715160, 0.072169 }, { 0.019334, 0.119193, 0.950227 } diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index ee451c7d7..636bf4328 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CANONATTRIBS_ -#define _CANONATTRIBS_ #include #include @@ -1231,7 +1229,7 @@ public: int a = Interpreter::toInt (t, ofs, astype); if (a > 1) { - int i = int (double (powf (2.f, float (a) / 32.f - 4.f)) * 50.f + 0.5f); + int i = static_cast(powf (2.f, static_cast(a) / 32.f - 4.f)) * 50.0 + 0.5; return i; } else { return 0; @@ -2142,5 +2140,4 @@ const TagAttrib canonAttribs[] = { { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr} }; } -#endif diff --git a/rtexif/fujiattribs.cc b/rtexif/fujiattribs.cc index 0eaa505f6..ffbf3a0be 100644 --- a/rtexif/fujiattribs.cc +++ b/rtexif/fujiattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FUJIATTRIBS_ -#define _FUJIATTRIBS_ #include "rtexif.h" @@ -312,5 +310,4 @@ const TagAttrib fujiAttribs[] = { { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr} }; } -#endif diff --git a/rtexif/kodakattribs.cc b/rtexif/kodakattribs.cc index a9c168a70..c89ca2298 100644 --- a/rtexif/kodakattribs.cc +++ b/rtexif/kodakattribs.cc @@ -1,8 +1,6 @@ /* * This file is part of RawTherapee. */ -#ifndef _KODAKATTRIBS_ -#define _KODAKATTRIBS_ #include #include "rtexif.h" @@ -58,7 +56,7 @@ void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif_) // Proback645 may have "Lens" but not "Focal Length" float flen = atof (val.c_str()); - if (flen != 0.0) { + if (flen != 0.f) { t = new Tag (exif, lookupAttrib (exifAttribs, "FocalLength")); t->initRational (flen * 32, 32); exif->replaceTag (t); @@ -66,7 +64,7 @@ void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif_) } else if (key == "Focal Length") { float flen = atof (val.c_str()); - if (flen != 0.0) { + if (flen != 0.f) { t = new Tag (exif, lookupAttrib (exifAttribs, "FocalLength")); t->initRational (flen * 32, 32); exif->replaceTag (t); @@ -74,7 +72,7 @@ void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif_) } else if (key == "Aperture") { float aperture = atof (&val.c_str()[1]); - if (aperture != 0.0) { + if (aperture != 0.f) { t = new Tag (exif, lookupAttrib (exifAttribs, "FNumber")); t->initRational ((int) (aperture * 10), 10); exif->replaceTag (t); @@ -161,5 +159,4 @@ const TagAttrib kodakIfdAttribs[] = { }; } -#endif diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index 2ef37b8fb..0bc9ce730 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _NIKONATTRIBS_ -#define _NIKONATTRIBS_ #include #include @@ -70,7 +68,7 @@ public: int a = t->getValue()[ofs]; if (a > 1) { - int i = int (double (powf (2.f, float (a) / 12.f - 5.f)) * 100.f + 0.5f); + int i = static_cast(powf(2.f, float (a) / 12.f - 5.f)) * 100.0 + 0.5; return i; } else { return 0; @@ -1229,5 +1227,3 @@ const TagAttrib nikon3Attribs[] = { }; } -#endif - diff --git a/rtexif/olympusattribs.cc b/rtexif/olympusattribs.cc index f590b8154..ec7ab98c7 100644 --- a/rtexif/olympusattribs.cc +++ b/rtexif/olympusattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _OLYMPUSATTRIBS_ -#define _OLYMPUSATTRIBS_ #include #include @@ -850,5 +848,3 @@ const TagAttrib olympusAttribs[] = { { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr} }; } -#endif - diff --git a/rtexif/panasonicattribs.cc b/rtexif/panasonicattribs.cc index 3062824cf..4ebcf2447 100644 --- a/rtexif/panasonicattribs.cc +++ b/rtexif/panasonicattribs.cc @@ -1,8 +1,6 @@ /* * This file is part of RawTherapee. */ -#ifndef _PANASONICATTRIBS_ -#define _PANASONICATTRIBS_ #include #include "rtexif.h" @@ -138,5 +136,3 @@ const TagAttrib panasonicRawAttribs[] = { }; } -#endif - diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index 46ae9f67e..da940f5cb 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PENTAXATTRIBS_ -#define _PENTAXATTRIBS_ #include #include @@ -696,7 +694,7 @@ public: }; PAColorSpaceInterpreter paColorSpaceInterpreter; -class PALensTypeInterpreter : public IntLensInterpreter< int > +class PALensTypeInterpreter final: public IntLensInterpreter< int > { public: PALensTypeInterpreter () @@ -1395,9 +1393,9 @@ public: std::string toString (const Tag* t) const override { int a = t->toInt (0, BYTE); - float b = float (10 * int (a >> 2)) * pow (4.f, float (int (a & 0x03) - 2)); + double b = static_cast(10 * (a >> 2)) * std::pow(4.0, static_cast((a & 0x03) - 2)); - if (b > 1.f) { + if (b > 1.0) { char buffer[32]; sprintf (buffer, "%.2f", b ); return buffer; @@ -1408,9 +1406,9 @@ public: double toDouble (const Tag* t, int ofs) override { int a = t->toInt (ofs, BYTE); - float b = float (10 * int (a >> 2)) * pow (4.f, float (int (a & 0x03) - 2)); + double b = static_cast(10 * (a >> 2)) * std::pow(4.0, static_cast((a & 0x03) - 2)); - if (b > 1.f) { + if (b > 1.0) { return b; } else { return 0.; @@ -2216,7 +2214,6 @@ const TagAttrib pentaxCameraInfoAttribs[] = { }; } -#endif diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 89ff6cd33..06604ade5 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -2344,7 +2344,7 @@ void ExifManager::parseCIFF (int length, TagDirectory* root) ev = ((short)get2 (f, INTEL)) / 32.0f; fseek (f, 34, SEEK_CUR); - if (shutter > 1e6) { + if (shutter > 1e6f) { shutter = get2 (f, INTEL) / 10.0f; } diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index c37533352..1a956a4a5 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -163,14 +163,14 @@ public: // Try to get the Tag in the current directory and in subdirectories // if lookUpward = true, it will scan the parents TagDirectory up to the root one, // but w/o looking into their subdirs - virtual Tag* findTag (const char* name, bool lookUpward = false) const; + Tag* findTag (const char* name, bool lookUpward = false) const; // Find a all Tags with the given name by scanning the whole tag tree std::vector findTags (const char* name); // Find a all Tags with the given ID by scanning the whole tag tree std::vector findTags (int ID); // Try to get the Tag in the current directory and in parent directories // (won't look into subdirs) - virtual Tag* findTagUpward (const char* name) const; + Tag* findTagUpward (const char* name) const; bool getXMPTagValue (const char* name, char* value) const; void keepTag (int ID); @@ -191,10 +191,10 @@ public: virtual TagDirectory* clone (TagDirectory* parent) const; void applyChange (const std::string &field, const Glib::ustring &value); - virtual void printAll (unsigned int level = 0) const; // reentrant debug function, keep level=0 on first call ! - virtual bool CPBDump (const Glib::ustring &commFName, const Glib::ustring &imageFName, const Glib::ustring &profileFName, const Glib::ustring &defaultPParams, + void printAll (unsigned int level = 0) const; // reentrant debug function, keep level=0 on first call ! + bool CPBDump (const Glib::ustring &commFName, const Glib::ustring &imageFName, const Glib::ustring &profileFName, const Glib::ustring &defaultPParams, const CacheImageData* cfs, const bool flagMode, Glib::KeyFile *keyFile = nullptr, Glib::ustring tagDirName = "") const; - virtual void sort (); + void sort (); }; // a table of tags: id are offset from beginning and not identifiers diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index 61223edf0..88251b131 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -15,8 +15,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _SONYMINOLTAATTRIBS_ -#define _SONYMINOLTAATTRIBS_ #include @@ -541,7 +539,7 @@ public: }; SAAntiBlurInterpreter saAntiBlurInterpreter; -class SALensIDInterpreter : public IntLensInterpreter +class SALensIDInterpreter final : public IntLensInterpreter { public: SALensIDInterpreter () @@ -1015,7 +1013,7 @@ public: }; SALensIDInterpreter saLensIDInterpreter; -class SALensID2Interpreter : public IntLensInterpreter< int > +class SALensID2Interpreter final : public IntLensInterpreter< int > { public: SALensID2Interpreter () @@ -2116,7 +2114,7 @@ public: // Decode the value if (a && a != 254) { // 254 = 'Auto' for CameraSettings3, but we might say the same for CameraSettings & CameraSettings2 (?) - return int (expf ((double (a) / 8.f - 6.f) * logf (2.f)) * 100.f + 0.5f); + return std::exp((a / 8.f - 6.f) * std::log(2.f)) * 100.f + 0.5f; } else { return 0; } @@ -2499,6 +2497,4 @@ const TagAttrib sonyCameraSettingsAttribs3[] = { {-1, AC_DONTWRITE, 0, 0, 0, AUTO, "", NULL}};*/ } -#endif - diff --git a/rtexif/stdattribs.cc b/rtexif/stdattribs.cc index 8e076152d..be7a28a5c 100644 --- a/rtexif/stdattribs.cc +++ b/rtexif/stdattribs.cc @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _STDATTRIBS_ -#define _STDATTRIBS_ #include #include @@ -927,5 +925,3 @@ const TagAttrib ifdAttribs[] = { { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr} }; } - -#endif diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index 59250bc81..143268786 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -33,7 +33,7 @@ public: typedef double(*double2double_fun)(double val); -class Adjuster : public Gtk::Grid +class Adjuster final : public Gtk::Grid { protected: diff --git a/rtgui/batchqueueentry.h b/rtgui/batchqueueentry.h index c4cd48615..f06b65046 100644 --- a/rtgui/batchqueueentry.h +++ b/rtgui/batchqueueentry.h @@ -50,7 +50,7 @@ struct BatchQueueEntryIdleHelper { int pending; }; -class BatchQueueEntry : public ThumbBrowserEntryBase, public BQEntryUpdateListener, public rtengine::NonCopyable +class BatchQueueEntry final : public ThumbBrowserEntryBase, public BQEntryUpdateListener, public rtengine::NonCopyable { guint8* opreview; diff --git a/rtgui/batchtoolpanelcoord.h b/rtgui/batchtoolpanelcoord.h index 7a5fe77ed..ea11f97c8 100644 --- a/rtgui/batchtoolpanelcoord.h +++ b/rtgui/batchtoolpanelcoord.h @@ -28,7 +28,7 @@ class FilePanel; class Thumbnail; -class BatchToolPanelCoordinator : +class BatchToolPanelCoordinator final : public ToolPanelCoordinator, public FileSelectionChangeListener, public BatchPParamsChangeListener, diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc index 596d99607..ea493d6e1 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -70,7 +70,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB // -0.1 rad < Hue < 1.6 rad for (int i = 0; i < 7; i++) { - float x = float(i) * (1.0f / 6.0); + float x = float(i) * (1.0f / 6.f); Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); bottomMilestones.push_back( GradientMilestone(double(x), double(R), double(G), double(B)) ); } @@ -1185,10 +1185,10 @@ void BlackWhite::updateRGBLabel () RGBLabels->set_text( Glib::ustring::compose(M("TP_BWMIX_RGBLABEL"), - Glib::ustring::format(std::fixed, std::setprecision(1), r * 100.), - Glib::ustring::format(std::fixed, std::setprecision(1), g * 100.), - Glib::ustring::format(std::fixed, std::setprecision(1), b * 100.), - Glib::ustring::format(std::fixed, std::setprecision(0), ceil(kcorrec * 100./*(r+g+b)*100.)*/))) + Glib::ustring::format(std::fixed, std::setprecision(1), r * 100.f), + Glib::ustring::format(std::fixed, std::setprecision(1), g * 100.f), + Glib::ustring::format(std::fixed, std::setprecision(1), b * 100.f), + Glib::ustring::format(std::fixed, std::setprecision(0), ceil(kcorrec * 100.f/*(r+g+b)*100.)*/))) ); // We have to update the RGB sliders too if preset values has been chosen diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index c37964e23..93dafc1ba 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -39,7 +39,7 @@ namespace { constexpr int cacheDirMode = 0777; -constexpr const char* cacheDirs[] = { "profiles", "images", "aehistograms", "embprofiles", "data" }; +constexpr const char* cacheDirs[] = { "profiles", "images", "embprofiles", "data" }; } @@ -59,9 +59,7 @@ void CacheManager::init () auto error = g_mkdir_with_parents (baseDir.c_str(), cacheDirMode); for (const auto& cacheDir : cacheDirs) { - if (strncmp(cacheDir, "aehistograms", 12)) { // don't create aehistograms folder. - error |= g_mkdir_with_parents (Glib::build_filename (baseDir, cacheDir).c_str(), cacheDirMode); - } + error |= g_mkdir_with_parents (Glib::build_filename (baseDir, cacheDir).c_str(), cacheDirMode); } if (error != 0 && rtengine::settings->verbose) { @@ -187,7 +185,6 @@ void CacheManager::renameEntry (const std::string& oldfilename, const std::strin auto error = g_rename (getCacheFileName ("profiles", oldfilename, paramFileExtension, oldmd5).c_str (), getCacheFileName ("profiles", newfilename, paramFileExtension, newmd5).c_str ()); error |= g_rename (getCacheFileName ("images", oldfilename, ".rtti", oldmd5).c_str (), getCacheFileName ("images", newfilename, ".rtti", newmd5).c_str ()); - error |= g_rename (getCacheFileName ("aehistograms", oldfilename, "", oldmd5).c_str (), getCacheFileName ("aehistograms", newfilename, "", newmd5).c_str ()); error |= g_rename (getCacheFileName ("embprofiles", oldfilename, ".icc", oldmd5).c_str (), getCacheFileName ("embprofiles", newfilename, ".icc", newmd5).c_str ()); error |= g_rename (getCacheFileName ("data", oldfilename, ".txt", oldmd5).c_str (), getCacheFileName ("data", newfilename, ".txt", newmd5).c_str ()); @@ -241,7 +238,6 @@ void CacheManager::clearImages () const deleteDir ("data"); deleteDir ("images"); - deleteDir ("aehistograms"); deleteDir ("embprofiles"); } @@ -277,7 +273,6 @@ void CacheManager::deleteFiles (const Glib::ustring& fname, const std::string& m } auto error = g_remove (getCacheFileName ("images", fname, ".rtti", md5).c_str ()); - error |= g_remove (getCacheFileName ("aehistograms", fname, "", md5).c_str ()); error |= g_remove (getCacheFileName ("embprofiles", fname, ".icc", md5).c_str ()); if (purgeData) { diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 62f6eee2c..9468770fc 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -523,7 +523,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" float R, G, B; for (int i = 0; i < 7; i++) { - float x = float (i) * (1.0f / 6.0); + float x = float (i) * (1.0f / 6.f); Color::hsv2rgb01 (x, 0.5f, 0.5f, R, G, B); shape3Milestones.push_back ( GradientMilestone (double (x), double (R), double (G), double (B)) ); } diff --git a/rtgui/coloredbar.h b/rtgui/coloredbar.h index 6cc121cd5..69cfa47d1 100644 --- a/rtgui/coloredbar.h +++ b/rtgui/coloredbar.h @@ -30,7 +30,7 @@ * the bar itself, i.e. use render_background (depending on its Gtk::Style) * */ -class ColoredBar : private BackBuffer, public ColorCaller +class ColoredBar final : private BackBuffer, public ColorCaller { private: diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index 59768a6ce..ddf917149 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -74,7 +74,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR // whole hue range for (int i = 0; i < 7; i++) { float R, G, B; - float x = float(i) * (1.0f / 6.0); + float x = float(i) * (1.0f / 6.f); Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); milestones.push_back( GradientMilestone(double(x), double(R), double(G), double(B)) ); } @@ -1203,11 +1203,11 @@ void ColorToning::colorForValue (double valX, double valY, enum ColorCaller::Ele // the strength applied to the current hue double strength, hue; hlColSat->getValue(strength, hue); - Color::hsv2rgb01(hue / 360.f, 1.f, 1.f, R, G, B); + Color::hsv2rgb01(hue / 360.0, 1.f, 1.f, R, G, B); const double gray = 0.46; - R = (gray * (1.0 - valX)) + R * valX; - G = (gray * (1.0 - valX)) + G * valX; - B = (gray * (1.0 - valX)) + B * valX; + R = (gray * (1.0 - valX)) + static_cast(R) * valX; + G = (gray * (1.0 - valX)) + static_cast(G) * valX; + B = (gray * (1.0 - valX)) + static_cast(B) * valX; } } else if (callerId == 3) { // Slider 2 background if (valY <= 0.5) @@ -1218,17 +1218,17 @@ void ColorToning::colorForValue (double valX, double valY, enum ColorCaller::Ele // the strength applied to the current hue double strength, hue; shadowsColSat->getValue(strength, hue); - Color::hsv2rgb01(hue / 360.f, 1.f, 1.f, R, G, B); + Color::hsv2rgb01(hue / 360.0, 1.f, 1.f, R, G, B); const double gray = 0.46; - R = (gray * (1.0 - valX)) + R * valX; - G = (gray * (1.0 - valX)) + G * valX; - B = (gray * (1.0 - valX)) + B * valX; + R = (gray * (1.0 - valX)) + static_cast(R) * valX; + G = (gray * (1.0 - valX)) + static_cast(G) * valX; + B = (gray * (1.0 - valX)) + static_cast(B) * valX; } } else if (callerId == 4) { // color curve vertical and horizontal crosshair Color::hsv2rgb01(float(valY), 1.0f, 0.5f, R, G, B); } else if (callerId == ID_LABREGION_HUE) { // TODO - float x = valX - 1.f/6.f; + float x = valX - 1.0/6.0; if (x < 0.f) { x += 1.f; } diff --git a/rtgui/coordinateadjuster.cc b/rtgui/coordinateadjuster.cc index ebf36b7e7..57190cf63 100644 --- a/rtgui/coordinateadjuster.cc +++ b/rtgui/coordinateadjuster.cc @@ -69,14 +69,14 @@ void CoordinateAdjuster::AxisAdjuster::setValue(double newValue) { float range = rangeUpperBound - rangeLowerBound; spinButtonConn.block(true); - spinButton->set_value(newValue * range + rangeLowerBound); + spinButton->set_value(static_cast(newValue) * range + rangeLowerBound); spinButtonConn.block(false); } void CoordinateAdjuster::AxisAdjuster::valueChanged() { float range = rangeUpperBound - rangeLowerBound; - parent->updatePos(idx, (spinButton->get_value() - rangeLowerBound) / range); + parent->updatePos(idx, (static_cast(spinButton->get_value()) - rangeLowerBound) / range); } CoordinateAdjuster::CoordinateAdjuster(CoordinateProvider *provider, CurveEditorSubGroup *parent, const std::vector &axis) @@ -171,7 +171,7 @@ void CoordinateAdjuster::startNumericalAdjustment(const std::vector Gtk::SpinButton *currSpinButton = axisAdjusters.at(i)->spinButton; currSpinButton->set_sensitive(true); float range = axisAdjusters.at(i)->rangeUpperBound - axisAdjusters.at(i)->rangeLowerBound; - currSpinButton->set_range(newBoundaries.at(i).minVal * range + axisAdjusters.at(i)->rangeLowerBound, newBoundaries.at(i).maxVal * range + axisAdjusters.at(i)->rangeLowerBound); + currSpinButton->set_range(newBoundaries.at(i).minVal * static_cast(range) + static_cast(axisAdjusters.at(i)->rangeLowerBound), newBoundaries.at(i).maxVal * static_cast(range) + static_cast(axisAdjusters.at(i)->rangeLowerBound)); } axisAdjusters.at(0)->spinButton->grab_focus(); @@ -200,7 +200,7 @@ void CoordinateAdjuster::switchAdjustedPoint(std::vector &pos, const std // ...narrow the range to the new interval float range = axisAdjusters.at(i)->rangeUpperBound - axisAdjusters.at(i)->rangeLowerBound; - currAxis->spinButton->set_range(newBoundaries.at(i).minVal * range + axisAdjusters.at(i)->rangeLowerBound, newBoundaries.at(i).maxVal * range + axisAdjusters.at(i)->rangeLowerBound); + currAxis->spinButton->set_range(newBoundaries.at(i).minVal * static_cast(range) + static_cast(axisAdjusters.at(i)->rangeLowerBound), newBoundaries.at(i).maxVal * static_cast(range) + static_cast(axisAdjusters.at(i)->rangeLowerBound)); // enable events currAxis->spinButtonConn.block(false); diff --git a/rtgui/coordinateadjuster.h b/rtgui/coordinateadjuster.h index 70fe42233..24edc707a 100644 --- a/rtgui/coordinateadjuster.h +++ b/rtgui/coordinateadjuster.h @@ -69,7 +69,7 @@ public: * * The position of the Axis in the vector will be used in the communication between the Adjuster and the Provider to identify the Axis */ -class CoordinateAdjuster : public Gtk::FlowBox +class CoordinateAdjuster final : public Gtk::FlowBox { public: diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 3bdcf14cf..d9d496523 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -1006,7 +1006,7 @@ void Crop::cropWidth1Resized (int &X, int &Y, int &W, int &H, float custom_ratio } if (fixr->get_active() || custom_ratio > 0) { - double r = custom_ratio > 0 ? custom_ratio : getRatio(); + double r = custom_ratio > 0.f ? custom_ratio : static_cast(getRatio()); H = (int)round(W / r); int Hmax = min(ny + nh, maxh - ny); @@ -1053,7 +1053,7 @@ void Crop::cropWidth2Resized (int &X, int &Y, int &W, int &H, float custom_ratio } if (fixr->get_active() || custom_ratio > 0) { - double r = custom_ratio > 0 ? custom_ratio : getRatio(); + double r = custom_ratio > 0 ? custom_ratio : static_cast(getRatio()); H = (int)round(W / r); int Hmax = min(ny + nh, maxh - ny); @@ -1101,7 +1101,7 @@ void Crop::cropHeight1Resized (int &X, int &Y, int &W, int &H, float custom_rati } if (fixr->get_active() || custom_ratio > 0) { - double r = custom_ratio > 0 ? custom_ratio : getRatio(); + double r = custom_ratio > 0 ? custom_ratio : static_cast(getRatio()); W = (int)round(H * r); int Wmax = min(nx + nw, maxw - nx); @@ -1148,7 +1148,7 @@ void Crop::cropHeight2Resized (int &X, int &Y, int &W, int &H, float custom_rati } if (fixr->get_active() || custom_ratio > 0) { - double r = custom_ratio > 0 ? custom_ratio : getRatio(); + double r = custom_ratio > 0 ? custom_ratio : static_cast(getRatio()); W = (int)round(H * r); int Wmax = min(nx + nw, maxw - nx); @@ -1205,7 +1205,7 @@ void Crop::cropTopLeftResized (int &X, int &Y, int &W, int &H, float custom_rati } if (fixr->get_active() || custom_ratio > 0) { - double r = custom_ratio > 0 ? custom_ratio : getRatio(); + double r = custom_ratio > 0 ? custom_ratio : static_cast(getRatio()); W = (int)round(H * r); if (W > oldXR) { @@ -1252,7 +1252,7 @@ void Crop::cropTopRightResized (int &X, int &Y, int &W, int &H, float custom_rat } if (fixr->get_active() || custom_ratio > 0) { - double r = custom_ratio > 0 ? custom_ratio : getRatio(); + double r = custom_ratio > 0 ? custom_ratio : static_cast(getRatio()); W = (int)round(H * r); if (W > maxw - nx) { @@ -1298,7 +1298,7 @@ void Crop::cropBottomLeftResized (int &X, int &Y, int &W, int &H, float custom_r } if (fixr->get_active() || custom_ratio > 0) { - double r = custom_ratio > 0 ? custom_ratio : getRatio(); + double r = custom_ratio > 0 ? custom_ratio : static_cast(getRatio()); W = (int)round(H * r); if (W > oldXR) { @@ -1342,7 +1342,7 @@ void Crop::cropBottomRightResized (int &X, int &Y, int &W, int &H, float custom_ } if (fixr->get_active() || custom_ratio > 0) { - double r = custom_ratio > 0 ? custom_ratio : getRatio(); + double r = custom_ratio > 0 ? custom_ratio : static_cast(getRatio()); W = (int)round(H * r); if (W > maxw - nx) { diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 0a9b81112..d87876cec 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -37,6 +37,7 @@ #include "rtsurface.h" #include "../rtengine/dcrop.h" +#include "../rtengine/imagesource.h" #include "../rtengine/procparams.h" #include "../rtengine/rt_math.h" @@ -123,7 +124,7 @@ void CropWindow::initZoomSteps() zoomSteps.push_back(ZoomStep(" 8%", 1.0/12.0, 120, true)); char lbl[64]; for (int s = 100; s >= 11; --s) { - float z = 10./float(s); + float z = 10.f / s; sprintf(lbl, "% 2d%%", int(z * 100)); bool is_major = (s == s/10 * 10); zoomSteps.push_back(ZoomStep(lbl, z, s, is_major)); @@ -294,7 +295,7 @@ void CropWindow::flawnOver (bool isFlawnOver) void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y, double deltaX, double deltaY) { double delta = 0.0; - if (abs(deltaX) > abs(deltaY)) { + if (std::fabs(deltaX) > std::fabs(deltaY)) { delta = deltaX; } else { delta = deltaY; @@ -303,7 +304,7 @@ void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y, if (direction == GDK_SCROLL_SMOOTH) { scrollAccum += delta; //Only change zoom level if we've accumulated +/- 1.0 of deltas. This conditional handles the previous delta=0.0 case - if (abs(scrollAccum) < 1.0) { + if (std::fabs(scrollAccum) < 1.0) { return; } } diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index 491124ad5..623653d2d 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -54,7 +54,7 @@ public: }; class ImageArea; -class CropWindow : public LWButtonListener, public CropDisplayHandler, public EditCoordSystem, public ObjectMOBuffer, public rtengine::NonCopyable +class CropWindow final : public LWButtonListener, public CropDisplayHandler, public EditCoordSystem, public ObjectMOBuffer, public rtengine::NonCopyable { static bool initialized; diff --git a/rtgui/curveeditor.h b/rtgui/curveeditor.h index baae8f492..abc0cc10a 100644 --- a/rtgui/curveeditor.h +++ b/rtgui/curveeditor.h @@ -18,8 +18,8 @@ */ #pragma once -#include "coloredbar.h" #include "editcallbacks.h" +#include "guiutils.h" #include "../rtengine/diagonalcurvetypes.h" #include "../rtengine/flatcurvetypes.h" @@ -28,6 +28,7 @@ class CurveEditorGroup; class CurveEditorSubGroup; +class ColorProvider; class PopUpToggleButton; /* diff --git a/rtgui/defringe.cc b/rtgui/defringe.cc index cdec88edc..7aae8377a 100644 --- a/rtgui/defringe.cc +++ b/rtgui/defringe.cc @@ -37,7 +37,7 @@ Defringe::Defringe () : FoldableToolPanel(this, "defringe", M("TP_DEFRINGE_LABEL float R, G, B; for (int i = 0; i < 7; i++) { - float x = float(i) * (1.0f / 6.0); + float x = i / 6.f; Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); bottomMilestones.push_back( GradientMilestone(double(x), double(R), double(G), double(B)) ); } diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index eed6c63d3..079a083ea 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -477,13 +477,13 @@ void DiagonalCurveEditorSubGroup::pipetteMouseOver(EditDataProvider *provider, i double pos[3]; shcSelector->getPositions(pos[0], pos[1], pos[2]); - if (pipetteVal >= pos[2]) { + if (static_cast(pipetteVal) >= pos[2]) { editedAdjuster = highlights; paramCurve->setActiveParam(4); - } else if(pipetteVal >= pos[1]) { + } else if(static_cast(pipetteVal) >= pos[1]) { editedAdjuster = lights; paramCurve->setActiveParam(5); - } else if(pipetteVal >= pos[0]) { + } else if(static_cast(pipetteVal) >= pos[0]) { editedAdjuster = darks; paramCurve->setActiveParam(6); } else { diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index a077da807..9b1f67462 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -27,7 +27,7 @@ class DiagonalCurveEditor; class MyDiagonalCurve; -class DiagonalCurveEditorSubGroup : +class DiagonalCurveEditorSubGroup final : public CurveEditorSubGroup, public SHCListener, public AdjusterListener, diff --git a/rtgui/dirpyrequalizer.cc b/rtgui/dirpyrequalizer.cc index fd0268efa..34aecf095 100644 --- a/rtgui/dirpyrequalizer.cc +++ b/rtgui/dirpyrequalizer.cc @@ -428,7 +428,7 @@ void DirPyrEqualizer::lumacontrastPlusPressed () { for (int i = 0; i < 6; i++) { - float inc = 0.05 * (6 - i); + double inc = 0.05 * (6 - i); multiplier[i]->setValue(multiplier[i]->getValue() + inc); adjusterChanged(multiplier[i], multiplier[i]->getValue()); } @@ -439,7 +439,7 @@ void DirPyrEqualizer::lumacontrastMinusPressed () { for (int i = 0; i < 6; i++) { - float inc = -0.05 * (6 - i); + double inc = -0.05 * (6 - i); multiplier[i]->setValue(multiplier[i]->getValue() + inc); adjusterChanged(multiplier[i], multiplier[i]->getValue()); } diff --git a/rtgui/editcallbacks.h b/rtgui/editcallbacks.h index c2efcf53e..ee357c2f7 100644 --- a/rtgui/editcallbacks.h +++ b/rtgui/editcallbacks.h @@ -129,19 +129,19 @@ public: @param picked True if the cursor is still above the the same object than on button pressed and with the same modifier keys. If false, the user moved the cursor away or the modifier key is different, so the element is considered as NOT selected. @return true if the preview has to be redrawn, false otherwise */ - virtual bool pick1 (bool picked); + bool pick1 (bool picked); /** @brief Triggered when the user is releasing mouse button 2 while in action==ES_ACTION_PICKING mode @param picked True if the cursor is still above the the same object than on button pressed and with the same modifier keys. If false, the user moved the cursor away or the modifier key is different, so the element is considered as NOT selected. @return true if the preview has to be redrawn, false otherwise */ - virtual bool pick2 (bool picked); + bool pick2 (bool picked); /** @brief Triggered when the user is releasing mouse button 3 while in action==ES_ACTION_PICKING mode @param picked True if the cursor is still above the the same object than on button pressed and with the same modifier keys. If false, the user moved the cursor away or the modifier key is different, so the element is considered as NOT selected. @return true if the preview has to be redrawn, false otherwise */ - virtual bool pick3 (bool picked); + bool pick3 (bool picked); /** @brief Get the geometry to be shown to the user */ const std::vector& getVisibleGeometry (); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 806af8b2e..6a0d41878 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -61,7 +61,7 @@ void setprogressStrUI(double val, const Glib::ustring str, MyProgressBar* pProgr } } - +#if !defined(__APPLE__) // monitor profile not supported on apple bool find_default_monitor_profile (GdkWindow *rootwin, Glib::ustring &defprof, Glib::ustring &defprofname) { #ifdef WIN32 @@ -91,7 +91,7 @@ bool find_default_monitor_profile (GdkWindow *rootwin, Glib::ustring &defprof, G ReleaseDC (NULL, hDC); } -#elif !defined(__APPLE__) +#else // taken from geeqie (image.c) and adapted // Originally licensed as GPL v2+, with the following copyright: // * Copyright (C) 2006 John Ellis @@ -129,7 +129,7 @@ bool find_default_monitor_profile (GdkWindow *rootwin, Glib::ustring &defprof, G #endif return false; } - +#endif } diff --git a/rtgui/editwidgets.cc b/rtgui/editwidgets.cc index f7c748744..e67b664db 100644 --- a/rtgui/editwidgets.cc +++ b/rtgui/editwidgets.cc @@ -126,13 +126,13 @@ void Circle::drawInnerGeometry(Cairo::RefPtr &cr, ObjectMOBuffer if (filled && state != INSENSITIVE) { cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*rtengine::RT_PI); - if (innerLineWidth > 0.) { + if (innerLineWidth > 0.f) { cr->fill_preserve(); cr->stroke(); } else { cr->fill(); } - } else if (innerLineWidth > 0.) { + } else if (innerLineWidth > 0.f) { cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*rtengine::RT_PI); if (state == INSENSITIVE) { @@ -176,7 +176,7 @@ void Circle::drawToMOChannel (Cairo::RefPtr &cr, unsigned short cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0, 2.*rtengine::RT_PI); if (filled) { - if (innerLineWidth > 0.) { + if (innerLineWidth > 0.f) { cr->fill_preserve(); cr->stroke(); } else { @@ -224,7 +224,7 @@ void Line::drawOuterGeometry(Cairo::RefPtr &cr, ObjectMOBuffer * void Line::drawInnerGeometry(Cairo::RefPtr &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) { - if ((flags & F_VISIBLE) && innerLineWidth > 0.) { + if ((flags & F_VISIBLE) && innerLineWidth > 0.f) { if (state != INSENSITIVE) { RGBColor color; @@ -383,13 +383,13 @@ void Polyline::drawInnerGeometry(Cairo::RefPtr &cr, ObjectMOBuff } } - if (innerLineWidth > 0.) { + if (innerLineWidth > 0.f) { cr->fill_preserve(); cr->stroke(); } else { cr->fill(); } - } else if (innerLineWidth > 0.) { + } else if (innerLineWidth > 0.f) { rtengine::Coord currPos; for (unsigned int i = 0; i < points.size(); ++i) { @@ -459,7 +459,7 @@ void Polyline::drawToMOChannel (Cairo::RefPtr &cr, unsigned shor } if (filled) { - if (innerLineWidth > 0.) { + if (innerLineWidth > 0.f) { cr->fill_preserve(); cr->stroke(); } else { @@ -576,13 +576,13 @@ void Rectangle::drawInnerGeometry(Cairo::RefPtr &cr, ObjectMOBuf if (filled && state != INSENSITIVE) { cr->rectangle(tl.x + 0.5, tl.y + 0.5, br.x - tl.x, br.y - tl.y); - if (innerLineWidth > 0.) { + if (innerLineWidth > 0.f) { cr->fill_preserve(); cr->stroke(); } else { cr->fill(); } - } else if (innerLineWidth > 0.) { + } else if (innerLineWidth > 0.f) { cr->rectangle(tl.x + 0.5, tl.y + 0.5, br.x - tl.x, br.y - tl.y); if (state == INSENSITIVE) { @@ -634,7 +634,7 @@ void Rectangle::drawToMOChannel(Cairo::RefPtr &cr, unsigned shor cr->rectangle(tl.x + 0.5, tl.y + 0.5, br.x - tl.x, br.y - tl.y); if (filled) { - if (innerLineWidth > 0.) { + if (innerLineWidth > 0.f) { cr->fill_preserve(); cr->stroke(); } else { diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h index 0894c21ad..d336d83f9 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -25,7 +25,7 @@ #include "toolpanel.h" #include "../rtexif/rtexif.h" -class ExifPanel : +class ExifPanel final : public Gtk::VBox, public ToolPanel { diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index 86ab59395..53f3f1f2b 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -56,7 +56,7 @@ public: /* * Class handling actions common to all thumbnails of the file browser */ -class FileBrowser : public ThumbBrowserBase, +class FileBrowser final : public ThumbBrowserBase, public LWButtonListener, public ExportPanelListener, public ProfileStoreListener, diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h index ea5140ed6..67b953514 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -43,7 +43,7 @@ struct FileBrowserEntryIdleHelper { }; class FileThumbnailButtonSet; -class FileBrowserEntry : public ThumbBrowserEntryBase, +class FileBrowserEntry final : public ThumbBrowserEntryBase, public ThumbnailListener, public ThumbImageUpdateListener, public rtengine::NonCopyable diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 7380dd4e8..256f52d33 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -46,8 +46,6 @@ using namespace std; -#define CHECKTIME 2000 - FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : filepanel(filepanel), selectedDirectoryId(1), diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 10f2bc88f..194153921 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -43,7 +43,7 @@ class ToolBar; * - handling the thumbnail toolbar, * - monitoring the directory (for any change) */ -class FileCatalog : public Gtk::VBox, +class FileCatalog final : public Gtk::VBox, public PreviewLoaderListener, public FilterPanelListener, public FileBrowserListener, diff --git a/rtgui/flatcurveeditorsubgroup.h b/rtgui/flatcurveeditorsubgroup.h index c358dde3b..865a0ef83 100644 --- a/rtgui/flatcurveeditorsubgroup.h +++ b/rtgui/flatcurveeditorsubgroup.h @@ -27,7 +27,7 @@ class FlatCurveEditor; class MyFlatCurve; -class FlatCurveEditorSubGroup: +class FlatCurveEditorSubGroup final : public CurveEditorSubGroup, public rtengine::NonCopyable { diff --git a/rtgui/gradient.cc b/rtgui/gradient.cc index 4f389e112..b46f8e1ca 100644 --- a/rtgui/gradient.cc +++ b/rtgui/gradient.cc @@ -164,7 +164,7 @@ void Gradient::updateGeometry(const int centerX, const int centerY, const double const auto decay = feather * rtengine::norm2 (imW, imH) / 200.0; rtengine::Coord origin (imW / 2 + centerX * imW / 200, imH / 2 + centerY * imH / 200); - const auto updateLine = [&](Geometry* geometry, const float radius, const float begin, const float end) + const auto updateLine = [&](Geometry* geometry, const double radius, const double begin, const double end) { const auto line = static_cast(geometry); line->begin = PolarCoord(radius, -degree + begin); @@ -173,7 +173,7 @@ void Gradient::updateGeometry(const int centerX, const int centerY, const double line->end += origin; }; - const auto updateLineWithDecay = [&](Geometry* geometry, const float radius, const float offSetAngle) + const auto updateLineWithDecay = [&](Geometry* geometry, const double radius, const double offSetAngle) { const auto line = static_cast(geometry); line->begin = PolarCoord (radius, -degree + 180.) + PolarCoord (decay, -degree + offSetAngle); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 02a28607f..d759751c3 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -20,7 +20,6 @@ #include "guiutils.h" #include "options.h" -#include "../rtengine/rt_math.h" #include "../rtengine/utils.h" #include "../rtengine/procparams.h" #include "rtimage.h" @@ -827,12 +826,6 @@ void MyExpander::set_expanded( bool expanded ) return; } - bool isVisible = expBox->is_visible(); - - if (isVisible == expanded) { - return; - } - if (!useEnabled) { if (expanded ) { statusImage->set(openedImage->get_surface()); diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 97c72513b..d4c91734a 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -92,7 +92,7 @@ private: * } * */ -class GThreadLock +class GThreadLock final { public: GThreadLock() @@ -110,7 +110,7 @@ public: * * Will relock on destruction. */ -class GThreadUnLock +class GThreadUnLock final { public: GThreadUnLock() @@ -125,7 +125,7 @@ public: #pragma GCC diagnostic pop -class ConnectionBlocker +class ConnectionBlocker final { public: explicit ConnectionBlocker (Gtk::Widget *associatedWidget, sigc::connection& connection) : connection (associatedWidget ? &connection : nullptr), wasBlocked(false) @@ -152,7 +152,7 @@ private: /** * @brief Glue box to control visibility of the MyExpender's content ; also handle the frame around it */ -class ExpanderBox: public Gtk::EventBox +class ExpanderBox final : public Gtk::EventBox { private: Gtk::Container *pC; @@ -185,7 +185,7 @@ public: * * Warning: once you've instantiated this class with a text label or a widget label, you won't be able to revert to the other solution. */ -class MyExpander : public Gtk::VBox +class MyExpander final : public Gtk::VBox { public: typedef sigc::signal type_signal_enabled_toggled; @@ -295,7 +295,7 @@ public: /** * @brief subclass of Gtk::ScrolledWindow in order to handle the scrollwheel */ -class MyScrolledWindow : public Gtk::ScrolledWindow +class MyScrolledWindow final : public Gtk::ScrolledWindow { bool on_scroll_event (GdkEventScroll* event) override; @@ -310,7 +310,7 @@ public: /** * @brief subclass of Gtk::ScrolledWindow in order to handle the large toolbars (wider than available space) */ -class MyScrolledToolbar : public Gtk::ScrolledWindow +class MyScrolledToolbar final : public Gtk::ScrolledWindow { bool on_scroll_event (GdkEventScroll* event) override; @@ -340,7 +340,7 @@ public: /** * @brief subclass of Gtk::ComboBoxText in order to handle the scrollwheel */ -class MyComboBoxText : public Gtk::ComboBoxText +class MyComboBoxText final : public Gtk::ComboBoxText { int naturalWidth, minimumWidth; sigc::connection myConnection; @@ -360,7 +360,7 @@ public: /** * @brief subclass of Gtk::SpinButton in order to handle the scrollwheel */ -class MySpinButton : public Gtk::SpinButton +class MySpinButton final : public Gtk::SpinButton { protected: @@ -375,7 +375,7 @@ public: /** * @brief subclass of Gtk::HScale in order to handle the scrollwheel */ -class MyHScale : public Gtk::HScale +class MyHScale final : public Gtk::HScale { bool on_scroll_event (GdkEventScroll* event) override; @@ -385,7 +385,7 @@ class MyHScale : public Gtk::HScale /** * @brief subclass of Gtk::FileChooserButton in order to handle the scrollwheel */ -class MyFileChooserButton: public Gtk::Button { +class MyFileChooserButton final : public Gtk::Button { private: void show_chooser(); @@ -473,14 +473,14 @@ typedef enum RTNav { /** * @brief Handle the switch between text and image to be displayed in the HBox (to be used in a button/toolpanel) */ -class TextOrIcon : public Gtk::HBox +class TextOrIcon final : public Gtk::HBox { public: TextOrIcon (const Glib::ustring &filename, const Glib::ustring &labelTx, const Glib::ustring &tooltipTx); }; -class MyImageMenuItem : public Gtk::MenuItem +class MyImageMenuItem final : public Gtk::MenuItem { private: Gtk::Grid *box; @@ -493,7 +493,7 @@ public: const Gtk::Label* getLabel () const; }; -class MyProgressBar : public Gtk::ProgressBar +class MyProgressBar final : public Gtk::ProgressBar { private: int w; @@ -512,7 +512,7 @@ public: /** * @brief Define a gradient milestone */ -class GradientMilestone +class GradientMilestone final { public: double position; diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index dd0cbde46..b8338e4e8 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -518,26 +518,26 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin // Luma cc->set_source_rgb(1.0, 1.0, 1.0); if (options.histogramDrawMode < 2) { - cc->move_to(Lab_L * (winw - 3.*s) / 100.0 + 0.5*s, 0); - cc->line_to(Lab_L * (winw - 3.*s) / 100.0 + 0.5*s, winh - 0); + cc->move_to(static_cast(Lab_L) * (winw - 3. * s) / 100.0 + 0.5 * s, 0); + cc->line_to(static_cast(Lab_L) * (winw - 3. * s) / 100.0 + 0.5 * s, winh - 0); } else { - cc->move_to(HistogramScaling::log (100, Lab_L) * (winw - 1.) / 100.0 + 0.5*s, 0); - cc->line_to(HistogramScaling::log (100, Lab_L) * (winw - 1.) / 100.0 + 0.5*s, winh - 0); + cc->move_to(HistogramScaling::log(100, Lab_L) * (winw - 1.) / 100.0 + 0.5 * s, 0); + cc->line_to(HistogramScaling::log(100, Lab_L) * (winw - 1.) / 100.0 + 0.5 * s, winh - 0); } cc->stroke(); } if (needChroma) { // Chroma - float chromaval = sqrt(Lab_a * Lab_a + Lab_b * Lab_b) / 1.8; + double chromaval = sqrt(Lab_a * Lab_a + Lab_b * Lab_b) / 1.8; // float chromaval = sqrt(Lab_a*Lab_a + Lab_b*Lab_b); cc->set_source_rgb(0.9, 0.9, 0.0); if (options.histogramDrawMode < 2) { - cc->move_to(chromaval * (winw - 1.) / 100.0 + 0.5*s, 0); - cc->line_to(chromaval * (winw - 1.) / 100.0 + 0.5*s, winh - 0); + cc->move_to(chromaval * (winw - 1.) / 100.0 + 0.5 * s, 0); + cc->line_to(chromaval * (winw - 1.) / 100.0 + 0.5 * s, winh - 0); } else { - cc->move_to(HistogramScaling::log (100, chromaval) * (winw - 1.) / 100.0 + 0.5*s, 0); - cc->line_to(HistogramScaling::log (100, chromaval) * (winw - 1.) / 100.0 + 0.5*s, winh - 0); + cc->move_to(HistogramScaling::log(100, chromaval) * (winw - 1.) / 100.0 + 0.5 * s, 0); + cc->line_to(HistogramScaling::log(100, chromaval) * (winw - 1.) / 100.0 + 0.5 * s, winh - 0); } cc->stroke(); } @@ -989,7 +989,7 @@ void HistogramArea::drawCurve(Cairo::RefPtr &cr, cr->set_line_width(s); cr->move_to (0, vsize - 1); - scale = scale <= 0.f ? 0.001f : scale; // avoid division by zero and negative values + scale = scale <= 0.0 ? 0.001 : scale; // avoid division by zero and negative values for (int i = 0; i < 256; i++) { double val = data[i] * (double)vsize / scale; diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 4fd21bcc2..cec44ed03 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -53,7 +53,7 @@ public: double log (double vsize, double val); }; -class HistogramRGBArea : public Gtk::DrawingArea, public BackBuffer, private HistogramScaling, public rtengine::NonCopyable +class HistogramRGBArea final : public Gtk::DrawingArea, public BackBuffer, private HistogramScaling, public rtengine::NonCopyable { private: typedef const double (*TMatrix)[3]; @@ -116,7 +116,7 @@ public: virtual void toggleButtonMode() = 0; }; -class HistogramArea : public Gtk::DrawingArea, public BackBuffer, private HistogramScaling, public rtengine::NonCopyable +class HistogramArea final : public Gtk::DrawingArea, public BackBuffer, private HistogramScaling, public rtengine::NonCopyable { public: typedef sigc::signal type_signal_factor_changed; @@ -174,7 +174,7 @@ private: void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const override; }; -class HistogramPanel : public Gtk::Grid, public PointerMotionListener, public DrawModeListener, public rtengine::NonCopyable +class HistogramPanel final : public Gtk::Grid, public PointerMotionListener, public DrawModeListener, public rtengine::NonCopyable { protected: diff --git a/rtgui/hsvequalizer.cc b/rtgui/hsvequalizer.cc index ee3eb90a7..817ba1f4d 100644 --- a/rtgui/hsvequalizer.cc +++ b/rtgui/hsvequalizer.cc @@ -38,7 +38,7 @@ HSVEqualizer::HSVEqualizer () : FoldableToolPanel(this, "hsvequalizer", M("TP_HS // -0.1 rad < Hue < 1.6 rad for (int i = 0; i < 7; i++) { - float x = float(i) * (1.0f / 6.0); + float x = i / 6.0; Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); bottomMilestones.push_back( GradientMilestone(double(x), double(R), double(G), double(B)) ); } diff --git a/rtgui/iccprofilecreator.h b/rtgui/iccprofilecreator.h index 2cd19e14f..8ee46a71d 100644 --- a/rtgui/iccprofilecreator.h +++ b/rtgui/iccprofilecreator.h @@ -27,7 +27,7 @@ class RTWindow; -class ICCProfileCreator : public Gtk::Dialog, public AdjusterListener +class ICCProfileCreator final : public Gtk::Dialog, public AdjusterListener { private: diff --git a/rtgui/imagearea.h b/rtgui/imagearea.h index 28b52dcd2..586bba7a7 100644 --- a/rtgui/imagearea.h +++ b/rtgui/imagearea.h @@ -34,7 +34,7 @@ class ImageAreaPanel; -class ImageArea : +class ImageArea final : public Gtk::DrawingArea, public CropWindowListener, public EditDataProvider, diff --git a/rtgui/imageareapanel.h b/rtgui/imageareapanel.h index 831371dbb..f52ca9060 100644 --- a/rtgui/imageareapanel.h +++ b/rtgui/imageareapanel.h @@ -22,7 +22,7 @@ class ImageArea; -class ImageAreaPanel : +class ImageAreaPanel final : public Gtk::VBox { diff --git a/rtgui/inspector.h b/rtgui/inspector.h index 4cb0cb8df..9a99fb8a6 100644 --- a/rtgui/inspector.h +++ b/rtgui/inspector.h @@ -40,7 +40,7 @@ public: //~InspectorBuffer(); }; -class Inspector : public Gtk::DrawingArea +class Inspector final : public Gtk::DrawingArea { private: diff --git a/rtgui/iptcpanel.h b/rtgui/iptcpanel.h index 15d117f87..100904d1a 100644 --- a/rtgui/iptcpanel.h +++ b/rtgui/iptcpanel.h @@ -25,7 +25,7 @@ #include "guiutils.h" #include "toolpanel.h" -class IPTCPanel : +class IPTCPanel final : public Gtk::VBox, public ToolPanel { diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index 491b02c4c..5f4febc0a 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -203,7 +203,7 @@ LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"), for (int i = 0; i < 7; i++) { float R, G, B; - float x = float(i) * (1.0f / 6.0); + float x = i / 6.0; Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); milestones.emplace_back(x, R, G, B); } diff --git a/rtgui/labgrid.cc b/rtgui/labgrid.cc index 516dbb825..d8a22b1d9 100644 --- a/rtgui/labgrid.cc +++ b/rtgui/labgrid.cc @@ -209,8 +209,8 @@ bool LabGridArea::on_draw(const ::Cairo::RefPtr &crf) float x, y, z; int ii = i - cells/2; int jj = j - cells/2; - float a = step * (ii + 0.5); - float b = step * (jj + 0.5); + float a = step * (ii + 0.5f); + float b = step * (jj + 0.5f); Color::Lab2XYZ(25000.f, a, b, x, y, z); Color::xyz2srgb(x, y, z, R, G, B); cr->set_source_rgb(R / 65535.f, G / 65535.f, B / 65535.f); @@ -231,10 +231,10 @@ bool LabGridArea::on_draw(const ::Cairo::RefPtr &crf) // drawing the connection line cr->set_antialias(Cairo::ANTIALIAS_DEFAULT); float loa, hia, lob, hib; - loa = .5f * (width + width * low_a); - hia = .5f * (width + width * high_a); - lob = .5f * (height + height * low_b); - hib = .5f * (height + height * high_b); + loa = .5 * (width + width * low_a); + hia = .5 * (width + width * high_a); + lob = .5 * (height + height * low_b); + hib = .5 * (height + height * high_b); cr->set_line_width(2. * double(s)); cr->set_source_rgb(0.6, 0.6, 0.6); cr->move_to(loa, lob); @@ -319,8 +319,8 @@ bool LabGridArea::on_motion_notify_event(GdkEventMotion *event) int height = get_allocated_height() - 2 * inset * s - padding.get_top() - padding.get_bottom(); const float mouse_x = std::min(double(std::max(event->x - inset * s - padding.get_right(), 0.)), double(width)); const float mouse_y = std::min(double(std::max(get_allocated_height() - 1 - event->y - inset * s - padding.get_bottom(), 0.)), double(height)); - const float ma = (2.0 * mouse_x - width) / (float)width; - const float mb = (2.0 * mouse_y - height) / (float)height; + const float ma = (2.f * mouse_x - width) / width; + const float mb = (2.f * mouse_y - height) / height; if (isDragged) { if (litPoint == LOW) { low_a = ma; diff --git a/rtgui/lockablecolorpicker.cc b/rtgui/lockablecolorpicker.cc index 071847424..0a08bb945 100644 --- a/rtgui/lockablecolorpicker.cc +++ b/rtgui/lockablecolorpicker.cc @@ -37,7 +37,7 @@ void LockableColorPicker::updateBackBuffer () int newW, newH; // -------------------- setting some key constants --------------------- - constexpr float circlePadding = 3.f; // keep this value odd + constexpr double circlePadding = 3.0; // keep this value odd constexpr double opacity = 0.62; // --------------------------------------------------------------------- @@ -121,18 +121,18 @@ void LockableColorPicker::updateBackBuffer () bbcr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); bbcr->set_line_width (0.); - float center = (float)size / 2.f + circlePadding; + double center = static_cast(size) / 2.0 + circlePadding; // black background of the whole color picker bbcr->set_line_width (0.); bbcr->set_source_rgba (0., 0., 0., opacity); - bbcr->arc_negative (center, center, center, 0., (double)rtengine::RT_PI); + bbcr->arc_negative (center, center, center, 0., rtengine::RT_PI); bbcr->line_to (0, 2. * center + textHeight); - bbcr->arc_negative (2. * textPadding, 2. * center + textHeight, 2. * textPadding, (double)rtengine::RT_PI, (double)rtengine::RT_PI / 2.); + bbcr->arc_negative (2. * textPadding, 2. * center + textHeight, 2. * textPadding, rtengine::RT_PI, rtengine::RT_PI / 2.); bbcr->line_to (textWidth, 2. * center + textHeight + 2. * textPadding); - bbcr->arc_negative (textWidth, 2. * center + textHeight, 2. * textPadding, (double)rtengine::RT_PI / 2., 0.); + bbcr->arc_negative (textWidth, 2. * center + textHeight, 2. * textPadding, rtengine::RT_PI / 2., 0.); bbcr->line_to (textWidth + 2. * textPadding, 2. * center + 2. * textPadding); - bbcr->arc_negative (textWidth, 2. * center + 2. * textPadding, 2. * textPadding, 0., (double)rtengine::RT_PI * 1.5); + bbcr->arc_negative (textWidth, 2. * center + 2. * textPadding, 2. * textPadding, 0., rtengine::RT_PI * 1.5); bbcr->line_to (2. * center, 2. * center); bbcr->close_path(); bbcr->set_line_join (Cairo::LINE_JOIN_BEVEL); @@ -222,7 +222,7 @@ void LockableColorPicker::updateBackBuffer () bbcr->set_antialias(Cairo::ANTIALIAS_SUBPIXEL); - float center = (float)size / 2.f + circlePadding; + double center = static_cast(size) / 2. + circlePadding; // light grey circle around the color mark bbcr->arc (center, center, center - circlePadding / 2., 0., 2. * (double)rtengine::RT_PI); diff --git a/rtgui/lockablecolorpicker.h b/rtgui/lockablecolorpicker.h index 77d2e8e9f..baeea41ef 100644 --- a/rtgui/lockablecolorpicker.h +++ b/rtgui/lockablecolorpicker.h @@ -33,7 +33,7 @@ public: virtual void switchPickerVisibility(bool isVisible) = 0; }; -class LockableColorPicker : BackBuffer +class LockableColorPicker final : BackBuffer { public: enum class Size { diff --git a/rtgui/mycurve.cc b/rtgui/mycurve.cc index 7401570c8..d460713fb 100644 --- a/rtgui/mycurve.cc +++ b/rtgui/mycurve.cc @@ -183,7 +183,7 @@ float MyCurve::getVal(LUTf &curve, int x) if (size_t(graphW) == curve.getSize()) { return curve[x]; } else { - return curve.getVal01(float(x) / graphW); + return curve.getVal01(x / graphW); } } diff --git a/rtgui/mydiagonalcurve.cc b/rtgui/mydiagonalcurve.cc index abd339ce0..ac7976b7e 100644 --- a/rtgui/mydiagonalcurve.cc +++ b/rtgui/mydiagonalcurve.cc @@ -358,14 +358,14 @@ void MyDiagonalCurve::draw (int handle) // draw upper and lower bounds if (curve.type == DCT_Parametric && activeParam > 0 && lpoint.getUpperBound() > 1 && upoint.getUpperBound() > 1) { cr->set_source_rgba (1.0, 1.0, 1.0, 0.1); - cr->move_to (graphX, getVal(upoint, 0) * -graphH + graphY); + cr->move_to (graphX, static_cast(getVal(upoint, 0)) * -graphH + graphY); for (int i = 1; i < graphW - 2; ++i) { - cr->line_to ((double)i + graphX, getVal(upoint, i) * -graphH + graphY); + cr->line_to ((double)i + graphX, static_cast(getVal(upoint, i)) * -graphH + graphY); } for (int i = graphW - 3; i >= 0; --i) { - cr->line_to ((double)i + graphX, getVal(lpoint, i) * -graphH + graphY); + cr->line_to ((double)i + graphX, static_cast(getVal(lpoint, i)) * -graphH + graphY); } cr->fill (); @@ -390,21 +390,21 @@ void MyDiagonalCurve::draw (int handle) if (n > 1) { if (pipetteR > -1.f) { cr->set_source_rgba (1., 0., 0., 0.5); // WARNING: assuming that red values are stored in pipetteR, which might not be the case! - cr->move_to (graphX + graphW*pipetteR, graphY + 1. * s); + cr->move_to (graphX + graphW * static_cast(pipetteR), graphY + 1. * s); cr->rel_line_to (0, -graphH - 1. * s); cr->stroke (); } if (pipetteG > -1.f) { cr->set_source_rgba (0., 1., 0., 0.5); // WARNING: assuming that green values are stored in pipetteG, which might not be the case! - cr->move_to (graphX + graphW*pipetteG, graphY + 1. * s); + cr->move_to (graphX + graphW * static_cast(pipetteG), graphY + 1. * s); cr->rel_line_to (0, -graphH - 1. * s); cr->stroke (); } if (pipetteB > -1.f) { cr->set_source_rgba (0., 0., 1., 0.5); // WARNING: assuming that blue values are stored in pipetteB, which might not be the case! - cr->move_to (graphX + graphW*pipetteB, graphY + 1. * s); + cr->move_to (graphX + graphW * static_cast(pipetteB), graphY + 1. * s); cr->rel_line_to (0, -graphH - 1. * s); cr->stroke (); } @@ -414,7 +414,7 @@ void MyDiagonalCurve::draw (int handle) cr->set_line_width (2. * s); c = style->get_color (state); cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->move_to (graphX + graphW*pipetteVal, graphY + 1. * s); + cr->move_to (graphX + graphW * static_cast(pipetteVal), graphY + 1. * s); cr->rel_line_to (0, -graphH - 1. * s); cr->stroke (); cr->set_line_width (1. * s); @@ -460,7 +460,7 @@ void MyDiagonalCurve::draw (int handle) // draw curve cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->move_to (graphX, getVal(point, 0) * -graphH + graphY); + cr->move_to (graphX, static_cast(getVal(point, 0)) * -graphH + graphY); for (int i = 1; i < graphW; ++i) { cr->line_to ((double)i + graphX, (double)getVal(point, i) * -graphH + graphY); diff --git a/rtgui/mydiagonalcurve.h b/rtgui/mydiagonalcurve.h index b38373006..b2b83c02e 100644 --- a/rtgui/mydiagonalcurve.h +++ b/rtgui/mydiagonalcurve.h @@ -41,7 +41,7 @@ public: std::vector x, y; // in case of parametric curves the curve parameters are stored in vector x. In other cases these vectors store the coordinates of the bullets. }; -class MyDiagonalCurve : public MyCurve +class MyDiagonalCurve final : public MyCurve { private: IdleRegister idle_register; diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index 362d34f35..da993987c 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -233,21 +233,21 @@ void MyFlatCurve::draw () if (n > 1) { if (pipetteR > -1.f) { cr->set_source_rgba (1., 0., 0., 0.5); // WARNING: assuming that red values are stored in pipetteR, which might not be the case! - cr->move_to (graphX + graphW*pipetteR, graphY + 1. * s); + cr->move_to (graphX + graphW * static_cast(pipetteR), graphY + 1. * s); cr->rel_line_to (0, -graphH - 1. * s); cr->stroke (); } if (pipetteG > -1.f) { cr->set_source_rgba (0., 1., 0., 0.5); // WARNING: assuming that green values are stored in pipetteG, which might not be the case! - cr->move_to (graphX + graphW*pipetteG, graphY + 1. * s); + cr->move_to (graphX + graphW * static_cast(pipetteG), graphY + 1. * s); cr->rel_line_to (0, -graphH - 1. * s); cr->stroke (); } if (pipetteB > -1.f) { cr->set_source_rgba (0., 0., 1., 0.5); // WARNING: assuming that blue values are stored in pipetteB, which might not be the case! - cr->move_to (graphX + graphW*pipetteB, graphY + 1. * s); + cr->move_to (graphX + graphW * static_cast(pipetteB), graphY + 1. * s); cr->rel_line_to (0, -graphH - 1. * s); cr->stroke (); } @@ -257,7 +257,7 @@ void MyFlatCurve::draw () cr->set_line_width (2. * s); c = style->get_color (state); cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->move_to (graphX + graphW*pipetteVal, graphY + 1. * s); + cr->move_to (graphX + graphW * static_cast(pipetteVal), graphY + 1. * s); cr->rel_line_to (0, -graphH - 1. * s); cr->stroke (); cr->set_line_width (1. * s); @@ -437,10 +437,10 @@ void MyFlatCurve::draw () // draw curve c = style->get_color(state); cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->move_to (graphX, getVal(point, 0) * -graphH + graphY); + cr->move_to (graphX, static_cast(getVal(point, 0)) * -graphH + graphY); for (int i = 1; i < graphW; ++i) { - cr->line_to ((double)i + graphX, (double)getVal(point, i) * -graphH + graphY); + cr->line_to ((double)i + graphX, static_cast(getVal(point, i)) * -graphH + graphY); } cr->stroke (); diff --git a/rtgui/myflatcurve.h b/rtgui/myflatcurve.h index 88d651a05..5da1d09ad 100644 --- a/rtgui/myflatcurve.h +++ b/rtgui/myflatcurve.h @@ -66,7 +66,7 @@ public: double centerY; }; -class MyFlatCurve : public MyCurve +class MyFlatCurve final : public MyCurve { protected: diff --git a/rtgui/navigator.h b/rtgui/navigator.h index c1c23c6dc..e9d40e309 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -25,7 +25,7 @@ class PreviewWindow; -class Navigator : +class Navigator final : public Gtk::Frame, public PointerMotionListener { diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 1403e7c1b..75e18e83c 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -34,7 +34,7 @@ class ProcParams; struct ParamsEdited; -class PartialPasteDlg : public Gtk::Dialog +class PartialPasteDlg final : public Gtk::Dialog { public: diff --git a/rtgui/popupbutton.h b/rtgui/popupbutton.h index 87b1b73a6..a67339a9f 100644 --- a/rtgui/popupbutton.h +++ b/rtgui/popupbutton.h @@ -24,7 +24,7 @@ #include "popupcommon.h" -class PopUpButton : +class PopUpButton final : public Gtk::Button, public PopUpCommon { diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 76a104ffa..a6cbe7939 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -29,7 +29,7 @@ class RTWindow; class Splash; -class Preferences : +class Preferences final : public Gtk::Dialog, public ProfileStoreListener { diff --git a/rtgui/previewhandler.h b/rtgui/previewhandler.h index d9c91f6ad..4fd9a1e82 100644 --- a/rtgui/previewhandler.h +++ b/rtgui/previewhandler.h @@ -44,7 +44,7 @@ struct PreviewHandlerIdleHelper { int pending; }; -class PreviewHandler : public rtengine::PreviewImageListener, public rtengine::NonCopyable +class PreviewHandler final : public rtengine::PreviewImageListener, public rtengine::NonCopyable { private: friend int setImageUI (void* data); diff --git a/rtgui/previewloader.h b/rtgui/previewloader.h index 9a74ee2eb..a8032fcaf 100644 --- a/rtgui/previewloader.h +++ b/rtgui/previewloader.h @@ -20,10 +20,15 @@ #include -#include - #include "../rtengine/noncopyable.h" +namespace Glib +{ + +class ustring; + +} + class FileBrowserEntry; class PreviewLoaderListener diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index b3c968682..c3a125c49 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -49,7 +49,7 @@ class PartialProfile; } class RTImage; -class ProfilePanel : +class ProfilePanel final : public Gtk::Grid, public PParamsChangeListener, public ProfileStoreListener, diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index f4d1d8f7e..90c9f67f0 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -28,7 +28,7 @@ #undef THREAD_PRIORITY_NORMAL -class PLDBridge : +class PLDBridge final : public rtengine::ProgressListener { public: diff --git a/rtgui/renamedlg.h b/rtgui/renamedlg.h index f9447fbac..3c92965f8 100644 --- a/rtgui/renamedlg.h +++ b/rtgui/renamedlg.h @@ -26,7 +26,7 @@ class CacheImageData; -class RenameDialog : +class RenameDialog final : public Gtk::Dialog { diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index c78be375f..2fdd8f319 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -278,7 +278,7 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") for (int i = 0; i < 7; i++) { float R, G, B; - float x = float (i) * (1.0f / 6.0); + float x = i / 6.0; Color::hsv2rgb01 (x, 0.5f, 0.5f, R, G, B); milestones.push_back ( GradientMilestone (double (x), double (R), double (G), double (B)) ); } @@ -659,10 +659,16 @@ void Retinex::writeOptions (std::vector &tpOpen) tpOpen.push_back (expsettings->get_expanded ()); } -void Retinex::updateToolState (std::vector &tpOpen) +void Retinex::updateToolState(const std::vector& tpOpen) { + if (tpOpen.empty()) { + expsettings->set_expanded(false); + + return; + } + if (tpOpen.size() >= 10) { - expsettings->set_expanded (tpOpen.at (9)); + expsettings->set_expanded(tpOpen[9]); } } diff --git a/rtgui/retinex.h b/rtgui/retinex.h index ff524f854..dea65daab 100644 --- a/rtgui/retinex.h +++ b/rtgui/retinex.h @@ -104,32 +104,32 @@ protected: sigc::connection medianmapConn; public: - Retinex (); - ~Retinex () override; + Retinex(); + ~Retinex() override; - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override; - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override; - void setBatchMode (bool batchMode) override; - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; - void trimValues (rtengine::procparams::ProcParams* pp) override; - void adjusterChanged (Adjuster* a, double newval) override; - void autoOpenCurve () override; - void medianmapChanged (); - void minmaxChanged (double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) override; - void updateLabel (); - void updateTrans (); - void neutral_pressed (); + void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override; + void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override; + void setBatchMode(bool batchMode) override; + void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; + void trimValues(rtengine::procparams::ProcParams* pp) override; + void adjusterChanged(Adjuster* a, double newval) override; + void autoOpenCurve() override; + void medianmapChanged(); + void minmaxChanged(double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) override; + void updateLabel(); + void updateTrans(); + void neutral_pressed(); - void enabledChanged () override; - void curveChanged (CurveEditor* ce) override; + void enabledChanged() override; + void curveChanged(CurveEditor* ce) override; void retinexMethodChanged(); void mapMethodChanged(); void viewMethodChanged(); void retinexColorSpaceChanged(); void gammaretinexChanged(); void ColorSpaceUpdateUI(); - void writeOptions (std::vector &tpOpen); - void updateToolState (std::vector &tpOpen); + void writeOptions(std::vector &tpOpen); + void updateToolState(const std::vector& tpOpen); void setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd); void updateCurveBackgroundHistogram( const LUTu& histToneCurve, @@ -144,9 +144,8 @@ public: const LUTu& histLRETI ); - void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override; + void colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override; private: - void foldAllButMe (GdkEventButton* event, MyExpander *expander); - + void foldAllButMe(GdkEventButton* event, MyExpander *expander); }; diff --git a/rtgui/rtimage.h b/rtgui/rtimage.h index b68becd82..eb1930d28 100644 --- a/rtgui/rtimage.h +++ b/rtgui/rtimage.h @@ -25,7 +25,7 @@ /** * @brief A derived class of Gtk::Image in order to handle theme-related icon sets. */ -class RTImage : public Gtk::Image, public RTScalable +class RTImage final : public Gtk::Image, public RTScalable { static double dpiBack; // used to keep track of master dpi change static int scaleBack; // used to keep track of master scale change diff --git a/rtgui/rtscalable.cc b/rtgui/rtscalable.cc index a48a95fd2..78202326a 100644 --- a/rtgui/rtscalable.cc +++ b/rtgui/rtscalable.cc @@ -68,7 +68,7 @@ double RTScalable::getDPI () double RTScalable::getTweakedDPI () { - return dpi * fontScale; + return dpi * static_cast(fontScale); } int RTScalable::getScale () diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 514685a16..fc315e1b7 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -99,6 +99,8 @@ RTWindow::RTWindow () , bpanel (nullptr) , splash (nullptr) , btn_fullscreen (nullptr) + , iFullscreen (nullptr) + , iFullscreen_exit (nullptr) , epanel (nullptr) , fpanel (nullptr) { @@ -179,7 +181,7 @@ RTWindow::RTWindow () fontScale = options.fontSize / (float)RTScalable::baseFontSize; } if (rtengine::settings->verbose) { - printf("\"Non-Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", options.fontSize, (int)initialGdkScale, fontScale); + printf("\"Non-Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", options.fontSize, (int)initialGdkScale, static_cast(fontScale)); } } else { Glib::RefPtr style = Gtk::StyleContext::create(); @@ -209,7 +211,7 @@ RTWindow::RTWindow () if ((int)initialGdkScale > 1 || pt != RTScalable::baseFontSize) { css = Glib::ustring::compose ("* { font-size: %1pt}", pt * (int)initialGdkScale); if (rtengine::settings->verbose) { - printf("\"Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", pt, (int)initialGdkScale, fontScale); + printf("\"Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", pt, (int)initialGdkScale, static_cast(fontScale)); } } } diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 4791ac6c1..c493c2db4 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -35,7 +35,7 @@ class BatchQueuePanel; class EditorPanel; class FilePanel; class PLDBridge; -class RTWindow : +class RTWindow final : public Gtk::Window, public rtengine::ProgressListener, public rtengine::NonCopyable diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index 448b37fd7..445452a54 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -22,7 +22,7 @@ #include "saveformatpanel.h" -class SaveAsDialog : +class SaveAsDialog final : public Gtk::Dialog, public FormatChangeListener { diff --git a/rtgui/shcselector.h b/rtgui/shcselector.h index 5c4421e0a..e03ca8e06 100644 --- a/rtgui/shcselector.h +++ b/rtgui/shcselector.h @@ -29,7 +29,7 @@ public: virtual void shcChanged() = 0; }; -class SHCSelector : public Gtk::DrawingArea, BackBuffer +class SHCSelector final : public Gtk::DrawingArea, BackBuffer { protected: diff --git a/rtgui/splash.h b/rtgui/splash.h index 363c51489..bc63cef91 100644 --- a/rtgui/splash.h +++ b/rtgui/splash.h @@ -20,7 +20,7 @@ #include -class SplashImage : +class SplashImage final : public Gtk::DrawingArea { @@ -39,7 +39,7 @@ public: }; //class Splash : public Gtk::Window { -class Splash : public Gtk::Dialog +class Splash final : public Gtk::Dialog { private: diff --git a/rtgui/thresholdselector.h b/rtgui/thresholdselector.h index f948b56ad..4ae86560e 100644 --- a/rtgui/thresholdselector.h +++ b/rtgui/thresholdselector.h @@ -113,10 +113,10 @@ protected: void updateBackBuffer(); Gtk::SizeRequestMode get_request_mode_vfunc () const override; - void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const override; - void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const override; - void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const override; - void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const override; + void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const final; + void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const final; + void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const final; + void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const final; void on_realize () override; bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) override; bool on_button_press_event (GdkEventButton* event) override; diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h index b4caac0a9..69017b183 100644 --- a/rtgui/thumbbrowserbase.h +++ b/rtgui/thumbbrowserbase.h @@ -60,10 +60,10 @@ class ThumbBrowserBase : bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) override; Gtk::SizeRequestMode get_request_mode_vfunc () const override; - void get_preferred_height_vfunc (int &minimum_height, int &natural_height) const override; - void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const override; - void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const override; - void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const override; + void get_preferred_height_vfunc (int &minimum_height, int &natural_height) const final; + void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const final; + void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const final; + void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const final; bool on_button_press_event (GdkEventButton* event) override; bool on_button_release_event (GdkEventButton* event) override; diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 5295b9d61..87bc730eb 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -887,11 +887,6 @@ void Thumbnail::_loadThumbnail(bool firstTrial) } if ( cfs.thumbImgType == CacheImageData::FULL_THUMBNAIL ) { - if(!tpp->isAeValid()) { - // load aehistogram - tpp->readAEHistogram (getCacheFileName ("aehistograms", "")); - } - // load embedded profile tpp->readEmbProfile (getCacheFileName ("embprofiles", ".icc")); @@ -937,10 +932,6 @@ void Thumbnail::_saveThumbnail () // save thumbnail image tpp->writeImage (getCacheFileName ("images", "")); - if(!tpp->isAeValid()) { - // save aehistogram - tpp->writeAEHistogram (getCacheFileName ("aehistograms", "")); - } // save embedded profile tpp->writeEmbProfile (getCacheFileName ("embprofiles", ".icc")); diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index aecf1f39f..12b3eebcc 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -143,7 +143,7 @@ public: this->batchMode = batchMode; } - virtual Glib::ustring getToolName () { + Glib::ustring getToolName () { return toolName; } }; @@ -164,11 +164,11 @@ public: FoldableToolPanel(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11 = false, bool useEnabled = false); - MyExpander* getExpander() override + MyExpander* getExpander() final { return exp; } - void setExpanded (bool expanded) override + void setExpanded (bool expanded) final { if (exp) { exp->set_expanded( expanded ); @@ -186,7 +186,7 @@ public: exp->show(); } } - bool getExpanded () override + bool getExpanded () final { if (exp) { return exp->get_expanded(); @@ -194,11 +194,11 @@ public: return false; } - void setParent (Gtk::Box* parent) override + void setParent (Gtk::Box* parent) final { parentContainer = parent; } - Gtk::Box* getParent () override + Gtk::Box* getParent () final { return parentContainer; } diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 57f61a09c..00ad96328 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -632,40 +632,52 @@ void ToolPanelCoordinator::closeImage () void ToolPanelCoordinator::closeAllTools() { - - for (size_t i = 0; i < options.tpOpen.size(); i++) + for (size_t i = 0; i < options.tpOpen.size(); ++i) { if (i < expList.size()) { - expList.at (i)->set_expanded (false); + expList[i]->set_expanded(false); } + } } void ToolPanelCoordinator::openAllTools() { - - for (size_t i = 0; i < options.tpOpen.size(); i++) + for (size_t i = 0; i < options.tpOpen.size(); ++i) { if (i < expList.size()) { - expList.at (i)->set_expanded (true); + expList[i]->set_expanded(true); } + } } void ToolPanelCoordinator::updateToolState() { - - for (size_t i = 0; i < options.tpOpen.size(); i++) - if (i < expList.size()) { - expList.at (i)->set_expanded (options.tpOpen.at (i)); + if (options.tpOpen.empty()) { + for (auto expander : expList) { + expander->set_expanded(false); } + wavelet->updateToolState({}); + retinex->updateToolState({}); + + return; + } + + for (size_t i = 0; i < options.tpOpen.size(); ++i) { + if (i < expList.size()) { + expList[i]->set_expanded(options.tpOpen[i]); + } + } + if (options.tpOpen.size() > expList.size()) { - size_t sizeWavelet = options.tpOpen.size() - expList.size(); + const size_t sizeWavelet = options.tpOpen.size() - expList.size(); + std::vector temp; - for (size_t i = 0; i < sizeWavelet; i++) { - temp.push_back (options.tpOpen.at (i + expList.size())); + for (size_t i = 0; i < sizeWavelet; ++i) { + temp.push_back(options.tpOpen[i + expList.size()]); } - wavelet->updateToolState (temp); - retinex->updateToolState (temp); + wavelet->updateToolState(temp); + retinex->updateToolState(temp); } } diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 4313f6d12..0fc1a9070 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -314,11 +314,11 @@ public: // imageareatoollistener interface void spotWBselected(int x, int y, Thumbnail* thm = nullptr) override; - void sharpMaskSelected(bool sharpMask) override; + void sharpMaskSelected(bool sharpMask) override final; int getSpotWBRectSize() const override; void cropSelectionReady() override; void rotateSelectionReady(double rotate_deg, Thumbnail* thm = nullptr) override; - ToolBar* getToolBar() const override; + ToolBar* getToolBar() const final; CropGUIListener* startCropEditing(Thumbnail* thm = nullptr) override; void updateTPVScrollbar (bool hide); @@ -326,7 +326,7 @@ public: // ToolBarListener interface void toolSelected (ToolMode tool) override; - void editModeSwitchedOff () override; + void editModeSwitchedOff () final; void setEditProvider (EditDataProvider *provider); diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 3981457e6..a2642dad7 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -3030,18 +3030,32 @@ void Wavelet::writeOptions(std::vector &tpOpen) tpOpen.push_back (expfinal->get_expanded ()); } -void Wavelet::updateToolState(std::vector &tpOpen) +void Wavelet::updateToolState(const std::vector& tpOpen) { - if(tpOpen.size() >= 9) { - expsettings->set_expanded(tpOpen.at(0)); - expcontrast->set_expanded(tpOpen.at(1)); - expchroma->set_expanded(tpOpen.at(2)); - exptoning->set_expanded(tpOpen.at(3)); - expnoise->set_expanded(tpOpen.at(4)); - expedge->set_expanded(tpOpen.at(5)); - expgamut->set_expanded(tpOpen.at(6)); - expresid->set_expanded(tpOpen.at(7)); - expfinal->set_expanded(tpOpen.at(8)); + if (tpOpen.empty()) { + expsettings->set_expanded(false); + expcontrast->set_expanded(false); + expchroma->set_expanded(false); + exptoning->set_expanded(false); + expnoise->set_expanded(false); + expedge->set_expanded(false); + expgamut->set_expanded(false); + expresid->set_expanded(false); + expfinal->set_expanded(false); + + return; + } + + if (tpOpen.size() >= 9) { + expsettings->set_expanded(tpOpen[0]); + expcontrast->set_expanded(tpOpen[1]); + expchroma->set_expanded(tpOpen[2]); + exptoning->set_expanded(tpOpen[3]); + expnoise->set_expanded(tpOpen[4]); + expedge->set_expanded(tpOpen[5]); + expgamut->set_expanded(tpOpen[6]); + expresid->set_expanded(tpOpen[7]); + expfinal->set_expanded(tpOpen[8]); } } diff --git a/rtgui/wavelet.h b/rtgui/wavelet.h index 6551b58d4..d01e52749 100644 --- a/rtgui/wavelet.h +++ b/rtgui/wavelet.h @@ -20,12 +20,13 @@ #pragma once #include + #include "adjuster.h" -#include "toolpanel.h" -#include "curvelistener.h" -#include "thresholdadjuster.h" #include "colorprovider.h" +#include "curvelistener.h" #include "guiutils.h" +#include "thresholdadjuster.h" +#include "toolpanel.h" class CurveEditor; class CurveEditorGroup; @@ -43,21 +44,21 @@ class Wavelet final : public FoldableToolPanel { public: - Wavelet (); - ~Wavelet () override; + Wavelet(); + ~Wavelet() override; - bool wavComputed_ (); + bool wavComputed_(); void adjusterChanged(Adjuster* a, double newval) override; - void autoOpenCurve () override; - void curveChanged (CurveEditor* ce) override; - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override; - void setAdjusterBehavior (bool multiplieradd, bool thresholdadd, bool threshold2add, bool thresadd, bool chroadd, bool chromaadd, bool contrastadd, bool skinadd, bool reschroadd, bool tmrsadd, bool resconadd, bool resconHadd, bool thradd, bool thrHadd, bool skyadd, bool edgradadd, bool edgvaladd, bool strengthadd, bool gammaadd, bool edgedetectadd, bool edgedetectthradd, bool edgedetectthr2add); - void setBatchMode (bool batchMode) override; - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; - void setEditProvider (EditDataProvider *provider) override; - void updateToolState (std::vector &tpOpen); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override; - void writeOptions (std::vector &tpOpen); + void autoOpenCurve() override; + void curveChanged(CurveEditor* ce) override; + void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override; + void setAdjusterBehavior(bool multiplieradd, bool thresholdadd, bool threshold2add, bool thresadd, bool chroadd, bool chromaadd, bool contrastadd, bool skinadd, bool reschroadd, bool tmrsadd, bool resconadd, bool resconHadd, bool thradd, bool thrHadd, bool skyadd, bool edgradadd, bool edgvaladd, bool strengthadd, bool gammaadd, bool edgedetectadd, bool edgedetectthradd, bool edgedetectthr2add); + void setBatchMode(bool batchMode) override; + void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; + void setEditProvider(EditDataProvider *provider) override; + void updateToolState(const std::vector& tpOpen); + void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override; + void writeOptions(std::vector &tpOpen); void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) override; void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) override; @@ -66,38 +67,38 @@ public: void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) override; private: - void foldAllButMe (GdkEventButton* event, MyExpander *expander); + void foldAllButMe(GdkEventButton* event, MyExpander *expander); - void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override; - void BAmethodChanged (); - void NPmethodChanged (); - void BackmethodChanged (); - void CHSLmethodChanged (); - void CHmethodChanged (); - void CLmethodChanged (); - void DirmethodChanged (); - void EDmethodChanged (); - void HSmethodChanged (); - void LmethodChanged (); - void MedgreinfChanged (); - void TMmethodChanged (); - void TilesmethodChanged (); - void avoidToggled (); - void cbenabToggled (); - void contrastMinusPressed (); - void contrastPlusPressed (); - void daubcoeffmethodChanged (); - void enabledChanged () override; - void linkedgToggled (); - void lipstToggled (); - void medianToggled (); - void medianlevToggled (); - void neutralPressed (); - void neutral_pressed (); - void neutralchPressed (); - void tmrToggled (); + void colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override; + void BAmethodChanged(); + void NPmethodChanged(); + void BackmethodChanged(); + void CHSLmethodChanged(); + void CHmethodChanged(); + void CLmethodChanged(); + void DirmethodChanged(); + void EDmethodChanged(); + void HSmethodChanged(); + void LmethodChanged(); + void MedgreinfChanged(); + void TMmethodChanged(); + void TilesmethodChanged(); + void avoidToggled(); + void cbenabToggled(); + void contrastMinusPressed(); + void contrastPlusPressed(); + void daubcoeffmethodChanged(); + void enabledChanged() override; + void linkedgToggled(); + void lipstToggled(); + void medianToggled(); + void medianlevToggled(); + void neutralPressed(); + void neutral_pressed(); + void neutralchPressed(); + void tmrToggled(); void updatewavLabel (); - void wavChanged (double nlevel) override; + void wavChanged(double nlevel) override; void HSmethodUpdateUI(); void CHmethodUpdateUI(); @@ -113,13 +114,13 @@ private: // void MedgreinfUpdateUI(); // void DirmethodUpdateUI(); // void LmethodUpdateUI(); - void adjusterUpdateUI (Adjuster* a); - void enabledUpdateUI (); - void medianlevUpdateUI (); - void cbenabUpdateUI (); - void lipstUpdateUI (); + void adjusterUpdateUI(Adjuster* a); + void enabledUpdateUI(); + void medianlevUpdateUI(); + void cbenabUpdateUI(); + void lipstUpdateUI(); - void enableToggled(MyExpander *expander); + void enableToggled(MyExpander* expander); CurveEditorGroup* const curveEditorG; diff --git a/tools/generateRtexifUpdates b/tools/generateRtexifUpdates index 72a97862e..b4ace209d 100755 --- a/tools/generateRtexifUpdates +++ b/tools/generateRtexifUpdates @@ -32,7 +32,10 @@ echo #------------------------------------------------------------------------------ # Canon printf '%s\n' "Saving ${tmpdir}/canon_lenses" -xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -canon:all) | sort -fuV > "${tmpdir}/canon_lenses" +xmlstarlet sel -T -t \ + -m "taginfo/table/tag[@name='LensType']/values/key" \ + -v "concat(@id,' ',val)" \ + -n < <("$et" -listx -canon:all) | sort -fuV > "${tmpdir}/canon_lenses" #In :10.1 Sigma 50mm f/2.8 EX #Out: {10, "Sigma 50mm f/2.8 EX"}, @@ -55,7 +58,11 @@ sed -r -i \ # replace with '] = "' # append '";' printf '%s\n' "Saving ${tmpdir}/canon_cameras" -xmlstarlet sel -T -t -m "taginfo/table/tag[@name='CanonModelID']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -canon:all) | sort -fuV > "${tmpdir}/canon_cameras" +xmlstarlet sel -T -t \ + -m "taginfo/table/tag[@name='CanonModelID']/values/key" \ + -v "concat(@id,' ',val)" \ + -n < <("$et" -listx -canon:all) | sort -fuV > "${tmpdir}/canon_cameras" + sed -r -i \ -e 's/^/ choices[/' \ -e 's/\t/] = "/' \ @@ -65,28 +72,84 @@ sed -r -i \ #------------------------------------------------------------------------------ # Nikon LensIDs are composite tags printf '%s\n' "Saving ${tmpdir}/nikon" -xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensID']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -composite:all) > "${tmpdir}/nikon" -sed -r -i -e '/^... /d' -e 's/^/ {"/' -e 's/([A-F0-9]+)[A-F0-9.]*\t/\1", "/' -e 's/$/"},/' -e 's|(.* ")(.*) F([0-9]+)|\1\2 f/\3|' -e 's| F/([0-9]+)| f/\1|' "${tmpdir}/nikon" + +xmlstarlet sel -T -t \ + -m "taginfo/table/tag[@name='LensID']/values/key" \ + -v "concat(@id,' ',val)" \ + -n < <("$et" -listx -composite:all) > "${tmpdir}/nikon" + +sed -r -i \ + -e '/^... /d' \ + -e 's/^/ {"/' \ + -e 's/([A-F0-9]+)[A-F0-9.]*\t/\1", "/' \ + -e 's/$/"},/' \ + -e 's|(.* ")(.*) F([0-9]+)|\1\2 f/\3|' \ + -e 's| F/([0-9]+)| f/\1|' \ + "${tmpdir}/nikon" #------------------------------------------------------------------------------ # Olympus printf '%s\n' "Saving ${tmpdir}/olympus" -xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -olympus:all) | sort -fuV > "${tmpdir}/olympus" -sed -r -i -e '/0 00 00\tNone/d' -e 's/^/ lenses["0/' -e 's/\t/"] = "/' -e 's/$/";/' -e 's| F([0-9]+)| f/\1|g' "${tmpdir}/olympus" + +xmlstarlet sel -T -t \ + -m "taginfo/table/tag[@name='LensType']/values/key" \ + -v "concat(@id,' ',val)" \ + -n < <("$et" -listx -olympus:all) | sort -fuV > "${tmpdir}/olympus" + +sed -r -i \ + -e '/0 00 00\tNone/d' \ + -e 's/^/ lenses["0/' \ + -e 's/\t/"] = "/' \ + -e 's/$/";/' \ + -e 's| F([0-9]+)| f/\1|g' \ + "${tmpdir}/olympus" #------------------------------------------------------------------------------ # Pentax printf '%s\n' "Saving ${tmpdir}/pentax" -xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -pentax:all) | sort -fuV > "${tmpdir}/pentax" -sed -r -i -e 's/^/ choices.insert (p_t (256 * /' -e 's/([0-9]+) ([0-9]+)([0-9.]*)/\1 + \2/' -e 's/\t/, "/' -e 's/$/"));/' -e 's| F([0-9]+)| f/\1|' "${tmpdir}/pentax" + +xmlstarlet sel -T -t \ + -m "taginfo/table/tag[@name='LensType']/values/key" \ + -v "concat(@id,' ',val)" \ + -n < <("$et" -listx -pentax:all) | sort -fuV > "${tmpdir}/pentax" + +sed -r -i \ + -e 's/^/ choices.insert (p_t (256 * /' \ + -e 's/([0-9]+) ([0-9]+)([0-9.]*)/\1 + \2/' \ + -e 's/\t/, "/' \ + -e 's/$/"));/' \ + -e 's| F([0-9]+)| f/\1|' \ + "${tmpdir}/pentax" #------------------------------------------------------------------------------ # Sony printf '%s\n' "Saving ${tmpdir}/sony" -xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -sony:all) | sort -fuV > "${tmpdir}/sony" + +xmlstarlet sel -T -t \ + -m "taginfo/table/tag[@name='LensType']/values/key" \ + -v "concat(@id,' ',val)" \ + -n < <("$et" -listx -sony:all) | sort -fuV > "${tmpdir}/sony" + # Sony has more lenses under the LensType2 tag printf '%s\n' "Saving ${tmpdir}/sony-lenstype2" -xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType2']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -sony:all) | sort -fuV > "${tmpdir}/sony-lenstype2" -sed -r -i -e 's/^/ {/' -e 's/([0-9]+)[0-9.]*\t/\1, "/' -e 's/$/"},/' -e 's| F([0-9]+)| f/\1|g' "${tmpdir}/sony" -sed -r -i -e '/255\tTamron Lens (255)/d' -e 's/([0-9]+)[0-9.]*\t/\1, "/' -e 's/^/ choices.insert (p_t (/' -e 's/$/"));/' -e 's| F([0-9]+)| f/\1|g' "${tmpdir}/sony-lenstype2" + +xmlstarlet sel -T -t \ + -m "taginfo/table/tag[@name='LensType2']/values/key" \ + -v "concat(@id,' ',val)" \ + -n < <("$et" -listx -sony:all) | sort -fuV > "${tmpdir}/sony-lenstype2" + +sed -r -i \ + -e 's/^/ {/' \ + -e 's/([0-9]+)[0-9.]*\t/\1, "/' \ + -e 's/$/"},/' \ + -e 's| F([0-9]+)| f/\1|g' \ + "${tmpdir}/sony" + +sed -r -i \ + -e '/255\tTamron Lens (255)/d' \ + -e 's/([0-9]+)[0-9.]*\t/\1, "/' \ + -e 's/^/ choices.insert (p_t (/' \ + -e 's/$/"));/' \ + -e 's| F([0-9]+)| f/\1|g' \ + "${tmpdir}/sony-lenstype2" diff --git a/tools/osx/executable_loader.in b/tools/osx/executable_loader.in index 429173d8e..5ee609043 100644 --- a/tools/osx/executable_loader.in +++ b/tools/osx/executable_loader.in @@ -1,19 +1,22 @@ #!/bin/sh +# GIMP has this next line regarding raising the number-of-open-files limit: +ulimit -n 7000 + cd "$(dirname "$0")" || exit 1 cwd="$(pwd)" -app="${cwd%/Contents/*}" +app="/Applications/RawTherapee.app" lib="${app}/Contents/Frameworks" resources="${app}/Contents/Resources" -etc="${resources}"/etc +etc="${resources}/etc" export XDG_DATA_DIRS="${resources}/share" -export DYLD_LIBRARY_PATH="${lib}" +export DYLD_FALLBACK_LIBRARY_PATH="${lib}" export GTK_PATH="${lib}/gtk-3.0/3.0.0" export XDG_DATA_HOME="${resources}/share" export GSETTINGS_SCHEMA_DIR="${resources}/share/glib-2.0/schemas" export GDK_PIXBUF_MODULE_FILE="${etc}/gtk-3.0/gdk-pixbuf.loaders" -export GDK_PIXBUF_MODULEDIR="${lib}/gdk-pixbuf-2.0/2.10.0/loaders" +export GDK_PIXBUF_MODULEDIR="${lib}" export RT_SETTINGS="${HOME}/Library/Application Support/RawTherapee/config" export RT_CACHE="${HOME}/Library/Application Support/RawTherapee/cache" @@ -27,4 +30,4 @@ esac AppleLocale=`defaults read -g AppleLocale` export LANG=${AppleLocale%@*}.UTF-8 -exec "${cwd}/bin/rawtherapee-bin" "$@" +exec "${app}/Contents/MacOS/bin/rawtherapee-bin" "$@" diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index cb8839455..08740f696 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -76,10 +76,7 @@ if [[ -z "${MINIMUM_SYSTEM_VERSION}" ]]; then MINIMUM_SYSTEM_VERSION="$(sw_vers -productVersion | cut -d. -f-2)" fi -case ${PROC_BIT_DEPTH} in - 64) arch=x86_64;; - 32) arch=i386;; -esac +arch=x86_64 cat <<__EOS__ PROJECT_NAME: ${PROJECT_NAME} @@ -102,7 +99,7 @@ MACOS="${CONTENTS}/MacOS" LIB="${CONTENTS}/Frameworks" ETC="${RESOURCES}/etc" EXECUTABLE="${MACOS}/rawtherapee" -GDK_PREFIX="${LOCAL_PREFIX}/local/opt/gdk-pixbuf" +GDK_PREFIX="${LOCAL_PREFIX}/local/" msg "Removing old files:" rm -rf "${APP}" "${PROJECT_NAME}_*.dmg" "*zip" @@ -117,73 +114,80 @@ msg "Copying release files:" ditto "${CMAKE_BUILD_TYPE}/MacOS" "${MACOS}" ditto "Resources" "${RESOURCES}" +# Copy the Lensfun database into the app bundle +mkdir -p "${RESOURCES}/share/lensfun" +ditto ${LOCAL_PREFIX}/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun" + +# Copy liblensfun to Frameworks +ditto ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks/liblensfun.2.dylib" + +# Copy libomp to Frameworks +ditto ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks" + msg "Copying dependencies from ${GTK_PREFIX}:" CheckLink "${EXECUTABLE}" -msg "Copying library modules from ${GTK_PREFIX}:" -ditto --arch "${arch}" {"${GDK_PREFIX}/lib","${LIB}"}/gdk-pixbuf-2.0 -ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gtk-3.0 - -msg "Removing static libraries and cache files:" -find -E "${LIB}" -type f -regex '.*\.(a|la|cache)$' | while read -r; do rm "${REPLY}"; done - -msg "Copying configuration files from ${GTK_PREFIX}:" -install -d "${ETC}/gtk-3.0" - -# Make Frameworks folder flat -mv "${LIB}"/gdk-pixbuf-2.0/2*/loaders/*.so "${LIB}" -mv "${LIB}"/gtk-3.0/3*/immodules/*.so "${LIB}" -# the print*.so lead to errors when running gtk-query-immodules-3.0, just seeing what the app does without, since they are not in immodules -# and including them leads to errors and a completely empty gtk.immodules file -# mv "${LIB}"/gtk-3.0/3*/printbackends/*.so "${LIB}" -rm -r "${LIB}"/gtk-3.0 -rm -r "${LIB}"/gdk-pixbuf-2.0 - -"${GDK_PREFIX}"/bin/gdk-pixbuf-query-loaders "${LIB}"/libpix*.so > "${ETC}"/gtk-3.0/gdk-pixbuf.loaders -"${GTK_PREFIX}"/bin/gtk-query-immodules-3.0 "${LIB}"/im*.so > "${ETC}"/gtk-3.0/gtk.immodules -sed -i "" -e "s|${PWD}/RawTherapee.app/Contents/|/Applications/RawTherapee.app/Contents/|" "${ETC}/gtk-3.0/gdk-pixbuf.loaders" "${ETC}/gtk-3.0/gtk.immodules" - -mkdir -p ${RESOURCES}/share/glib-2.0 -cp -pRL {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/glib-2.0/schemas -"${LOCAL_PREFIX}/local/bin/glib-compile-schemas" "${RESOURCES}/share/glib-2.0/schemas" - -msg "Copying shared files from ${GTK_PREFIX}:" -cp -pRL {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/mime - -# GTK3 themes -ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/themes/Mac/gtk-3.0/gtk-keys.css -ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/themes/Default/gtk-3.0/gtk-keys.css -# Adwaita icons -iconfolders=("16x16/actions" "16x16/devices" "16x16/mimetypes" "16x16/places" "16x16/status" "48x48/devices") -for f in "${iconfolders[@]}"; do - mkdir -p ${RESOURCES}/share/icons/Adwaita/${f} - cp ${LOCAL_PREFIX}/local/share/icons/Adwaita/${f}/* "${RESOURCES}"/share/icons/Adwaita/${f} -done -ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/icons/Adwaita/index.theme -"${LOCAL_PREFIX}/local/bin/gtk-update-icon-cache" "${RESOURCES}/share/icons/Adwaita" - -# Copy libjpeg-turbo into the app bundle -cp ${LOCAL_PREFIX}/local/lib/libjpeg.*.dylib "${CONTENTS}/Frameworks" +# Copy libjpeg-turbo ("62") into the app bundle +ditto ${LOCAL_PREFIX}/local/lib/libjpeg.62.dylib "${CONTENTS}/Frameworks/libjpeg.62.dylib" # Copy libexpat into the app bundle (which is keg-only) - -if [[ -d /usr/local/Cellar/expat ]]; then cp /usr/local/Cellar/expat/*/lib/libexpat.1.dylib "${CONTENTS}/Frameworks"; else cp "${EXPATLIB}" "${CONTENTS}/Frameworks"; fi +if [[ -d /usr/local/Cellar/expat ]]; then ditto /usr/local/Cellar/expat/*/lib/libexpat.1.dylib "${CONTENTS}/Frameworks"; else ditto "${EXPATLIB}" "${CONTENTS}/Frameworks/libexpat.1.dylib"; fi # Copy libz into the app bundle -cp /usr/lib/libz.1.dylib "${CONTENTS}/Frameworks" +ditto ${LOCAL_PREFIX}/local/lib/libz.1.dylib "${CONTENTS}/Frameworks" -# Copy libtiff into the app bundle -cp ${LOCAL_PREFIX}/local/lib/libtiff.5.dylib "${CONTENTS}/Frameworks" +# Copy libpng16 to the app bundle +ditto ${LOCAL_PREFIX}/local/lib/libpng16.16.dylib "${CONTENTS}/Frameworks/libpng16.16.dylib" + +# Copy libtiff 5 into the app bundle +ditto ${LOCAL_PREFIX}/local/lib/libtiff.5.dylib "${CONTENTS}/Frameworks/libtiff.5.dylib" # Copy the Lensfun database into the app bundle mkdir -p "${RESOURCES}/share/lensfun" -cp ${LOCAL_PREFIX}/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun" +ditto ${LOCAL_PREFIX}/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun" # Copy liblensfun to Frameworks -cp ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks" +ditto ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks/liblensfun.2.dylib" # Copy libomp to Frameworks -cp ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks" +ditto ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks" + +# Prepare GTK+3 installation +msg "Copying configuration files from ${GTK_PREFIX}:" +install -d "${ETC}/gtk-3.0" +msg "Copying library modules from ${GTK_PREFIX}:" +ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gdk-pixbuf-2.0 +ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gtk-3.0 +msg "Removing static libraries and cache files:" +find -E "${LIB}" -type f -regex '.*\.(a|la|cache)$' | while read -r; do rm "${REPLY}"; done + +# Make Frameworks folder flat +msg "Flattening the Frameworks folder" +ditto "${LIB}"/gdk-pixbuf-2.0/2*/loaders/*.so "${LIB}" +ditto "${LIB}"/gtk-3.0/3*/immodules/*.{dylib,so} "${LIB}" +rm -r "${LIB}"/gtk-3.0 +rm -r "${LIB}"/gdk-pixbuf-2.0 + +msg "Build glib database:" +mkdir -p ${RESOURCES}/share/glib-2.0 +ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/glib-2.0/schemas +"${LOCAL_PREFIX}/local/bin/glib-compile-schemas" "${RESOURCES}/share/glib-2.0/schemas" + +# GTK+3 themes +msg "Copy GTK+3 theme and icon resources:" +ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/themes/Mac/gtk-3.0/gtk-keys.css +ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/themes/Default/gtk-3.0/gtk-keys.css + +# Adwaita icons +msg "Copy Adwaita icons" +iconfolders=("16x16/actions" "16x16/devices" "16x16/mimetypes" "16x16/places" "16x16/status" "48x48/devices") +for f in "${iconfolders[@]}"; do + mkdir -p ${RESOURCES}/share/icons/Adwaita/${f} + ditto ${LOCAL_PREFIX}/local/share/icons/Adwaita/${f}/* "${RESOURCES}"/share/icons/Adwaita/${f} +done +ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/icons/Adwaita/index.theme +"${LOCAL_PREFIX}/local/bin/gtk-update-icon-cache" "${RESOURCES}/share/icons/Adwaita" +ditto "${LOCAL_PREFIX}/local/share/icons/hicolor" "${RESOURCES}/share/icons/hicolor" # Install names find -E "${CONTENTS}" -type f -regex '.*/(rawtherapee-cli|rawtherapee|.*\.(dylib|so))' | while read -r x; do @@ -198,9 +202,23 @@ find -E "${CONTENTS}" -type f -regex '.*/(rawtherapee-cli|rawtherapee|.*\.(dylib } | bash -v done -msg "Registering @loader_path into the executable:" -echo " install_name_tool -add_rpath @executable_path/../../Frameworks '${EXECUTABLE}'" | bash -v -echo " install_name_tool -add_rpath @loader_path/../Frameworks '${EXECUTABLE}-cli'" | bash -v +# fix @rpath in Frameworks +msg "Registering @rpath in Frameworks folder:" +for frameworklibs in ${CONTENTS}/Frameworks/* ; do + echo " install_name_tool -delete_rpath /opt/local/lib '${frameworklibs}'" | bash -v + echo " install_name_tool -add_rpath /Applications/RawTherapee.app/Contents/Frameworks '${frameworklibs}'" | bash -v +done + +# pixbuf loaders & immodules +msg "Build GTK3 databases:" +"${LOCAL_PREFIX}"/local/bin/gdk-pixbuf-query-loaders "${LIB}"/libpix*.so > "${ETC}"/gtk-3.0/gdk-pixbuf.loaders +"${LOCAL_PREFIX}"/local/bin/gtk-query-immodules-3.0 "${LIB}"/im-* > "${ETC}"/gtk-3.0/gtk.immodules +sed -i "" -e "s|${PWD}/RawTherapee.app/Contents/|/Applications/RawTherapee.app/Contents/|" "${ETC}/gtk-3.0/gdk-pixbuf.loaders" "${ETC}/gtk-3.0/gtk.immodules" +sed -i "" -e "s|/opt/local/|/usr/|" "${ETC}/gtk-3.0/gtk.immodules" + +# Mime directory +msg "Copying shared files from ${GTK_PREFIX}:" +ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/mime msg "Installing required application bundle files:" PROJECT_SOURCE_DATA_DIR="${PROJECT_SOURCE_DIR}/tools/osx" @@ -208,36 +226,49 @@ ditto "${PROJECT_SOURCE_DIR}/build/Resources" "${RESOURCES}" # Executable loader # Note: executable is renamed to 'rawtherapee-bin'. mkdir "${MACOS}/bin" -mv "${MACOS}/rawtherapee" "${MACOS}/bin/rawtherapee-bin" +ditto "${MACOS}/rawtherapee" "${MACOS}/bin/rawtherapee-bin" +rm "${MACOS}/rawtherapee" install -m 0755 "${PROJECT_SOURCE_DATA_DIR}/executable_loader.in" "${MACOS}/rawtherapee" # App bundle resources -cp "${PROJECT_SOURCE_DATA_DIR}/"{rawtherapee,profile}.icns "${RESOURCES}" -cp "${PROJECT_SOURCE_DATA_DIR}/PkgInfo" "${CONTENTS}" +ditto "${PROJECT_SOURCE_DATA_DIR}/"{rawtherapee,profile}.icns "${RESOURCES}" +ditto "${PROJECT_SOURCE_DATA_DIR}/PkgInfo" "${CONTENTS}" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/Info.plist.in" "${CONTENTS}/Info.plist" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/Info.plist-bin.in" "${CONTENTS}/MacOS/bin/Info.plist" sed -i "" -e "s|@version@|${PROJECT_FULL_VERSION}| s|@shortVersion@|${PROJECT_VERSION}| s|@arch@|${arch}|" \ "${CONTENTS}/Info.plist" -plutil -convert binary1 "${CONTENTS}/Info.plist" -plutil -convert binary1 "${CONTENTS}/MacOS/bin/Info.plist" +plutil -convert xml1 "${CONTENTS}/Info.plist" +plutil -convert xml1 "${CONTENTS}/MacOS/bin/Info.plist" +update-mime-database -V "${CONTENTS}/Resources/share/mime" + +# Append an LC_RPATH +msg "Registering @rpath into the executable:" +echo " install_name_tool -add_rpath /Applications/RawTherapee.app/Contents/Frameworks '${MACOS}/bin/rawtherapee-bin'" | bash -v +echo " install_name_tool -add_rpath /Applications/RawTherapee.app/Contents/Frameworks '${EXECUTABLE}-cli'" | bash -v + # Sign the app +msg "Codesigning:" CODESIGNID="$(cmake .. -LA -N | grep "CODESIGNID" | cut -d "=" -f2)" if ! test -z "$CODESIGNID" ; then install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/rt.entitlements" "${CONTENTS}/Entitlements.plist" -plutil -convert binary1 "${CONTENTS}/Entitlements.plist" +plutil -convert xml1 "${CONTENTS}/Entitlements.plist" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/rt-bin.entitlements" "${CONTENTS}/MacOS/bin/Entitlements.plist" -plutil -convert binary1 "${CONTENTS}/MacOS/bin/Entitlements.plist" -codesign -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee-bin" --timestamp -o runtime --entitlements "${APP}/Contents/MacOS/bin/Entitlements.plist" "${APP}/Contents/MacOS/bin/rawtherapee-bin" -codesign --deep --preserve-metadata=identifier,entitlements,runtime --strict -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee" --timestamp -o runtime --entitlements "${APP}/Contents/Entitlements.plist" "${APP}" - spctl -a -vvvv "${APP}" +plutil -convert xml1 "${CONTENTS}/MacOS/bin/Entitlements.plist" +codesign -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee-bin" -o runtime --timestamp --entitlements "${APP}/Contents/MacOS/bin/Entitlements.plist" "${APP}/Contents/MacOS/bin/rawtherapee-bin" +for frameworklibs in ${CONTENTS}/Frameworks/* ; do + codesign -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee-bin" -o runtime --timestamp "${frameworklibs}" +done +codesign --deep --preserve-metadata=identifier,entitlements,runtime --timestamp --strict -v -s "${CODESIGNID}" -i "com.rawtherapee.RawTherapee" -o runtime --entitlements "${CONTENTS}/Entitlements.plist" "${APP}" +spctl -a -vvvv "${APP}" fi # Notarize the app NOTARY="$(cmake .. -LA -N | grep "NOTARY" | cut -d "=" -f2)" if ! test -z "$NOTARY" ; then + msg "Notarizing the application:" ditto -c -k --sequesterRsrc --keepParent "${APP}" "${APP}.zip" - uuid=`xcrun altool --notarize-app --primary-bundle-id "com.rawtherapee.rawtherapee" ${NOTARY} --file "${APP}.zip" 2>&1 | grep 'RequestUUID' | awk '{ print $3 }'` + uuid=`xcrun altool --notarize-app --primary-bundle-id "com.rawtherapee.RawTherapee" ${NOTARY} --file "${APP}.zip" 2>&1 | grep 'RequestUUID' | awk '{ print $3 }'` echo "Result= $uuid" # Display identifier string sleep 15 while : @@ -265,7 +296,7 @@ function CreateDmg { msg "Preparing disk image sources at ${srcDir}:" cp -R "${APP}" "${srcDir}" - cp AboutThisBuild.txt "${srcDir}" + ditto AboutThisBuild.txt "${srcDir}" ln -s /Applications "${srcDir}" # Web bookmarks @@ -292,7 +323,9 @@ function CreateDmg { fi # Notarize the dmg - if ! test -z "$NOTARY" ; then + + if ! test -z "$NOTARY" ; then + msg "Notarizing the dmg:" zip "${dmg_name}.dmg.zip" "${dmg_name}.dmg" uuid=`xcrun altool --notarize-app --primary-bundle-id "com.rawtherapee" ${NOTARY} --file "${dmg_name}.dmg.zip" 2>&1 | grep 'RequestUUID' | awk '{ print $3 }'` echo "dmg Result= $uuid" # Display identifier string @@ -316,9 +349,10 @@ function CreateDmg { fi done fi + +# Zip disk image for redistribution + msg "Zipping disk image for redistribution:" - - # Zip disk image for redistribution zip "${dmg_name}.zip" "${dmg_name}.dmg" AboutThisBuild.txt rm "${dmg_name}.dmg" @@ -326,3 +360,5 @@ function CreateDmg { rm -rf "${srcDir}" } CreateDmg +msg "Finishing build:" +echo "Script complete."