diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13aa6677a..e483ace01 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,81 +1,96 @@ name: macOS build on: push: - branches-ignore: - - '**' + branches: + - dev + - patch** + - newlocallab + pull_request: + branches: + - dev + - newlocallab + release: + types: + - created jobs: build: - runs-on: macos-latest + runs-on: macos-10.15 steps: - uses: actions/checkout@v1 - name: Install dependencies - run: > - brew install gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme - libsigc++ little-cms2 libiptcdata fftw lensfun llvm expat pkgconfig - libomp shared-mime-info - - name: patch libiconv run: | - mkdir libiconv && cd libiconv - wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz - tar xf libiconv-1.16.tar.gz - cd libiconv-1.16 - patch -p1 < "${GITHUB_WORKSPACE}/tools/osx/libiconv_1.16_rt.patch" - mkdir build && cd build - destDir="$(pwd)" - ../configure --prefix=/opt/local --disable-static \ - CFLAGS='-arch x86_64 -mmacosx-version-min=10.9' \ - LDFLAGS='-arch x86_64 -mmacosx-version-min=10.9' \ - CXXFLAGS='-arch x86_64 -mmacosx-version-min=10.9' - make --jobs - make DESTDIR="${destDir}" install - sudo mv opt/local /usr/local/opt/libiconv - - name: cmake + date -u + mkdir build + date +%s > build/stamp + brew uninstall --ignore-dependencies libtiff + brew install libtiff gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++ little-cms2 libiptcdata fftw lensfun expat pkgconfig libomp shared-mime-info | tee -a depslog + date -u + echo "----====Pourage====----" + cat depslog | grep Pouring + zsh -c 'echo "Completed installation of dependencies in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"' + - name: Configure build system env: CMAKE_CXX_STANDARD: 11 - PKG_CONFIG_PATH: /usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig + PKG_CONFIG_PATH: /usr/local/opt/libtiff/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig RAW_THERAPEE_MAJOR: '5' RAW_THERAPEE_MINOR: '8' C_FLAGS: > - -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib - -I/usr/local/include -I/usr/local/opt/gdk-pixbuf/include - -I/usr/local/opt/libiconv/include -I/usr/local/opt/libxml2/include - -I/usr/local/opt/expat/include -I/usr/local/opt/llvm/include + -arch x86_64 -mtune=generic -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include -I/usr/local/opt/gdk-pixbuf/include -I/usr/local/opt/libiconv/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/expat/include -I/usr/local/opt/libtiff/include run: | # GITHUB_REF is the ref that triggered the build, like # refs/heads/new-feature - the next line parses that to REF: the branch # name only (new-feature) - REF=${GITHUB_REF##*/} - mkdir build && cd build + export REF=${GITHUB_REF##*/} + export C_FLAGS=$(echo -e $C_FLAGS | tr -d '\n') + cd build && date -u && date +%s > configstamp cmake \ - -DCMAKE_BUILD_TYPE="release" \ + -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ - -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/gdk-pixbuf/lib -L/usr/local/opt/libiconv/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/expat/lib" \ + -DCMAKE_EXE_LINKER_FLAGS="-L. -L/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/opt/gdk-pixbuf/lib -L/usr/local/opt/libiconv/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/expat/lib" \ -DCACHE_NAME_SUFFIX="${RAW_THERAPEE_MAJOR}.${RAW_THERAPEE_MINOR}-${REF}" \ - -DPROC_TARGET_NUMBER="2" \ + -DPROC_TARGET_NUMBER="1" \ -DPROC_LABEL="generic processor" \ -DWITH_LTO="OFF" \ - -DLENSFUNDBDIR="./share/lensfun" \ - -DOpenMP_C_FLAGS=-fopenmp=libomp \ - -DOpenMP_CXX_FLAGS=-fopenmp=libomp \ - -DOpenMP_C_LIB_NAMES="libomp" \ - -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="/usr/local/lib/libomp.dylib" \ + -DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \ + -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang \ + -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ \ + -DCMAKE_C_FLAGS="-arch x86_64 -Wno-pass-failed -Wno-deprecated-register -Wno-unused-command-line-argument" \ + -DCMAKE_CXX_FLAGS="-arch x86_64 -Wno-pass-failed -Wno-deprecated-register -Wno-unused-command-line-argument" \ -DOpenMP_C_FLAGS="${C_FLAGS}" \ -DOpenMP_CXX_FLAGS="${C_FLAGS}" \ - -DCMAKE_AR="/usr/local/opt/llvm/bin/llvm-ar" \ - -DCMAKE_RANLIB="/usr/local/opt/llvm/bin/llvm-ranlib" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET="10.11" \ + -DOpenMP_C_LIB_NAMES=libomp \ + -DOpenMP_CXX_LIB_NAMES=libomp \ + -DOpenMP_libomp_LIBRARY=/usr/local/lib/libomp.dylib \ + -DCMAKE_AR=/usr/bin/ar \ + -DCMAKE_RANLIB=/usr/bin/ranlib \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \ .. - make --jobs - make install - sudo make macosx_bundle - ARTIFACT=(RawTherapee*.zip) + zsh -c 'echo "Configured in $(printf "%0.2f" $(($[$(date +%s)-$(cat configstamp)]/$((60.))))) minutes"' + - name: Compile RawTherapee + run: | + date -u && date +%s > build/compilestamp + cd build + export REF=${GITHUB_REF##*/} + make -j$(sysctl -a | grep machdep.cpu.thread_count | tail -c 2) install + zsh -c 'echo "Compiled in $(printf "%0.2f" $(($[$(date +%s)-$(cat compilestamp)]/$((60.))))) minutes"' + - name: Create application bundle + run: | + zsh + date +%s > build/bundlestamp && date -u && cd build + export REF=${GITHUB_REF##*/} && export LOCAL_PREFIX=/usr && sudo make macosx_bundle + export ARTIFACT=(RawTherapee*.zip) echo "=== artifact: ${ARTIFACT}" # defining environment variables for next step as per # https://github.com/actions/starter-workflows/issues/68 echo "::set-env name=ARTIFACT_PATH::${GITHUB_WORKSPACE}/build/${ARTIFACT}" echo "::set-env name=ARTIFACT_FILE::${ARTIFACT}" + zsh -c 'echo "Bundled in $(printf "%0.2f" $(($[$(date +%s)-$(cat bundlestamp)]/$((60.))))) minutes"' + exit - uses: actions/upload-artifact@v1 with: name: ${{env.ARTIFACT_FILE}} path: ${{env.ARTIFACT_PATH}} + - name: Finish build + run: | + date -u + zsh -c 'echo "Build completed in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"' diff --git a/AboutThisBuild.txt.in b/AboutThisBuild.txt.in index 06f628187..4d8f4f3fe 100644 --- a/AboutThisBuild.txt.in +++ b/AboutThisBuild.txt.in @@ -14,6 +14,6 @@ Link flags: ${LFLAGS} OpenMP support: ${OPTION_OMP} MMAP support: ${WITH_MYFILE_MMAP} Build OS: ${BUILDINFO_OS} -Build date: ${BUILDINFO_DATE} ZULU +Build date: ${BUILDINFO_DATE} UTC Build epoch: ${BUILDINFO_EPOCH} Build UUID: ${BUILDINFO_UUID} diff --git a/CMakeLists.txt b/CMakeLists.txt index 5998ccb50..e3ae3b7ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,14 @@ -cmake_minimum_required(VERSION 3.5) +# Use of SOURCE_DIR target property begins at cmake 3.7 +if(APPLE) + cmake_minimum_required(VERSION 3.7) +else() + cmake_minimum_required(VERSION 3.5) +endif() # Compiler id for Apple Clang if(APPLE) cmake_policy(SET CMP0025 NEW) + cmake_policy(SET CMP0037 NEW) endif() # Must stay before the project() command: @@ -145,7 +151,7 @@ if(WIN32) CACHE STRING "Additional search paths") endif() -if(APPLE) +if(APPLE) # TODO make -mtune generic conditional and/or specifiable. if(CMAKE_CXX_COMPILER MATCHES "g\\+\\+-mp-4.[5-8]" OR CMAKE_CXX_COMPILER_ARG1 MATCHES "g\\+\\+-mp-4.[5-8]") set(CMAKE_EXE_LINKER_FLAGS @@ -210,7 +216,7 @@ endif() if(NOT DEFINED BUNDLE_BASE_INSTALL_DIR) if(APPLE) - set(BUNDLE_BASE_INSTALL_DIR "${CMAKE_BUILD_TYPE}/MacOS") + set(BUNDLE_BASE_INSTALL_DIR "${PROJECT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/MacOS") else() set(BUNDLE_BASE_INSTALL_DIR "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}") endif() @@ -219,7 +225,7 @@ endif() if(BUILD_BUNDLE) if(APPLE) set(BINDIR "${BUNDLE_BASE_INSTALL_DIR}") - set(CMAKE_INSTALL_PREFIX ".") + set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/build") else() set(BINDIR .) set(CMAKE_INSTALL_PREFIX "${BUNDLE_BASE_INSTALL_DIR}") @@ -233,7 +239,7 @@ endif() if(NOT DEFINED DATADIR) if(BUILD_BUNDLE) if(APPLE) - set(DATADIR "${CMAKE_BUILD_TYPE}/Resources/share") + set(DATADIR "${PROJECT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/Resources/share") else() set(DATADIR .) endif() @@ -245,7 +251,7 @@ endif() if(NOT DEFINED LIBDIR) if(BUILD_BUNDLE) if(APPLE) - set(LIBDIR "${CMAKE_BUILD_TYPE}/Frameworks") + set(LIBDIR "${PROJECT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/Frameworks") else() set(LIBDIR .) endif() @@ -362,8 +368,10 @@ if(APPLE) set(LOCAL_PREFIX "${LOCAL_PREFIX}" CACHE STRING "macos/gtk parent directory ie /usr or /opt") - elseif(NOT DEFINED LOCAL_PREFIX) - set(LOCAL_PREFIX "/usr") + else() + set(LOCAL_PREFIX + /usr + CACHE STRING "macos/gtk parent directory ie /usr or /opt") endif() if("${FANCY_DMG}") set(FANCY_DMG @@ -612,12 +620,10 @@ else() set(PROC_BIT_DEPTH 64 bits) endif() -# Get compiler name and version. Only CMake > 2.8.7 knows -# CMAKE_*_COMPILER_VERSION -if(CMAKE_VERSION VERSION_GREATER 2.8.7) +# Get compiler name and version. get_filename_component(COMPILER_INFO ${CMAKE_C_COMPILER} NAME_WE) set(COMPILER_INFO "${COMPILER_INFO} ${CMAKE_C_COMPILER_VERSION}") -else() +if(NOT APPLE) execute_process( COMMAND gcc -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -633,15 +639,18 @@ set(LFLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${UPPER_CMAKE_BUILD_TYPE}}" ) -set(ABOUT_COMMAND_WITH_ARGS - ${CMAKE_COMMAND} -DPROJECT_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} - -DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX} - -DPROC_LABEL:STRING="${PROC_LABEL}" - -DPROC_BIT_DEPTH:STRING="${PROC_BIT_DEPTH}" - -DBUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DGTKMM_VERSION:STRING=${GTKMM_VERSION} -DOPTION_OMP:STRING=${OPTION_OMP} - -DWITH_MYFILE_MMAP:STRING=${WITH_MYFILE_MMAP} - -DLENSFUN_VERSION:STRING=${LENSFUN_VERSION}) +if(NOT APPLE) + set(ABOUT_COMMAND_WITH_ARGS + ${CMAKE_COMMAND} -DPROJECT_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} + -DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX} + -DPROC_LABEL:STRING="${PROC_LABEL}" + -DPROC_BIT_DEPTH:STRING="${PROC_BIT_DEPTH}" + -DBUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DGTKMM_VERSION:STRING=${GTKMM_VERSION} + -DOPTION_OMP:STRING=${OPTION_OMP} + -DWITH_MYFILE_MMAP:STRING=${WITH_MYFILE_MMAP} + -DLENSFUN_VERSION:STRING=${LENSFUN_VERSION}) +endif() if(WIN32) list( @@ -654,16 +663,19 @@ if(WIN32) -DCMAKE_INSTALL_PREFIX:STRING="${CMAKE_INSTALL_PREFIX}" -DBIT_DEPTH:STRING="${CMAKE_SIZEOF_VOID_P}") elseif(APPLE) - list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Apple - -DCXX_FLAGS:STRING=${CXX_FLAGS} -DLFLAGS:STRING=${LFLAGS} - -DCOMPILER_INFO:STRING=${COMPILER_INFO}) + set( + ABOUT_COMMAND_WITH_ARGS + cmake -DPROJECT_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/UpdateInfo.cmake -DSYSTEM:STRING=Apple -DCXX_FLAGS:STRING=${CXX_FLAGS} -DLFLAGS:STRING=${LFLAGS} -DCOMPILER_INFO:STRING=${COMPILER_INFO} -DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX}) else() list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Linux -DCXX_FLAGS:STRING=${CXX_FLAGS} -DLFLAGS:STRING=${LFLAGS} -DCOMPILER_INFO:STRING=${COMPILER_INFO}) endif() - -list(APPEND ABOUT_COMMAND_WITH_ARGS -P "${PROJECT_SOURCE_DIR}/UpdateInfo.cmake") +if(NOT APPLE) + list(APPEND + ABOUT_COMMAND_WITH_ARGS + -P "${PROJECT_SOURCE_DIR}/UpdateInfo.cmake") +endif() add_custom_target( UpdateInfo ALL diff --git a/UpdateInfo.cmake b/UpdateInfo.cmake index 6fa8e289c..473c68364 100644 --- a/UpdateInfo.cmake +++ b/UpdateInfo.cmake @@ -1,5 +1,9 @@ # cmakefile executed within a makefile target +if(APPLE) + set(PROJECT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") +endif() + # If we find ReleaseInfo.cmake we use the info from there and don't need Git to be installed find_file(REL_INFO_FILE ReleaseInfo.cmake PATHS "${PROJECT_SOURCE_DIR}" NO_DEFAULT_PATH) if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) @@ -68,20 +72,19 @@ if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) execute_process(COMMAND date -Ru OUTPUT_VARIABLE BUILDINFO_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND date +%s OUTPUT_VARIABLE BUILDINFO_EPOCH OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND uuidgen COMMAND tr "A-Z" "a-z" OUTPUT_VARIABLE BUILDINFO_UUID OUTPUT_STRIP_TRAILING_WHITESPACE) - message(STATUS "Git checkout information:") - message(STATUS " Commit description: ${GIT_DESCRIBE}") - message(STATUS " Branch: ${GIT_BRANCH}") - message(STATUS " Commit: ${GIT_COMMIT}") - message(STATUS " Commit date: ${GIT_COMMIT_DATE}") - message(STATUS " Commits since tag: ${GIT_COMMITS_SINCE_TAG}") - message(STATUS " Commits since branch: ${GIT_COMMITS_SINCE_BRANCH}") - message(STATUS " Version (unreliable): ${GIT_NUMERIC_VERSION_BS}") + message(STATUS " Commit description: ${GIT_DESCRIBE}") + message(STATUS " Branch: ${GIT_BRANCH}") + message(STATUS " Commit: ${GIT_COMMIT}") + message(STATUS " Commit date: ${GIT_COMMIT_DATE}") + message(STATUS " Commits since tag: ${GIT_COMMITS_SINCE_TAG}") + message(STATUS " Commits since branch: ${GIT_COMMITS_SINCE_BRANCH}") + message(STATUS " Version (unreliable): ${GIT_NUMERIC_VERSION_BS}") message(STATUS "Build information:") - message(STATUS " Build OS: ${BUILDINFO_OS}") - message(STATUS " Build date: ${BUILDINFO_DATE}") - message(STATUS " Epoch: ${BUILDINFO_EPOCH}") - message(STATUS " UUID: ${BUILDINFO_UUID}") + message(STATUS " Build OS: ${BUILDINFO_OS}") + message(STATUS " Build date: ${BUILDINFO_DATE} UTC") + message(STATUS " Epoch: ${BUILDINFO_EPOCH}") + message(STATUS " UUID: ${BUILDINFO_UUID}") if(NOT DEFINED CACHE_NAME_SUFFIX) set(CACHE_NAME_SUFFIX "${GIT_DESCRIBE}") diff --git a/rtdata/CMakeLists.txt b/rtdata/CMakeLists.txt index 76804c0f0..00a32c0cc 100644 --- a/rtdata/CMakeLists.txt +++ b/rtdata/CMakeLists.txt @@ -47,8 +47,8 @@ if(WIN32) install(FILES ${FONTS} DESTINATION "${DATADIR}/fonts") endif() -install(DIRECTORY ${PROFILESDIR} DESTINATION "${DATADIR}" FILES_MATCHING PATTERN "*.pp3") -install(DIRECTORY ${THEMEDIR} DESTINATION "${DATADIR}") +install(DIRECTORY "${PROFILESDIR}" DESTINATION "${DATADIR}" FILES_MATCHING PATTERN "*.pp3") +install(DIRECTORY "${THEMEDIR}" DESTINATION "${DATADIR}") install(FILES ${IMG_SVG} DESTINATION "${DATADIR}/images") install(FILES ${IMG_PNG} DESTINATION "${DATADIR}/images") @@ -57,19 +57,15 @@ install(FILES ${IMG_ICO} DESTINATION "${DATADIR}/images") if(APPLE) # CMake escapes first item quote character. Do not remove 'DUMMY_VARIABLE=' set(MACOSX_BUNDLE_COMMAND DUMMY_VARIABLE= - PROJECT_NAME="${PROJECT_NAME}" + PROJECT_NAME=${PROJECT_NAME} PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}" - CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" + CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} GTK_PREFIX="${GTK_PREFIX}") - if(PROC_BIT_DEPTH MATCHES 32) - list(APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=32) - else() - list(APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=64) - endif() - list(APPEND MACOSX_BUNDLE_COMMAND sh "${PROJECT_SOURCE_DIR}/tools/osx/macosx_bundle.sh") + list(APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=64) + list(APPEND MACOSX_BUNDLE_COMMAND sh ${PROJECT_SOURCE_DIR}/tools/osx/macosx_bundle.sh) add_custom_target(macosx_bundle COMMAND ${MACOSX_BUNDLE_COMMAND} - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/build COMMENT "Creating macOS bundle") endif() diff --git a/rtdata/languages/default b/rtdata/languages/default index 5af093b6b..607484d19 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -728,6 +728,7 @@ HISTORY_MSG_491;White Balance HISTORY_MSG_492;RGB Curves HISTORY_MSG_493;L*a*b* Adjustments HISTORY_MSG_494;Capture Sharpening +HISTORY_MSG_CAT02PRESET;Cat02 automatic preset HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -1447,6 +1448,8 @@ TP_COLORAPP_MODEL;WP Model TP_COLORAPP_MODEL_TOOLTIP;White-Point Model.\n\nWB [RT] + [output]: RT's white balance is used for the scene, CIECAM02 is set to D50, and the output device's white balance is set in Viewing Conditions.\n\nWB [RT+CAT02] + [output]: RT's white balance settings are used by CAT02 and the output device's white balance is set in Viewing Conditions.\n\nFree temp+green + CAT02 + [output]: temp and green are selected by the user, the output device's white balance is set in Viewing Conditions. TP_COLORAPP_NEUTRAL;Reset TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values +TP_COLORAPP_PRESETCAT02;Preset cat02 automatic +TP_COLORAPP_PRESETCAT02_TIP;Set combobox, sliders, temp, green so that Cat02 automatic is preset.\nYou must change Cat02 adaptation Viewing conditions if need.\nYou can change Temperature and Tint Viewing conditions if need, and other settings if need. TP_COLORAPP_RSTPRO;Red & skin-tones protection TP_COLORAPP_RSTPRO_TOOLTIP;Red & skin-tones protection affects both sliders and curves. TP_COLORAPP_SURROUND;Surround @@ -2320,7 +2323,7 @@ TP_WBALANCE_SOLUX47;Solux 4700K (vendor) TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. TP_WBALANCE_STUDLABEL;Student Itcwb: %1 -TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation\nThe lower the student value, the better the correlation\nValues below 0.002 are excellent\nValues below 0.005 are very good\nValues below 0.01 are good\nValues below 0.05 are good enough\nValues above 0.5 are poor\nVery good Student test results does not mean that the WB is good, if the illuminant is non-standard the results are erratic.\nStudent=1000 means the calculations were not restarted but results are probably goods +TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation\nThe lower the student value, the better the correlation\nValues below 0.002 are excellent\nValues below 0.005 are very good\nValues below 0.01 are good\nValues below 0.05 are good enough\nValues above 0.5 are poor\nVery good Student test results does not mean that the WB is good, if the illuminant is non-standard the results are erratic.\nStudent=1000 means the calculations were not restarted but results are probably goods, use previous results TP_WBALANCE_TEMPBIAS;AWB temperature bias TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the "auto white balance"\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by "computedTemp + computedTemp * bias". TP_WBALANCE_TEMPERATURE;Temperature diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 5f59da371..3813c5708 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -1,35 +1,60 @@ -include_directories(${EXTRA_INCDIR} - ${EXPAT_INCLUDE_DIRS} - ${FFTW3F_INCLUDE_DIRS} - ${GLIB2_INCLUDE_DIRS} - ${GLIBMM_INCLUDE_DIRS} - ${GOBJECT_INCLUDE_DIRS} - ${GTHREAD_INCLUDE_DIRS} - ${GTKMM_INCLUDE_DIRS} - ${GTK_INCLUDE_DIRS} - ${IPTCDATA_INCLUDE_DIRS} - ${LCMS_INCLUDE_DIRS} - ${LENSFUN_INCLUDE_DIRS} - ${RSVG_INCLUDE_DIRS} -) +if(EXTRA_INCDIR) + include_directories("${EXTRA_INCDIR}") +endif() +if(EXPAT_INCLUDE_DIRS) + include_directories("${EXPAT_INCLUDE_DIRS}") +endif() +if(FFTW3F_INCLUDE_DIRS) + include_directories("${FFTW3F_INCLUDE_DIRS}") +endif() +if(GLIB2_INCLUDE_DIRS) + include_directories("${GLIB2_INCLUDE_DIRS}") +endif() +if(GLIBMM_INCLUDE_DIRS) + include_directories("${GLIBMM_INCLUDE_DIRS}") +endif() +if(GOBJECT_INCLUDE_DIRS) + include_directories("${GOBJECT_INCLUDE_DIRS}") +endif() +if(GTHREAD_INCLUDE_DIRS) + include_directories("${GTHREAD_INCLUDE_DIRS}") +endif() +if(GTKMM_INCLUDE_DIRS) + include_directories("${GTKMM_INCLUDE_DIRS}") +endif() +if(GTK_INCLUDE_DIRS) + include_directories("${GTK_INCLUDE_DIRS}") +endif() +if(IPTCDATA_INCLUDE_DIRS) + include_directories("${IPTCDATA_INCLUDE_DIRS}") +endif() +if(LCMS_INCLUDE_DIRS) + include_directories("${LCMS_INCLUDE_DIRS}") +endif() +if(LENSFUN_INCLUDE_DIRS) + include_directories("${LENSFUN_INCLUDE_DIRS}") +endif() +if(RSVG_INCLUDE_DIRS) + include_directories("${RSVG_INCLUDE_DIRS}") +endif() if(NOT WITH_SYSTEM_KLT) include_directories("${CMAKE_SOURCE_DIR}/rtengine/klt") else() - include_directories(${KLT_INCLUDE_DIRS}) + include_directories("${KLT_INCLUDE_DIRS}") endif() link_directories("${PROJECT_SOURCE_DIR}/rtexif" - ${EXPAT_LIBRARY_DIRS} - ${EXTRA_LIBDIR} - ${FFTW3F_LIBRARY_DIRS} - ${GLIB2_LIBRARY_DIRS} - ${GLIBMM_LIBRARY_DIRS} - ${GOBJECT_LIBRARY_DIRS} - ${GTHREAD_LIBRARY_DIRS} - ${IPTCDATA_LIBRARY_DIRS} - ${LCMS_LIBRARY_DIRS} - ${LENSFUN_LIBRARY_DIRS} - ${RSVG_LIBRARY_DIRS} + "${EXPAT_LIBRARY_DIRS}" + "${EXTRA_LIBDIR}" + "${FFTW3F_LIBRARY_DIRS}" + "${GLIB2_LIBRARY_DIRS}" + "${GLIBMM_LIBRARY_DIRS}" + "${GOBJECT_LIBRARY_DIRS}" + "${GTHREAD_LIBRARY_DIRS}" + "${IPTCDATA_LIBRARY_DIRS}" + "${LCMS_LIBRARY_DIRS}" + "${LENSFUN_LIBRARY_DIRS}" + "${RSVG_LIBRARY_DIRS}" ) set(CAMCONSTSFILE "camconst.json") @@ -165,13 +190,13 @@ endif() include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") -add_library(rtengine STATIC ${RTENGINESOURCEFILES}) +add_library(rtengine STATIC "${RTENGINESOURCEFILES}") add_dependencies(rtengine UpdateInfo) # It may be nice to store library version too if(BUILD_SHARED_LIBS) - install(TARGETS rtengine DESTINATION ${LIBDIR}) + install(TARGETS rtengine DESTINATION "${LIBDIR}") endif() set_target_properties(rtengine PROPERTIES COMPILE_FLAGS "${RTENGINE_CXX_FLAGS}") diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 6c9105036..fc3b29b9f 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1148,15 +1148,15 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) ipf.ciecam_02float(ncie, float (adap), pW, 2, nprevl, params.get(), customColCurve1, customColCurve2, customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 0 , scale, execsharp, d, dj, yb, 1); - if ((params->colorappearance.autodegree || params->colorappearance.autodegreeout) && acListener && params->colorappearance.enabled) { + if ((params->colorappearance.autodegree || params->colorappearance.autodegreeout) && acListener && params->colorappearance.enabled && !params->colorappearance.presetcat02) { acListener->autoCamChanged(100.* (double)d, 100.* (double)dj); } - if (params->colorappearance.autoadapscen && acListener && params->colorappearance.enabled) { + if (params->colorappearance.autoadapscen && acListener && params->colorappearance.enabled && !params->colorappearance.presetcat02) { acListener->adapCamChanged(adap); //real value of adapt scene } - if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled) { + if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled && !params->colorappearance.presetcat02) { acListener->ybCamChanged((int) yb); //real value Yb scene } } else { @@ -1584,7 +1584,7 @@ void ImProcCoordinator::saveInputICCReference(const Glib::ustring& fname, bool a if (params->wb.method == "Camera") { currWB = imgsrc->getWB(); - } else if (params->wb.method == "Auto") { + } else if (params->wb.method == "autold") { if (lastAwbEqual != params->wb.equal || lastAwbTempBias != params->wb.tempBias) { double rm, gm, bm; imgsrc->getAutoWBMultipliers(rm, gm, bm); diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 40a5ae68a..1dee8375b 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1392,7 +1392,8 @@ ColorAppearanceParams::ColorAppearanceParams() : ybout(18), greenout(1.0), tempsc(5000), - greensc(1.0) + greensc(1.0), + presetcat02(false) { } @@ -1437,7 +1438,8 @@ bool ColorAppearanceParams::operator ==(const ColorAppearanceParams& other) cons && ybout == other.ybout && greenout == other.greenout && tempsc == other.tempsc - && greensc == other.greensc; + && greensc == other.greensc + && presetcat02 == other.presetcat02; } bool ColorAppearanceParams::operator !=(const ColorAppearanceParams& other) const @@ -3233,6 +3235,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->colorappearance.ybout, "Color appearance", "Ybout", colorappearance.ybout, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.datacie, "Color appearance", "Datacie", colorappearance.datacie, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.tonecie, "Color appearance", "Tonecie", colorappearance.tonecie, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.presetcat02, "Color appearance", "Presetcat02", colorappearance.presetcat02, keyFile); const std::map ca_mapping = { {ColorAppearanceParams::TcMode::LIGHT, "Lightness"}, @@ -4225,6 +4228,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Color appearance", "Ybout", pedited, colorappearance.ybout, pedited->colorappearance.ybout); assignFromKeyfile(keyFile, "Color appearance", "Datacie", pedited, colorappearance.datacie, pedited->colorappearance.datacie); assignFromKeyfile(keyFile, "Color appearance", "Tonecie", pedited, colorappearance.tonecie, pedited->colorappearance.tonecie); + assignFromKeyfile(keyFile, "Color appearance", "Presetcat02", pedited, colorappearance.presetcat02, pedited->colorappearance.presetcat02); const std::map tc_mapping = { {"Lightness", ColorAppearanceParams::TcMode::LIGHT}, diff --git a/rtengine/procparams.h b/rtengine/procparams.h index e6828f570..034577cb6 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -680,6 +680,7 @@ struct ColorAppearanceParams { double greenout; int tempsc; double greensc; + bool presetcat02; ColorAppearanceParams(); diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 765d0c0ac..fdc122569 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -43,7 +43,7 @@ #include "rtlensfun.h" #include "../rtgui/options.h" -//#define BENCHMARK +#define BENCHMARK #include "StopWatch.h" #ifdef _OPENMP @@ -4405,7 +4405,7 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double itcwb_delta : 1 by default can be set between 0 to 5 ==> delta temp to build histogram xy - if camera temp is not probably good */ // BENCHFUN - // BENCHFUN + BENCHFUN TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix("sRGB"); diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 4507f2b40..a063d965b 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -1130,7 +1130,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT double cam_g = colorMatrix[1][0] * camwbRed + colorMatrix[1][1] * camwbGreen + colorMatrix[1][2] * camwbBlue; double cam_b = colorMatrix[2][0] * camwbRed + colorMatrix[2][1] * camwbGreen + colorMatrix[2][2] * camwbBlue; currWB = ColorTemp (cam_r, cam_g, cam_b, params.wb.equal); - } else if (params.wb.method == "Auto") { + } else if (params.wb.method == "autold") { currWB = ColorTemp (autoWBTemp, autoWBGreen, wbEqual, "Custom"); } diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index d097ead72..6b9d86baf 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -276,7 +276,7 @@ private: currWB = ColorTemp(); } else if (params.wb.method == "Camera") { currWB = imgsrc->getWB(); - } else if (params.wb.method == "Auto") { + } else if (params.wb.method == "autold") { double rm, gm, bm; imgsrc->getAutoWBMultipliers(rm, gm, bm); currWB.update(rm, gm, bm, params.wb.equal, params.wb.tempBias); diff --git a/rtexif/CMakeLists.txt b/rtexif/CMakeLists.txt index 5a3831455..836f832e2 100644 --- a/rtexif/CMakeLists.txt +++ b/rtexif/CMakeLists.txt @@ -18,12 +18,12 @@ if(WIN32) link_directories(. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}) else() set_target_properties(rtexif PROPERTIES COMPILE_FLAGS " -fPIC") - include_directories(${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}) - link_directories(${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}) + include_directories("${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}") + link_directories("${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}") endif() include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") if(BUILD_SHARED_LIBS) - install(TARGETS rtexif DESTINATION ${LIBDIR}) + install(TARGETS rtexif DESTINATION "${LIBDIR}") endif() diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 4b21ce421..828151338 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -164,13 +164,13 @@ set(NONCLISOURCEFILES zoompanel.cc ) -include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) if(APPLE) find_package(MacIntegration REQUIRED) # At the time of writing CMake has no module finder for gtkmacintegration so here we have it hard-coded, if installed via macports it should be in /opt/local/... - set(EXTRA_LIB_RTGUI ${MacIntegration_LIBRARIES}) - set(EXTRA_INCDIR ${EXTRA_INCDIR} ${MacIntegration_INCLUDE_DIRS}) + set(EXTRA_LIB_RTGUI "${MacIntegration_LIBRARIES}") + set(EXTRA_INCDIR "${EXTRA_INCDIR}" "${MacIntegration_INCLUDE_DIRS}") endif() if(WIN32) @@ -236,16 +236,16 @@ else() endif() # Excluding libatomic needed by Clang/FreeBSD, #3636 -if(OPENMP_FOUND AND NOT APPLE AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") - set(EXTRA_LIB_RTGUI ${EXTRA_LIB_RTGUI} "atomic") +if(OPENMP_FOUND AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + set(EXTRA_LIB_RTGUI "${EXTRA_LIB_RTGUI}" "atomic") endif() # Create config.h which defines where data are stored configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h") # Create new executables targets -add_executable(rth ${EXTRA_SRC_NONCLI} ${NONCLISOURCEFILES}) -add_executable(rth-cli ${EXTRA_SRC_CLI} ${CLISOURCEFILES}) +add_executable(rth "${EXTRA_SRC_NONCLI}" "${NONCLISOURCEFILES}") +add_executable(rth-cli "${EXTRA_SRC_CLI}" "${CLISOURCEFILES}") # Add dependencies to executables targets add_dependencies(rth UpdateInfo) @@ -311,5 +311,5 @@ target_link_libraries(rth-cli rtengine ) # Install executables -install(TARGETS rth DESTINATION ${BINDIR}) -install(TARGETS rth-cli DESTINATION ${BINDIR}) +install(TARGETS rth DESTINATION "${BINDIR}") +install(TARGETS rth-cli DESTINATION "${BINDIR}") diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 9468770fc..eed1c074b 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -25,6 +25,7 @@ #include "guiutils.h" #include "options.h" #include "rtimage.h" +#include "eventmapper.h" #include "../rtengine/color.h" #include "../rtengine/procparams.h" @@ -217,8 +218,16 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" milestones.push_back ( GradientMilestone (0., 0., 0., 0.) ); milestones.push_back ( GradientMilestone (1., 1., 1., 1.) ); + auto m = ProcEventMapper::getInstance(); + Evcatpreset = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CAT02PRESET"); - // ------------------------ Process #1: Converting to CIECAM + //preset button cat02 + presetcat02 = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_PRESETCAT02"))); + presetcat02->set_tooltip_markup (M("TP_COLORAPP_PRESETCAT02_TIP")); + presetcat02conn = presetcat02->signal_toggled().connect( sigc::mem_fun(*this, &ColorAppearance::presetcat02pressed)); + pack_start (*presetcat02, Gtk::PACK_SHRINK); + + // ----------------------- Process #1: Converting to CIECAM // Process 1 frame @@ -801,6 +810,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) tcmodeconn.block (true); tcmode2conn.block (true); tcmode3conn.block (true); + presetcat02conn.block (true); shape->setCurve (pp->colorappearance.curve); shape2->setCurve (pp->colorappearance.curve2); shape3->setCurve (pp->colorappearance.curve3); @@ -808,7 +818,12 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) toneCurveMode2->set_active (toUnderlying(pp->colorappearance.curveMode2)); toneCurveMode3->set_active (toUnderlying(pp->colorappearance.curveMode3)); curveMode3Changed(); // This will set the correct sensitive state of depending Adjusters + presetcat02->set_active(pp->colorappearance.presetcat02); + nexttemp = pp->wb.temperature; + nextgreen = pp->wb.green; + + printf("temp=%f green=%f\n", nexttemp, nextgreen); if (pedited) { degree->setEditedState (pedited->colorappearance.degree ? Edited : UnEdited); degreeout->setEditedState (pedited->colorappearance.degreeout ? Edited : UnEdited); @@ -858,6 +873,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) if (!pedited->colorappearance.curveMode3) { toneCurveMode3->set_active (3); } + presetcat02->set_inconsistent(!pedited->colorappearance.presetcat02); } @@ -993,6 +1009,10 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) ybout->setValue (pp->colorappearance.ybout); tempsc->setValue (pp->colorappearance.tempsc); greensc->setValue (pp->colorappearance.greensc); + presetcat02conn.block (true); + presetcat02->set_active (pp->colorappearance.presetcat02); + presetcat02conn.block (false); + lastpresetcat02 = pp->colorappearance.presetcat02; tcmode3conn.block (false); tcmode2conn.block (false); @@ -1045,6 +1065,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) pp->colorappearance.ybout = ybout->getValue (); pp->colorappearance.tempsc = tempsc->getValue (); pp->colorappearance.greensc = greensc->getValue (); + pp->colorappearance.presetcat02 = presetcat02->get_active(); int tcMode = toneCurveMode->get_active_row_number(); @@ -1114,6 +1135,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) pedited->colorappearance.ybout = ybout->getEditedState (); pedited->colorappearance.tempsc = tempsc->getEditedState (); pedited->colorappearance.greensc = greensc->getEditedState (); + pedited->colorappearance.presetcat02 = presetcat02->get_inconsistent (); } @@ -1309,6 +1331,130 @@ void ColorAppearance::badpix_toggled () { } */ +void ColorAppearance::presetcat02pressed () +{ + if (presetcat02->get_active ()) { + disableListener(); + jlight->resetValue (false); + qbright->resetValue (false); + chroma->resetValue (false); + schroma->resetValue (false); + mchroma->resetValue (false); + rstprotection->resetValue (false); + contrast->resetValue (false); + qcontrast->resetValue (false); + colorh->resetValue (false); + tempout->resetValue (false); + greenout->resetValue (false); + ybout->resetValue (false); + tempsc->resetValue (false); + greensc->resetValue (false); + badpixsl->resetValue (false); + wbmodel->set_active (0); + toneCurveMode->set_active (0); + toneCurveMode2->set_active (0); + toneCurveMode3->set_active (0); + shape->reset(); + shape2->reset(); + shape3->reset(); + gamutconn.block (true); + gamut->set_active (true); + gamutconn.block (false); + degree->setAutoValue (true); + degree->resetValue (false); + adapscen->resetValue (false); + adapscen->setAutoValue (true); + degreeout->resetValue (false); + degreeout->setAutoValue (true); + ybscen->resetValue (false); + ybscen->setAutoValue (true); + surrsrc->set_active (0); + wbmodel->set_active (2); + tempsc->resetValue (false); + greensc->resetValue (false); + adapscen->setValue(400.); + ybscen->setValue(18); + surround->set_active (0); + adaplum->setValue(400.); + degreeout->setValue(70); + ybout->setValue(18); + tempout->setValue (nexttemp); + greenout->setValue (nextgreen); + enableListener(); + } else { + disableListener(); +/* jlight->resetValue (false); + qbright->resetValue (false); + chroma->resetValue (false); + schroma->resetValue (false); + mchroma->resetValue (false); + rstprotection->resetValue (false); + contrast->resetValue (false); + qcontrast->resetValue (false); + colorh->resetValue (false); + tempout->resetValue (false); + greenout->resetValue (false); + ybout->resetValue (false); + tempsc->resetValue (false); + greensc->resetValue (false); + badpixsl->resetValue (false); + wbmodel->set_active (0); + toneCurveMode->set_active (0); + toneCurveMode2->set_active (0); + toneCurveMode3->set_active (0); + shape->reset(); + shape2->reset(); + shape3->reset(); + gamutconn.block (true); + gamut->set_active (true); + gamutconn.block (false); +*/ + degree->setAutoValue (true); + degree->resetValue (false); + adapscen->resetValue (false); + adapscen->setAutoValue (true); + degreeout->resetValue (false); + degreeout->setAutoValue (true); + ybscen->resetValue (false); + ybscen->setAutoValue (true); + surrsrc->set_active (0); + wbmodel->set_active (0); + tempsc->resetValue (false); + greensc->resetValue (false); + adapscen->resetValue (false); + ybscen->resetValue (false); + surround->set_active (0); + adaplum->resetValue (false); + degreeout->resetValue (false); + ybout->resetValue (false); + tempout->resetValue (false); + greenout->resetValue (false); + enableListener(); + + } + if (batchMode) { + if (presetcat02->get_inconsistent()) { + presetcat02->set_inconsistent (false); + presetcat02conn.block (true); + presetcat02->set_active (false); + presetcat02conn.block (false); + } else if (lastpresetcat02) { + presetcat02->set_inconsistent (true); + } + + lastpresetcat02 = presetcat02->get_active (); + } + + if (listener) { + if (presetcat02->get_active ()) { + listener->panelChanged (Evcatpreset, M ("GENERAL_ENABLED")); + } else { + listener->panelChanged (Evcatpreset, M ("GENERAL_DISABLED")); + } + } + +} + void ColorAppearance::datacie_toggled () { @@ -1470,6 +1616,10 @@ void ColorAppearance::autoCamChanged (double ccam, double ccamout) void ColorAppearance::adapCamChanged (double cadap) { + if(presetcat02->get_active()){ + return; + } + idle_register.add( [this, cadap]() -> bool { @@ -1483,6 +1633,10 @@ void ColorAppearance::adapCamChanged (double cadap) void ColorAppearance::ybCamChanged (int ybsc) { + if(presetcat02->get_active()){ + return; + } + idle_register.add( [this, ybsc]() -> bool { diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index c42bca774..7379eb9b0 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -66,7 +66,7 @@ public: bool adapCamComputed_ (); void ybCamChanged (int yb) override; bool ybCamComputed_ (); - + void presetcat02pressed (); void curveChanged (CurveEditor* ce) override; void curveMode1Changed (); bool curveMode1Changed_ (); @@ -99,6 +99,8 @@ public: void writeOptions (std::vector &tpOpen); private: + rtengine::ProcEvent Evcatpreset; + bool bgTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); bool srTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); void foldAllButMe (GdkEventButton* event, MyExpander *expander); @@ -143,6 +145,9 @@ private: Gtk::CheckButton* tonecie; // Gtk::CheckButton* sharpcie; Gtk::Button* neutral; + Gtk::CheckButton* presetcat02; + sigc::connection presetcat02conn; + MyComboBoxText* surrsrc; sigc::connection surrsrcconn; @@ -172,6 +177,9 @@ private: bool lastgamut; bool lastdatacie; bool lasttonecie; + bool lastpresetcat02; + double nexttemp; + double nextgreen; IdleRegister idle_register; }; diff --git a/rtgui/options.h b/rtgui/options.h index c0ed2138b..0bc421300 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -20,7 +20,12 @@ #include #include +#if __has_include() #include +#else +#include +#endif + #include "../rtengine/settings.h" #include diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index f39c73e03..448b1316c 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -247,6 +247,7 @@ void ParamsEdited::set(bool v) colorappearance.ybout = v; colorappearance.tempsc = v; colorappearance.greensc = v; + colorappearance.presetcat02 = v; //colorBoost.amount = v; //colorBoost.avoidclip = v; @@ -837,6 +838,7 @@ void ParamsEdited::initFrom(const std::vector& colorappearance.ybout = colorappearance.ybout && p.colorappearance.ybout == other.colorappearance.ybout; colorappearance.tempsc = colorappearance.tempsc && p.colorappearance.tempsc == other.colorappearance.tempsc; colorappearance.greensc = colorappearance.greensc && p.colorappearance.greensc == other.colorappearance.greensc; + colorappearance.presetcat02 = colorappearance.presetcat02 && p.colorappearance.presetcat02 == other.colorappearance.presetcat02; //colorBoost.amount = colorBoost.amount && p.colorBoost.amount == other.colorBoost.amount; //colorBoost.avoidclip = colorBoost.avoidclip && p.colorBoost.avoidclip == other.colorBoost.avoidclip; @@ -2083,6 +2085,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.colorappearance.tonecie = mods.colorappearance.tonecie; } + if (colorappearance.presetcat02) { + toEdit.colorappearance.presetcat02 = mods.colorappearance.presetcat02; + } + // if (colorappearance.sharpcie) toEdit.colorappearance.sharpcie = mods.colorappearance.sharpcie; if (impulseDenoise.enabled) { toEdit.impulseDenoise.enabled = mods.impulseDenoise.enabled; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 23e90635e..47985400e 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -294,6 +294,7 @@ struct ColorAppearanceParamsEdited { bool ybout; bool tempsc; bool greensc; + bool presetcat02; }; struct DirPyrDenoiseParamsEdited { diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 87bc730eb..7452c9d72 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -216,7 +216,7 @@ const ProcParams& Thumbnail::getProcParamsU () double ct; getCamWB (ct, pparams->wb.green); pparams->wb.temperature = ct; - } else if (pparams->wb.method == "Auto") { + } else if (pparams->wb.method == "autold") { double ct; getAutoWB (ct, pparams->wb.green, pparams->wb.equal, pparams->wb.tempBias); pparams->wb.temperature = ct; diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 9a5f1a398..5d1c907df 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -897,7 +897,7 @@ int WhiteBalance::_setActiveMethod(Glib::ustring &label, Gtk::TreeModel::Childre if (row[methodColumns.colLabel] == label) { method->set_active(iter); - found = method->get_active_row_number(); + found = row[methodColumns.colId]; } if (found != -1) { diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 2352133a9..9258810c0 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -404,6 +404,7 @@ function CreateDmg { # Zip disk image for redistribution msg "Zipping disk image for redistribution:" + zip "${dmg_name}.zip" "${dmg_name}.dmg" rm "${dmg_name}.dmg" msg "Removing disk image caches:" rm -rf "${srcDir}"