Merge branch 'dev' into spot-removal-tool

This commit is contained in:
Hombre 2020-05-18 14:54:30 +02:00
commit f42548b018
306 changed files with 20836 additions and 10481 deletions

96
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,96 @@
name: macOS build
on:
push:
branches:
- dev
- patch**
- newlocallab
pull_request:
branches:
- dev
- newlocallab
release:
types:
- created
jobs:
build:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
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/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: >
-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)
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_VERBOSE_MAKEFILE:BOOL=ON \
-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="1" \
-DPROC_LABEL="generic processor" \
-DWITH_LTO="OFF" \
-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}" \
-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 \
..
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"'

View File

@ -13,3 +13,7 @@ Build flags: ${CXX_FLAGS}
Link flags: ${LFLAGS}
OpenMP support: ${OPTION_OMP}
MMAP support: ${WITH_MYFILE_MMAP}
Build OS: ${BUILDINFO_OS}
Build date: ${BUILDINFO_DATE} UTC
Build epoch: ${BUILDINFO_EPOCH}
Build UUID: ${BUILDINFO_UUID}

View File

@ -1,13 +1,21 @@
# 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:
if(${CMAKE_EXTRA_GENERATOR} MATCHES "Eclipse CDT4")
set(CMAKE_CXX_COMPILER_ARG1 "-std=c++11" CACHE STRING "C++ version for eclipse" FORCE)
set(CMAKE_CXX_COMPILER_ARG1
"-std=c++11"
CACHE STRING "C++ version for eclipse" FORCE)
# Users building with Eclipse should set CMAKE_ECLIPSE_VERSION through the
# command line to their current version of Eclipse:
# set(CMAKE_ECLIPSE_VERSION "4.6.0" CACHE STRING "Eclipse version" FORCE)
@ -17,7 +25,10 @@ project(RawTherapee)
# The default target is Debug:
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "One of: None Debug Release RelWithDebInfo MinSizeRel" FORCE)
set(CMAKE_BUILD_TYPE
Debug
CACHE STRING "One of: None Debug Release RelWithDebInfo MinSizeRel"
FORCE)
endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
@ -26,11 +37,15 @@ string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
message(FATAL_ERROR "Building RawTherapee requires using GCC version 4.9 or higher!")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION
VERSION_LESS "4.9")
message(
FATAL_ERROR
"Building RawTherapee requires using GCC version 4.9 or higher!")
endif()
# We might want to build using the old C++ ABI, even when using a new GCC version:
# We might want to build using the old C++ ABI, even when using a new GCC
# version:
if(USE_OLD_CXX_ABI)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
endif()
@ -46,22 +61,39 @@ message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
# Cache name suffix examples: "" = ~/.config/RawTherapee, "5" = ~/.config/RawTherapee-5, "_testing" = ~/.config/RawTherapee_testing
# Use "" for stable releases and "5-dev" for anything else.
set(CACHE_NAME_SUFFIX "" CACHE STRING "RawTherapee's cache folder suffix")
# Cache name suffix examples: "" = ~/.config/RawTherapee, "5" =
# ~/.config/RawTherapee-5, "_testing" = ~/.config/RawTherapee_testing Use "" for
# stable releases and "5-dev" for anything else.
set(CACHE_NAME_SUFFIX
""
CACHE STRING "RawTherapee's cache folder suffix")
# By default we don't use a specific processor target, so PROC_TARGET_NUMBER is set to 0.
# Specify other values to optimize for specific processor architecture as listed in ProcessorTargets.cmake:
set(PROC_TARGET_NUMBER 0 CACHE STRING "Selected target processor from the list above (taken from ProcessorTargets.cmake)")
# By default we don't use a specific processor target, so PROC_TARGET_NUMBER is
# set to 0. Specify other values to optimize for specific processor architecture
# as listed in ProcessorTargets.cmake:
set(PROC_TARGET_NUMBER
0
CACHE
STRING
"Selected target processor from the list above (taken from ProcessorTargets.cmake)"
)
# Set special compilation flags for rtengine which get added to CMAKE_CXX_FLAGS:
# Some Linux distros build with -O2 instead of -O3. We explicitly enable auto vectorization by using -ftree-vectorize
set(RTENGINE_CXX_FLAGS "-ftree-vectorize" CACHE STRING "Special compilation flags for RTEngine")
# Some Linux distros build with -O2 instead of -O3. We explicitly enable auto
# vectorization by using -ftree-vectorize
set(RTENGINE_CXX_FLAGS
"-ftree-vectorize"
CACHE STRING "Special compilation flags for RTEngine")
# Loads the ProcessorTargets list:
include(ProcessorTargets.cmake)
set(PROC_LABEL "undefined" CACHE STRING "Target processor label, unused if PROC_TARGET_NUMBER = 0 or 2")
set(PROC_FLAGS "" CACHE STRING "Target processor related build/link flags")
set(PROC_LABEL
"undefined"
CACHE STRING
"Target processor label, unused if PROC_TARGET_NUMBER = 0 or 2")
set(PROC_FLAGS
""
CACHE STRING "Target processor related build/link flags")
if((NOT (PROC_TARGET_NUMBER EQUAL 0)) AND (NOT (PROC_TARGET_NUMBER EQUAL 2)))
set(PROC_LABEL ${PROC_TARGET_${PROC_TARGET_NUMBER}_LABEL})
endif()
@ -69,7 +101,10 @@ if(NOT(PROC_TARGET_NUMBER EQUAL 0))
set(PROC_FLAGS ${PROC_TARGET_${PROC_TARGET_NUMBER}_FLAGS})
endif()
if(UNIX AND PROC_LABEL STREQUAL "undefined")
execute_process(COMMAND uname -p OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE cpu)
execute_process(
COMMAND uname -p
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE cpu)
if("${cpu}" STREQUAL "unknown")
set(PROC_LABEL "${CMAKE_SYSTEM_PROCESSOR}")
else()
@ -77,7 +112,8 @@ if(UNIX AND PROC_LABEL STREQUAL "undefined")
endif()
endif()
# If PROC_FORCED_LABEL exists, its value is loaded in PROC_LABEL to override the one from ProcessorTargets:
# If PROC_FORCED_LABEL exists, its value is loaded in PROC_LABEL to override the
# one from ProcessorTargets:
if(DEFINED PROC_FORCED_LABEL)
set(PROC_LABEL ${PROC_FORCED_LABEL})
endif()
@ -87,10 +123,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PROC_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PROC_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PROC_FLAGS}")
# Stop compilation on typos such as std:swap (missing colon will be detected as unused label):
# Stop compilation on typos such as std:swap (missing colon will be detected as
# unused label):
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-label")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=delete-incomplete")
# Do net set math errno, as we never check its value.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-math-errno")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-math-errno")
# Special treatment for x87 and x86-32 SSE (see GitHub issue #4324)
include(FindX87Math)
if(HAVE_X87_MATH)
@ -106,21 +147,35 @@ endif()
include(FindUnalignedMalloc)
if(WIN32)
# Add additional paths. Look in the MinGW path first, then in the Gtkmm path.
# If you wish to build some dependent libraries, you have to install them in MinGW to use them:
set(CMAKE_PREFIX_PATH $ENV{MINGW_BASEPATH} $ENV{GTKMM_BASEPATH} CACHE STRING "Additional search paths")
# Add additional paths. Look in the MinGW path first, then in the Gtkmm
# path. If you wish to build some dependent libraries, you have to install
# them in MinGW to use them:
set(CMAKE_PREFIX_PATH
$ENV{MINGW_BASEPATH} $ENV{GTKMM_BASEPATH}
CACHE STRING "Additional search paths")
endif()
if(APPLE)
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 "${CMAKE_EXE_LINKER_FLAGS} /usr/lib/libstdc++.6.dylib")
message(STATUS "CMAKE_CXX_COMPILER is MacPorts GCC.\n CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
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
"${CMAKE_EXE_LINKER_FLAGS} /usr/lib/libstdc++.6.dylib -Wl,-headerpad_max_install_names -mtune=generic"
)
message(
STATUS
"CMAKE_CXX_COMPILER is MacPorts GCC.\n CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}"
)
endif()
# Set minimum system version
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.9")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -headerpad_max_install_names")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}"
)
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-headerpad_max_install_names -mtune=generic"
)
endif()
option(USE_EXPERIMENTAL_LANG_VERSIONS "Build with -std=c++0x" OFF)
@ -132,34 +187,54 @@ option(WITH_SAN "Build with run-time sanitizer" OFF)
option(WITH_PROF "Build with profiling instrumentation" OFF)
option(WITH_SYSTEM_KLT "Build using system KLT library." OFF)
option(OPTION_OMP "Build with OpenMP support" ON)
option(STRICT_MUTEX "True (recommended): MyMutex will behave like POSIX Mutex; False: MyMutex will behave like POSIX RecMutex; Note: forced to ON for Debug builds" ON)
option(TRACE_MYRWMUTEX "Trace custom R/W Mutex (Debug builds only); redirecting std::out to a file is strongly recommended!" OFF)
option(AUTO_GDK_FLUSH "Use gdk_flush on all gdk_thread_leave other than the GUI thread; set it ON if you experience X Server warning/errors" OFF)
#option(TARGET32BIT "Build for 32-bit architecture when ON, otherwise 64-bit. Default is OFF" OFF)
option(
STRICT_MUTEX
"True (recommended): MyMutex will behave like POSIX Mutex; False: MyMutex will behave like POSIX RecMutex; Note: forced to ON for Debug builds"
ON)
option(
TRACE_MYRWMUTEX
"Trace custom R/W Mutex (Debug builds only); redirecting std::out to a file is strongly recommended!"
OFF)
option(
AUTO_GDK_FLUSH
"Use gdk_flush on all gdk_thread_leave other than the GUI thread; set it ON if you experience X Server warning/errors"
OFF)
# option(TARGET32BIT "Build for 32-bit architecture when ON, otherwise 64-bit.
# Default is OFF" OFF)
option(ENABLE_TCMALLOC "Use the tcmalloc library if available" OFF)
set(TCMALLOC_LIB_DIR "" CACHE PATH "Custom path for the tcmalloc library")
set(TCMALLOC_LIB_DIR
""
CACHE PATH "Custom path for the tcmalloc library")
# Set installation directories:
if(WIN32 OR APPLE)
if(BUILD_BUNDLE)
message(STATUS "You have set BUILD_BUNDLE=ON but this is not necessary - the option is forced to ON for Windows and macOS.")
message(
STATUS
"You have set BUILD_BUNDLE=ON but this is not necessary - the option is forced to ON for Windows and macOS."
)
endif()
set(BUILD_BUNDLE ON FORCE)
endif()
if(NOT DEFINED BUNDLE_BASE_INSTALL_DIR)
if(APPLE)
set(BUNDLE_BASE_INSTALL_DIR "${CMAKE_BINARY_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()
endif()
if(BUILD_BUNDLE)
if(APPLE)
set(BINDIR "${BUNDLE_BASE_INSTALL_DIR}")
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/build")
else()
set(BINDIR .)
set(CMAKE_INSTALL_PREFIX "${BUNDLE_BASE_INSTALL_DIR}")
endif()
endif()
if(NOT DEFINED BINDIR)
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
@ -168,7 +243,7 @@ endif()
if(NOT DEFINED DATADIR)
if(BUILD_BUNDLE)
if(APPLE)
set(DATADIR "../../Resources")
set(DATADIR "${PROJECT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/Resources/share")
else()
set(DATADIR .)
endif()
@ -180,7 +255,7 @@ endif()
if(NOT DEFINED LIBDIR)
if(BUILD_BUNDLE)
if(APPLE)
set(LIBDIR "../../Frameworks")
set(LIBDIR "${PROJECT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/Frameworks")
else()
set(LIBDIR .)
endif()
@ -200,7 +275,11 @@ endif()
if(NOT DEFINED DOCDIR)
if(BUILD_BUNDLE)
if(APPLE)
set(DOCDIR "${DATADIR}/doc")
else()
set(DOCDIR "${DATADIR}/share/doc")
endif()
else()
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee")
endif()
@ -208,7 +287,11 @@ endif()
if(NOT DEFINED CREDITSDIR)
if(BUILD_BUNDLE)
if(APPLE)
set(CREDITSDIR "${DATADIR}")
else()
set(CREDITSDIR "${DATADIR}")
endif()
else()
set(CREDITSDIR "${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee")
endif()
@ -216,7 +299,11 @@ endif()
if(NOT DEFINED LICENCEDIR)
if(BUILD_BUNDLE)
if(APPLE)
set(LICENCEDIR "${CREDITSDIR}")
else()
set(LICENCEDIR "${DATADIR}")
endif()
else()
set(LICENCEDIR "${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee")
endif()
@ -225,7 +312,11 @@ endif()
if(NOT DEFINED DESKTOPDIR)
if(UNIX)
if(BUILD_BUNDLE)
if(APPLE)
set(DESKTOPDIR "${DATADIR}/applications")
else()
set(DESKTOPDIR "${DATADIR}/share/applications")
endif()
else()
set(DESKTOPDIR "${CMAKE_INSTALL_PREFIX}/share/applications")
endif()
@ -235,7 +326,11 @@ endif()
if(NOT DEFINED ICONSDIR)
if(UNIX)
if(BUILD_BUNDLE)
if(APPLE)
set(ICONSDIR "${DATADIR}/icons")
else()
set(ICONSDIR "${DATADIR}/share/icons")
endif()
else()
set(ICONSDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
endif()
@ -245,32 +340,59 @@ endif()
if(NOT DEFINED APPDATADIR)
if(UNIX)
if(BUILD_BUNDLE)
if(APPLE)
set(APPDATADIR "${DATADIR}/metainfo")
else()
set(APPDATADIR "${DATADIR}/share/metainfo")
endif()
else()
set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/metainfo")
endif()
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")
set(CODESIGNID
"${CODESIGNID}"
CACHE STRING "Codesigning Identity")
endif()
if("${NOTARY}")
set(NOTARY "${NOTARY}" CACHE STRING "Notarization Identity")
set(NOTARY
"${NOTARY}"
CACHE STRING "Notarization Identity")
endif()
if("${LOCAL_PREFIX}")
set(LOCAL_PREFIX
"${LOCAL_PREFIX}"
CACHE STRING "macos/gtk parent directory ie /usr or /opt")
else()
set(LOCAL_PREFIX
/usr
CACHE STRING "macos/gtk parent directory ie /usr or /opt")
endif()
if("${FANCY_DMG}")
set(FANCY_DMG
ON
CACHE BOOL
"Use the andreyvit/create-dmg script to make a fancy .dmg")
endif()
endif()
# Enforce absolute paths for non-bundle builds:
if(NOT BUILD_BUNDLE)
foreach(path BINDIR DATADIR LIBDIR DOCDIR CREDITSDIR LICENCEDIR)
if(NOT (IS_ABSOLUTE "${${path}}"))
message(FATAL_ERROR "The ${path} path has to be absolute when using -DBUILD_BUNDLE=OFF")
message(
FATAL_ERROR
"The ${path} path has to be absolute when using -DBUILD_BUNDLE=OFF"
)
endif()
endforeach()
endif()
@ -312,7 +434,14 @@ if(GTK_VERSION VERSION_GREATER "3.24.1" AND GTK_VERSION VERSION_LESS "3.24.7")
else()
set(CERTAINTY "likely to")
endif()
message(WARNING "\nWarning! You are using GTK+ version " ${GTK_VERSION} " which is " ${CERTAINTY} " have an issue where combobox menu scroll-arrows are missing when a Gtk::ComboBox list does not fit vertically on the screen. As a result, users of your build will not be able to select items in the following comboboxes: Processing Profiles, Film Simulation, and the camera and lens profiles in Profiled Lens Correction.\nIt is recommended that you either downgrade GTK+ to <= 3.24.1 or upgrade to >= 3.24.7.")
message(
WARNING
"\nWarning! You are using GTK+ version "
${GTK_VERSION}
" which is "
${CERTAINTY}
" have an issue where combobox menu scroll-arrows are missing when a Gtk::ComboBox list does not fit vertically on the screen. As a result, users of your build will not be able to select items in the following comboboxes: Processing Profiles, Film Simulation, and the camera and lens profiles in Profiled Lens Correction.\nIt is recommended that you either downgrade GTK+ to <= 3.24.1 or upgrade to >= 3.24.7."
)
endif()
pkg_check_modules(GLIB2 REQUIRED glib-2.0>=2.44)
@ -362,9 +491,12 @@ endif()
if(WITH_LTO)
# Using LTO with older versions of binutils requires setting extra flags
set(BINUTILS_VERSION_MININUM "2.29")
execute_process(COMMAND ar --version OUTPUT_VARIABLE BINUTILS_VERSION_DETECTED)
string(REGEX REPLACE ".* ([0-9.]+)\n.*" "\\1" BINUTILS_VERSION_DETECTED "${BINUTILS_VERSION_DETECTED}")
if("${BINUTILS_VERSION_DETECTED}" VERSION_LESS "${BINUTILS_VERSION_MININUM}")
execute_process(COMMAND ar --version
OUTPUT_VARIABLE BINUTILS_VERSION_DETECTED)
string(REGEX REPLACE ".* ([0-9.]+)\n.*" "\\1" BINUTILS_VERSION_DETECTED
"${BINUTILS_VERSION_DETECTED}")
if("${BINUTILS_VERSION_DETECTED}" VERSION_LESS
"${BINUTILS_VERSION_MININUM}")
if(APPLE)
if(!CMAKE_AR)
set(CMAKE_AR "/opt/local/bin/ar")
@ -376,7 +508,15 @@ if(WITH_LTO)
set(CMAKE_AR "/usr/bin/gcc-ar")
set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")
endif()
message(STATUS "Binutils version detected as less than " ${BINUTILS_VERSION_MININUM} " - setting CMake parameters to enable LTO linking:\n CMAKE_AR=\"" ${CMAKE_AR} "\"\n CMAKE_RANLIB=\"" ${CMAKE_RANLIB} "\"")
message(
STATUS
"Binutils version detected as less than "
${BINUTILS_VERSION_MININUM}
" - setting CMake parameters to enable LTO linking:\n CMAKE_AR=\""
${CMAKE_AR}
"\"\n CMAKE_RANLIB=\""
${CMAKE_RANLIB}
"\"")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
@ -387,7 +527,8 @@ endif()
if(WITH_SAN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${WITH_SAN}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${WITH_SAN}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${WITH_SAN}")
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${WITH_SAN}")
endif()
if(WITH_PROF)
@ -396,11 +537,14 @@ 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)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -Werror=unknown-pragmas")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -Werror=unknown-pragmas")
endif()
endif()
@ -420,7 +564,8 @@ int main()
fftwf_init_threads();
fftwf_plan_with_nthreads(1);
return 0;
}" _fftw3f_multithread)
}"
_fftw3f_multithread)
if(_fftw3f_multithread)
add_definitions(-DRT_FFTW3F_OMP)
else()
@ -438,30 +583,41 @@ get_filename_component(ABS_BINARY_DIR "${CMAKE_BINARY_DIR}" ABSOLUTE)
set(OUT_OF_SOURCE_BUILD TRUE)
if(ABS_SOURCE_DIR STREQUAL ABS_BINARY_DIR)
set(OUT_OF_SOURCE_BUILD FALSE)
message(WARNING "You are performing an in-source build. This is discouraged. For an explanation and the advantages of out-of-source builds, please refer to http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F")
message(
WARNING
"You are performing an in-source build. This is discouraged. For an explanation and the advantages of out-of-source builds, please refer to http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F"
)
endif()
# Remove files which could require manual work.
# We will remove this after some time to have a clean build system without file modifications in the source tree again. (?)
set(OOSB_FILES "${PROJECT_SOURCE_DIR}/rtdata/rawtherapee.desktop" "${PROJECT_SOURCE_DIR}/rtgui/version.h" "${PROJECT_SOURCE_DIR}/rtgui/config.h" "${PROJECT_SOURCE_DIR}/AboutThisBuild.txt")
# Remove files which could require manual work. We will remove this after some
# time to have a clean build system without file modifications in the source
# tree again. (?)
set(OOSB_FILES
"${PROJECT_SOURCE_DIR}/rtdata/rawtherapee.desktop"
"${PROJECT_SOURCE_DIR}/rtgui/version.h"
"${PROJECT_SOURCE_DIR}/rtgui/config.h"
"${PROJECT_SOURCE_DIR}/AboutThisBuild.txt")
if(OUT_OF_SOURCE_BUILD)
foreach(f ${OOSB_FILES})
file(REMOVE "${f}")
endforeach()
endif()
# Check for generated files in the source tree which should not be there when doing an out-of-source build.
# Without checking for this it might happen that old versions are used for the compilation:
# Check for generated files in the source tree which should not be there when
# doing an out-of-source build. Without checking for this it might happen that
# old versions are used for the compilation:
if(OUT_OF_SOURCE_BUILD)
foreach(f ${OOSB_FILES})
if(EXISTS "${f}")
message(SEND_ERROR "Generated \"${f}\" found inside the source tree. Please remove it as it is a relic of the old build system and prevents valid compilation now.")
message(
SEND_ERROR
"Generated \"${f}\" found inside the source tree. Please remove it as it is a relic of the old build system and prevents valid compilation now."
)
endif()
endforeach()
endif()
### Start generating AboutThisBuild.txt
# Set the platform bit-depth:
# Start generating AboutThisBuild.txt Set the platform bit-depth:
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(PROC_BIT_DEPTH 32 bits)
else()
@ -469,21 +625,27 @@ else()
endif()
# Get compiler name and version.
# Only CMake > 2.8.7 knows CMAKE_*_COMPILER_VERSION
if(CMAKE_VERSION VERSION_GREATER 2.8.7)
get_filename_component(COMPILER_INFO ${CMAKE_C_COMPILER} NAME_WE)
set(COMPILER_INFO "${COMPILER_INFO} ${CMAKE_C_COMPILER_VERSION}")
else()
execute_process(COMMAND gcc -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT APPLE)
execute_process(
COMMAND gcc -dumpversion
OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
set(COMPILER_INFO "gcc ${GCC_VERSION}")
endif()
# Get C++ and linker flags for rtengine (the GUI's C++ flags may have fewer flags):
set(CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CMAKE_BUILD_TYPE}} ${RTENGINE_CXX_FLAGS}")
set(LFLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${UPPER_CMAKE_BUILD_TYPE}}")
# Get C++ and linker flags for rtengine (the GUI's C++ flags may have fewer
# flags):
set(CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CMAKE_BUILD_TYPE}} ${RTENGINE_CXX_FLAGS}"
)
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}
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}"
@ -492,45 +654,69 @@ set(ABOUT_COMMAND_WITH_ARGS ${CMAKE_COMMAND}
-DOPTION_OMP:STRING=${OPTION_OMP}
-DWITH_MYFILE_MMAP:STRING=${WITH_MYFILE_MMAP}
-DLENSFUN_VERSION:STRING=${LENSFUN_VERSION})
endif()
if(WIN32)
list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Windows
list(
APPEND
ABOUT_COMMAND_WITH_ARGS
-DSYSTEM:STRING=Windows
-DCXX_FLAGS:STRING="${CXX_FLAGS}"
-DLFLAGS:STRING="${LFLAGS}"
-DCOMPILER_INFO:STRING="${COMPILER_INFO}"
-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
set(
ABOUT_COMMAND_WITH_ARGS
cmake
-DPROJECT_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR}
-DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX}
-P ${PROJECT_SOURCE_DIR}/UpdateInfo.cmake
-DSYSTEM:STRING=Apple
-DCXX_FLAGS:STRING=${CXX_FLAGS}
-DLFLAGS:STRING=${LFLAGS}
-DCOMPILER_INFO:STRING=${COMPILER_INFO})
else()
list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Linux
-DCXX_FLAGS:STRING=${CXX_FLAGS}
-DLFLAGS:STRING=${LFLAGS}
-DCXX_FLAGS:STRING=${CXX_FLAGS} -DLFLAGS:STRING=${LFLAGS}
-DCOMPILER_INFO:STRING=${COMPILER_INFO})
endif()
if(NOT APPLE)
list(APPEND
ABOUT_COMMAND_WITH_ARGS
-P "${PROJECT_SOURCE_DIR}/UpdateInfo.cmake")
endif()
list(APPEND ABOUT_COMMAND_WITH_ARGS -P "${PROJECT_SOURCE_DIR}/UpdateInfo.cmake")
add_custom_target(UpdateInfo ALL
add_custom_target(
UpdateInfo ALL
COMMAND ${ABOUT_COMMAND_WITH_ARGS}
COMMENT "Creating AboutThisBuild.txt and other version-dependent files")
### End generating AboutThisBuild.txt
# End generating AboutThisBuild.txt
install(FILES AUTHORS.txt DESTINATION "${CREDITSDIR}")
install(FILES LICENSE.txt DESTINATION "${LICENCEDIR}")
install(FILES "${CMAKE_BINARY_DIR}/AboutThisBuild.txt" DESTINATION "${CREDITSDIR}")
install(FILES RELEASE_NOTES.txt DESTINATION "${CREDITSDIR}" OPTIONAL)
install(FILES "${CMAKE_BINARY_DIR}/AboutThisBuild.txt"
DESTINATION "${CREDITSDIR}")
install(
FILES RELEASE_NOTES.txt
DESTINATION "${CREDITSDIR}"
OPTIONAL)
# The standard location for man pages in Linux is /usr/share/man
# Use "manpath" to see the search paths for man pages on your system.
# The standard location for man pages in Linux is /usr/share/man Use "manpath"
# to see the search paths for man pages on your system.
if(BUILD_BUNDLE)
install(FILES "${PROJECT_SOURCE_DIR}/doc/manpage/rawtherapee.1" DESTINATION "${DATADIR}/share/man/man1")
if(APPLE)
install(FILES "${PROJECT_SOURCE_DIR}/doc/manpage/rawtherapee.1"
DESTINATION "${DATADIR}/man/man1")
else()
install(FILES "${PROJECT_SOURCE_DIR}/doc/manpage/rawtherapee.1" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1")
install(FILES "${PROJECT_SOURCE_DIR}/doc/manpage/rawtherapee.1"
DESTINATION "${DATADIR}/share/man/man1")
endif()
else()
install(FILES "${PROJECT_SOURCE_DIR}/doc/manpage/rawtherapee.1"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1")
endif()
if(WIN32)
@ -538,7 +724,8 @@ if(WIN32)
endif()
if(UNIX)
install(FILES com.rawtherapee.RawTherapee.appdata.xml DESTINATION "${APPDATADIR}")
install(FILES com.rawtherapee.RawTherapee.appdata.xml
DESTINATION "${APPDATADIR}")
endif()
# check whether the used version of lensfun has lfDatabase::LoadDirectory
@ -566,26 +753,31 @@ int main()
lfDatabase *db = 0;
bool b = db->LoadDirectory(0);
return 0;
}" LENSFUN_HAS_LOAD_DIRECTORY)
}"
LENSFUN_HAS_LOAD_DIRECTORY)
set(TCMALLOC_LIB_DIR)
if(ENABLE_TCMALLOC)
if(TCMALLOC_LIB_DIR)
find_library(TCMALLOC_LIBRARIES tcmalloc PATHS ${TCMALLOC_LIB_DIR} NO_DEFAULT_PATH)
find_library(TCMALLOC_LIBRARIES tcmalloc PATHS ${TCMALLOC_LIB_DIR}
NO_DEFAULT_PATH)
else()
find_library(TCMALLOC_LIBRARIES tcmalloc)
endif()
if(TCMALLOC_LIBRARIES)
message(STATUS "using tcmalloc library in ${TCMALLOC_LIBRARIES}")
else()
set(TCMALLOC_LIBRARIES "" CACHE INTERNAL "" FORCE)
set(TCMALLOC_LIBRARIES
""
CACHE INTERNAL "" FORCE)
message(STATUS "tcmalloc not found")
endif()
else()
set(TCMALLOC_LIBRARIES "" CACHE INTERNAL "" FORCE)
set(TCMALLOC_LIBRARIES
""
CACHE INTERNAL "" FORCE)
endif()
add_subdirectory(rtexif)
add_subdirectory(rtengine)
add_subdirectory(rtgui)

View File

@ -1,6 +1,6 @@
RawTherapee - A powerful, cross-platform raw image processing program.
Copyright (C) 2004-2012 Gabor Horvath <hgabor@rawtherapee.com>
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

View File

@ -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:

View File

@ -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)
@ -10,10 +14,10 @@ if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
find_program(GIT_CMD git PATHS "/opt/local/bin" "/usr/local/bin" "/usr/bin")
find_program(GIT_CMD git)
set(SHELL "/bin/bash")
else(WIN32) # Linux
else() # Linux
find_program(GIT_CMD git)
set(SHELL "/bin/bash")
endif(WIN32)
endif()
# Fail if Git is not installed
if(GIT_CMD STREQUAL GIT_CMD-NOTFOUND)
@ -64,6 +68,10 @@ if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
set(GIT_NUMERIC_VERSION_BS "${GIT_NUMERIC_VERSION_BS}.${GIT_COMMITS_SINCE_TAG}")
endif()
execute_process(COMMAND uname -mrs OUTPUT_VARIABLE BUILDINFO_OS OUTPUT_STRIP_TRAILING_WHITESPACE)
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}")
@ -72,6 +80,11 @@ if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
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} UTC")
message(STATUS " Epoch: ${BUILDINFO_EPOCH}")
message(STATUS " UUID: ${BUILDINFO_UUID}")
if(NOT DEFINED CACHE_NAME_SUFFIX)
set(CACHE_NAME_SUFFIX "${GIT_DESCRIBE}")
@ -79,10 +92,9 @@ if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
else()
message(STATUS "CACHE_NAME_SUFFIX is \"${CACHE_NAME_SUFFIX}\"")
endif()
else(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
else()
include("${PROJECT_SOURCE_DIR}/ReleaseInfo.cmake")
endif(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
endif()
if(WIN32)
if(BIT_DEPTH EQUAL 4)
@ -97,12 +109,12 @@ if(WIN32)
set(ARCHITECTURE_ALLOWED "x64 ia64")
# installing in 64 bits mode for all 64 bits processors, even for itanium architecture
set(INSTALL_MODE "x64 ia64")
endif(BIT_DEPTH EQUAL 4)
endif()
# set part of the output archive name
set(SYSTEM_NAME "WinVista")
configure_file("${PROJECT_SOURCE_DIR}/tools/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_BINARY_DIR}/rtdata/WindowsInnoSetup.iss")
endif(WIN32)
endif()
# build version.h from template
configure_file("${PROJECT_SOURCE_DIR}/rtgui/version.h.in" "${CMAKE_BINARY_DIR}/rtgui/version.h")

View File

@ -24,7 +24,7 @@ mark_as_advanced(MACINTEGRATION_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set MACINTEGRATION_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MACINTEGRATION DEFAULT_MSG MACINTEGRATION_LIBRARY MACINTEGRATION_INCLUDE_DIR)
find_package_handle_standard_args(MacIntegration DEFAULT_MSG MACINTEGRATION_LIBRARY MACINTEGRATION_INCLUDE_DIR)
if(MACINTEGRATION_FOUND)
set(MacIntegration_LIBRARIES ${MACINTEGRATION_LIBRARY})

View File

@ -19,13 +19,12 @@
<url type="donation">https://www.paypal.me/rawtherapee</url>
<url type="help">https://rawpedia.rawtherapee.com</url>
<url type="homepage">https://www.rawtherapee.com</url>
<url type="translate">https://discuss.pixls.us/t/localization-how-to-translate-rawtherapee-and-rawpedia/2594</url>
<url type="translate">https://rawpedia.rawtherapee.com/Main_Page#Localization</url>
<launchable type="desktop-id">rawtherapee.desktop</launchable>
<releases>
<release version="5.8" date="2020-02-04" type="stable"></release>
<release version="5.7" date="2019-09-10" type="stable"></release>
<release version="5.6" date="2019-04-20" type="stable"></release>
<release version="5.6~rc2" date="2019-04-17" type="development"></release>
<release version="5.6~rc1" date="2019-04-10" type="development"></release>
<release version="5.5" date="2018-12-17" type="stable"></release>
</releases>
<provides>

View File

@ -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")
@ -44,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")
@ -54,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 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()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24px"
height="24px"
viewBox="0 0 24 24"
version="1.1"
id="SVGRoot"
inkscape:export-filename="/tmp/template.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="questionmark.svg">
<sodipodi:namedview
id="base"
pagecolor="#E0E1E2"
bordercolor="#666768"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="17.125"
inkscape:cx="2.4963333"
inkscape:cy="9.7590888"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:window-width="1920"
inkscape:window-height="1021"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:grid-bbox="true"
inkscape:pagecheckerboard="false"
inkscape:snap-bbox="true"
inkscape:bbox-nodes="true"
inkscape:snap-others="false"
inkscape:object-nodes="false"
inkscape:snap-grids="true"
inkscape:snap-bbox-midpoints="true">
<inkscape:grid
type="xygrid"
id="grid1374"
originx="1"
originy="1"
empspacing="11"
dotted="false" />
</sodipodi:namedview>
<defs
id="defs815" />
<metadata
id="metadata818">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Maciej Dworak</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:rights>
<dc:description>RawTherapee icon.</dc:description>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1">
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:18.52196503px;line-height:125%;font-family:Georgia;-inkscape-font-specification:'Georgia Bold';letter-spacing:0px;word-spacing:0px;opacity:0.7;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-11.29845"
y="19"
id="text821"><tspan
sodipodi:role="line"
id="tspan819"
x="-11.29845"
y="19"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:18.52196503px;font-family:Georgia;-inkscape-font-specification:'Georgia Bold';fill:#ffffff;stroke-width:1px">?</tspan></text>
<path
style="opacity:0.7;fill:#2a7fff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 12 1 A 11 11 0 0 0 1 12 A 11 11 0 0 0 12 23 A 11 11 0 0 0 23 12 A 11 11 0 0 0 12 1 z M 11.804688 5.3027344 C 13.125101 5.3027344 14.193859 5.6466458 15.007812 6.3339844 C 15.827796 7.021323 16.236328 7.9291641 16.236328 9.0566406 C 16.236328 10.268527 15.820323 11.250246 14.988281 12.003906 C 14.156239 12.757567 13.046892 13.188348 11.660156 13.296875 L 11.607422 14.527344 L 10.800781 14.527344 L 10.800781 11.009766 C 11.675027 10.937414 12.361067 10.663813 12.855469 10.1875 C 13.349871 9.705157 13.595703 9.0506215 13.595703 8.2246094 C 13.595703 7.5674173 13.421964 7.0422942 13.072266 6.6503906 C 12.728596 6.2524578 12.264528 6.0527344 11.679688 6.0527344 C 11.432487 6.0527344 11.212469 6.0805023 11.019531 6.1347656 C 10.826594 6.1829996 10.639863 6.2625663 10.458984 6.3710938 C 10.519278 6.5640309 10.587635 6.8136002 10.666016 7.1210938 C 10.750426 7.422558 10.792969 7.7016782 10.792969 7.9609375 C 10.792969 8.3829875 10.6543 8.7121235 10.376953 8.9472656 C 10.105635 9.1763785 9.7247003 9.2910156 9.2363281 9.2910156 C 8.7781025 9.2910156 8.4176323 9.1468276 8.1523438 8.8574219 C 7.8930844 8.5680162 7.7636719 8.2130656 7.7636719 7.7910156 C 7.7636719 7.0976478 8.1574292 6.5096866 8.9472656 6.0273438 C 9.737102 5.5450009 10.689269 5.3027344 11.804688 5.3027344 z M 11.244141 15.332031 C 11.708396 15.332031 12.113362 15.502204 12.457031 15.839844 C 12.806729 16.171454 12.980469 16.565212 12.980469 17.023438 C 12.980469 17.481663 12.806729 17.877374 12.457031 18.208984 C 12.113362 18.534566 11.708396 18.697266 11.244141 18.697266 C 10.773857 18.697266 10.365324 18.534566 10.015625 18.208984 C 9.6719557 17.877374 9.5 17.481663 9.5 17.023438 C 9.5 16.565212 9.6719557 16.171454 10.015625 15.839844 C 10.365324 15.502204 10.773857 15.332031 11.244141 15.332031 z "
id="path939" />
<g
aria-label="?"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:18.52196503px;line-height:125%;font-family:Georgia;-inkscape-font-specification:'Georgia Bold';letter-spacing:0px;word-spacing:0px;opacity:0.7;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text943" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 83 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -977,6 +977,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: <b>-</b>
!GENERAL_AUTO;Automatic
!GENERAL_CLOSE;Close
!GENERAL_CURRENT;Current
!GENERAL_HELP;Help
!GENERAL_OPEN;Open
!GENERAL_RESET;Reset
!GENERAL_SAVE_AS;Save as...
@ -1353,6 +1354,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: <b>-</b>
!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
!HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
!ICCPROFCREATOR_COPYRIGHT;Copyright:
!ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP;Reset to the default copyright, granted to "RawTherapee, CC0"
@ -1919,6 +1921,8 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: <b>-</b>
!TP_LABCURVE_CURVEEDITOR_LH;LH
!TP_LABCURVE_CURVEEDITOR_LH_TOOLTIP;Luminance according to hue L=f(H)
!TP_LABCURVE_CURVEEDITOR_LL_TOOLTIP;Luminance according to luminance L=f(L)
!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

View File

@ -973,6 +973,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: <b>-</b>
!FILEBROWSER_SHOWUNCOLORHINT;Show images without a color label.\nShortcut: <b>Alt-0</b>
!FILEBROWSER_UNRANK_TOOLTIP;Unrank.\nShortcut: <b>Shift-0</b>
!GENERAL_CURRENT;Current
!GENERAL_HELP;Help
!GENERAL_RESET;Reset
!GENERAL_SAVE_AS;Save as...
!GENERAL_SLIDER;Slider
@ -1400,6 +1401,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: <b>-</b>
!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
@ -1884,6 +1886,8 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: <b>-</b>
!TP_LABCURVE_LCREDSK_TIP;If enabled, the LC Curve affects only red and skin-tones.\nIf disabled, it applies to all tones.
!TP_LABCURVE_RSTPROTECTION;Red and skin-tones protection
!TP_LABCURVE_RSTPRO_TOOLTIP;Works on the Chromaticity slider and the CC curve.
!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

View File

@ -2323,6 +2323,7 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: <b>-</b>
!FILEBROWSER_POPUPREMOVE;Delete permanently
!FILEBROWSER_POPUPREMOVEINCLPROC;Delete permanently, including queue-processed version
!FILEBROWSER_SHOWNOTTRASHHINT;Show only images not in trash.
!GENERAL_HELP;Help
!HISTORY_MSG_494;Capture Sharpening
!HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only
!HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative
@ -2334,6 +2335,7 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: <b>-</b>
!HISTORY_MSG_PDSHARPEN_ITERATIONS;CS - Iterations
!HISTORY_MSG_PDSHARPEN_RADIUS;CS - Radius
!HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - Corner radius boost
!HISTORY_MSG_TRANS_Method;Geometry - Method
!PARTIALPASTE_FILMNEGATIVE;Film Negative
!PREFERENCES_APPEARANCE_PSEUDOHIDPI;Pseudo-HiDPI mode
!TP_DEHAZE_LUMINANCE;Luminance only
@ -2343,6 +2345,8 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: <b>-</b>
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_LENSGEOM_LIN;Linear
!TP_LENSGEOM_LOG;Logarithmic
!TP_PDSHARPENING_LABEL;Capture Sharpening
!TP_SHARPENING_ITERCHECK;Auto limit iterations
!TP_SHARPENING_RADIUS_BOOST;Corner radius boost

View File

@ -2390,5 +2390,9 @@ ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: <b>-</b>
! Untranslated keys follow; remove the ! prefix after an entry is translated.
!!!!!!!!!!!!!!!!!!!!!!!!!
!GENERAL_HELP;Help
!HISTORY_MSG_PDSHARPEN_CHECKITER;CS - Auto limit iterations
!HISTORY_MSG_TRANS_Method;Geometry - Method
!TP_LENSGEOM_LIN;Linear
!TP_LENSGEOM_LOG;Logarithmic
!TP_SHARPENING_ITERCHECK;Auto limit iterations

View File

@ -340,6 +340,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh
!GENERAL_ENABLE;Enable
!GENERAL_ENABLED;Enabled
!GENERAL_FILE;File
!GENERAL_HELP;Help
!GENERAL_LANDSCAPE;Landscape
!GENERAL_NA;n/a
!GENERAL_NO;No
@ -875,6 +876,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh
!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
!HISTORY_NEWSNAPSHOT;Add
!HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
!HISTORY_SNAPSHOT;Snapshot
@ -1791,6 +1793,8 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh
!TP_LENSGEOM_AUTOCROP;Auto-Crop
!TP_LENSGEOM_FILL;Auto-fill
!TP_LENSGEOM_LABEL;Lens / Geometry
!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

View File

@ -226,6 +226,7 @@
!GENERAL_ENABLE;Enable
!GENERAL_ENABLED;Enabled
!GENERAL_FILE;File
!GENERAL_HELP;Help
!GENERAL_LANDSCAPE;Landscape
!GENERAL_NA;n/a
!GENERAL_NO;No
@ -787,6 +788,7 @@
!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
!HISTORY_NEWSNAPSHOT;Add
!HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
!HISTORY_SNAPSHOT;Snapshot
@ -1775,6 +1777,8 @@
!TP_LENSGEOM_AUTOCROP;Auto-Crop
!TP_LENSGEOM_FILL;Auto-fill
!TP_LENSGEOM_LABEL;Lens / Geometry
!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

View File

@ -2321,6 +2321,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nTecla de Atajo: <b>-</b>
!FILEBROWSER_POPUPREMOVE;Delete permanently
!FILEBROWSER_POPUPREMOVEINCLPROC;Delete permanently, including queue-processed version
!FILEBROWSER_SHOWNOTTRASHHINT;Show only images not in trash.
!GENERAL_HELP;Help
!HISTORY_MSG_494;Capture Sharpening
!HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only
!HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative
@ -2333,6 +2334,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nTecla de Atajo: <b>-</b>
!HISTORY_MSG_PDSHARPEN_RADIUS;CS - Radius
!HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - Corner radius boost
!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius
!HISTORY_MSG_TRANS_Method;Geometry - Method
!MAIN_FRAME_PLACES_DEL;Remove
!MAIN_TAB_FAVORITES;Favorites
!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: <b>Alt-u</b>
@ -2361,6 +2363,8 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nTecla de Atajo: <b>-</b>
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_LENSGEOM_LIN;Linear
!TP_LENSGEOM_LOG;Logarithmic
!TP_LENSPROFILE_CORRECTION_AUTOMATCH;Automatically selected
!TP_LENSPROFILE_CORRECTION_MANUAL;Manually selected
!TP_LENSPROFILE_MODE_HEADER;Lens Profile

View File

@ -2273,6 +2273,7 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: <b>-</b>
!FILEBROWSER_POPUPREMOVE;Delete permanently
!FILEBROWSER_POPUPREMOVEINCLPROC;Delete permanently, including queue-processed version
!FILEBROWSER_SHOWNOTTRASHHINT;Show only images not in trash.
!GENERAL_HELP;Help
!HISTORY_MSG_494;Capture Sharpening
!HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only
!HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative
@ -2284,6 +2285,7 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: <b>-</b>
!HISTORY_MSG_PDSHARPEN_ITERATIONS;CS - Iterations
!HISTORY_MSG_PDSHARPEN_RADIUS;CS - Radius
!HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - Corner radius boost
!HISTORY_MSG_TRANS_Method;Geometry - Method
!MAIN_FRAME_PLACES_DEL;Remove
!PARTIALPASTE_FILMNEGATIVE;Film Negative
!PROGRESSBAR_DECODING;Decoding...
@ -2301,6 +2303,8 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: <b>-</b>
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_LENSGEOM_LIN;Linear
!TP_LENSGEOM_LOG;Logarithmic
!TP_LENSPROFILE_CORRECTION_AUTOMATCH;Automatically selected
!TP_LENSPROFILE_CORRECTION_MANUAL;Manually selected
!TP_LENSPROFILE_MODE_HEADER;Lens Profile

View File

@ -1285,6 +1285,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: <b>-</b>
!GENERAL_APPLY;Apply
!GENERAL_ASIMAGE;As Image
!GENERAL_CURRENT;Current
!GENERAL_HELP;Help
!GENERAL_OPEN;Open
!GENERAL_RESET;Reset
!GENERAL_SAVE_AS;Save as...
@ -1578,6 +1579,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: <b>-</b>
!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
@ -1945,6 +1947,8 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: <b>-</b>
!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

View File

@ -8,30 +8,6 @@
#08 2012-12-22 a3novy
#09 2013-04-01 a3novy
#10 2013-04-19 a3novy
#11 2013-09-10 firefly
#12 2013-10-28 firefly
#13 2014-01-07 firefly
#14 2014-01-15 firefly
#15 2014-02-25 firefly
#16 2014-04-07 firefly
#17 2014-04-08 firefly
#18 2014-05-16 firefly
#19 2014-07-13 firefly
#20 2014-07-24 firefly
#21 2014-09-11 firefly
#22 2014-10-21 firefly
#23 2014-11-07 firefly
#24 2014-11-18 firefly
#25 2015-01-05 firefly
#26 2015-02-17 firefly
#27 2015-02-21 firefly
#28 2015-03-03 firefly
#29 2015-04-20 firefly
#30 2015-05-01 firefly
#31 2015-05-31 firefly
#32 2015-06-13 firefly
#33 2015-07-20 firefly
#34 2015-08-12 firefly
ABOUT_TAB_BUILD;バージョン
ABOUT_TAB_CREDITS;クレジット
@ -49,7 +25,7 @@ CURVEEDITOR_CURVE;カーブ
CURVEEDITOR_CURVES;カーブ
CURVEEDITOR_CUSTOM;カスタム
CURVEEDITOR_DARKS;ダーク
CURVEEDITOR_EDITPOINT_HINT;ボタンを押すと数値で入出力を編集出来ます\n\n編集したいカーブ上のポイントを右クリックします\n編集を無効にする場合はポイント以外の部分で右クリックします
CURVEEDITOR_EDITPOINT_HINT;ボタンを押すと数値で入出力を編集出来ます\n\n編集したいカーブ上のポイントを右クリックします\n編集を無効にする場合はポイント以外の部分で右クリックします
CURVEEDITOR_HIGHLIGHTS;ハイライト
CURVEEDITOR_LIGHTS;ライト
CURVEEDITOR_LINEAR;リニア
@ -489,8 +465,8 @@ HISTORY_MSG_205;CAM02 ホット/バッドピクセル
HISTORY_MSG_206;CAT02 - 自動で順応
HISTORY_MSG_207;フリンジ低減 - 色相カーブ
HISTORY_MSG_208;ブルー/レッド イコライザ
HISTORY_MSG_210;グラデーションフィルター - 角度
HISTORY_MSG_211;グラデーションフィルター
HISTORY_MSG_210;減光フィルター - 角度
HISTORY_MSG_211;減光フィルター
HISTORY_MSG_212;ビネットフィルター - 強さ
HISTORY_MSG_213;ビネットフィルター
HISTORY_MSG_214;白黒
@ -517,10 +493,10 @@ HISTORY_MSG_234;白黒 ‘後の‘カーブのタイプ
HISTORY_MSG_235;白黒 チャンネルミキサー 自動
HISTORY_MSG_236;--未使用--
HISTORY_MSG_237;白黒 チャンネルミキサー
HISTORY_MSG_238;グラデーションフィルター フェザー処理
HISTORY_MSG_239;グラデーションフィルター 強さ
HISTORY_MSG_240;グラデーションフィルター 中央
HISTORY_MSG_241;ビネットフィルター フェザー処理
HISTORY_MSG_238;減光フィルター フェザー
HISTORY_MSG_239;減光フィルター 強さ
HISTORY_MSG_240;減光フィルター 中央
HISTORY_MSG_241;ビネットフィルター フェザー
HISTORY_MSG_242;ビネットフィルター 形状
HISTORY_MSG_243;半径
HISTORY_MSG_244;ビネットフィルター 強さ
@ -757,6 +733,7 @@ HISTORY_MSG_490;DRC - 量
HISTORY_MSG_491;ホワイトバランス
HISTORY_MSG_492;RGBカーブ
HISTORY_MSG_493;L*a*b*調整
HISTORY_MSG_494;キャプチャーシャープニング
HISTORY_MSG_CLAMPOOG;色域外の色を切り取る
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - カラー補正
HISTORY_MSG_COLORTONING_LABREGION_AB;CT - 色の補正
@ -774,6 +751,7 @@ HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;CT - マスクの表示
HISTORY_MSG_COLORTONING_LABREGION_SLOPE;CT - スロープ
HISTORY_MSG_DEHAZE_DEPTH;霞除去 - 深度
HISTORY_MSG_DEHAZE_ENABLED;霞除去
HISTORY_MSG_DEHAZE_LUMINANCE;霞除去 - 輝度のみ
HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;霞除去 - 深度マップの表示
HISTORY_MSG_DEHAZE_STRENGTH;霞除去 - 強さ
HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;デュアルデモザイク - 自動しきい値
@ -794,6 +772,13 @@ HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;ローカルコントラスト - 明るい
HISTORY_MSG_LOCALCONTRAST_RADIUS;ローカルコントラスト - 半径
HISTORY_MSG_METADATA_MODE;メタデータ コピーモード
HISTORY_MSG_MICROCONTRAST_CONTRAST;マイクロコントラスト - コントラストのしきい値
HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - しきい値の自動設定
HISTORY_MSG_PDSHARPEN_AUTO_RADIUS;CS - シグマの自動設定
HISTORY_MSG_PDSHARPEN_CHECKITER;CS - 繰り返しの自動制限
HISTORY_MSG_PDSHARPEN_CONTRAST;CS - コントラストのしきい値
HISTORY_MSG_PDSHARPEN_ITERATIONS;CS - 繰り返し
HISTORY_MSG_PDSHARPEN_RADIUS;CS - シグマ
HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - 周辺のシグマを増やす
HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - 振れに対するデモザイクの方式
HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;ラインノイズフィルタの方向
HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAFラインフィルタ
@ -960,8 +945,8 @@ MAIN_TOOLTIP_BACKCOLOR2;プレビューの背景色を指定します: <b>白</b
MAIN_TOOLTIP_BACKCOLOR3;プレビューの背景色を指定します: <b>中間のグレー</b>\nショートカット: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>固定</b> / <b>固定解除</b> - <b>補正前</b> の表示設定\n\n<b>固定</b>: <b>補正前</b>をそのまま表示し変更されません\n複数のツールの累積効果を評価するのに役立ちます\nさらに、比較は履歴上のどこからでも行うことができます\n\n<b>固定解除</b>: 現在使用のツールの効果が <b>補正後</b> に表示され、その1段階前が <b>補正前</b> に表示されます
MAIN_TOOLTIP_HIDEHP;左パネル 表示/非表示 (履歴含む)\nショートカット: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;ハイライト・クリッピング領域の表示\nショートカット: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;シャドウ・クリッピング領域の表示\nショートカット: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;ハイライト・クリッピング領域の表示\nショートカット: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;シャドウ・クリッピング領域の表示\nショートカット: <b>&gt;</b>
MAIN_TOOLTIP_PREVIEWB;<b>ブルー チャンネル</b>表示\nショートカット: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;<b>フォーカス・マスク</b>表示\nショートカット: <b>Shift-f</b>\n\n浅い被写界深度、低イズ、高ズームの画像の場合は、より正確に\n\nイズの多い画像に対しては、検出精度を向上させるため10から30%縮小して評価します\n\nフォーカス・マスクをオンにすると表示に時間が掛かります
MAIN_TOOLTIP_PREVIEWG;<b>グリーン チャンネル</b>表示\nショートカット: <b>g</b>
@ -1023,7 +1008,7 @@ PARTIALPASTE_FLATFIELDBLURRADIUS;フラットフィールド ぼかし半径
PARTIALPASTE_FLATFIELDBLURTYPE;フラットフィールド ぼかしタイプ
PARTIALPASTE_FLATFIELDCLIPCONTROL;フラットフィールド クリップコントロール
PARTIALPASTE_FLATFIELDFILE;フラットフィールド ファイル
PARTIALPASTE_GRADIENT;グラデーションフィルター
PARTIALPASTE_GRADIENT;減光フィルター
PARTIALPASTE_HSVEQUALIZER;HSV イコライザ
PARTIALPASTE_ICMSETTINGS;ICM 設定
PARTIALPASTE_IMPULSEDENOISE;インパルス・ノイズ低減
@ -1562,6 +1547,7 @@ TP_DEFRINGE_RADIUS;半径
TP_DEFRINGE_THRESHOLD;しきい値
TP_DEHAZE_DEPTH;深度
TP_DEHAZE_LABEL;霞除去
TP_DEHAZE_LUMINANCE;輝度のみ
TP_DEHAZE_SHOW_DEPTH_MAP;深度マップの表示
TP_DEHAZE_STRENGTH;強さ
TP_DIRPYRDENOISE_CHROMINANCE_AMZ;自動(多分割方式)
@ -1672,9 +1658,9 @@ TP_EXPOS_BLACKPOINT_LABEL;raw ブラック・ポイント
TP_EXPOS_WHITEPOINT_LABEL;raw ホワイト・ポイント
TP_FILMNEGATIVE_BLUE;ブルーの比率
TP_FILMNEGATIVE_GREEN;参考指数(コントラスト)
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_GUESS_TOOLTIP;原画像の中で色相がニュートラルな部分2か所をピックすることでレッドとブルーの比率を自動で設定します。明るさが異なる2か所をピックします。その後、ホワイトバランスを設定します。
TP_FILMNEGATIVE_LABEL;ネガフィルム
TP_FILMNEGATIVE_PICK;Pick neutral spots
TP_FILMNEGATIVE_PICK;ニュートラルなポイントをピック
TP_FILMNEGATIVE_RED;レッドの比率
TP_FILMSIMULATION_LABEL;フィルムシミュレーション
TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapeeはフィルムシミュレーション機能に使う画像をHald CLUTフォルダーの中から探すよう設計されていますプログラムに組み込むにはフォルダーが大き過ぎるため。\n変更するには、環境設定 > 画像処理 > フィルムシミュレーションと進み\nどのフォルダーが使われているか確認します。機能を利用する場合は、Hald CLUTだけが入っているフォルダーを指定するか、 この機能を使わない場合はそのフォルダーを空にしておきます。\n\n詳しくはRawPediaを参照して下さい。\n\nフィルム画像のスキャンを止めますか
@ -1698,9 +1684,9 @@ TP_GRADIENT_CENTER_Y;中央 Y軸
TP_GRADIENT_CENTER_Y_TOOLTIP;アンカーポイントの位置 y軸: -100=上端, 0=中央, +100=下端
TP_GRADIENT_DEGREE;角度
TP_GRADIENT_DEGREE_TOOLTIP;回転角度の度数
TP_GRADIENT_FEATHER;フェザー処理
TP_GRADIENT_FEATHER_TOOLTIP;対角線に対するグラデーションの幅の割合
TP_GRADIENT_LABEL;グラデーションフィルター
TP_GRADIENT_FEATHER;フェザー
TP_GRADIENT_FEATHER_TOOLTIP;対角線に対する減光の幅の割合
TP_GRADIENT_LABEL;減光フィルター
TP_GRADIENT_STRENGTH;強さ
TP_GRADIENT_STRENGTH_TOOLTIP;終点位置でのフィルターの強さ
TP_HLREC_BLEND;ブレンド
@ -1817,13 +1803,14 @@ TP_METADATA_STRIP;メタデータを全て取り除く
TP_METADATA_TUNNEL;変更なしでコピー
TP_NEUTRAL;リセット
TP_NEUTRAL_TIP;露光量補正のスライダー値をニュートラルにリセットします。\n自動露光補正の調整値ついても同様にリセットされます
TP_PCVIGNETTE_FEATHER;フェザー処理
TP_PCVIGNETTE_FEATHER_TOOLTIP;フェザー処理 0=四隅だけ、50=中央までの半分、100=中央まで
TP_PCVIGNETTE_FEATHER;フェザー
TP_PCVIGNETTE_FEATHER_TOOLTIP;フェザー 0=四隅だけ、50=中央までの半分、100=中央まで
TP_PCVIGNETTE_LABEL;ビネットフィルター
TP_PCVIGNETTE_ROUNDNESS;フィルター形状
TP_PCVIGNETTE_ROUNDNESS_TOOLTIP;形状 0=長方形、50=楕円形、100=円形
TP_PCVIGNETTE_STRENGTH;強さ
TP_PCVIGNETTE_STRENGTH_TOOLTIP;終点位置でのフィルターの強さ(四隅)
TP_PDSHARPENING_LABEL;キャプチャーシャープニング
TP_PERSPECTIVE_HORIZONTAL;水平
TP_PERSPECTIVE_LABEL;パースペクティブ
TP_PERSPECTIVE_VERTICAL;垂直
@ -2054,10 +2041,12 @@ TP_SHARPENING_EDRADIUS;半径
TP_SHARPENING_EDTOLERANCE;エッジ許容
TP_SHARPENING_HALOCONTROL;ハロ抑制
TP_SHARPENING_HCAMOUNT;適用量
TP_SHARPENING_ITERCHECK;繰り返しの自動制限
TP_SHARPENING_LABEL;シャープニング
TP_SHARPENING_METHOD;方式
TP_SHARPENING_ONLYEDGES;エッジのみシャープニング
TP_SHARPENING_RADIUS;半径
TP_SHARPENING_RADIUS_BOOST;周辺のシグマを増やす
TP_SHARPENING_RLD;RL デコンボリューション
TP_SHARPENING_RLD_AMOUNT;適用量
TP_SHARPENING_RLD_DAMPING;減衰
@ -2311,6 +2300,7 @@ TP_WBALANCE_TUNGSTEN;タングステン
TP_WBALANCE_WATER1;水中 1
TP_WBALANCE_WATER2;水中 2
TP_WBALANCE_WATER_HEADER;水中
The last update by firefly 2019-12-21
ZOOMPANEL_100;(100%)
ZOOMPANEL_NEWCROPWINDOW;新規ディテール ウィンドウを開く
ZOOMPANEL_ZOOM100;100%にズーム\nショートカット: <b>z</b>
@ -2323,16 +2313,7 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: <b>-</b>
! Untranslated keys follow; remove the ! prefix after an entry is translated.
!!!!!!!!!!!!!!!!!!!!!!!!!
!HISTORY_MSG_494;Capture Sharpening
!HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only
!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
!TP_DEHAZE_LUMINANCE;Luminance only
!TP_PDSHARPENING_LABEL;Capture Sharpening
!TP_SHARPENING_ITERCHECK;Auto limit iterations
!TP_SHARPENING_RADIUS_BOOST;Corner radius boost
!GENERAL_HELP;Help
!HISTORY_MSG_TRANS_Method;Geometry - Method
!TP_LENSGEOM_LIN;Linear
!TP_LENSGEOM_LOG;Logarithmic

View File

@ -908,6 +908,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés <b>-</b>
!GENERAL_AUTO;Automatic
!GENERAL_CLOSE;Close
!GENERAL_CURRENT;Current
!GENERAL_HELP;Help
!GENERAL_OPEN;Open
!GENERAL_RESET;Reset
!GENERAL_SAVE_AS;Save as...
@ -1287,6 +1288,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés <b>-</b>
!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
!HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
!ICCPROFCREATOR_COPYRIGHT;Copyright:
!ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP;Reset to the default copyright, granted to "RawTherapee, CC0"
@ -1911,6 +1913,8 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés <b>-</b>
!TP_LABCURVE_LCREDSK_TIP;If enabled, the LC Curve affects only red and skin-tones.\nIf disabled, it applies to all tones.
!TP_LABCURVE_RSTPROTECTION;Red and skin-tones protection
!TP_LABCURVE_RSTPRO_TOOLTIP;Works on the Chromaticity slider and the CC curve.
!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

View File

@ -1982,6 +1982,7 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: <b>-</b>
!FILEBROWSER_POPUPREMOVEINCLPROC;Delete permanently, including queue-processed version
!FILEBROWSER_SHOWNOTTRASHHINT;Show only images not in trash.
!GENERAL_CURRENT;Current
!GENERAL_HELP;Help
!GENERAL_RESET;Reset
!GENERAL_SAVE_AS;Save as...
!GENERAL_SLIDER;Slider
@ -2075,6 +2076,7 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: <b>-</b>
!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
@ -2255,6 +2257,8 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: <b>-</b>
!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

File diff suppressed because it is too large Load Diff

View File

@ -2264,6 +2264,7 @@ ZOOMPANEL_ZOOMOUT;Afastar\nAtalho: <b>-</b>
!FILEBROWSER_POPUPREMOVE;Delete permanently
!FILEBROWSER_POPUPREMOVEINCLPROC;Delete permanently, including queue-processed version
!FILEBROWSER_SHOWNOTTRASHHINT;Show only images not in trash.
!GENERAL_HELP;Help
!HISTORY_MSG_494;Capture Sharpening
!HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only
!HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative
@ -2275,6 +2276,7 @@ ZOOMPANEL_ZOOMOUT;Afastar\nAtalho: <b>-</b>
!HISTORY_MSG_PDSHARPEN_ITERATIONS;CS - Iterations
!HISTORY_MSG_PDSHARPEN_RADIUS;CS - Radius
!HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - Corner radius boost
!HISTORY_MSG_TRANS_Method;Geometry - Method
!MAIN_FRAME_PLACES_DEL;Remove
!PARTIALPASTE_FILMNEGATIVE;Film Negative
!PREFERENCES_APPEARANCE_PSEUDOHIDPI;Pseudo-HiDPI mode
@ -2293,6 +2295,8 @@ ZOOMPANEL_ZOOMOUT;Afastar\nAtalho: <b>-</b>
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_LENSGEOM_LIN;Linear
!TP_LENSGEOM_LOG;Logarithmic
!TP_LENSPROFILE_CORRECTION_AUTOMATCH;Automatically selected
!TP_LENSPROFILE_CORRECTION_MANUAL;Manually selected
!TP_LENSPROFILE_MODE_HEADER;Lens Profile

View File

@ -2269,6 +2269,7 @@ ZOOMPANEL_ZOOMOUT;Menos Zoom\nAtalho: <b>-</b>
!!!!!!!!!!!!!!!!!!!!!!!!!
!FILEBROWSER_BROWSEPATHBUTTONHINT;Click to open specified path, reload folder and apply "find" keywords.
!GENERAL_HELP;Help
!HISTORY_MSG_494;Capture Sharpening
!HISTORY_MSG_COLORTONING_LABREGION_OFFSET;CT - region offset
!HISTORY_MSG_COLORTONING_LABREGION_POWER;CT - region power
@ -2282,6 +2283,7 @@ ZOOMPANEL_ZOOMOUT;Menos Zoom\nAtalho: <b>-</b>
!HISTORY_MSG_PDSHARPEN_ITERATIONS;CS - Iterations
!HISTORY_MSG_PDSHARPEN_RADIUS;CS - Radius
!HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - Corner radius boost
!HISTORY_MSG_TRANS_Method;Geometry - Method
!PARTIALPASTE_FILMNEGATIVE;Film Negative
!PREFERENCES_CACHECLEAR_SAFETY;Only files in the cache are cleared. Processing profiles stored alongside the source images are not touched.
!PROGRESSBAR_DECODING;Decoding...
@ -2294,6 +2296,8 @@ ZOOMPANEL_ZOOMOUT;Menos Zoom\nAtalho: <b>-</b>
!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_LENSGEOM_LIN;Linear
!TP_LENSGEOM_LOG;Logarithmic
!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_USE_HEADER;Correct
!TP_PDSHARPENING_LABEL;Capture Sharpening

View File

@ -1475,6 +1475,7 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: <b>-</b>
!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_PP;Processing profiles
!FILECHOOSER_FILTER_SAME;Same format as current photo
!GENERAL_HELP;Help
!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_235;B&amp;W - CM - Auto
@ -1735,6 +1736,7 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: <b>-</b>
!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius
!HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold
!HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace
!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
@ -2013,6 +2015,8 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: <b>-</b>
!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_MANUAL;Manually selected
!TP_LENSPROFILE_MODE_HEADER;Lens Profile

View File

@ -1257,6 +1257,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике <b>-</b>
!GENERAL_APPLY;Apply
!GENERAL_ASIMAGE;As Image
!GENERAL_CURRENT;Current
!GENERAL_HELP;Help
!GENERAL_OPEN;Open
!GENERAL_RESET;Reset
!GENERAL_SAVE_AS;Save as...
@ -1553,6 +1554,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике <b>-</b>
!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
@ -1946,6 +1948,8 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике <b>-</b>
!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

View File

@ -2306,5 +2306,9 @@ ZOOMPANEL_ZOOMOUT;Zoom Out\nBližnjica: <b>-</b>
! Untranslated keys follow; remove the ! prefix after an entry is translated.
!!!!!!!!!!!!!!!!!!!!!!!!!
!GENERAL_HELP;Help
!HISTORY_MSG_PDSHARPEN_CHECKITER;CS - Auto limit iterations
!HISTORY_MSG_TRANS_Method;Geometry - Method
!TP_LENSGEOM_LIN;Linear
!TP_LENSGEOM_LOG;Logarithmic
!TP_SHARPENING_ITERCHECK;Auto limit iterations

View File

@ -1772,6 +1772,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: <b>-</b>
!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default
!FILEBROWSER_SHOWNOTTRASHHINT;Show only images not in trash.
!GENERAL_CURRENT;Current
!GENERAL_HELP;Help
!GENERAL_RESET;Reset
!GENERAL_SAVE_AS;Save as...
!GENERAL_SLIDER;Slider
@ -1902,6 +1903,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: <b>-</b>
!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
@ -2149,6 +2151,8 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: <b>-</b>
!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

View File

@ -225,6 +225,7 @@ GENERAL_DISABLED;Disabled
GENERAL_ENABLE;Enable
GENERAL_ENABLED;Enabled
GENERAL_FILE;File
GENERAL_HELP;Help
GENERAL_LANDSCAPE;Landscape
GENERAL_NA;n/a
GENERAL_NO;No
@ -566,10 +567,10 @@ 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_318;W - Contrast - Fine levels
HISTORY_MSG_319;W - Contrast - Fine range
HISTORY_MSG_320;W - Contrast - Coarse range
HISTORY_MSG_321;W - Contrast - Coarse levels
HISTORY_MSG_322;W - Gamut - Avoid color shift
HISTORY_MSG_323;W - ES - Local contrast
HISTORY_MSG_324;W - Chroma - Pastel
@ -727,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
@ -750,6 +752,7 @@ 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
HISTORY_MSG_FILMNEGATIVE_FILMBASE;Film base color
HISTORY_MSG_FILMNEGATIVE_VALUES;Film negative values
HISTORY_MSG_HISTMATCHING;Auto-matched tone curve
HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output - Primaries
@ -758,6 +761,7 @@ HISTORY_MSG_ICM_OUTPUT_TYPE;Output - Type
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_ILLUM;Illuminant
HISTORY_MSG_LOCALCONTRAST_AMOUNT;Local Contrast - Amount
HISTORY_MSG_LOCALCONTRAST_DARKNESS;Local Contrast - Darkness
HISTORY_MSG_LOCALCONTRAST_ENABLED;Local Contrast
@ -775,6 +779,7 @@ 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_PREPROCWB_MODE;Preprocess WB Mode
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
@ -787,7 +792,40 @@ HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light
HISTORY_MSG_SOFTLIGHT_STRENGTH;Soft light - Strength
HISTORY_MSG_SPOT;Spot removal
HISTORY_MSG_SPOT_ENTRY;Spot removal - Point modif.
HISTORY_MSG_TEMPOUT;CAM02 automatic temperature
HISTORY_MSG_TM_FATTAL_ANCHOR;DRC - Anchor
HISTORY_MSG_TRANS_Method;Geometry - Method
HISTORY_MSG_WAVBALCHROM;Equalizer chrominance
HISTORY_MSG_WAVBALLUM;Equalizer luminance
HISTORY_MSG_WAVCHROMFI;Chroma fine
HISTORY_MSG_WAVCHROMCO;Chroma coarse
HISTORY_MSG_WAVCLARI;Clarity
HISTORY_MSG_WAVEDGS;Edge stopping
HISTORY_MSG_WAVMERGEC;Merge C
HISTORY_MSG_WAVMERGEL;Merge L
HISTORY_MSG_WAVRADIUS;Radius Shadows-Highlight
HISTORY_MSG_WAVSCALE;Scale
HISTORY_MSG_WAVSHOWMASK;Show wavelet mask
HISTORY_MSG_WAVSIGMA;Damper
HISTORY_MSG_WAVSOFTRAD;Soft radius clarity
HISTORY_MSG_WAVSOFTRADEND;Soft radius final
HISTORY_MSG_WAVUSHAMET;Clarity method
HISTORY_MSG_THRESWAV;Balance threshold
HISTORY_MSG_BLUWAV;Damper
HISTORY_MSG_WAVOLDSH;Old algorithm
HISTORY_MSG_WAVOFFSET;Offset
HISTORY_MSG_WAVLOWTHR;Threshold low contrast
HISTORY_MSG_BLSHAPE;Blur by level
HISTORY_MSG_WAVBL;Blur levels
HISTORY_MSG_BLURWAV;Blur luminance
HISTORY_MSG_BLURCWAV;Blur chroma
HISTORY_MSG_EDGEFFECT;Edge Damper
HISTORY_MSG_SIGMAFIN;Final contrast Damper
HISTORY_MSG_SIGMATON;Toning Damper
HISTORY_MSG_SIGMACOL;Chroma Damper
HISTORY_MSG_SIGMADIR;Dir Damper
HISTORY_MSG_RANGEAB;Range ab
HISTORY_MSG_PROTAB;Protection
HISTORY_NEWSNAPSHOT;Add
HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
HISTORY_SNAPSHOT;Snapshot
@ -1020,6 +1058,7 @@ PARTIALPASTE_PREPROCESS_GREENEQUIL;Green equilibration
PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter
PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter
PARTIALPASTE_PREPROCESS_PDAFLINESFILTER;PDAF lines filter
PARTIALPASTE_PREPROCWB;Preprocess White Balance
PARTIALPASTE_PRSHARPENING;Post-resize sharpening
PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction
PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT;CA avoid color shift
@ -1426,6 +1465,16 @@ TP_COLORAPP_GAMUT;Gamut control (L*a*b*)
TP_COLORAPP_GAMUT_TOOLTIP;Allow gamut control in L*a*b* mode.
TP_COLORAPP_HUE;Hue (h)
TP_COLORAPP_HUE_TOOLTIP;Hue (h) - angle between 0° and 360°.
TP_COLORAPP_ILLUM;Illuminant
TP_COLORAPP_ILLUM_TOOLTIP;Select the illuminant closest to the shooting conditions.\nIn general D50, but it can change depending on the time and lattitude.
TP_COLORAPP_ILA;Incandescent StdA 2856K
TP_COLORAPP_IL41;D41
TP_COLORAPP_IL50;D50
TP_COLORAPP_IL55;D55
TP_COLORAPP_IL60;D60
TP_COLORAPP_IL65;D65
TP_COLORAPP_IL75;D75
TP_COLORAPP_ILFREE;Free
TP_COLORAPP_LABEL;CIE Color Appearance Model 2002
TP_COLORAPP_LABEL_CAM02;Image Adjustments
TP_COLORAPP_LABEL_SCENE;Scene Conditions
@ -1437,6 +1486,8 @@ TP_COLORAPP_MODEL;WP Model
TP_COLORAPP_MODEL_TOOLTIP;White-Point Model.\n\n<b>WB [RT] + [output]</b>: 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\n<b>WB [RT+CAT02] + [output]</b>: RT's white balance settings are used by CAT02 and the output device's white balance is set in Viewing Conditions.\n\n<b>Free temp+green + CAT02 + [output]:</b> 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 can change illuminant shooting conditions.\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 &amp; skin-tones protection affects both sliders and curves.
TP_COLORAPP_SURROUND;Surround
@ -1453,7 +1504,9 @@ TP_COLORAPP_TCMODE_LABEL2;Curve mode 2
TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode
TP_COLORAPP_TCMODE_LIGHTNESS;Lightness
TP_COLORAPP_TCMODE_SATUR;Saturation
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_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504
TP_COLORAPP_TEMP2_TOOLTIP;Either symmetrical mode temp = White balance.\nEither select illuminant always set Tint=1.\n\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504
TP_COLORAPP_TEMPOUT_TOOLTIP;Disable to chnage temperature and tint
TP_COLORAPP_TONECIE;Tone mapping using CIECAM02
TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect.
TP_COLORAPP_VIEWING_ABSOLUTELUMINANCE_TOOLTIP;Absolute luminance of the viewing environment\n(usually 16 cd/m²).
@ -1652,6 +1705,9 @@ TP_EXPOSURE_TCMODE_WEIGHTEDSTD;Weighted Standard
TP_EXPOS_BLACKPOINT_LABEL;Raw Black Points
TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
TP_FILMNEGATIVE_BLUE;Blue ratio
TP_FILMNEGATIVE_FILMBASE_PICK;Pick film base color
TP_FILMNEGATIVE_FILMBASE_TOOLTIP;Pick a spot of unexposed film (eg. the border between frames), to get the actual film base color values, and save them in the processing profile.\nThis makes it easy to get a more consistent color balance when batch-processing multiple pictures from the same roll.\nAlso use this when the converted image is extremely dark, bright, or color-unbalanced.
TP_FILMNEGATIVE_FILMBASE_VALUES;Film base RGB:
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
@ -1777,6 +1833,8 @@ TP_LABCURVE_RSTPRO_TOOLTIP;Works on the Chromaticity slider and the CC curve.
TP_LENSGEOM_AUTOCROP;Auto-Crop
TP_LENSGEOM_FILL;Auto-fill
TP_LENSGEOM_LABEL;Lens / Geometry
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
@ -1825,6 +1883,10 @@ TP_PREPROCESS_LINEDENOISE_DIRECTION_PDAF_LINES;Horizontal only on PDAF rows
TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Vertical
TP_PREPROCESS_NO_FOUND;None found
TP_PREPROCESS_PDAFLINESFILTER;PDAF lines filter
TP_PREPROCWB_LABEL;Preprocess White Balance
TP_PREPROCWB_MODE;Mode
TP_PREPROCWB_MODE_AUTO;Auto
TP_PREPROCWB_MODE_CAMERA;Camera
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_AUTO;Auto-correction
@ -2105,11 +2167,16 @@ 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;Chrominance balance
TP_WAVELET_BALCHRO_TOOLTIP;If enabled, the 'Contrast balance' curve or slider also modifies chroma balance.
TP_WAVELET_BALCHROM;Denoise Equalizer Blue-Red
TP_WAVELET_BALLUM;Denoise Equalizer White-Black
TP_WAVELET_BANONE;None
TP_WAVELET_BASLI;Slider
TP_WAVELET_BATYPE;Contrast balance method
TP_WAVELET_BLCURVE;Blur by levels
TP_WAVELET_BLURFRAME;Blur
TP_WAVELET_BLUWAV;Damper
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
@ -2119,22 +2186,32 @@ 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_CHROFRAME;Denoise Chrominance
TP_WAVELET_CHROMAFRAME;Chroma
TP_WAVELET_CHROMCO;Chrominance Coarse
TP_WAVELET_CHROMFI;Chrominance Fine
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_CHRWAV;Blur chroma
TP_WAVELET_CHSL;Sliders
TP_WAVELET_CHTYPE;Chrominance method
TP_WAVELET_CLA;Clarity
TP_WAVELET_CLARI;Sharp-mask and Clarity
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_CONTFRAME;Contrast - Compression
TP_WAVELET_CONTR;Gamut
TP_WAVELET_CONTRA;Contrast
TP_WAVELET_CONTRASTEDIT;Finer - Coarser levels
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_BL_TOOLTIP;Disabled if zoom > about 300%
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.
@ -2150,6 +2227,7 @@ 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_DIRFRAME;Directional contrast
TP_WAVELET_DONE;Vertical
TP_WAVELET_DTHR;Diagonal
TP_WAVELET_DTWO;Horizontal
@ -2163,6 +2241,8 @@ 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_EDEFFECT;Damper
TP_WAVELET_EDEFFECT_TOOLTIP;This slider controls how wide the range of contrast values are that receive the maximum effect from the tool.\nMaximum value (2.5) disabled the tool
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
@ -2173,10 +2253,12 @@ TP_WAVELET_EDSL;Threshold Sliders
TP_WAVELET_EDTYPE;Local contrast method
TP_WAVELET_EDVAL;Strength
TP_WAVELET_FINAL;Final Touchup
TP_WAVELET_FINCFRAME;Final Local Contrast
TP_WAVELET_FINEST;Finest
TP_WAVELET_HIGHLIGHT;Highlight luminance range
TP_WAVELET_HIGHLIGHT;Finer levels luminance range
TP_WAVELET_FINCOAR_TOOLTIP;The left (positive) part of the curve acts on the finer levels (increase).\nThe 2 points on the abscissa represent the respective action limits of finer and coarser levels 5 and 6 (default).\nThe right (negative) part of the curve acts on the coarser levels (increase).\nAvoid moving the left part of the curve with negative values. Avoid moving the right part of the curve with positives values
TP_WAVELET_HS1;Whole luminance range
TP_WAVELET_HS2;Shadows/Highlights
TP_WAVELET_HS2;Selective luminance range
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 <b>white balance is incorrect</b>.
TP_WAVELET_HUESKY;Sky hue
@ -2186,10 +2268,10 @@ TP_WAVELET_ITER_TOOLTIP;Left: increase low levels and reduce high levels,\nRight
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_ALL;All levels, in all directions
TP_WAVELET_LEVDIR_INF;Finer details levels, with selected level
TP_WAVELET_LEVDIR_ONE;One level
TP_WAVELET_LEVDIR_SUP;Above the level
TP_WAVELET_LEVDIR_SUP;Coarser details levels, without selected 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
@ -2200,57 +2282,91 @@ 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_LOWLIGHT;Coarser levels luminance range
TP_WAVELET_LOWTHR_TOOLTIP;Prevents amplification of fine textures and noise
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_MERGEC;Merge Chroma
TP_WAVELET_MERGEL;Merge Luma
TP_WAVELET_NEUTRAL;Neutral
TP_WAVELET_NOIS;Denoise
TP_WAVELET_NOISE;Denoise and Refine
TP_WAVELET_NOISE_TOOLTIP;If level 4 luminance denoise superior to 20, mode Agressive is used.\nIf chrominance coarse superior to 20, mode Agressive is used.
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_OLDSH;Algorithm using negatives values
TP_WAVELET_OPACITY;Opacity Blue-Yellow
TP_WAVELET_OPACITYW;Contrast balance d/v-h curve
TP_WAVELET_OPACITYWL;Final local contrast
TP_WAVELET_OPACITYWL;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_PROTAB;Protection
TP_WAVELET_RADIUS;Radius Shadows - Highlight
TP_WAVELET_RANGEAB;Range a and b %
TP_WAVELET_RE1;Reinforced
TP_WAVELET_RE2;Unchanged
TP_WAVELET_RE3;Reduced
TP_WAVELET_RESCHRO;Chroma
TP_WAVELET_RESBLUR;Blur Luminance
TP_WAVELET_RESBLURC;Blur Chroma
TP_WAVELET_RESBLUR_TOOLTIP;Disabled if zoom > about 500%
TP_WAVELET_RESCHRO;Intensity
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_SHA;Sharp mask
TP_WAVELET_SHFRAME;Shadows/Highlights
TP_WAVELET_SHOWMASK;Show wavelet 'mask'
TP_WAVELET_SIGMA;Damper
TP_WAVELET_SIGMAFIN;Damper
TP_WAVELET_SIGMA_TOOLTIP;The effect of the contrast sliders is stronger in medium contrast details, and weaker in high and low contrast details.\n With this slider you can control how quickly the effect dampens towards the extreme contrasts.\n The higher the slider is set, the wider the range of contrasts which will get a strong change, and the higher the risk to generate artifacts.\n The lower it is, the more pinpoint will the effect be applied to a narrow range of contrast values.
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_SOFTRAD;Soft Radius
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_THRESHOLD;Finer levels
TP_WAVELET_THRESHOLD2;Coarser levels
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. : All levels from level 1 up to the chosen value will only be affected within the Finer levels luminance range.\nAll other levels will have the whole range of luminances affected, unless the Coarser levels setting limits it.\nThe chosen value in this slider becomes the minimum possible value of the Coarser 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). : Only levels between the chosen value and level 9/Extra will be affected by the Coarser levels luminance range.\nAll other levels will have the whole range of luminances affected, unless the Finer levels setting limits it.\nThe lower level possible that will be considered by the algorithm is limited by the Finer levels value.
TP_WAVELET_THRESWAV;Balance Threshold
TP_WAVELET_THRH;Highlights threshold
TP_WAVELET_TILESBIG;Big tiles
TP_WAVELET_TILESBIG;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_BL;Blur levels
TP_WAVELET_TMEDGS;Edge stopping
TP_WAVELET_TMSCALE;Scale
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_TMSTRENGTH_TOOLTIP;Control the strength of tone mapping or contrast compression of the residual image.
TP_WAVELET_TMEDGS;Edge stopping
TP_WAVELET_TON;Toning
TP_WAVELET_TONFRAME;Excluded Colors
TP_WAVELET_TMTYPE;Compression method
TP_WAVELET_USH;None
TP_WAVELET_USHARP;Clarity method
TP_WAVELET_USHARP_TOOLTIP;Origin : the source file is the file before Wavelet.\nWavelet : the source file is the file including wavelet threatment
TP_WAVELET_USH_TOOLTIP;If you select Sharp-mask, wavelet settings will be automatically positioned :\nBackground=black, Process=below, level=3...you can change level between 1 and 4.\n\nIf you select Clarity, wavelet settings will be automatically positioned :\nBackground=residual, Process=above, level=7..you can change level between 5 and 10 and wavelet levels.
TP_WAVELET_WAVLOWTHR;Low contrast threshold
TP_WAVELET_WAVOFFSET;Offset
TP_WAVELET_OFFSET_TOOLTIP;Offset modifies the balance between shadows and highlights.\nHigh values here will amplify the contrast change of the highlights, whereas low values will amplify the contrast change of the shadows.\nAlong with a low Damper value you will able to select the contrasts that will be enhanced.
TP_WBALANCE_AUTO;Auto
TP_WBALANCE_AUTOITCGREEN;Temperature correlation
TP_WBALANCE_AUTOOLD;RGB grey
TP_WBALANCE_AUTO_HEADER;Automatic
TP_WBALANCE_CAMERA;Camera
TP_WBALANCE_CLOUDY;Cloudy
TP_WBALANCE_CUSTOM;Custom
@ -2292,6 +2408,8 @@ TP_WBALANCE_SOLUX41;Solux 4100K
TP_WBALANCE_SOLUX47;Solux 4700K (vendor)
TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery)
TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview.
TP_WBALANCE_STUDLABEL;Correlation factor: %1
TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation.\nLower values are better, where <0.005 is excellent,\n<0.01 is good, and >0.5 is poor.\nLow values do not mean that the white balance is good:\nif the illuminant is non-standard the results can be erratic.\nA value of 1000 means previous calculations are used and\nthe resultsare probably good.
TP_WBALANCE_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

View File

@ -6,6 +6,7 @@ image/png;
image/tiff;
image/x-adobe-dng;
image/x-canon-cr2;
image/x-canon-cr3;
image/x-canon-crf;
image/x-canon-crw;
image/x-fuji-raf;

View File

@ -9,6 +9,7 @@
# which can be useful if you want to keep the application and all the cache data in a single place,
# an external HD for example
MultiUser=true
UseSystemTheme=false
[File Browser]
# Image filename extensions to be looked for, and their corresponding search state (0/1 -> skip/include)
@ -38,5 +39,6 @@ CustomProfileBuilder=
#ImgDefault=Neutral
[GUI]
FontFamily=Helvetica Regular
CPFontFamily=Helvetica Regular
# Set the included font as default
FontFamily=Droid Sans Mono Slashed
CPFontFamily=Droid Sans Mono Slashed

View File

@ -14,7 +14,7 @@ Icon=rawtherapee
TryExec=rawtherapee
Exec=rawtherapee %f
Terminal=false
MimeType=image/jpeg;image/png;image/tiff;image/x-adobe-dng;image/x-canon-cr2;image/x-canon-crf;image/x-canon-crw;image/x-fuji-raf;image/x-hasselblad-3fr;image/x-hasselblad-fff;image/x-jpg;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-leaf-mos;image/x-leica-rwl;image/x-mamiya-mef;image/x-minolta-mrw;image/x-nikon-nef;image/x-nikon-nrw;image/x-olympus-orf;image/x-panasonic-raw;image/x-panasonic-rw2;image/x-pentax-pef;image/x-pentax-raw;image/x-phaseone-iiq;image/x-raw;image/x-rwz;image/x-samsung-srw;image/x-sigma-x3f;image/x-sony-arq;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-tif;
MimeType=image/jpeg;image/png;image/tiff;image/x-adobe-dng;image/x-canon-cr2;image/x-canon-cr3;image/x-canon-crf;image/x-canon-crw;image/x-fuji-raf;image/x-hasselblad-3fr;image/x-hasselblad-fff;image/x-jpg;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-leaf-mos;image/x-leica-rwl;image/x-mamiya-mef;image/x-minolta-mrw;image/x-nikon-nef;image/x-nikon-nrw;image/x-olympus-orf;image/x-panasonic-raw;image/x-panasonic-rw2;image/x-pentax-pef;image/x-pentax-raw;image/x-phaseone-iiq;image/x-raw;image/x-rwz;image/x-samsung-srw;image/x-sigma-x3f;image/x-sony-arq;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-tif;inode/directory;
Categories=Graphics;Photography;2DGraphics;RasterGraphics;GTK;
Keywords=raw;photo;photography;develop;pp3;graphics;
StartupNotify=true

View File

@ -565,7 +565,7 @@ button.text-button.toggle:hover:checked {
.drawingarea {
border-radius: 0;
background-color: #2A2A2A;
border: 0.0833333333333333em solid #1D1D1D;
border: 0.0833333333333333em solid #888888;
}
.drawingarea:disabled {
background-color: #444;

View File

@ -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<double>(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<double>(bstemp[dir]) * static_cast<double>(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]);
@ -1258,12 +1258,12 @@ float* RawImageSource::CA_correct_RT(
int indx = (row * width + col) >> 1;
#ifdef __SSE2__
for (; col < width - 7 - cb; col += 8, indx += 4) {
vfloat val = LVFU(RawDataTmp[indx]);
const vfloat val = vmaxf(LVFU(RawDataTmp[indx]), ZEROV);
STC2VFU(rawData[row][col], val);
}
#endif
for (; col < width - cb; col += 2, indx++) {
rawData[row][col] = RawDataTmp[indx];
rawData[row][col] = std::max(0.f, RawDataTmp[indx]);
}
}

View File

@ -1,30 +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}")
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")
@ -95,6 +125,7 @@ set(RTENGINESOURCEFILES
ipretinex.cc
ipshadowshighlights.cc
ipsharpen.cc
ipsharpenedges.cc
ipsoftlight.cc
iptransform.cc
ipvibrance.cc
@ -106,6 +137,7 @@ set(RTENGINESOURCEFILES
lj92.c
lmmse_demosaic.cc
loadinitial.cc
munselllch.cc
myfile.cc
panasonic_decoders.cc
pdaflinesfilter.cc
@ -160,13 +192,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}")
@ -187,6 +219,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)

View File

@ -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<double>(r[ii]) * static_cast<double>(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<double>(d[ii]) * static_cast<double>(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<double>(r[ii]);
}
rms = sqrtf(rms / n);
//Quit? This probably isn't the best stopping condition, but ok.
if(rms < RMSResidual) {
if(rms < static_cast<double>(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<double>(r[ii]) * static_cast<double>(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];
}

View File

@ -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
@ -64,8 +63,8 @@
namespace rtengine
{
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/*
Structure of the algorithm:
@ -484,7 +483,6 @@ enum nrquality {QUALITY_STANDARD, QUALITY_HIGH};
void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagefloat * dst, Imagefloat * calclum, float * ch_M, float *max_r, float *max_b, bool isRAW, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, const NoiseCurve & noiseLCurve, const NoiseCurve & noiseCCurve, float &nresi, float &highresi)
{
BENCHFUN
//#ifdef _DEBUG
MyTime t1e, t2e;
t1e.set();
@ -548,7 +546,7 @@ BENCHFUN
const bool denoiseMethodRgb = (dnparams.dmethod == "RGB");
// init luma noisevarL
const float noiseluma = static_cast<float>(dnparams.luma);
const float noisevarL = (useNoiseLCurve && (denoiseMethodRgb || !isRAW)) ? static_cast<float>(SQR(((noiseluma + 1.0) / 125.0) * (10. + (noiseluma + 1.0) / 25.0))) : static_cast<float>(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 +633,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<double>(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 +655,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 +667,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<float>(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<float> tilemask_in(TS, TS);
array2D<float> tilemask_out(TS, TS);
@ -681,13 +679,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 +881,19 @@ BENCHFUN
int height = tilebottom - tiletop;
int width2 = (width + 1) / 2;
float realred, realblue;
float interm_med = static_cast<float>(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<float>(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<float>(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 +1094,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<float>(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")) {
@ -1184,6 +1182,7 @@ BENCHFUN
} else {
madL[lvl][dir - 1] = SQR(MadRgb(WavCoeffs_L[dir], Wlvl_L * Hlvl_L));
}
}
}
}
@ -1201,16 +1200,16 @@ BENCHFUN
if (!memoryAllocationFailed) {
if (nrQuality == QUALITY_STANDARD) {
if (!WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, noisevarab_r, useNoiseCCurve, autoch, denoiseMethodRgb)) { //enhance mode
if (!WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, nullptr, 0, noisevarab_r, useNoiseCCurve, autoch, denoiseMethodRgb, denoiseNestedLevels)) { //enhance mode
memoryAllocationFailed = true;
}
} else { /*if (nrQuality==QUALITY_HIGH)*/
if (!WaveletDenoiseAll_BiShrinkAB(*Ldecomp, *adecomp, noisevarchrom, madL, noisevarab_r, useNoiseCCurve, autoch, denoiseMethodRgb)) { //enhance mode
if (!WaveletDenoiseAll_BiShrinkAB(*Ldecomp, *adecomp, noisevarchrom, madL, nullptr, 0, noisevarab_r, useNoiseCCurve, autoch, denoiseMethodRgb, denoiseNestedLevels)) { //enhance mode
memoryAllocationFailed = true;
}
if (!memoryAllocationFailed) {
if (!WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, noisevarab_r, useNoiseCCurve, autoch, denoiseMethodRgb)) {
if (!WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, nullptr, 0, noisevarab_r, useNoiseCCurve, autoch, denoiseMethodRgb, denoiseNestedLevels)) {
memoryAllocationFailed = true;
}
}
@ -1238,16 +1237,16 @@ BENCHFUN
if (!memoryAllocationFailed) {
if (nrQuality == QUALITY_STANDARD) {
if (!WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, noisevarab_b, useNoiseCCurve, autoch, denoiseMethodRgb)) { //enhance mode
if (!WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, nullptr, 0, noisevarab_b, useNoiseCCurve, autoch, denoiseMethodRgb, denoiseNestedLevels)) { //enhance mode
memoryAllocationFailed = true;
}
} else { /*if (nrQuality==QUALITY_HIGH)*/
if (!WaveletDenoiseAll_BiShrinkAB(*Ldecomp, *bdecomp, noisevarchrom, madL, noisevarab_b, useNoiseCCurve, autoch, denoiseMethodRgb)) { //enhance mode
if (!WaveletDenoiseAll_BiShrinkAB(*Ldecomp, *bdecomp, noisevarchrom, madL, nullptr, 0, noisevarab_b, useNoiseCCurve, autoch, denoiseMethodRgb, denoiseNestedLevels)) { //enhance mode
memoryAllocationFailed = true;
}
if (!memoryAllocationFailed) {
if (!WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, noisevarab_b, useNoiseCCurve, autoch, denoiseMethodRgb)) {
if (!WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, nullptr, 0, noisevarab_b, useNoiseCCurve, autoch, denoiseMethodRgb, denoiseNestedLevels)) {
memoryAllocationFailed = true;
}
}
@ -1274,16 +1273,16 @@ BENCHFUN
int edge = 0;
if (nrQuality == QUALITY_STANDARD) {
if (!WaveletDenoiseAllL(*Ldecomp, noisevarlum, madL, nullptr, edge)) { //enhance mode
if (!WaveletDenoiseAllL(*Ldecomp, noisevarlum, madL, nullptr, edge, denoiseNestedLevels)) { //enhance mode
memoryAllocationFailed = true;
}
} else { /*if (nrQuality==QUALITY_HIGH)*/
if (!WaveletDenoiseAll_BiShrinkL(*Ldecomp, noisevarlum, madL)) { //enhance mode
if (!WaveletDenoiseAll_BiShrinkL(*Ldecomp, noisevarlum, madL, nullptr, edge, denoiseNestedLevels)) { //enhance mode
memoryAllocationFailed = true;
}
if (!memoryAllocationFailed) {
if (!WaveletDenoiseAllL(*Ldecomp, noisevarlum, madL, nullptr, edge)) {
if (!WaveletDenoiseAllL(*Ldecomp, noisevarlum, madL, nullptr, edge, denoiseNestedLevels)) {
memoryAllocationFailed = true;
}
}
@ -1355,9 +1354,11 @@ BENCHFUN
#else
int subThread = 0;
#endif
// float blurbuffer[TS * TS] ALIGNED64;
float *Lblox = LbloxArray[subThread];
float *fLblox = fLbloxArray[subThread];
float pBuf[width + TS + 2 * blkrad * offset] ALIGNED16;
// float nbrwt[TS * TS] ALIGNED64;
#ifdef _OPENMP
#pragma omp for
#endif
@ -1433,6 +1434,7 @@ BENCHFUN
for (int hblk = 0; hblk < numblox_W; ++hblk) {
RGBtile_denoise(fLblox, hblk, noisevar_Ldetail);
// RGBtile_denoise(fLblox, hblk, noisevar_Ldetail, nbrwt, blurbuffer);
}//end of horizontal block loop
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -1449,8 +1451,14 @@ BENCHFUN
//add row of blocks to output image tile
RGBoutput_tile_row(Lblox, Ldetail, tilemask_out, height, width, topproc);
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}//end of vertical block loop
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#ifdef _OPENMP
#pragma omp parallel for num_threads(denoiseNestedLevels) if (denoiseNestedLevels>1)
@ -2037,6 +2045,13 @@ BENCHFUN
}//end of main RGB_denoise
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//void ImProcFunctions::RGBtile_denoise(float * fLblox, int hblproc, float noisevar_Ldetail, float * nbrwt, float * blurbuffer) //for DCT
void ImProcFunctions::RGBtile_denoise(float* fLblox, int hblproc, float noisevar_Ldetail) //for DCT
{
float nbrwt[TS * TS] ALIGNED64;
@ -2063,6 +2078,10 @@ void ImProcFunctions::RGBtile_denoise(float* fLblox, int hblproc, float noisevar
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void ImProcFunctions::RGBoutput_tile_row(float *bloxrow_L, float ** Ldetail, float ** tilemask_out, int height, int width, int top)
{
const int numblox_W = ceil((static_cast<float>(width)) / (offset));
@ -2121,7 +2140,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<float>(count - count_))) / 0.6745);
return (((median - 1) + (datalen / 2 - count_) / (static_cast<float>(count - count_))) / 0.6745f);
}
float ImProcFunctions::MadRgb(const float * DataList, const int datalen)
@ -2155,7 +2174,7 @@ float ImProcFunctions::MadRgb(const float * DataList, const int datalen)
// interpolate
delete[] histo;
return (((median - 1) + (datalen / 2 - count_) / (static_cast<float>(count - count_))) / 0.6745);
return (((median - 1) + (datalen / 2 - count_) / (static_cast<float>(count - count_))) / 0.6745f);
}
@ -2190,11 +2209,19 @@ void ImProcFunctions::Noise_residualAB(const wavelet_decomposition &WaveletCoeff
chmaxresid = maxresid;
}
bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3])
bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3], float * vari, int edge, int denoiseNestedLevels)
{
int maxlvl = min(WaveletCoeffs_L.maxlevel(), 5);
const float eps = 0.01f;
if (edge == 1 || edge == 3 || edge == 4 || edge == 5) {
maxlvl = 4; //for refine denoise edge wavelet
}
if (edge == 2) {
maxlvl = 7; //for locallab denoise
}
int maxWL = 0, maxHL = 0;
for (int lvl = 0; lvl < maxlvl; ++lvl) {
@ -2205,6 +2232,7 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &W
if (WaveletCoeffs_L.level_H(lvl) > maxHL) {
maxHL = WaveletCoeffs_L.level_H(lvl);
}
}
bool memoryAllocationFailed = false;
@ -2235,14 +2263,52 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &W
float ** WavCoeffs_L = WaveletCoeffs_L.level_coeffs(lvl);
if (lvl == maxlvl - 1) {
int edge = 0;
ShrinkAllL(WaveletCoeffs_L, buffer, lvl, dir, noisevarlum, madL[lvl], nullptr, edge);
// int edge = 0;
ShrinkAllL(WaveletCoeffs_L, buffer, lvl, dir, noisevarlum, madL[lvl], vari, edge);
} else {
//simple wavelet shrinkage
float * sfave = buffer[0] + 32;
float * sfaved = buffer[2] + 96;
float mad_Lr = madL[lvl][dir - 1];
/*
if ((edge == 1 || edge == 2 || edge == 3) && vari) {
noisevarlum = blurBuffer; // we need one buffer, but fortunately we don't have to allocate a new one because we can use blurBuffer
for (int i = 0; i < Wlvl_L * Hlvl_L; ++i) {
noisevarlum[i] = vari[lvl];
}
}
*/
float *nvl = nullptr;
nvl = new float[Hlvl_L * Wlvl_L];
for (int i = 0; i < Hlvl_L * Wlvl_L; ++i) {
nvl[i] = 0.f;
}
if ((edge == 1 || edge == 2 || edge == 3 || edge == 5) && vari) {
// nvl = blurBuffer; // we need one buffer, but fortunately we don't have to allocate a new one because we can use blurBuffer
if ((edge == 1 || edge == 3)) {
for (int i = 0; i < Hlvl_L * Wlvl_L; ++i) {
nvl[i] = vari[lvl];
}
}
if (edge == 2 || edge == 4 || edge == 5) {
for (int i = 0; i < Hlvl_L * Wlvl_L; ++i) {
nvl[i] = vari[lvl] * SQR(noisevarlum[i]);
}
}
}
else {
for (int i = 0; i < Hlvl_L * Wlvl_L; ++i) {
nvl[i] = noisevarlum[i];
}
}
float levelFactor = mad_Lr * 5.f / (lvl + 1);
#ifdef __SSE2__
@ -2254,14 +2320,14 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &W
int coeffloc_L;
for (coeffloc_L = 0; coeffloc_L < Hlvl_L * Wlvl_L - 3; coeffloc_L += 4) {
mad_Lv = LVFU(noisevarlum[coeffloc_L]) * levelFactorv;
mad_Lv = LVFU(nvl[coeffloc_L]) * levelFactorv;
mag_Lv = SQRV(LVFU(WavCoeffs_L[dir][coeffloc_L]));
STVFU(sfave[coeffloc_L], mag_Lv / (mag_Lv + mad_Lv * xexpf(-mag_Lv / (mad_Lv * ninev)) + epsv));
}
for (; coeffloc_L < Hlvl_L * Wlvl_L; ++coeffloc_L) {
float mag_L = SQR(WavCoeffs_L[dir][coeffloc_L]);
sfave[coeffloc_L] = mag_L / (mag_L + levelFactor * noisevarlum[coeffloc_L] * xexpf(-mag_L / (9.f * levelFactor * noisevarlum[coeffloc_L])) + eps);
sfave[coeffloc_L] = mag_L / (mag_L + levelFactor * nvl[coeffloc_L] * xexpf(-mag_L / (9.f * levelFactor * nvl[coeffloc_L])) + eps);
}
#else
@ -2271,12 +2337,13 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &W
int coeffloc_L = i * Wlvl_L + j;
float mag_L = SQR(WavCoeffs_L[dir][coeffloc_L]);
sfave[coeffloc_L] = mag_L / (mag_L + levelFactor * noisevarlum[coeffloc_L] * xexpf(-mag_L / (9.f * levelFactor * noisevarlum[coeffloc_L])) + eps);
sfave[coeffloc_L] = mag_L / (mag_L + levelFactor * nvl[coeffloc_L] * xexpf(-mag_L / (9.f * levelFactor * nvl[coeffloc_L])) + eps);
}
}
#endif
boxblur(sfave, sfaved, lvl + 2, Wlvl_L, Hlvl_L, false); //increase smoothness by locally averaging shrinkage
#ifdef __SSE2__
vfloat sfavev;
vfloat sf_Lv;
@ -2307,7 +2374,9 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &W
}
#endif
delete [] nvl;
}
}
}
}
@ -2322,11 +2391,20 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &W
return (!memoryAllocationFailed);
}
bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &WaveletCoeffs_L, const wavelet_decomposition &WaveletCoeffs_ab,
float *noisevarchrom, float madL[8][3], float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb)
bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &WaveletCoeffs_L, const wavelet_decomposition &WaveletCoeffs_ab, float *noisevarchrom, float madL[8][3], float *variC, int local, float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb, int denoiseNestedLevels)
{
int maxlvl = WaveletCoeffs_L.maxlevel();
if (local == 2) {
maxlvl = 7; //for local denoise
}
if (local == 3) {
maxlvl = 4; //for shape detection
}
if (autoch && noisevar_ab <= 0.001f) {
noisevar_ab = 0.02f;
}
@ -2394,14 +2472,36 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &
float ** WavCoeffs_ab = WaveletCoeffs_ab.level_coeffs(lvl);
if (lvl == maxlvl - 1) {
ShrinkAllAB(WaveletCoeffs_L, WaveletCoeffs_ab, buffer, lvl, dir, noisevarchrom, noisevar_ab, useNoiseCCurve, autoch, denoiseMethodRgb, madL[lvl], madab[lvl], true);
ShrinkAllAB(WaveletCoeffs_L, WaveletCoeffs_ab, buffer, lvl, dir, noisevarchrom, noisevar_ab, useNoiseCCurve, autoch, denoiseMethodRgb, madL[lvl], nullptr, 0, madab[lvl], true);
} else {
//simple wavelet shrinkage
float noisevarfc;
float mad_Lr = madL[lvl][dir - 1];
float mad_abr = useNoiseCCurve ? noisevar_ab * madab[lvl][dir - 1] : SQR(noisevar_ab) * madab[lvl][dir - 1];
float *nvc = nullptr;
nvc = new float[Hlvl_ab * Wlvl_ab];
if (noisevar_ab > 0.001f) {
if ((local == 2 || local == 3) && variC && useNoiseCCurve) {
noisevarfc = variC[lvl];
for (int p = 0; p < Hlvl_ab * Wlvl_ab; p++) {
nvc[p] = 10.f * sqrt(variC[lvl]) * SQR(1.f + 4.f * noisevarchrom[p]);
}
} else {
noisevarfc = noisevar_ab;
for (int p = 0; p < Hlvl_ab * Wlvl_ab; p++) {
nvc[p] = noisevarchrom[p];
}
}
// float mad_abr = useNoiseCCurve ? noisevar_ab * madab[lvl][dir - 1] : SQR(noisevar_ab) * madab[lvl][dir - 1];
float mad_abr = useNoiseCCurve ? noisevarfc * madab[lvl][dir - 1] : SQR(noisevarfc) * madab[lvl][dir - 1];
if (noisevarfc > 0.001f) {
#ifdef __SSE2__
vfloat onev = F2V(1.f);
@ -2413,7 +2513,7 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &
int coeffloc_ab;
for (coeffloc_ab = 0; coeffloc_ab < Hlvl_ab * Wlvl_ab - 3; coeffloc_ab += 4) {
mad_abv = LVFU(noisevarchrom[coeffloc_ab]) * mad_abrv;
mad_abv = LVFU(nvc[coeffloc_ab]) * mad_abrv;
tempabv = LVFU(WavCoeffs_ab[dir][coeffloc_ab]);
mag_Lv = LVFU(WavCoeffs_L[dir][coeffloc_ab]);
@ -2426,7 +2526,7 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &
for (; coeffloc_ab < Hlvl_ab * Wlvl_ab; ++coeffloc_ab) {
float mag_L = SQR(WavCoeffs_L[dir][coeffloc_ab ]);
float mag_ab = SQR(WavCoeffs_ab[dir][coeffloc_ab]);
WavCoeffs_ab[dir][coeffloc_ab] *= SQR(1.f - xexpf(-(mag_ab / (noisevarchrom[coeffloc_ab] * mad_abr)) - (mag_L / (9.f * mad_Lr)))/*satfactor_a*/);
WavCoeffs_ab[dir][coeffloc_ab] *= SQR(1.f - xexpf(-(mag_ab / (nvc[coeffloc_ab] * mad_abr)) - (mag_L / (9.f * mad_Lr)))/*satfactor_a*/);
}//now chrominance coefficients are denoised
#else
@ -2438,7 +2538,7 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &
float mag_L = SQR(WavCoeffs_L[dir][coeffloc_ab ]);
float mag_ab = SQR(WavCoeffs_ab[dir][coeffloc_ab]);
WavCoeffs_ab[dir][coeffloc_ab] *= SQR(1.f - xexpf(-(mag_ab / (noisevarchrom[coeffloc_ab] * mad_abr)) - (mag_L / (9.f * mad_Lr)))/*satfactor_a*/);
WavCoeffs_ab[dir][coeffloc_ab] *= SQR(1.f - xexpf(-(mag_ab / (nvc[coeffloc_ab] * mad_abr)) - (mag_L / (9.f * mad_Lr)))/*satfactor_a*/);
}
}//now chrominance coefficients are denoised
@ -2446,9 +2546,12 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &
#endif
}
delete [] nvc;
}
}
}
}
for (int i = 2; i >= 0; i--) {
@ -2460,16 +2563,20 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &
}
bool ImProcFunctions::WaveletDenoiseAllL(const wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3], float * vari, int edge)//mod JD
bool ImProcFunctions::WaveletDenoiseAllL(const wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3], float * vari, int edge, int denoiseNestedLevels)//mod JD
{
int maxlvl = min(WaveletCoeffs_L.maxlevel(), 5);
if (edge == 1) {
if (edge == 1 || edge == 3 || edge == 5) {
maxlvl = 4; //for refine denoise edge wavelet
}
if (edge == 2) {
maxlvl = 7; //for locallab denoise
}
int maxWL = 0, maxHL = 0;
for (int lvl = 0; lvl < maxlvl; ++lvl) {
@ -2518,11 +2625,20 @@ bool ImProcFunctions::WaveletDenoiseAllL(const wavelet_decomposition &WaveletCoe
bool ImProcFunctions::WaveletDenoiseAllAB(const wavelet_decomposition &WaveletCoeffs_L, const wavelet_decomposition &WaveletCoeffs_ab,
float *noisevarchrom, float madL[8][3], float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb)//mod JD
float *noisevarchrom, float madL[8][3], float *variC, int local, float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb, int denoiseNestedLevels)//mod JD
{
int maxlvl = WaveletCoeffs_L.maxlevel();
if (local == 2) {
maxlvl = 7; //for local denoise
}
if (local == 3) {
maxlvl = 4; //for shape detection
}
int maxWL = 0, maxHL = 0;
for (int lvl = 0; lvl < maxlvl; ++lvl) {
@ -2556,7 +2672,7 @@ bool ImProcFunctions::WaveletDenoiseAllAB(const wavelet_decomposition &WaveletCo
for (int lvl = 0; lvl < maxlvl; ++lvl) {
for (int dir = 1; dir < 4; ++dir) {
ShrinkAllAB(WaveletCoeffs_L, WaveletCoeffs_ab, buffer, lvl, dir, noisevarchrom, noisevar_ab, useNoiseCCurve, autoch, denoiseMethodRgb, madL[lvl]);
ShrinkAllAB(WaveletCoeffs_L, WaveletCoeffs_ab, buffer, lvl, dir, noisevarchrom, noisevar_ab, useNoiseCCurve, autoch, denoiseMethodRgb, madL[lvl], variC, local, nullptr, 0);
}
}
}
@ -2570,8 +2686,6 @@ bool ImProcFunctions::WaveletDenoiseAllAB(const wavelet_decomposition &WaveletCo
return (!memoryAllocationFailed);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void ImProcFunctions::ShrinkAllL(const wavelet_decomposition &WaveletCoeffs_L, float **buffer, int level, int dir,
@ -2583,7 +2697,7 @@ void ImProcFunctions::ShrinkAllL(const wavelet_decomposition &WaveletCoeffs_L, f
float * sfave = buffer[0] + 32;
float * sfaved = buffer[1] + 64;
float * blurBuffer = buffer[2] + 96;
// float * blurBuffer = buffer[2] + 96;
const int W_L = WaveletCoeffs_L.level_W(level);
const int H_L = WaveletCoeffs_L.level_H(level);
@ -2592,30 +2706,54 @@ void ImProcFunctions::ShrinkAllL(const wavelet_decomposition &WaveletCoeffs_L, f
const float mad_L = madL[dir - 1] ;
const float levelFactor = mad_L * 5.f / static_cast<float>(level + 1);
if (edge == 1 && vari) {
noisevarlum = blurBuffer; // we need one buffer, but fortunately we don't have to allocate a new one because we can use blurBuffer
float *nvl = nullptr;
nvl = new float[ H_L * W_L];
for (int i = 0; i < W_L * H_L; ++i) {
noisevarlum[i] = vari[level];
nvl[i] = 0.f;
}
if ((edge == 1 || edge == 2 || edge == 3 || edge == 5) && vari) {
// nvl = blurBuffer; // we need one buffer, but fortunately we don't have to allocate a new one because we can use blurBuffer
if ((edge == 1 || edge == 3)) {
for (int i = 0; i < W_L * H_L; ++i) {
nvl[i] = vari[level]; //* SQR(1.f + 4.f * noisevarchrom[p]);
}
}
if (edge == 2 || edge == 4 || edge == 5) {
for (int i = 0; i < W_L * H_L; ++i) {
nvl[i] = vari[level] * SQR(noisevarlum[i]);
}
}
}
else {
for (int i = 0; i < W_L * H_L; ++i) {
nvl[i] = noisevarlum[i];
}
}
int i = 0;
#ifdef __SSE2__
const vfloat levelFactorv = F2V(levelFactor);
const vfloat ninev = F2V(9.f);
const vfloat epsv = F2V(eps);
for (; i < W_L * H_L - 3; i += 4) {
const vfloat mad_Lv = LVFU(noisevarlum[i]) * levelFactorv;
for (i = 0; i < W_L * H_L - 3; i += 4) {
// const vfloat mad_Lv = LVFU(noisevarlum[i]) * levelFactorv;
const vfloat mad_Lv = LVFU(nvl[i]) * levelFactorv;
const vfloat magv = SQRV(LVFU(WavCoeffs_L[dir][i]));
STVFU(sfave[i], magv / (magv + mad_Lv * xexpf(-magv / (ninev * mad_Lv)) + epsv));
}
#endif
// few remaining pixels
for (; i < W_L * H_L; ++i) {
const float mag = SQR(WavCoeffs_L[dir][i]);
sfave[i] = mag / (mag + levelFactor * noisevarlum[i] * xexpf(-mag / (9 * levelFactor * noisevarlum[i])) + eps);
float mag = SQR(WavCoeffs_L[dir][i]);
sfave[i] = mag / (mag + levelFactor * nvl[i] * xexpf(-mag / (9 * levelFactor * nvl[i])) + eps);
}
boxblur(sfave, sfaved, level + 2, W_L, H_L, false); //increase smoothness by locally averaging shrinkage
@ -2635,12 +2773,15 @@ void ImProcFunctions::ShrinkAllL(const wavelet_decomposition &WaveletCoeffs_L, f
//use smoothed shrinkage unless local shrinkage is much less
WavCoeffs_L[dir][i] *= (SQR(sfaved[i]) + SQR(sf)) / (sfaved[i] + sf + eps);
}//now luminance coefficients are denoised
delete [] nvl;
}
void ImProcFunctions::ShrinkAllAB(const wavelet_decomposition & WaveletCoeffs_L, const wavelet_decomposition & WaveletCoeffs_ab, float **buffer, int level, int dir,
float * noisevarchrom, float noisevar_ab, const bool useNoiseCCurve, bool autoch,
bool denoiseMethodRgb, float * madL, float * madaab, bool madCalculated)
bool denoiseMethodRgb, float * madL, float * variC, int local, float * madaab, bool madCalculated)
{
//simple wavelet shrinkage
@ -2652,6 +2793,7 @@ void ImProcFunctions::ShrinkAllAB(const wavelet_decomposition &WaveletCoeffs_L,
float * sfaveab = buffer[0] + 32;
float * sfaveabd = buffer[1] + 64;
// float * blurBuffer = buffer[2] + 96;
int W_ab = WaveletCoeffs_ab.level_W(level);
int H_ab = WaveletCoeffs_ab.level_H(level);
@ -2671,9 +2813,30 @@ void ImProcFunctions::ShrinkAllAB(const wavelet_decomposition &WaveletCoeffs_L,
madab = SQR(MadRgb(WavCoeffs_ab[dir], W_ab * H_ab));
}
}
float noisevarfc;
if (noisevar_ab > 0.001f) {
madab = useNoiseCCurve ? madab : madab * noisevar_ab;
float *nvc = nullptr;
nvc = new float[ H_ab * W_ab];
if ((local == 2 || local == 3) && variC && useNoiseCCurve) {
noisevarfc = variC[level];
for (int p = 0; p < H_ab * W_ab; p++) {
nvc[p] = 10.f * sqrt(variC[level]) * SQR(1.f + 4.f * noisevarchrom[p]);
}
} else {
noisevarfc = noisevar_ab;
for (int p = 0; p < H_ab * W_ab; p++) {
nvc[p] = noisevarchrom[p];
}
}
// printf("varfc=%f nvc0=%f nvc1=%f nvc2=%f\n", noisevarfc, nvc[10], nvc[H_ab * W_ab /3], nvc[H_ab * W_ab /2]);
if (noisevarfc > 0.001f) {//noisevar_ab
//madab = useNoiseCCurve ? madab : madab * noisevar_ab;
madab = useNoiseCCurve ? madab : madab * noisevarfc;
#ifdef __SSE2__
vfloat onev = F2V(1.f);
vfloat mad_abrv = F2V(madab);
@ -2681,10 +2844,11 @@ void ImProcFunctions::ShrinkAllAB(const wavelet_decomposition &WaveletCoeffs_L,
vfloat rmadLm9v = onev / F2V(mad_L * 9.f);
vfloat mad_abv ;
vfloat mag_Lv, mag_abv;
int coeffloc_ab;
for (coeffloc_ab = 0; coeffloc_ab < H_ab * W_ab - 3; coeffloc_ab += 4) {
mad_abv = LVFU(noisevarchrom[coeffloc_ab]) * mad_abrv;
mad_abv = LVFU(nvc[coeffloc_ab]) * mad_abrv;
mag_Lv = LVFU(WavCoeffs_L[dir][coeffloc_ab]);
mag_abv = SQRV(LVFU(WavCoeffs_ab[dir][coeffloc_ab]));
@ -2696,7 +2860,7 @@ void ImProcFunctions::ShrinkAllAB(const wavelet_decomposition &WaveletCoeffs_L,
for (; coeffloc_ab < H_ab * W_ab; ++coeffloc_ab) {
float mag_L = SQR(WavCoeffs_L[dir][coeffloc_ab]);
float mag_ab = SQR(WavCoeffs_ab[dir][coeffloc_ab]);
sfaveab[coeffloc_ab] = (1.f - xexpf(-(mag_ab / (noisevarchrom[coeffloc_ab] * madab)) - (mag_L / (9.f * mad_L))));
sfaveab[coeffloc_ab] = (1.f - xexpf(-(mag_ab / (nvc[coeffloc_ab] * madab)) - (mag_L / (9.f * mad_L))));
}//now chrominance coefficients are denoised
#else
@ -2706,13 +2870,14 @@ void ImProcFunctions::ShrinkAllAB(const wavelet_decomposition &WaveletCoeffs_L,
int coeffloc_ab = i * W_ab + j;
float mag_L = SQR(WavCoeffs_L[dir][coeffloc_ab]);
float mag_ab = SQR(WavCoeffs_ab[dir][coeffloc_ab]);
sfaveab[coeffloc_ab] = (1.f - xexpf(-(mag_ab / (noisevarchrom[coeffloc_ab] * madab)) - (mag_L / (9.f * mad_L))));
sfaveab[coeffloc_ab] = (1.f - xexpf(-(mag_ab / (nvc[coeffloc_ab] * madab)) - (mag_L / (9.f * mad_L))));
}
}//now chrominance coefficients are denoised
#endif
boxblur(sfaveab, sfaveabd, level + 2, W_ab, H_ab, false); //increase smoothness by locally averaging shrinkage
// boxblur(sfaveab, sfaveabd, blurBuffer, level + 2, level + 2, W_ab, H_ab); //increase smoothness by locally averaging shrinkage
#ifdef __SSE2__
vfloat epsv = F2V(eps);
vfloat sfabv;
@ -2750,6 +2915,7 @@ void ImProcFunctions::ShrinkAllAB(const wavelet_decomposition &WaveletCoeffs_L,
#endif
}
delete [] nvc;
}
void ImProcFunctions::ShrinkAll_info(float ** WavCoeffs_a, float ** WavCoeffs_b,
@ -2908,7 +3074,7 @@ void ImProcFunctions::RGB_denoise_infoGamCurve(const procparams::DirPyrDenoisePa
bool denoiseMethodRgb = (dnparams.dmethod == "RGB");
if (denoiseMethodRgb) {
gamslope = exp(log(static_cast<double>(gamthresh)) / gam) / gamthresh;
gamslope = exp(log(static_cast<double>(gamthresh)) / static_cast<double>(gam)) / static_cast<double>(gamthresh);
Color::gammaf2lut(gamcurve, gam, gamthresh, gamslope, 65535.f, 32768.f);
} else {
Color::gammanf2lut(gamcurve, gam, 65535.f, 32768.f);
@ -3189,19 +3355,19 @@ void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc,
}
float realred, realblue;
float interm_med = static_cast<float>(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<float>(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<float>(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;

View File

@ -254,7 +254,6 @@ public:
}
// handy to sum up per thread histograms. #pragma omp simd speeds up the loop by about factor 3 for LUTu (uint32_t).
template<typename U = T, typename = typename std::enable_if<std::is_same<U, std::uint32_t>::value>::type>
LUT<T> & operator+=(const LUT<T>& rhs)
{
if (rhs.size == this->size) {

View File

@ -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<double>(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<double>(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<double>(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<double>(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;

View File

@ -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<float>(imatrices.rgb_cam[k][j]) / d65_white[i];
}
}
}

View File

@ -1470,48 +1470,48 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
vfloat bluev1 = greenv - (temp00v * vdup(LVFU(Dgrb[1][(indx - v1) >> 1])) + (onev - vdup(LVFU(hvwt[(indx + 1 + offset) >> 1]))) * vdup(LVFU(Dgrb[1][(indx + 1 + offset) >> 1])) + (onev - vdup(LVFU(hvwt[(indx - 1 + offset) >> 1]))) * vdup(LVFU(Dgrb[1][(indx - 1 + offset) >> 1])) + temp01v * vdup(LVFU(Dgrb[1][(indx + v1) >> 1]))) * tempv;
vfloat redv2 = greenv - vdup(LVFU(Dgrb[0][indx >> 1]));
vfloat bluev2 = greenv - vdup(LVFU(Dgrb[1][indx >> 1]));
STVFU(red[row][col], c65535v * vself(selmask, redv1, redv2));
STVFU(blue[row][col], c65535v * vself(selmask, bluev1, bluev2));
STVFU(red[row][col], vmaxf(c65535v * vself(selmask, redv1, redv2), ZEROV));
STVFU(blue[row][col], vmaxf(c65535v * vself(selmask, bluev1, bluev2), ZEROV));
}
if(offset == 0) {
for (; indx < rr * ts + cc1 - 16 - (cc1 & 1); indx++, col++) {
float temp = 1.f / (hvwt[(indx - v1) >> 1] + 2.f - hvwt[(indx + 1) >> 1] - hvwt[(indx - 1) >> 1] + hvwt[(indx + v1) >> 1]);
red[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp);
blue[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp));
indx++;
col++;
red[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]);
blue[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]));
}
if(cc1 & 1) { // width of tile is odd
float temp = 1.f / (hvwt[(indx - v1) >> 1] + 2.f - hvwt[(indx + 1) >> 1] - hvwt[(indx - 1) >> 1] + hvwt[(indx + v1) >> 1]);
red[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp);
blue[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp));
}
} else {
for (; indx < rr * ts + cc1 - 16 - (cc1 & 1); indx++, col++) {
red[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]);
blue[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]));
indx++;
col++;
float temp = 1.f / (hvwt[(indx - v1) >> 1] + 2.f - hvwt[(indx + 1) >> 1] - hvwt[(indx - 1) >> 1] + hvwt[(indx + v1) >> 1]);
red[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp);
blue[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp));
}
if(cc1 & 1) { // width of tile is odd
red[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]);
blue[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]));
}
}
@ -1520,41 +1520,41 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
if((fc(cfarray, rr, 2) & 1) == 1) {
for (; indx < rr * ts + cc1 - 16 - (cc1 & 1); indx++, col++) {
float temp = 1.f / (hvwt[(indx - v1) >> 1] + 2.f - hvwt[(indx + 1) >> 1] - hvwt[(indx - 1) >> 1] + hvwt[(indx + v1) >> 1]);
red[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp);
blue[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp));
indx++;
col++;
red[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]);
blue[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]));
}
if(cc1 & 1) { // width of tile is odd
float temp = 1.f / (hvwt[(indx - v1) >> 1] + 2.f - hvwt[(indx + 1) >> 1] - hvwt[(indx - 1) >> 1] + hvwt[(indx + v1) >> 1]);
red[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp);
blue[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp));
}
} else {
for (; indx < rr * ts + cc1 - 16 - (cc1 & 1); indx++, col++) {
red[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]);
blue[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]));
indx++;
col++;
float temp = 1.f / (hvwt[(indx - v1) >> 1] + 2.f - hvwt[(indx + 1) >> 1] - hvwt[(indx - 1) >> 1] + hvwt[(indx + v1) >> 1]);
red[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp);
blue[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
temp));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[1][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[1][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[1][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[1][(indx + v1) >> 1]) *
temp));
}
if(cc1 & 1) { // width of tile is odd
red[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]);
blue[row][col] = 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]);
red[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[0][indx >> 1]));
blue[row][col] = std::max(0.f, 65535.f * (rgbgreen[indx] - Dgrb[1][indx >> 1]));
}
}
@ -1568,13 +1568,13 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#ifdef __SSE2__
for (; cc < cc1 - 19; cc += 4) {
STVFU(green[row][cc + left], LVF(rgbgreen[rr * ts + cc]) * c65535v);
STVFU(green[row][cc + left], vmaxf(LVF(rgbgreen[rr * ts + cc]) * c65535v, ZEROV));
}
#endif
for (; cc < cc1 - 16; cc++) {
green[row][cc + left] = 65535.f * rgbgreen[rr * ts + cc];
green[row][cc + left] = std::max(0.f, 65535.f * rgbgreen[rr * ts + cc]);
}
}

View File

@ -188,6 +188,16 @@ public:
}
}
void fill(const T val, bool multiThread = false)
{
#ifdef _OPENMP
#pragma omp parallel for if(multiThread)
#endif
for (int i = 0; i < x * y; ++i) {
data[i] = val;
}
}
void free()
{
if ((owner) && (data)) {

View File

@ -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;

View File

@ -195,7 +195,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void);
/* Create a string where valuestring references a string so
* it will not be freed by cJSON_Delete */
CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string);
/* Create an object/arrray that only references it's elements so
/* Create an object/array that only references it's elements so
* they will not be freed by cJSON_Delete */
CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child);
CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child);

View File

@ -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 <pnmio.h>
#include <klt.h>
#include <cmath>
#include <cstring>

View File

@ -2,20 +2,25 @@
* This file is part of RawTherapee.
*/
#include "camconst.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cerrno>
#include <cassert>
#include <memory>
#include <vector>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include <glibmm/ustring.h>
#include "settings.h"
#include "rt_math.h"
#include <cstdio>
#include <cstring>
// cJSON is a very minimal JSON parser lib in C, not for threaded stuff etc, so if we're going to use JSON more than just
// here we should probably replace cJSON with something beefier.
#include "cJSON.h"
#include <errno.h>
#include <assert.h>
#include <inttypes.h>
namespace rtengine
{
@ -30,66 +35,70 @@ CameraConst::CameraConst() : pdafOffset(0)
}
bool
CameraConst::parseApertureScaling(CameraConst *cc, void *ji_)
bool CameraConst::parseApertureScaling(CameraConst *cc, const void *ji_)
{
cJSON *ji = (cJSON *)ji_;
const cJSON *ji = static_cast<const cJSON *>(ji_);
if (ji->type != cJSON_Array) {
fprintf(stderr, "\"ranges\":\"aperture_scaling\" must be an array\n");
return false;
}
for (ji = ji->child; ji != nullptr; ji = ji->next) {
cJSON *js = cJSON_GetObjectItem(ji, "aperture");
for (ji = ji->child; ji; ji = ji->next) {
const cJSON *js = cJSON_GetObjectItem(ji, "aperture");
if (!js) {
fprintf(stderr, "missing \"ranges\":\"aperture_scaling\":\"aperture\" object item.\n");
return false;
} else if (js->type != cJSON_Number) {
}
if (js->type != cJSON_Number) {
fprintf(stderr, "\"ranges\":\"aperture_scaling\":\"aperture\" must be a number.\n");
return false;
}
float aperture = (float)js->valuedouble;
const float aperture = js->valuedouble;
js = cJSON_GetObjectItem(ji, "scale_factor");
if (!js) {
fprintf(stderr, "missing \"ranges\":\"aperture_scaling\":\"scale_factor\" object item.\n");
return false;
} else if (js->type != cJSON_Number) {
}
if (js->type != cJSON_Number) {
fprintf(stderr, "\"ranges\":\"aperture_scaling\":\"scale_factor\" must be a number.\n");
return false;
}
float scale_factor = (float)js->valuedouble;
cc->mApertureScaling.insert(std::pair<float, float>(aperture, scale_factor));
const float scale_factor = js->valuedouble;
cc->mApertureScaling.emplace(aperture, scale_factor);
}
return true;
}
bool
CameraConst::parseLevels(CameraConst *cc, int bw, void *ji_)
bool CameraConst::parseLevels(CameraConst *cc, int bw, const void *ji_)
{
cJSON *ji = (cJSON *)ji_;
const cJSON *ji = static_cast<const cJSON *>(ji_);
if (ji->type == cJSON_Number) {
struct camera_const_levels lvl;
camera_const_levels lvl;
lvl.levels[0] = lvl.levels[1] = lvl.levels[2] = lvl.levels[3] = ji->valueint;
cc->mLevels[bw].insert(std::pair<int, struct camera_const_levels>(0, lvl));
cc->mLevels[bw].emplace(0, lvl);
return true;
} else if (ji->type != cJSON_Array) {
}
if (ji->type != cJSON_Array) {
fprintf(stderr, "\"ranges\":\"%s\" must be a number or an array\n", bw ? "white" : "black");
return false;
}
if (ji->child->type == cJSON_Number) {
struct camera_const_levels lvl;
camera_const_levels lvl;
int i;
cJSON *js;
const cJSON *js;
for (js = ji->child, i = 0; js != nullptr && i < 4; js = js->next, i++) {
for (js = ji->child, i = 0; js && i < 4; js = js->next, i++) {
lvl.levels[i] = js->valueint;
}
@ -97,39 +106,36 @@ CameraConst::parseLevels(CameraConst *cc, int bw, void *ji_)
lvl.levels[3] = lvl.levels[1]; // G2 = G1
} else if (i == 1) {
lvl.levels[3] = lvl.levels[2] = lvl.levels[1] = lvl.levels[0];
} else if (i != 4 || js != nullptr) {
} else if (i != 4 || js) {
fprintf(stderr, "\"ranges\":\"%s\" array must have 1, 3 or 4 numbers.\n", bw ? "white" : "black");
return false;
}
cc->mLevels[bw].insert(std::pair<int, struct camera_const_levels>(0, lvl));
cc->mLevels[bw].emplace(0, lvl);
return true;
}
for (ji = ji->child; ji != nullptr; ji = ji->next) {
int iso[1000] = { 0 };
int iso_count = 0;
cJSON *js = cJSON_GetObjectItem(ji, "iso");
for (ji = ji->child; ji; ji = ji->next) {
const cJSON *js = cJSON_GetObjectItem(ji, "iso");
if (!js) {
fprintf(stderr, "missing \"ranges\":\"%s\":\"iso\" object item.\n", bw ? "white" : "black");
return false;
} else if (js->type == cJSON_Number) {
iso[0] = js->valueint;
iso_count = 1;
} else if (js->type == cJSON_Array) {
int i;
}
for (js = js->child, i = 0; js != nullptr && i < 1000; js = js->next, i++) {
std::vector<int> isos;
if (js->type == cJSON_Number) {
isos.push_back(js->valueint);
} else if (js->type == cJSON_Array) {
for (js = js->child; js; js = js->next) {
if (js->type != cJSON_Number) {
fprintf(stderr, "\"ranges\":\"%s\":\"iso\" must be a number or an array of numbers.\n", bw ? "white" : "black");
return false;
}
iso[i] = js->valueint;
isos.push_back(js->valueint);
}
iso_count = i;
} else {
fprintf(stderr, "\"ranges\":\"%s\":\"iso\" must be an array or a number.\n", bw ? "white" : "black");
return false;
@ -142,14 +148,14 @@ CameraConst::parseLevels(CameraConst *cc, int bw, void *ji_)
return false;
}
struct camera_const_levels lvl;
camera_const_levels lvl;
if (js->type == cJSON_Number) {
lvl.levels[0] = lvl.levels[1] = lvl.levels[2] = lvl.levels[3] = js->valueint;
} else if (js->type == cJSON_Array) {
int i;
for (js = js->child, i = 0; js != nullptr && i < 4; js = js->next, i++) {
for (js = js->child, i = 0; js && i < 4; js = js->next, i++) {
if (js->type != cJSON_Number) {
fprintf(stderr, "\"ranges\":\"%s\":\"levels\" must be a number or an array of numbers.\n", bw ? "white" : "black");
return false;
@ -162,7 +168,7 @@ CameraConst::parseLevels(CameraConst *cc, int bw, void *ji_)
lvl.levels[3] = lvl.levels[1]; // G2 = G1
} else if (i == 1) {
lvl.levels[3] = lvl.levels[2] = lvl.levels[1] = lvl.levels[0];
} else if (i != 4 || js != nullptr) {
} else if (i != 4 || js) {
fprintf(stderr, "\"ranges\":\"%s\":\"levels\" array must have 1, 3 or 4 numbers.\n", bw ? "white" : "black");
return false;
}
@ -171,40 +177,38 @@ CameraConst::parseLevels(CameraConst *cc, int bw, void *ji_)
return false;
}
for (int i = 0; i < iso_count; i++) {
cc->mLevels[bw].insert(std::pair<int, struct camera_const_levels>(iso[i], lvl));
for (auto iso : isos) {
cc->mLevels[bw].emplace(iso, lvl);
}
}
return true;
}
CameraConst *
CameraConst::parseEntry(void *cJSON_, const char *make_model)
CameraConst* CameraConst::parseEntry(const void *cJSON_, const char *make_model)
{
cJSON *js, *ji, *jranges;
js = (cJSON *)cJSON_;
const cJSON *js = static_cast<const cJSON*>(cJSON_);
CameraConst *cc = new CameraConst;
std::unique_ptr<CameraConst> cc(new CameraConst);
cc->make_model = make_model;
ji = cJSON_GetObjectItem(js, "dcraw_matrix");
const cJSON *ji = cJSON_GetObjectItem(js, "dcraw_matrix");
if (ji) {
if (ji->type != cJSON_Array) {
fprintf(stderr, "\"dcraw_matrix\" must be an array\n");
goto parse_error;
return nullptr;
}
int i;
for (i = 0, ji = ji->child; i < 12 && ji != nullptr; i++, ji = ji->next) {
for (i = 0, ji = ji->child; i < 12 && ji; i++, ji = ji->next) {
if (ji->type != cJSON_Number) {
fprintf(stderr, "\"dcraw_matrix\" array must contain numbers\n");
goto parse_error;
return nullptr;
}
cc->dcraw_matrix[i] = (short)ji->valueint;
cc->dcraw_matrix[i] = ji->valueint;
}
}
@ -213,23 +217,23 @@ CameraConst::parseEntry(void *cJSON_, const char *make_model)
if (ji) {
if (ji->type != cJSON_Array) {
fprintf(stderr, "\"raw_crop\" must be an array\n");
goto parse_error;
return nullptr;
}
int i;
for (i = 0, ji = ji->child; i < 4 && ji != nullptr; i++, ji = ji->next) {
for (i = 0, ji = ji->child; i < 4 && ji; i++, ji = ji->next) {
if (ji->type != cJSON_Number) {
fprintf(stderr, "\"raw_crop\" array must contain numbers\n");
goto parse_error;
return nullptr;
}
cc->raw_crop[i] = ji->valueint;
}
if (i != 4 || ji != nullptr) {
if (i != 4 || ji) {
fprintf(stderr, "\"raw_crop\" must contain 4 numbers\n");
goto parse_error;
return nullptr;
}
}
@ -238,43 +242,39 @@ CameraConst::parseEntry(void *cJSON_, const char *make_model)
if (ji) {
if (ji->type != cJSON_Array) {
fprintf(stderr, "\"masked_areas\" must be an array\n");
goto parse_error;
return nullptr;
}
int i;
for (i = 0, ji = ji->child; i < 8 * 4 && ji != nullptr; i++, ji = ji->next) {
for (i = 0, ji = ji->child; i < 2 * 4 && ji; i++, ji = ji->next) {
if (ji->type != cJSON_Number) {
fprintf(stderr, "\"masked_areas\" array must contain numbers\n");
goto parse_error;
return nullptr;
}
cc->raw_mask[i / 4][i % 4] = ji->valueint;
}
if (i % 4 != 0) {
fprintf(stderr, "\"masked_areas\" array length must be divisable by 4\n");
goto parse_error;
fprintf(stderr, "\"masked_areas\" array length must be divisible by 4\n");
return nullptr;
}
}
jranges = cJSON_GetObjectItem(js, "ranges");
const cJSON *jranges = cJSON_GetObjectItem(js, "ranges");
if (jranges) {
ji = cJSON_GetObjectItem(jranges, "black");
if (ji) {
if (!parseLevels(cc, 0, ji)) {
goto parse_error;
}
if (ji && !parseLevels(cc.get(), 0, ji)) {
return nullptr;
}
ji = cJSON_GetObjectItem(jranges, "white");
if (ji) {
if (!parseLevels(cc, 1, ji)) {
goto parse_error;
}
if (ji && !parseLevels(cc.get(), 1, ji)) {
return nullptr;
}
ji = cJSON_GetObjectItem(jranges, "white_max");
@ -282,32 +282,28 @@ CameraConst::parseEntry(void *cJSON_, const char *make_model)
if (ji) {
if (ji->type != cJSON_Number) {
fprintf(stderr, "\"ranges\":\"white_max\" must be a number\n");
goto parse_error;
return nullptr;
}
cc->white_max = (int)ji->valueint;
cc->white_max = ji->valueint;
}
ji = cJSON_GetObjectItem(jranges, "aperture_scaling");
if (ji) {
if (!parseApertureScaling(cc, ji)) {
goto parse_error;
}
if (ji && !parseApertureScaling(cc.get(), ji)) {
return nullptr;
}
}
for (int bw = 0; bw < 2; bw++) {
struct camera_const_levels lvl;
camera_const_levels lvl;
if (!cc->get_Levels(lvl, bw, 0, 0)) {
std::map<int, struct camera_const_levels>::iterator it;
it = cc->mLevels[bw].begin();
const auto it = cc->mLevels[bw].cbegin();
if (it != cc->mLevels[bw].end()) {
if (it != cc->mLevels[bw].cend()) {
// insert levels with lowest iso as the default (iso 0)
struct camera_const_levels lvl = it->second;
cc->mLevels[bw].insert(std::pair<int, struct camera_const_levels>(0, lvl));
cc->mLevels[bw].emplace(0, it->second);
}
}
}
@ -317,13 +313,13 @@ CameraConst::parseEntry(void *cJSON_, const char *make_model)
if (ji) {
if (ji->type != cJSON_Array) {
fprintf(stderr, "\"pdaf_pattern\" must be an array\n");
goto parse_error;
return nullptr;
}
for (ji = ji->child; ji != nullptr; ji = ji->next) {
for (ji = ji->child; ji; ji = ji->next) {
if (ji->type != cJSON_Number) {
fprintf(stderr, "\"pdaf_pattern\" array must contain numbers\n");
goto parse_error;
return nullptr;
}
cc->pdafPattern.push_back(ji->valueint);
@ -335,7 +331,7 @@ CameraConst::parseEntry(void *cJSON_, const char *make_model)
if (ji) {
if (ji->type != cJSON_Number) {
fprintf(stderr, "\"pdaf_offset\" must contain a number\n");
goto parse_error;
return nullptr;
}
cc->pdafOffset = ji->valueint;
@ -346,27 +342,21 @@ CameraConst::parseEntry(void *cJSON_, const char *make_model)
if (ji) {
if (ji->type != cJSON_False && ji->type != cJSON_True) {
fprintf(stderr, "\"global_green_equilibration\" must be a boolean\n");
goto parse_error;
return nullptr;
}
cc->globalGreenEquilibration = (ji->type == cJSON_True);
}
return cc;
parse_error:
delete cc;
return nullptr;
return cc.release();
}
bool
CameraConst::has_dcrawMatrix()
bool CameraConst::has_dcrawMatrix() const
{
return dcraw_matrix[0] != 0;
}
void
CameraConst::update_dcrawMatrix(const short *other)
void CameraConst::update_dcrawMatrix(const short *other)
{
if (!other) {
return;
@ -377,8 +367,7 @@ CameraConst::update_dcrawMatrix(const short *other)
}
}
const short *
CameraConst::get_dcrawMatrix()
const short* CameraConst::get_dcrawMatrix() const
{
if (!has_dcrawMatrix()) {
return nullptr;
@ -387,44 +376,35 @@ CameraConst::get_dcrawMatrix()
return dcraw_matrix;
}
bool
CameraConst::has_pdafPattern()
{
return pdafPattern.size() > 0;
}
std::vector<int>
CameraConst::get_pdafPattern()
const std::vector<int>& CameraConst::get_pdafPattern() const
{
return pdafPattern;
}
void
CameraConst::update_pdafPattern(const std::vector<int> &other)
void CameraConst::update_pdafPattern(const std::vector<int> &other)
{
if (other.empty()) {
return;
}
pdafPattern = other;
}
void
CameraConst::update_pdafOffset(int other)
void CameraConst::update_pdafOffset(int other)
{
if (other == 0) {
return;
}
pdafOffset = other;
}
bool
CameraConst::has_rawCrop()
bool CameraConst::has_rawCrop() const
{
return raw_crop[0] != 0 || raw_crop[1] != 0 || raw_crop[2] != 0 || raw_crop[3] != 0;
}
void
CameraConst::get_rawCrop(int& left_margin, int& top_margin, int& width, int& height)
void CameraConst::get_rawCrop(int& left_margin, int& top_margin, int& width, int& height) const
{
left_margin = raw_crop[0];
top_margin = raw_crop[1];
@ -432,22 +412,20 @@ CameraConst::get_rawCrop(int& left_margin, int& top_margin, int& width, int& hei
height = raw_crop[3];
}
bool
CameraConst::has_rawMask(int idx)
bool CameraConst::has_rawMask(int idx) const
{
if (idx < 0 || idx > 7) {
if (idx < 0 || idx > 1) {
return false;
}
return (raw_mask[idx][0] | raw_mask[idx][1] | raw_mask[idx][2] | raw_mask[idx][3]) != 0;
}
void
CameraConst::get_rawMask(int idx, int& top, int& left, int& bottom, int& right)
void CameraConst::get_rawMask(int idx, int& top, int& left, int& bottom, int& right) const
{
top = left = bottom = right = 0;
if (idx < 0 || idx > 7) {
if (idx < 0 || idx > 1) {
return;
}
@ -457,38 +435,30 @@ CameraConst::get_rawMask(int idx, int& top, int& left, int& bottom, int& right)
right = raw_mask[idx][3];
}
void
CameraConst::update_Levels(const CameraConst *other)
void CameraConst::update_Levels(const CameraConst *other)
{
if (!other) {
return;
}
if (other->mLevels[0].size()) {
mLevels[0].clear();
if (!other->mLevels[0].empty()) {
mLevels[0] = other->mLevels[0];
}
if (other->mLevels[1].size()) {
mLevels[1].clear();
if (!other->mLevels[1].empty()) {
mLevels[1] = other->mLevels[1];
}
if (other->mApertureScaling.size()) {
mApertureScaling.clear();
if (!other->mApertureScaling.empty()) {
mApertureScaling = other->mApertureScaling;
}
if (other->white_max) {
white_max = other->white_max;
}
// for (std::map<int, struct camera_const_levels>::iterator i=other->mLevels[0].begin(); i!=other->mLevels[0].end(); i++) {
// }
}
void
CameraConst::update_Crop(CameraConst *other)
void CameraConst::update_Crop(CameraConst *other)
{
if (!other) {
return;
@ -499,18 +469,16 @@ CameraConst::update_Crop(CameraConst *other)
}
}
bool
CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float fnumber)
bool CameraConst::get_Levels(camera_const_levels & lvl, int bw, int iso, float fnumber) const
{
std::map<int, struct camera_const_levels>::iterator it;
it = mLevels[bw].find(iso);
std::map<int, camera_const_levels>::const_iterator it = mLevels[bw].find(iso);
if (it == mLevels[bw].end()) {
std::map<int, struct camera_const_levels>::iterator best_it = mLevels[bw].begin();
auto best_it = mLevels[bw].cbegin();
if (iso > 0) {
for (it = mLevels[bw].begin(); it != mLevels[bw].end(); ++it) {
if (abs(it->first - iso) <= abs(best_it->first - iso)) {
if (std::abs(it->first - iso) <= std::abs(best_it->first - iso)) {
best_it = it;
} else {
break;
@ -527,35 +495,34 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float
lvl = it->second;
if (bw == 1 && fnumber > 0 && mApertureScaling.size() > 0) {
std::map<float, float>::iterator it;
it = mApertureScaling.find(fnumber);
if (bw == 1 && fnumber > 0 && !mApertureScaling.empty()) {
std::map<float, float>::const_iterator scaleIt = mApertureScaling.find(fnumber);
if (it == mApertureScaling.end()) {
if (scaleIt == mApertureScaling.end()) {
// fnumber may be an exact aperture, eg 1.414, or a rounded eg 1.4. In our map we
// should have rounded numbers so we translate and retry the lookup
// table with traditional 1/3 stop f-number rounding used by most cameras, we only
// have in the range 0.7 - 10.0, but aperture scaling rarely happen past f/4.0
const float fn_tab[8][3] = {
{ 0.7, 0.8, 0.9 },
{ 1.0, 1.1, 1.2 },
{ 1.4, 1.6, 1.8 },
{ 2.0, 2.2, 2.5 },
{ 2.8, 3.2, 3.5 },
{ 4.0, 4.5, 5.0 },
{ 5.6, 6.3, 7.1 },
{ 8.0, 9.0, 10.0 }
constexpr float fn_tab[8][3] = {
{ 0.7f, 0.8f, 0.9f },
{ 1.f, 1.1f, 1.2f },
{ 1.4f, 1.6f, 1.8f },
{ 2.f, 2.2f, 2.5f },
{ 2.8f, 3.2f, 3.5f },
{ 4.f, 4.5f, 5.f },
{ 5.6f, 6.3f, 7.1f },
{ 8.f, 9.f, 10.f }
};
for (int avh = 0; avh < 8; avh++) {
for (int k = 0; k < 3; k++) {
float av = (avh - 1) + (float)k / 3;
float aperture = sqrtf(powf(2, av));
const float av = (avh - 1) + k / 3.f;
const float aperture = std::sqrt(std::pow(2.f, 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);
scaleIt = mApertureScaling.find(fnumber);
avh = 7;
break;
}
@ -563,23 +530,21 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float
}
}
float scaling = 1.0;
float scaling = 1.f;
if (it == mApertureScaling.end()) {
std::map<float, float>::reverse_iterator it;
for (it = mApertureScaling.rbegin(); it != mApertureScaling.rend(); ++it) {
if (it->first > fnumber) {
scaling = it->second;
if (scaleIt == mApertureScaling.end()) {
for (auto entry = mApertureScaling.crbegin(); entry != mApertureScaling.crend(); ++entry) {
if (entry->first > fnumber) {
scaling = entry->second;
} else {
break;
}
}
} else {
scaling = it->second;
scaling = scaleIt->second;
}
if (scaling > 1.0) {
if (scaling > 1.f) {
for (int i = 0; i < 4; i++) {
lvl.levels[i] *= scaling;
@ -593,24 +558,22 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float
return true;
}
int
CameraConst::get_BlackLevel(const int idx, const int iso_speed)
int CameraConst::get_BlackLevel(const int idx, const int iso_speed) const
{
assert(idx >= 0 && idx <= 3);
struct camera_const_levels lvl;
camera_const_levels lvl;
if (!get_Levels(lvl, 0, iso_speed, 0.0)) {
if (!get_Levels(lvl, 0, iso_speed, 0.f)) {
return -1;
}
return lvl.levels[idx];
}
int
CameraConst::get_WhiteLevel(const int idx, const int iso_speed, const float fnumber)
int CameraConst::get_WhiteLevel(const int idx, const int iso_speed, const float fnumber) const
{
assert(idx >= 0 && idx <= 3);
struct camera_const_levels lvl;
camera_const_levels lvl;
if (!get_Levels(lvl, 1, iso_speed, fnumber)) {
return -1;
@ -619,45 +582,41 @@ CameraConst::get_WhiteLevel(const int idx, const int iso_speed, const float fnum
return lvl.levels[idx];
}
bool
CameraConst::has_globalGreenEquilibration()
bool CameraConst::has_globalGreenEquilibration() const
{
return globalGreenEquilibration >= 0;
}
bool
CameraConst::get_globalGreenEquilibration()
bool CameraConst::get_globalGreenEquilibration() const
{
return globalGreenEquilibration > 0;
}
void
CameraConst::update_globalGreenEquilibration(bool other)
void CameraConst::update_globalGreenEquilibration(bool other)
{
globalGreenEquilibration = (other ? 1 : 0);
}
bool
CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_)
bool CameraConstantsStore::parse_camera_constants_file(const Glib::ustring& filename_)
{
// read the file into a single long string
const char *filename = filename_.c_str();
FILE *stream = fopen(filename, "rt");
if (stream == nullptr) {
if (!stream) {
fprintf(stderr, "Could not open camera constants file \"%s\": %s\n", filename, strerror(errno));
return false;
}
size_t bufsize = 16384;
size_t increment = 2 * bufsize;
size_t bufsize = 262144;
size_t increment = bufsize;
size_t datasize = 0, ret;
char *buf = (char *)malloc(bufsize);
while ((ret = fread(&buf[datasize], 1, bufsize - datasize, stream)) != 0) {
while ((ret = fread(&buf[datasize], 1, bufsize - datasize - 1, stream)) != 0) {
datasize += ret;
if (datasize == bufsize) { // we need more memory
if (datasize == bufsize - 1) { // we need more memory
bufsize += increment;
void *temp = realloc(buf, bufsize); // try to realloc buffer with new size
if (!temp) { // realloc failed
@ -683,17 +642,13 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_)
fclose(stream);
if(datasize == bufsize) {
buf = (char *)realloc(buf, datasize + 1);
}
buf[datasize] = '\0';
// remove comments
cJSON_Minify(buf);
// parse
cJSON *jsroot = cJSON_Parse(buf);
cJSON* const jsroot = cJSON_Parse(buf);
if (!jsroot) {
char str[128];
@ -711,20 +666,16 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_)
}
free(buf);
/*{
char *js_str = cJSON_Print(jsroot);
printf("%s\n", js_str);
free(js_str);
}*/
cJSON *js = cJSON_GetObjectItem(jsroot, "camera_constants");
const cJSON *js = cJSON_GetObjectItem(jsroot, "camera_constants");
if (!js) {
fprintf(stderr, "missing \"camera_constants\" object item\n");
goto parse_error;
}
for (js = js->child; js != nullptr; js = js->next) {
cJSON *ji = cJSON_GetObjectItem(js, "make_model");
for (js = js->child; js; js = js->next) {
const cJSON *ji = cJSON_GetObjectItem(js, "make_model");
if (!ji) {
fprintf(stderr, "missing \"make_model\" object item\n");
@ -738,30 +689,30 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_)
is_array = true;
}
while (ji != nullptr) {
while (ji) {
if (ji->type != cJSON_String) {
fprintf(stderr, "\"make_model\" must be a string or an array of strings\n");
goto parse_error;
}
CameraConst *cc = CameraConst::parseEntry((void *)js, ji->valuestring);
CameraConst* const cc = CameraConst::parseEntry((const void *)js, ji->valuestring);
if (!cc) {
goto parse_error;
}
Glib::ustring make_model(ji->valuestring);
make_model = make_model.uppercase();
std::string make_model(ji->valuestring);
std::transform(make_model.begin(), make_model.end(), make_model.begin(), ::toupper);
const auto ret = mCameraConstants.emplace(make_model, cc);
const auto entry = mCameraConstants.emplace(make_model, cc);
if(ret.second) { // entry inserted into map
if (entry.second) { // entry inserted into map
if (settings->verbose) {
printf("Add camera constants for \"%s\"\n", make_model.c_str());
}
} else {
// The CameraConst already exist for this camera make/model -> we merge the values
CameraConst *existingcc = ret.first->second;
CameraConst* const existingcc = entry.first->second;
// updating the dcraw matrix
existingcc->update_dcrawMatrix(cc->get_dcrawMatrix());
@ -809,33 +760,30 @@ 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"));
Glib::ustring userFile(Glib::build_filename(userSettingsDir, "camconst.json"));
const Glib::ustring userFile(Glib::build_filename(userSettingsDir, "camconst.json"));
if (Glib::file_test(userFile, Glib::FILE_TEST_EXISTS)) {
parse_camera_constants_file(userFile);
}
}
CameraConstantsStore *
CameraConstantsStore::getInstance()
CameraConstantsStore* CameraConstantsStore::getInstance()
{
static CameraConstantsStore instance_;
return &instance_;
}
CameraConst *
CameraConstantsStore::get(const char make[], const char model[])
const CameraConst* CameraConstantsStore::get(const char make[], const char model[]) const
{
Glib::ustring key(make);
std::string key(make);
key += " ";
key += model;
key = key.uppercase();
std::map<std::string, CameraConst *>::iterator it;
it = mCameraConstants.find(key);
std::transform(key.begin(), key.end(), key.begin(), ::toupper);
const auto it = mCameraConstants.find(key);
if (it == mCameraConstants.end()) {
return nullptr;

View File

@ -3,10 +3,17 @@
*/
#pragma once
#include <glibmm/ustring.h>
#include <map>
#include <string>
#include <vector>
namespace Glib
{
class ustring;
}
namespace rtengine
{
@ -14,41 +21,40 @@ struct camera_const_levels {
int levels[4];
};
class CameraConst
class CameraConst final
{
private:
std::string make_model;
short dcraw_matrix[12];
int raw_crop[4];
int raw_mask[8][4];
int raw_mask[2][4];
int white_max;
std::map<int, struct camera_const_levels> mLevels[2];
std::map<int, camera_const_levels> mLevels[2];
std::map<float, float> mApertureScaling;
std::vector<int> pdafPattern;
int pdafOffset;
int globalGreenEquilibration;
CameraConst();
static bool parseLevels(CameraConst *cc, int bw, void *ji);
static bool parseApertureScaling(CameraConst *cc, void *ji);
bool get_Levels(struct camera_const_levels & lvl, int bw, int iso, float fnumber);
static bool parseLevels(CameraConst *cc, int bw, const void *ji);
static bool parseApertureScaling(CameraConst *cc, const void *ji);
bool get_Levels(camera_const_levels & lvl, int bw, int iso, float fnumber) const;
public:
static CameraConst *parseEntry(void *cJSON, const char *make_model);
bool has_dcrawMatrix(void);
bool has_pdafPattern(void);
static CameraConst *parseEntry(const void *cJSON, const char *make_model);
bool has_dcrawMatrix(void) const;
void update_dcrawMatrix(const short *other);
const short *get_dcrawMatrix(void);
std::vector<int> get_pdafPattern();
int get_pdafOffset() {return pdafOffset;}
bool has_rawCrop(void);
void get_rawCrop(int& left_margin, int& top_margin, int& width, int& height);
bool has_rawMask(int idx);
void get_rawMask(int idx, int& top, int& left, int& bottom, int& right);
int get_BlackLevel(int idx, int iso_speed);
int get_WhiteLevel(int idx, int iso_speed, float fnumber);
bool has_globalGreenEquilibration();
bool get_globalGreenEquilibration();
const short *get_dcrawMatrix(void) const;
const std::vector<int>& get_pdafPattern() const;
int get_pdafOffset() const {return pdafOffset;};
bool has_rawCrop(void) const;
void get_rawCrop(int& left_margin, int& top_margin, int& width, int& height) const;
bool has_rawMask(int idx) const;
void get_rawMask(int idx, int& top, int& left, int& bottom, int& right) const;
int get_BlackLevel(int idx, int iso_speed) const;
int get_WhiteLevel(int idx, int iso_speed, float fnumber) const;
bool has_globalGreenEquilibration() const;
bool get_globalGreenEquilibration() const;
void update_Levels(const CameraConst *other);
void update_Crop(CameraConst *other);
void update_pdafPattern(const std::vector<int> &other);
@ -56,19 +62,19 @@ public:
void update_globalGreenEquilibration(bool other);
};
class CameraConstantsStore
class CameraConstantsStore final
{
private:
std::map<std::string, CameraConst *> 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[]);
const CameraConst *get(const char make[], const char model[]) const;
};
}

View File

@ -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 }
@ -1240,6 +1240,12 @@ Camera constants:
"ranges": { "white": 4050 } // nominal 4080-4093
},
{ // Quality C, only raw crop
"make_model": "Canon PowerShot SX70 HS",
"dcraw_matrix" : [18285, -8907, -1951, -1845, 10688, 1323, 364, 1101, 5139], // taken from ART
"raw_crop": [ 96, 17, 5248, 3932 ]
},
{ // Quality C
"make_model": "Canon PowerShot SX150 IS",
"dcraw_matrix": [ 13481, -4867, -1063, -2074, 9960, 2472, -170, 1474, 3894 ], // Adobe DNG Converter 11.1 ColorMatrix1 (there is only one matrix and illuminant, and it's for daylight)
@ -1265,6 +1271,7 @@ Camera constants:
{ // Quality C
"make_model": "FUJIFILM GFX 100",
"dcraw_matrix" : [16212, -8423, -1583, -4336, 12583, 1937, -195, 726, 6199], // taken from ART
"raw_crop": [ 0, 2, 11664, 8734 ]
},
@ -1288,6 +1295,12 @@ Camera constants:
"ranges": { "white": 16100 }
},
{ // Quality C
"make_model": [ "FUJIFILM X100V", "FUJIFILM X-T4" ],
"dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v12.2 D65
"raw_crop": [ 0, 5, 6252, 4140 ]
},
{ // Quality C
"make_model": "Fujifilm X10",
"ranges": { "white": 3788 }
@ -1323,6 +1336,11 @@ Camera constants:
"ranges": { "white": 16100 }
},
{ // Quality C, bisected from the overexposed region of one pre-release sample file
"make_model": "FUJIFILM X-A7",
"ranges": { "white": 16382 }
},
{ // Quality B
"make_model": "FUJIFILM X-A10",
"dcraw_matrix": [ 11540,-4999,-991,-2949,10963,2278,-382,1049,5605 ], // DNGv9.12 D65
@ -1340,6 +1358,7 @@ Camera constants:
{ // Quality C
"make_model": [ "FUJIFILM X-T100" ],
"dcraw_matrix" : [11673, -4760, -1041, -3988, 12058, 2166, -771, 1417, 5568], // taken from ART
"ranges": { "white": 16100 }
},
@ -1365,7 +1384,8 @@ Camera constants:
},
{ // Quality C, only raw crop
"make_model": [ "FUJIFILM X-T3", "FUJIFILM X-T30" ],
"make_model": [ "FUJIFILM X-T3", "FUJIFILM X-T30", "FUJIFILM X-PRO3" ],
"dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v11, standard_v2 d65
"raw_crop": [ 0, 5, 6252, 4176]
},
@ -1381,6 +1401,11 @@ Camera constants:
"ranges": { "white": 4040 }
},
{ // Quality B, Matrix from ART
"make_model" : "LEICA D-LUX 7",
"dcraw_matrix" : [11577, -4230, -1106, -3967, 12211, 1957, -758, 1762, 5610]
},
{ // Quality B, Matrix from Adobe's dcp D65 instead of the internal in Leica's DNG
"make_model": "LEICA Q (Typ 116)",
"dcraw_matrix": [ 10068,-4043,-1068,-5319,14268,1044,-765,1701,6522 ], // DCP D65
@ -1398,6 +1423,16 @@ Camera constants:
"raw_crop": [ 4, 4, -4, -4 ] // full raw 6016x4016, Official 6000x4000
},
{ // Quality C, only raw crop
"make_model": "Leica SL2",
"raw_crop": [ 0, 0, 0, -18 ] // 18 rows at bottom are garbage
},
{ // Quality B, Matrix from ART
"make_model" : "LEICA V-LUX 5",
"dcraw_matrix" : [9803, -4185, -992, -4066, 12578, 1628, -838, 1824, 5288]
},
{ // Quality C
"make_model": "LG mobile LG-H815",
"dcraw_matrix": [ 5859,547,-1250,-6484,15547,547,-2422,5625,3906 ], // DNG D65
@ -1505,7 +1540,7 @@ Camera constants:
{ // Quality B
"make_model": "NIKON COOLPIX P1000",
"dcraw_matrix": [ 14294, -6116, -1333, -1628, 10219, 1637, -14, 1158, 5022 ], // ColorMatrix2 from Adobe DNG Converter 11.4
"ranges": { "black": 200, "white": 4093 }
"ranges": { "black": 200, "white": 4087 }
},
{ // Quality B, no LENR samples
@ -1758,6 +1793,7 @@ Camera constants:
{ // Quality C, only raw crop
"make_model": "OLYMPUS TG-6",
"dcraw_matrix" : [10899, -3832, -1082, -2112, 10736, 1575, -267, 1452, 5269], // taken from ART
"raw_crop": [ 0, 0, -24, 0 ] // 24 pixels at right are garbage
},

View File

@ -18,6 +18,7 @@
*/
// Code adapted from ART
// https://bitbucket.org/agriggio/art/
/*
*
* This file is part of ART.
@ -37,9 +38,14 @@
*/
// 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
*
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:
@ -3036,11 +3042,11 @@ bool crxSetupImageData(
void crxFreeImageData(CrxImage* img)
{
CrxTile* tile = img->tiles;
if (img->tiles) {
CrxTile* const tile = img->tiles;
const int nTiles = img->tileRows * img->tileCols;
if (img->tiles) {
for (std::int32_t curTile = 0; curTile < nTiles; curTile++, tile++) {
for (std::int32_t curTile = 0; curTile < nTiles; ++curTile) {
if (tile[curTile].comps) {
for (std::int32_t curPlane = 0; curPlane < img->nPlanes; ++curPlane) {
crxFreeSubbandData(img, tile[curTile].comps + curPlane);

View File

@ -33,6 +33,50 @@
namespace {
void compute13x13kernel(float sigma, float kernel[13][13]) {
const double temp = -2.f * rtengine::SQR(sigma);
float sum = 0.f;
for (int i = -6; i <= 6; ++i) {
for (int j = -6; j <= 6; ++j) {
if((rtengine::SQR(i) + rtengine::SQR(j)) <= rtengine::SQR(3.0 * 2.0)) {
kernel[i + 6][j + 6] = std::exp((rtengine::SQR(i) + rtengine::SQR(j)) / temp);
sum += kernel[i + 6][j + 6];
} else {
kernel[i + 6][j + 6] = 0.f;
}
}
}
for (int i = 0; i < 13; ++i) {
for (int j = 0; j < 13; ++j) {
kernel[i][j] /= sum;
}
}
}
void compute9x9kernel(float sigma, float kernel[9][9]) {
const double temp = -2.f * rtengine::SQR(sigma);
float sum = 0.f;
for (int i = -4; i <= 4; ++i) {
for (int j = -4; j <= 4; ++j) {
if((rtengine::SQR(i) + rtengine::SQR(j)) <= rtengine::SQR(3.0 * 1.5)) {
kernel[i + 4][j + 4] = std::exp((rtengine::SQR(i) + rtengine::SQR(j)) / temp);
sum += kernel[i + 4][j + 4];
} else {
kernel[i + 4][j + 4] = 0.f;
}
}
}
for (int i = 0; i < 9; ++i) {
for (int j = 0; j < 9; ++j) {
kernel[i][j] /= sum;
}
}
}
void compute7x7kernel(float sigma, float kernel[7][7]) {
const double temp = -2.f * rtengine::SQR(sigma);
@ -99,31 +143,7 @@ void compute3x3kernel(float sigma, float kernel[3][3]) {
}
}
inline void initTile(float** dst, const int tileSize)
{
// first rows
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < tileSize; ++j) {
dst[i][j] = 1.f;
}
}
// left and right border
for (int i = 3; i < tileSize - 3; ++i) {
dst[i][0] = dst[i][1] = dst[i][2] = 1.f;
dst[i][tileSize - 3] = dst[i][tileSize - 2] = dst[i][tileSize - 1] = 1.f;
}
// last rows
for (int i = tileSize - 3 ; i < tileSize; ++i) {
for (int j = 0; j < tileSize; ++j) {
dst[i][j] = 1.f;
}
}
}
inline void gauss3x3div (float** RESTRICT src, float** RESTRICT dst, float** RESTRICT divBuffer, const int tileSize, const float kernel[3][3])
void gauss3x3div (float** RESTRICT src, float** RESTRICT dst, float** RESTRICT divBuffer, const int tileSize, const float kernel[3][3])
{
const float c11 = kernel[0][0];
@ -131,6 +151,11 @@ inline void gauss3x3div (float** RESTRICT src, float** RESTRICT dst, float** RES
const float c00 = kernel[1][1];
for (int i = 1; i < tileSize - 1; i++) {
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 1; j < tileSize - 1; j++) {
const float val = c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
@ -140,7 +165,7 @@ inline void gauss3x3div (float** RESTRICT src, float** RESTRICT dst, float** RES
}
}
inline void gauss5x5div (float** RESTRICT src, float** RESTRICT dst, float** RESTRICT divBuffer, const int tileSize, const float kernel[5][5])
void gauss5x5div (float** RESTRICT src, float** RESTRICT dst, float** RESTRICT divBuffer, const int tileSize, const float kernel[5][5])
{
const float c21 = kernel[0][1];
@ -151,8 +176,13 @@ inline void gauss5x5div (float** RESTRICT src, float** RESTRICT dst, float** RES
for (int i = 2; i < tileSize - 2; ++i) {
// I tried hand written SSE code but gcc vectorizes better
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 2; j < tileSize - 2; ++j) {
const float val = c21 * (src[i - 2][j - 1] + src[i - 2][j + 1] + src[i - 1][j - 2] + src[i - 1][j + 2] + src[i + 1][j - 2] + src[i + 1][j + 2] + src[i + 2][j - 1] + src[i + 2][j + 1]) +
const float val = c21 * ((src[i - 2][j - 1] + src[i - 2][j + 1]) + (src[i - 1][j - 2] + src[i - 1][j + 2]) + (src[i + 1][j - 2] + src[i + 1][j + 2]) + (src[i + 2][j - 1] + src[i + 2][j + 1])) +
c20 * (src[i - 2][j] + src[i][j - 2] + src[i][j + 2] + src[i + 2][j]) +
c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
@ -163,7 +193,7 @@ inline void gauss5x5div (float** RESTRICT src, float** RESTRICT dst, float** RES
}
}
inline void gauss7x7div(float** RESTRICT src, float** RESTRICT dst, float** RESTRICT divBuffer, const int tileSize, const float kernel[7][7])
void gauss7x7div(float** RESTRICT src, float** RESTRICT dst, float** RESTRICT divBuffer, const int tileSize, const float kernel[7][7])
{
const float c31 = kernel[0][2];
@ -177,11 +207,16 @@ inline void gauss7x7div(float** RESTRICT src, float** RESTRICT dst, float** REST
for (int i = 3; i < tileSize - 3; ++i) {
// I tried hand written SSE code but gcc vectorizes better
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 3; j < tileSize - 3; ++j) {
const float val = c31 * (src[i - 3][j - 1] + src[i - 3][j + 1] + src[i - 1][j - 3] + src[i - 1][j + 3] + src[i + 1][j - 3] + src[i + 1][j + 3] + src[i + 3][j - 1] + src[i + 3][j + 1]) +
const float val = c31 * ((src[i - 3][j - 1] + src[i - 3][j + 1]) + (src[i - 1][j - 3] + src[i - 1][j + 3]) + (src[i + 1][j - 3] + src[i + 1][j + 3]) + (src[i + 3][j - 1] + src[i + 3][j + 1])) +
c30 * (src[i - 3][j] + src[i][j - 3] + src[i][j + 3] + src[i + 3][j]) +
c22 * (src[i - 2][j - 2] + src[i - 2][j + 2] + src[i + 2][j - 2] + src[i + 2][j + 2]) +
c21 * (src[i - 2][j - 1] + src[i - 2][j + 1] * c21 + src[i - 1][j - 2] + src[i - 1][j + 2] + src[i + 1][j - 2] + src[i + 1][j + 2] + src[i + 2][j - 1] + src[i + 2][j + 1]) +
c21 * ((src[i - 2][j - 1] + src[i - 2][j + 1]) + (src[i - 1][j - 2] + src[i - 1][j + 2]) + (src[i + 1][j - 2] + src[i + 1][j + 2]) + (src[i + 2][j - 1] + src[i + 2][j + 1])) +
c20 * (src[i - 2][j] + src[i][j - 2] + src[i][j + 2] + src[i + 2][j]) +
c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
@ -192,13 +227,117 @@ inline void gauss7x7div(float** RESTRICT src, float** RESTRICT dst, float** REST
}
}
inline void gauss3x3mult(float** RESTRICT src, float** RESTRICT dst, const int tileSize, const float kernel[3][3])
void gauss9x9div(float** RESTRICT src, float** RESTRICT dst, float** RESTRICT divBuffer, const int tileSize, const float kernel[9][9])
{
const float c42 = kernel[0][2];
const float c41 = kernel[0][3];
const float c40 = kernel[0][4];
const float c33 = kernel[1][1];
const float c32 = kernel[1][2];
const float c31 = kernel[1][3];
const float c30 = kernel[1][4];
const float c22 = kernel[2][2];
const float c21 = kernel[2][3];
const float c20 = kernel[2][4];
const float c11 = kernel[3][3];
const float c10 = kernel[3][4];
const float c00 = kernel[4][4];
for (int i = 4; i < tileSize - 4; ++i) {
// I tried hand written SSE code but gcc vectorizes better
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 4; j < tileSize - 4; ++j) {
const float val = c42 * ((src[i - 4][j - 2] + src[i - 4][j + 2]) + (src[i - 2][j - 4] + src[i - 2][j + 4]) + (src[i + 2][j - 4] + src[i + 2][j + 4]) + (src[i + 4][j - 2] + src[i + 4][j + 2])) +
c41 * ((src[i - 4][j - 1] + src[i - 4][j + 1]) + (src[i - 1][j - 4] + src[i - 1][j + 4]) + (src[i + 1][j - 4] + src[i + 1][j + 4]) + (src[i + 4][j - 1] + src[i + 4][j + 1])) +
c40 * (src[i - 4][j] + src[i][j - 4] + src[i][j + 4] + src[i + 4][j]) +
c33 * (src[i - 3][j - 3] + src[i - 3][j + 3] + src[i + 3][j - 3] + src[i + 3][j + 3]) +
c32 * ((src[i - 3][j - 2] + src[i - 3][j + 2]) + (src[i - 2][j - 3] + src[i - 2][j + 3]) + (src[i + 2][j - 3] + src[i + 2][j + 3]) + (src[i + 3][j - 2] + src[i + 3][j + 2])) +
c31 * ((src[i - 3][j - 1] + src[i - 3][j + 1]) + (src[i - 1][j - 3] + src[i - 1][j + 3]) + (src[i + 1][j - 3] + src[i + 1][j + 3]) + (src[i + 3][j - 1] + src[i + 3][j + 1])) +
c30 * (src[i - 3][j] + src[i][j - 3] + src[i][j + 3] + src[i + 3][j]) +
c22 * (src[i - 2][j - 2] + src[i - 2][j + 2] + src[i + 2][j - 2] + src[i + 2][j + 2]) +
c21 * ((src[i - 2][j - 1] + src[i - 2][j + 1]) + (src[i - 1][j - 2] + src[i - 1][j + 2]) + (src[i + 1][j - 2] + src[i + 1][j + 2]) + (src[i + 2][j - 1] + src[i + 2][j + 1])) +
c20 * (src[i - 2][j] + src[i][j - 2] + src[i][j + 2] + src[i + 2][j]) +
c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
c00 * src[i][j];
dst[i][j] = divBuffer[i][j] / std::max(val, 0.00001f);
}
}
}
void gauss13x13div(float** RESTRICT src, float** RESTRICT dst, float** RESTRICT divBuffer, const int tileSize, const float kernel[13][13])
{
const float c60 = kernel[0][6];
const float c53 = kernel[1][3];
const float c52 = kernel[1][4];
const float c51 = kernel[1][5];
const float c50 = kernel[1][6];
const float c44 = kernel[2][2];
const float c42 = kernel[2][4];
const float c41 = kernel[2][5];
const float c40 = kernel[2][6];
const float c33 = kernel[3][3];
const float c32 = kernel[3][4];
const float c31 = kernel[3][5];
const float c30 = kernel[3][6];
const float c22 = kernel[4][4];
const float c21 = kernel[4][5];
const float c20 = kernel[4][6];
const float c11 = kernel[5][5];
const float c10 = kernel[5][6];
const float c00 = kernel[6][6];
for (int i = 6; i < tileSize - 6; ++i) {
// I tried hand written SSE code but gcc vectorizes better
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 6; j < tileSize - 6; ++j) {
const float val = c60 * (src[i - 6][j] + src[i][j - 6] + src[i][j + 6] + src[i + 6][j]) +
c53 * ((src[i - 5][j - 3] + src[i - 5][j + 3]) + (src[i - 3][j - 5] + src[i - 3][j + 5]) + (src[i + 3][j - 5] + src[i + 3][j + 5]) + (src[i + 5][j - 3] + src[i + 5][j + 3])) +
c52 * ((src[i - 5][j - 2] + src[i - 5][j + 2]) + (src[i - 2][j - 5] + src[i - 2][j + 5]) + (src[i + 2][j - 5] + src[i + 2][j + 5]) + (src[i + 5][j - 2] + src[i + 5][j + 2])) +
c51 * ((src[i - 5][j - 1] + src[i - 5][j + 1]) + (src[i - 1][j - 5] + src[i - 1][j + 5]) + (src[i + 1][j - 5] + src[i + 1][j + 5]) + (src[i + 5][j - 1] + src[i + 5][j + 1])) +
c50 * ((src[i - 5][j] + src[i][j - 5] + src[i][j + 5] + src[i + 5][j]) + ((src[i - 4][j - 3] + src[i - 4][j + 3]) + (src[i - 3][j - 4] + src[i - 3][j + 4]) + (src[i + 3][j - 4] + src[i + 3][j + 4]) + (src[i + 4][j - 3] + src[i + 4][j + 3]))) +
c44 * (src[i - 4][j - 4] + src[i - 4][j + 4] + src[i + 4][j - 4] + src[i + 4][j + 4]) +
c42 * ((src[i - 4][j - 2] + src[i - 4][j + 2]) + (src[i - 2][j - 4] + src[i - 2][j + 4]) + (src[i + 2][j - 4] + src[i + 2][j + 4]) + (src[i + 4][j - 2] + src[i + 4][j + 2])) +
c41 * ((src[i - 4][j - 1] + src[i - 4][j + 1]) + (src[i - 1][j - 4] + src[i - 1][j + 4]) + (src[i + 1][j - 4] + src[i + 1][j + 4]) + (src[i + 4][j - 1] + src[i + 4][j + 1])) +
c40 * (src[i - 4][j] + src[i][j - 4] + src[i][j + 4] + src[i + 4][j]) +
c33 * (src[i - 3][j - 3] + src[i - 3][j + 3] + src[i + 3][j - 3] + src[i + 3][j + 3]) +
c32 * ((src[i - 3][j - 2] + src[i - 3][j + 2]) + (src[i - 2][j - 3] + src[i - 2][j + 3]) + (src[i + 2][j - 3] + src[i + 2][j + 3]) + (src[i + 3][j - 2] + src[i + 3][j + 2])) +
c31 * ((src[i - 3][j - 1] + src[i - 3][j + 1]) + (src[i - 1][j - 3] + src[i - 1][j + 3]) + (src[i + 1][j - 3] + src[i + 1][j + 3]) + (src[i + 3][j - 1] + src[i + 3][j + 1])) +
c30 * (src[i - 3][j] + src[i][j - 3] + src[i][j + 3] + src[i + 3][j]) +
c22 * (src[i - 2][j - 2] + src[i - 2][j + 2] + src[i + 2][j - 2] + src[i + 2][j + 2]) +
c21 * ((src[i - 2][j - 1] + src[i - 2][j + 1]) + (src[i - 1][j - 2] + src[i - 1][j + 2]) + (src[i + 1][j - 2] + src[i + 1][j + 2]) + (src[i + 2][j - 1] + src[i + 2][j + 1])) +
c20 * (src[i - 2][j] + src[i][j - 2] + src[i][j + 2] + src[i + 2][j]) +
c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
c00 * src[i][j];
dst[i][j] = divBuffer[i][j] / std::max(val, 0.00001f);
}
}
}
void gauss3x3mult(float** RESTRICT src, float** RESTRICT dst, const int tileSize, const float kernel[3][3])
{
const float c11 = kernel[0][0];
const float c10 = kernel[0][1];
const float c00 = kernel[1][1];
for (int i = 1; i < tileSize - 1; i++) {
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 1; j < tileSize - 1; j++) {
const float val = c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
@ -209,7 +348,7 @@ inline void gauss3x3mult(float** RESTRICT src, float** RESTRICT dst, const int t
}
inline void gauss5x5mult (float** RESTRICT src, float** RESTRICT dst, const int tileSize, const float kernel[5][5])
void gauss5x5mult (float** RESTRICT src, float** RESTRICT dst, const int tileSize, const float kernel[5][5])
{
const float c21 = kernel[0][1];
@ -220,8 +359,13 @@ inline void gauss5x5mult (float** RESTRICT src, float** RESTRICT dst, const int
for (int i = 2; i < tileSize - 2; ++i) {
// I tried hand written SSE code but gcc vectorizes better
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 2; j < tileSize - 2; ++j) {
const float val = c21 * (src[i - 2][j - 1] + src[i - 2][j + 1] + src[i - 1][j - 2] + src[i - 1][j + 2] + src[i + 1][j - 2] + src[i + 1][j + 2] + src[i + 2][j - 1] + src[i + 2][j + 1]) +
const float val = c21 * ((src[i - 2][j - 1] + src[i - 2][j + 1]) + (src[i - 1][j - 2] + src[i - 1][j + 2]) + (src[i + 1][j - 2] + src[i + 1][j + 2]) + (src[i + 2][j - 1] + src[i + 2][j + 1])) +
c20 * (src[i - 2][j] + src[i][j - 2] + src[i][j + 2] + src[i + 2][j]) +
c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
@ -232,7 +376,7 @@ inline void gauss5x5mult (float** RESTRICT src, float** RESTRICT dst, const int
}
}
inline void gauss7x7mult(float** RESTRICT src, float** RESTRICT dst, const int tileSize, const float kernel[7][7])
void gauss7x7mult(float** RESTRICT src, float** RESTRICT dst, const int tileSize, const float kernel[7][7])
{
const float c31 = kernel[0][2];
@ -246,11 +390,115 @@ inline void gauss7x7mult(float** RESTRICT src, float** RESTRICT dst, const int t
for (int i = 3; i < tileSize - 3; ++i) {
// I tried hand written SSE code but gcc vectorizes better
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 3; j < tileSize - 3; ++j) {
const float val = c31 * (src[i - 3][j - 1] + src[i - 3][j + 1] + src[i - 1][j - 3] + src[i - 1][j + 3] + src[i + 1][j - 3] + src[i + 1][j + 3] + src[i + 3][j - 1] + src[i + 3][j + 1]) +
const float val = c31 * ((src[i - 3][j - 1] + src[i - 3][j + 1]) + (src[i - 1][j - 3] + src[i - 1][j + 3]) + (src[i + 1][j - 3] + src[i + 1][j + 3]) + (src[i + 3][j - 1] + src[i + 3][j + 1])) +
c30 * (src[i - 3][j] + src[i][j - 3] + src[i][j + 3] + src[i + 3][j]) +
c22 * (src[i - 2][j - 2] + src[i - 2][j + 2] + src[i + 2][j - 2] + src[i + 2][j + 2]) +
c21 * (src[i - 2][j - 1] + src[i - 2][j + 1] * c21 + src[i - 1][j - 2] + src[i - 1][j + 2] + src[i + 1][j - 2] + src[i + 1][j + 2] + src[i + 2][j - 1] + src[i + 2][j + 1]) +
c21 * ((src[i - 2][j - 1] + src[i - 2][j + 1]) + (src[i - 1][j - 2] + src[i - 1][j + 2]) + (src[i + 1][j - 2] + src[i + 1][j + 2]) + (src[i + 2][j - 1] + src[i + 2][j + 1])) +
c20 * (src[i - 2][j] + src[i][j - 2] + src[i][j + 2] + src[i + 2][j]) +
c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
c00 * src[i][j];
dst[i][j] *= val;
}
}
}
void gauss9x9mult(float** RESTRICT src, float** RESTRICT dst, const int tileSize, const float kernel[9][9])
{
const float c42 = kernel[0][2];
const float c41 = kernel[0][3];
const float c40 = kernel[0][4];
const float c33 = kernel[1][1];
const float c32 = kernel[1][2];
const float c31 = kernel[1][3];
const float c30 = kernel[1][4];
const float c22 = kernel[2][2];
const float c21 = kernel[2][3];
const float c20 = kernel[2][4];
const float c11 = kernel[3][3];
const float c10 = kernel[3][4];
const float c00 = kernel[4][4];
for (int i = 4; i < tileSize - 4; ++i) {
// I tried hand written SSE code but gcc vectorizes better
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 4; j < tileSize - 4; ++j) {
const float val = c42 * ((src[i - 4][j - 2] + src[i - 4][j + 2]) + (src[i - 2][j - 4] + src[i - 2][j + 4]) + (src[i + 2][j - 4] + src[i + 2][j + 4]) + (src[i + 4][j - 2] + src[i + 4][j + 2])) +
c41 * ((src[i - 4][j - 1] + src[i - 4][j + 1]) + (src[i - 1][j - 4] + src[i - 1][j + 4]) + (src[i + 1][j - 4] + src[i + 1][j + 4]) + (src[i + 4][j - 1] + src[i + 4][j + 1])) +
c40 * (src[i - 4][j] + src[i][j - 4] + src[i][j + 4] + src[i + 4][j]) +
c33 * (src[i - 3][j - 3] + src[i - 3][j + 3] + src[i + 3][j - 3] + src[i + 3][j + 3]) +
c32 * ((src[i - 3][j - 2] + src[i - 3][j + 2]) + (src[i - 2][j - 3] + src[i - 2][j + 3]) + (src[i + 2][j - 3] + src[i + 2][j + 3]) + (src[i + 3][j - 2] + src[i + 3][j + 2])) +
c31 * ((src[i - 3][j - 1] + src[i - 3][j + 1]) + (src[i - 1][j - 3] + src[i - 1][j + 3]) + (src[i + 1][j - 3] + src[i + 1][j + 3]) + (src[i + 3][j - 1] + src[i + 3][j + 1])) +
c30 * (src[i - 3][j] + src[i][j - 3] + src[i][j + 3] + src[i + 3][j]) +
c22 * (src[i - 2][j - 2] + src[i - 2][j + 2] + src[i + 2][j - 2] + src[i + 2][j + 2]) +
c21 * ((src[i - 2][j - 1] + src[i - 2][j + 1]) + (src[i - 1][j - 2] + src[i - 1][j + 2]) + (src[i + 1][j - 2] + src[i + 1][j + 2]) + (src[i + 2][j - 1] + src[i + 2][j + 1])) +
c20 * (src[i - 2][j] + src[i][j - 2] + src[i][j + 2] + src[i + 2][j]) +
c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
c00 * src[i][j];
dst[i][j] *= val;
}
}
}
void gauss13x13mult(float** RESTRICT src, float** RESTRICT dst, const int tileSize, const float kernel[13][13])
{
const float c60 = kernel[0][6];
const float c53 = kernel[1][3];
const float c52 = kernel[1][4];
const float c51 = kernel[1][5];
const float c50 = kernel[1][6];
const float c44 = kernel[2][2];
const float c42 = kernel[2][4];
const float c41 = kernel[2][5];
const float c40 = kernel[2][6];
const float c33 = kernel[3][3];
const float c32 = kernel[3][4];
const float c31 = kernel[3][5];
const float c30 = kernel[3][6];
const float c22 = kernel[4][4];
const float c21 = kernel[4][5];
const float c20 = kernel[4][6];
const float c11 = kernel[5][5];
const float c10 = kernel[5][6];
const float c00 = kernel[6][6];
for (int i = 6; i < tileSize - 6; ++i) {
// I tried hand written SSE code but gcc vectorizes better
#if defined(__clang__)
#pragma clang loop vectorize(assume_safety)
#elif defined(__GNUC__)
#pragma GCC ivdep
#endif
for (int j = 6; j < tileSize - 6; ++j) {
const float val = c60 * (src[i - 6][j] + src[i][j - 6] + src[i][j + 6] + src[i + 6][j]) +
c53 * ((src[i - 5][j - 3] + src[i - 5][j + 3]) + (src[i - 3][j - 5] + src[i - 3][j + 5]) + (src[i + 3][j - 5] + src[i + 3][j + 5]) + (src[i + 5][j - 3] + src[i + 5][j + 3])) +
c52 * ((src[i - 5][j - 2] + src[i - 5][j + 2]) + (src[i - 2][j - 5] + src[i - 2][j + 5]) + (src[i + 2][j - 5] + src[i + 2][j + 5]) + (src[i + 5][j - 2] + src[i + 5][j + 2])) +
c51 * ((src[i - 5][j - 1] + src[i - 5][j + 1]) + (src[i - 1][j - 5] + src[i - 1][j + 5]) + (src[i + 1][j - 5] + src[i + 1][j + 5]) + (src[i + 5][j - 1] + src[i + 5][j + 1])) +
c50 * ((src[i - 5][j] + src[i][j - 5] + src[i][j + 5] + src[i + 5][j]) + ((src[i - 4][j - 3] + src[i - 4][j + 3]) + (src[i - 3][j - 4] + src[i - 3][j + 4]) + (src[i + 3][j - 4] + src[i + 3][j + 4]) + (src[i + 4][j - 3] + src[i + 4][j + 3]))) +
c44 * (src[i - 4][j - 4] + src[i - 4][j + 4] + src[i + 4][j - 4] + src[i + 4][j + 4]) +
c42 * ((src[i - 4][j - 2] + src[i - 4][j + 2]) + (src[i - 2][j - 4] + src[i - 2][j + 4]) + (src[i + 2][j - 4] + src[i + 2][j + 4]) + (src[i + 4][j - 2] + src[i + 4][j + 2])) +
c41 * ((src[i - 4][j - 1] + src[i - 4][j + 1]) + (src[i - 1][j - 4] + src[i - 1][j + 4]) + (src[i + 1][j - 4] + src[i + 1][j + 4]) + (src[i + 4][j - 1] + src[i + 4][j + 1])) +
c40 * (src[i - 4][j] + src[i][j - 4] + src[i][j + 4] + src[i + 4][j]) +
c33 * (src[i - 3][j - 3] + src[i - 3][j + 3] + src[i + 3][j - 3] + src[i + 3][j + 3]) +
c32 * ((src[i - 3][j - 2] + src[i - 3][j + 2]) + (src[i - 2][j - 3] + src[i - 2][j + 3]) + (src[i + 2][j - 3] + src[i + 2][j + 3]) + (src[i + 3][j - 2] + src[i + 3][j + 2])) +
c31 * ((src[i - 3][j - 1] + src[i - 3][j + 1]) + (src[i - 1][j - 3] + src[i - 1][j + 3]) + (src[i + 1][j - 3] + src[i + 1][j + 3]) + (src[i + 3][j - 1] + src[i + 3][j + 1])) +
c30 * (src[i - 3][j] + src[i][j - 3] + src[i][j + 3] + src[i + 3][j]) +
c22 * (src[i - 2][j - 2] + src[i - 2][j + 2] + src[i + 2][j - 2] + src[i + 2][j + 2]) +
c21 * ((src[i - 2][j - 1] + src[i - 2][j + 1]) + (src[i - 1][j - 2] + src[i - 1][j + 2]) + (src[i + 1][j - 2] + src[i + 1][j + 2]) + (src[i + 2][j - 1] + src[i + 2][j + 1])) +
c20 * (src[i - 2][j] + src[i][j - 2] + src[i][j + 2] + src[i + 2][j]) +
c11 * (src[i - 1][j - 1] + src[i - 1][j + 1] + src[i + 1][j - 1] + src[i + 1][j + 1]) +
c10 * (src[i - 1][j] + src[i][j - 1] + src[i][j + 1] + src[i + 1][j]) +
@ -495,32 +743,33 @@ float calcRadiusXtrans(const float * const *rawData, int W, int H, float lowerLi
bool checkForStop(float** tmpIThr, float** iterCheck, int fullTileSize, int border)
{
bool stopped = false;
for (int ii = border; !stopped && ii < fullTileSize - border; ++ii) {
for (int ii = border; ii < fullTileSize - border; ++ii) {
#ifdef __SSE2__
for (int jj = border; jj < fullTileSize - border; jj += 4) {
if (_mm_movemask_ps((vfloat)vmaskf_lt(LVFU(tmpIThr[ii][jj]), LVFU(iterCheck[ii - border][jj - border])))) {
stopped = true;
break;
if (UNLIKELY(_mm_movemask_ps((vfloat)vmaskf_lt(LVFU(tmpIThr[ii][jj]), LVFU(iterCheck[ii - border][jj - border]))))) {
return true;
}
}
#else
for (int jj = border; jj < fullTileSize - border; ++jj) {
if (tmpIThr[ii][jj] < iterCheck[ii - border][jj - border]) {
stopped = true;
break;
return true;
}
}
#endif
}
return stopped;
return false;
}
void CaptureDeconvSharpening (float ** clipmask, float** luminance, float** 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 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];
float kernel5[5][5];
float kernel3[3][3];
@ -528,20 +777,26 @@ BENCHFUN
compute3x3kernel(sigma, kernel3);
} else if (is5x5) {
compute5x5kernel(sigma, kernel5);
} else {
} else if (is7x7) {
compute7x7kernel(sigma, kernel7);
} else if (is9x9) {
compute9x9kernel(sigma, kernel9);
} else {
compute13x13kernel(sigma, kernel13);
}
constexpr int tileSize = 32;
const int border = iterations <= 30 ? 5 : 7;
const int border = (is3x3 || is5x5 || is7x7) ? iterations <= 30 ? 5 : 7 : 8;
const int fullTileSize = tileSize + 2 * border;
const float cornerRadius = std::min<float>(1.15f, sigma + sigmaCornerOffset);
const float cornerRadius = std::min<float>(2.f, sigma + sigmaCornerOffset);
const float cornerDistance = sqrt(rtengine::SQR(W * 0.5f) + rtengine::SQR(H * 0.5f));
const float distanceFactor = (cornerRadius - sigma) / cornerDistance;
double progress = startVal;
const double progressStep = (endVal - startVal) * rtengine::SQR(tileSize) / (W * H);
constexpr float minBlend = 0.01f;
#ifdef _OPENMP
#pragma omp parallel
#endif
@ -549,9 +804,9 @@ BENCHFUN
int progresscounter = 0;
array2D<float> tmpIThr(fullTileSize, fullTileSize);
array2D<float> tmpThr(fullTileSize, fullTileSize);
tmpThr.fill(1.f);
array2D<float> lumThr(fullTileSize, fullTileSize);
array2D<float> iterCheck(tileSize, tileSize);
initTile(tmpThr, fullTileSize);
#ifdef _OPENMP
#pragma omp for schedule(dynamic,16) collapse(2)
#endif
@ -562,12 +817,24 @@ BENCHFUN
// fill tiles
if (endOfRow || endOfCol) {
// special handling for small tiles at end of row or column
float maxVal = 0.f;
if (checkIterStop) {
for (int k = 0, ii = endOfCol ? H - fullTileSize + border : i; k < tileSize; ++k, ++ii) {
for (int l = 0, jj = endOfRow ? W - fullTileSize + border : j; l < tileSize; ++l, ++jj) {
iterCheck[k][l] = oldLuminance[ii][jj] * clipmask[ii][jj] * 0.5f;
iterCheck[k][l] = oldLuminance[ii][jj] * blend[ii][jj] * 0.5f;
maxVal = std::max(maxVal, blend[ii][jj]);
}
}
} else {
for (int k = 0, ii = endOfCol ? H - fullTileSize + border : i; k < tileSize; ++k, ++ii) {
for (int l = 0, jj = endOfRow ? W - fullTileSize + border : j; l < tileSize; ++l, ++jj) {
maxVal = std::max(maxVal, blend[ii][jj]);
}
}
}
if (maxVal < minBlend) {
// no pixel of the tile has a blend factor >= minBlend => skip the tile
continue;
}
for (int k = 0, ii = endOfCol ? H - fullTileSize : i - border; k < fullTileSize; ++k, ++ii) {
for (int l = 0, jj = endOfRow ? W - fullTileSize : j - border; l < fullTileSize; ++l, ++jj) {
@ -576,12 +843,24 @@ BENCHFUN
}
}
} else {
float maxVal = 0.f;
if (checkIterStop) {
for (int ii = 0; ii < tileSize; ++ii) {
for (int jj = 0; jj < tileSize; ++jj) {
iterCheck[ii][jj] = oldLuminance[i + ii][j + jj] * clipmask[i + ii][j + jj] * 0.5f;
iterCheck[ii][jj] = oldLuminance[i + ii][j + jj] * blend[i + ii][j + jj] * 0.5f;
maxVal = std::max(maxVal, blend[i + ii][j + jj]);
}
}
} else {
for (int ii = 0; ii < tileSize; ++ii) {
for (int jj = 0; jj < tileSize; ++jj) {
maxVal = std::max(maxVal, blend[i + ii][j + jj]);
}
}
}
if (maxVal < minBlend) {
// no pixel of the tile has a blend factor >= minBlend => skip the tile
continue;
}
for (int ii = i; ii < i + fullTileSize; ++ii) {
for (int jj = j; jj < j + fullTileSize; ++jj) {
@ -590,61 +869,100 @@ BENCHFUN
}
}
}
bool stopped = false;
if (is3x3) {
for (int k = 0; k < iterations && !stopped; ++k) {
for (int k = 0; k < iterations; ++k) {
// apply 3x3 gaussian blur and divide luminance by result of gaussian blur
gauss3x3div(tmpIThr, tmpThr, lumThr, fullTileSize, kernel3);
gauss3x3mult(tmpThr, tmpIThr, fullTileSize, kernel3);
if (checkIterStop) {
stopped = checkForStop(tmpIThr, iterCheck, fullTileSize, border);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
} else if (is5x5) {
for (int k = 0; k < iterations && !stopped; ++k) {
for (int k = 0; k < iterations; ++k) {
// apply 5x5 gaussian blur and divide luminance by result of gaussian blur
gauss5x5div(tmpIThr, tmpThr, lumThr, fullTileSize, kernel5);
gauss5x5mult(tmpThr, tmpIThr, fullTileSize, kernel5);
if (checkIterStop) {
stopped = checkForStop(tmpIThr, iterCheck, fullTileSize, border);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
} else if (is7x7) {
for (int k = 0; k < iterations; ++k) {
// apply 5x5 gaussian blur and divide luminance by result of gaussian blur
gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, kernel7);
gauss7x7mult(tmpThr, tmpIThr, fullTileSize, kernel7);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
} else if (is9x9) {
for (int k = 0; k < iterations; ++k) {
// apply 5x5 gaussian blur and divide luminance by result of gaussian blur
gauss9x9div(tmpIThr, tmpThr, lumThr, fullTileSize, kernel9);
gauss9x9mult(tmpThr, tmpIThr, fullTileSize, kernel9);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
} 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<float>(sigma) + distanceFactor * distance;
if (sigmaTile >= 0.4f) {
if (sigmaTile > 0.84) { // have to use 7x7 kernel
if (sigmaTile > 1.5f) { // have to use 13x13 kernel
float lkernel13[13][13];
compute13x13kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel13);
for (int k = 0; k < iterations; ++k) {
// apply 13x13 gaussian blur and divide luminance by result of gaussian blur
gauss13x13div(tmpIThr, tmpThr, lumThr, fullTileSize, lkernel13);
gauss13x13mult(tmpThr, tmpIThr, fullTileSize, lkernel13);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
} else if (sigmaTile > 1.15f) { // have to use 9x9 kernel
float lkernel9[9][9];
compute9x9kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel9);
for (int k = 0; k < iterations; ++k) {
// apply 9x9 gaussian blur and divide luminance by result of gaussian blur
gauss9x9div(tmpIThr, tmpThr, lumThr, fullTileSize, lkernel9);
gauss9x9mult(tmpThr, tmpIThr, fullTileSize, lkernel9);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
} else if (sigmaTile > 0.84f) { // have to use 7x7 kernel
float lkernel7[7][7];
compute7x7kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel7);
for (int k = 0; k < iterations && !stopped; ++k) {
for (int k = 0; k < iterations; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur
gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, lkernel7);
gauss7x7mult(tmpThr, tmpIThr, fullTileSize, lkernel7);
if (checkIterStop) {
stopped = checkForStop(tmpIThr, iterCheck, fullTileSize, border);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
} else { // can use 5x5 kernel
float lkernel7[5][5];
compute5x5kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel7);
for (int k = 0; k < iterations && !stopped; ++k) {
float lkernel5[5][5];
compute5x5kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel5);
for (int k = 0; k < iterations; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur
gauss5x5div(tmpIThr, tmpThr, lumThr, fullTileSize, lkernel7);
gauss5x5mult(tmpThr, tmpIThr, fullTileSize, lkernel7);
if (checkIterStop) {
stopped = checkForStop(tmpIThr, iterCheck, fullTileSize, border);
gauss5x5div(tmpIThr, tmpThr, lumThr, fullTileSize, lkernel5);
gauss5x5mult(tmpThr, tmpIThr, fullTileSize, lkernel5);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
}
}
} else {
for (int k = 0; k < iterations && !stopped; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur
gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, kernel7);
gauss7x7mult(tmpThr, tmpIThr, fullTileSize, kernel7);
if (checkIterStop) {
stopped = checkForStop(tmpIThr, iterCheck, fullTileSize, border);
for (int k = 0; k < iterations; ++k) {
// apply 13x13 gaussian blur and divide luminance by result of gaussian blur
gauss13x13div(tmpIThr, tmpThr, lumThr, fullTileSize, kernel13);
gauss13x13mult(tmpThr, tmpIThr, fullTileSize, kernel13);
if (checkIterStop && k < iterations - 1 && checkForStop(tmpIThr, iterCheck, fullTileSize, border)) {
break;
}
}
}
@ -653,23 +971,23 @@ BENCHFUN
// special handling for small tiles at end of row or column
for (int k = border, ii = endOfCol ? H - fullTileSize : i - border; k < fullTileSize - border; ++k) {
for (int l = border, jj = endOfRow ? W - fullTileSize : j - border; l < fullTileSize - border; ++l) {
luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], std::max(tmpIThr[k][l], 0.0f), luminance[ii + k][jj + l]);
luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], tmpIThr[k][l], luminance[ii + k][jj + l]);
}
}
} else {
for (int ii = border; ii < fullTileSize - border; ++ii) {
for (int jj = border; jj < fullTileSize - border; ++jj) {
luminance[i + ii - border][j + jj - border] = rtengine::intp(blend[i + ii - border][j + jj - border], std::max(tmpIThr[ii][jj], 0.0f), luminance[i + ii - border][j + jj - border]);
luminance[i + ii - border][j + jj - border] = rtengine::intp(blend[i + ii - border][j + jj - border], tmpIThr[ii][jj], luminance[i + ii - border][j + jj - border]);
}
}
}
if (plistener) {
if (++progresscounter % 16 == 0) {
if (++progresscounter % 32 == 0) {
#ifdef _OPENMP
#pragma omp critical(csprogress)
#endif
{
progress += 16.0 * progressStep;
progress += 32.0 * progressStep;
progress = rtengine::min(progress, endVal);
plistener->setProgress(progress);
}
@ -687,18 +1005,23 @@ namespace rtengine
void RawImageSource::captureSharpening(const procparams::CaptureSharpeningParams &sharpeningParams, bool showMask, double &conrastThreshold, double &radius) {
if (!(ri->getSensorType() == ST_BAYER || ri->getSensorType() == ST_FUJI_XTRANS || ri->get_colors() == 1)) {
return;
}
if (plistener) {
plistener->setProgressStr(M("TP_PDSHARPENING_LABEL"));
plistener->setProgress(0.0);
}
BENCHFUN
constexpr 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 }
};
float contrast = conrastThreshold / 100.f;
float contrast = conrastThreshold / 100.0;
const float clipVal = (ri->get_white(1) - ri->get_cblack(1)) * scale_mul[1];
@ -708,7 +1031,7 @@ BENCHFUN
array2D<float> clipMask(W, H);
constexpr float clipLimit = 0.95f;
constexpr float maxSigma = 1.15f;
constexpr float maxSigma = 2.f;
if (getSensorType() == ST_BAYER) {
const float whites[2][2] = {
@ -757,6 +1080,10 @@ BENCHFUN
}
}
if (std::isnan(radius)) {
return;
}
if (showMask) {
array2D<float>& L = blue; // blue will be overridden anyway => we can use its buffer to store L
#ifdef _OPENMP
@ -770,8 +1097,7 @@ BENCHFUN
plistener->setProgress(0.1);
}
array2D<float>& blend = red; // red will be overridden anyway => we can use its buffer to store the blend mask
buildBlendMask(L, blend, W, H, contrast, 1.f, sharpeningParams.autoContrast, clipMask);
buildBlendMask(L, clipMask, W, H, contrast, sharpeningParams.autoContrast, clipMask);
if (plistener) {
plistener->setProgress(0.2);
}
@ -781,7 +1107,7 @@ BENCHFUN
#endif
for (int i = 0; i < H; ++i) {
for (int j = 0; j < W; ++j) {
red[i][j] = green[i][j] = blue[i][j] = blend[i][j] * 16384.f;
red[i][j] = green[i][j] = blue[i][j] = clipMask[i][j] * 16384.f;
}
}
if (plistener) {
@ -818,18 +1144,18 @@ BENCHFUN
if (plistener) {
plistener->setProgress(0.1);
}
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
array2D<float>& blend = clipMask; // we can share blend and clipMask buffer here
buildBlendMask(L, blend, W, H, contrast, 1.f, sharpeningParams.autoContrast, clipMask);
buildBlendMask(L, clipMask, W, H, contrast, sharpeningParams.autoContrast, clipMask);
if (plistener) {
plistener->setProgress(0.2);
}
conrastThreshold = contrast * 100.f;
CaptureDeconvSharpening(clipMask, YNew, YOld, blend, W, H, radius, sharpeningParams.deconvradiusOffset, sharpeningParams.deconviter, sharpeningParams.deconvitercheck, plistener, 0.2, 0.9);
CaptureDeconvSharpening(YNew, YOld, clipMask, W, H, radius, sharpeningParams.deconvradiusOffset, sharpeningParams.deconviter, sharpeningParams.deconvitercheck, plistener, 0.2, 0.9);
if (plistener) {
plistener->setProgress(0.9);
}
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic, 16)
#endif
@ -837,7 +1163,7 @@ BENCHFUN
int j = 0;
#ifdef __SSE2__
for (; j < W - 3; j += 4) {
const vfloat factor = vmaxf(LVFU(YNew[i][j]), ZEROV) / vmaxf(LVFU(YOld[i][j]), F2V(0.00001f));
const vfloat factor = LVFU(YNew[i][j]) / vmaxf(LVFU(YOld[i][j]), F2V(0.00001f));
STVFU(red[i][j], LVFU(redVals[i][j]) * factor);
STVFU(green[i][j], LVFU(greenVals[i][j]) * factor);
STVFU(blue[i][j], LVFU(blueVals[i][j]) * factor);
@ -845,7 +1171,7 @@ BENCHFUN
#endif
for (; j < W; ++j) {
const float factor = std::max(YNew[i][j], 0.f) / std::max(YOld[i][j], 0.00001f);
const float factor = YNew[i][j] / std::max(YOld[i][j], 0.00001f);
red[i][j] = redVals[i][j] * factor;
green[i][j] = greenVals[i][j] * factor;
blue[i][j] = blueVals[i][j] * factor;

View File

@ -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;

View File

@ -23,7 +23,7 @@
namespace rtengine
{
class CieImage :
class CieImage final :
public NonCopyable
{
private:

File diff suppressed because it is too large Load Diff

View File

@ -20,15 +20,16 @@
#pragma once
#include <array>
#include <glibmm/ustring.h>
#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
{
@ -100,7 +101,6 @@ private:
#endif
static float computeXYZ2Lab(float f);
static float computeXYZ2LabY(float f);
public:
@ -132,7 +132,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 +144,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<double>(D50x) / (static_cast<double>(D50x) + 15 + 3 * static_cast<double>(D50z));
constexpr static double v0 = 9.0 / (static_cast<double>(D50x) + 15 + 3 * static_cast<double>(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;
@ -183,6 +184,16 @@ public:
static void init ();
static void cleanup ();
static inline float computeXYZ2LabY(float f)
{
if (f < 0.f) {
return 327.68f * (kappa * f / MAXVALF);
} else if (f > 65535.f) {
return 327.68f * (116.f * xcbrtf(f / MAXVALF) - 16.f);
} else {
return cachefy[f];
}
}
/**
* @brief Extract luminance "sRGB" from red/green/blue values
@ -206,7 +217,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<double>(r) * workingspace[1][0] + static_cast<double>(g) * workingspace[1][1] + static_cast<double>(b) * workingspace[1][2];
}
#ifdef __SSE2__
@ -591,6 +602,7 @@ public:
* @param xyz_rgb[3][3] transformation matrix to use for the conversion
*/
static void rgbxyz (float r, float g, float b, float &x, float &y, float &z, const double xyz_rgb[3][3]);
static void rgbxyY(float r, float g, float b, float &x, float &y, float &Y, const float xyz_rgb[3][3]);
static void rgbxyz (float r, float g, float b, float &x, float &y, float &z, const float xyz_rgb[3][3]);
#ifdef __SSE2__
static void rgbxyz (vfloat r, vfloat g, vfloat b, vfloat &x, vfloat &y, vfloat &z, const vfloat xyz_rgb[3][3]);
@ -607,6 +619,7 @@ public:
*/
static void Lab2XYZ(float L, float a, float b, float &x, float &y, float &z);
static void L2XYZ(float L, float &x, float &y, float &z);
static float L2Y(float L);
#ifdef __SSE2__
static void Lab2XYZ(vfloat L, vfloat a, vfloat b, vfloat &x, vfloat &y, vfloat &z);
@ -972,10 +985,10 @@ public:
template <typename T, typename U>
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 +999,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;
}
@ -1372,7 +1385,7 @@ public:
* @param HH hue before [-PI ; +PI]
* @param Chprov1 chroma after [0 ; 180 (can be superior)]
* @param CC chroma before [0 ; 180]
* @param corectionHuechroma hue correction depending on chromaticity (saturation), in radians [0 ; 0.45] (return value)
* @param correctionHueChroma hue correction depending on chromaticity (saturation), in radians [0 ; 0.45] (return value)
* @param correctlum hue correction depending on luminance (brightness, contrast,...), in radians [0 ; 0.45] (return value)
* @param munsDbgInfo (Debug target only) object to collect information
*/

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,7 @@
#include <cmath>
#include <map>
#include <string>
#include "procparams.h"
namespace rtengine
{
@ -53,6 +54,7 @@ public:
explicit ColorTemp (double e) : temp(-1.), green(-1.), equal (e), method("Custom") {}
ColorTemp (double t, double g, double e, const std::string &m);
ColorTemp (double mulr, double mulg, double mulb, double e);
static void tempxy(bool separated, int repref, float **Tx, float **Ty, float **Tz, float **Ta, float **Tb, float **TL, double *TX, double *TY, double *TZ, const procparams::WBParams & wbpar);
void update (const double rmul, const double gmul, const double bmul, const double equal, const double tempBias=0.0)
{
@ -95,6 +97,8 @@ public:
static void temp2mulxyz (double tem, const std::string &method, double &Xxyz, double &Zxyz);
static void cieCAT02(double Xw, double Yw, double Zw, double &CAM02BB00, double &CAM02BB01, double &CAM02BB02, double &CAM02BB10, double &CAM02BB11, double &CAM02BB12, double &CAM02BB20, double &CAM02BB21, double &CAM02BB22, double adap );
static void cieCAT02float(float Xw, float Yw, float Zw, float &CAM02BB00, float &CAM02BB01, float &CAM02BB02, float &CAM02BB10, float &CAM02BB11, float &CAM02BB12, float &CAM02BB20, float &CAM02BB21, float &CAM02BB22, float adap);
static void icieCAT02float(float Xw, float Yw, float Zw, float &iCAM02BB00, float &iCAM02BB01, float &iCAM02BB02, float &iCAM02BB10, float &iCAM02BB11, float &iCAM02BB12, float &iCAM02BB20, float &iCAM02BB21, float &iCAM02BB22, float adap);
bool operator== (const ColorTemp& other) const
{
@ -162,6 +166,125 @@ public:
static const double ColorchechGreD1_spect[97];
static const double ColorchechSGBlaN3_6_spect[97];//ColorChecker SG N3
static const double JDC468_GraK14_44_spect[97];//468 K14
static const double JDC468_BluM5_spect[97]; //468 M5
static const double JDC468_BluD6_spect[97]; //468 D6
static const double JDC468_BluF4_spect[97]; //468 F4
static const double JDC468_RedG21va_spect[97]; //468 G21 modifié
static const double JDC468_RedI9_spect[97]; //468 I9
static const double JDC468_GreI8_spect[97]; //468 I8
static const double JDC468_GreQ7_spect[97]; //468 Q7
static const double ColorGreenM25_spect[97];
static const double ColorYellowkeltano_spect[97];
static const double ColorGreenalsi_spect[97];
static const double ColorRedpetunia_spect[97];
static const double ColorRedkurttu_spect[97];
static const double ColorRedlupiini_spect[97];
static const double ColorRedhevosminttu_spect[97];
static const double ColorRedneilikka_spect[97];
static const double ColorRedpelagornia_spect[97];
static const double ColorRedtalvio_spect[97];
static const double ColorBrownpoimulehti_spect[97];
static const double ColorOrangetuntematon_spect[97];
static const double ColorOrangetlehmus_spect[97];
static const double ColorOrangvaahtera_spect[97];
static const double ColorBrownlehmus_spect[97];
static const double ColorBrownuotiosammal_spect[97];
static const double ColorBlacksoil_spect[97];
static const double ColorGraynahjajaekaelae_spect[97];
static const double ColorGreennuotisammal_spect[97];
static const double ColorGreenleskenlehti_spect[97];
static const double ColorGreenlinnunkaali_spect[97];
static const double ColorGreenpelto_spect[97];
static const double ColorGreenrodvoikukka[97];
static const double ColorGreenlehmus[97];
static const double ColorGreenlinden[97];
static const double ColorYellowlehmus[97];
static const double ColorYellowsuikeroalpi[97];
static const double ColorYellowpensashanhikki1[97];
static const double ColorYellowpensashanhikki2[97];
static const double ColorBluehiidenvirna[97];
static const double ColorBluekurkkuyrtti[97];
static const double ColorPinksiankaersaemoe[97];
static const double ColorVioletharakankello[97];
static const double ColorVioletalsikeapila[97];
static const double ColorVioletakilleija[97];
static const double ColorOrangekehaekukka[97];
static const double ColorRedpihlaja[97];
static const double ColorVioletpetunia[97];
static const double ColorVioletorvokki[97];
static const double ColorBluesinisievikki[97];
static const double ColorBlueiisoppi[97];
static const double ColorBluelobelia[97];
static const double ColorWhiteojaka[97];
static const double ColorWhitepetunia[97];
static const double ColorWhitepelargonia[97];
static const double ColorWhitepaeivaen[97];
static const double JDC468_B14_75Redspect[97];
static const double Colorblue_spect[97];
static const double ColorGreenkoriste[97];
static const double ColorGreenpoimulehti[97];
static const double ColorGreenhopeapaju[97];
static const double ColorReduuden[97];
static const double ColorRedpajuan[97];
static const double ColorRedjaloan[97];
static const double ColorBlueukon[97];
static const double ColorBlueorvokki[97];
static const double ColorBluemalvikki[97];
static const double ColorBlackmaito[97];
static const double ColorOrangpihlaja[97];
static const double ColorBlackpihlaja[97];
static const double ColorViolA1_spect[97];
static const double ColorViolA4_spect[97];
static const double ColorViolA6_spect[97];
static const double ColorBlueSkyK3_spect[97];
static const double ColorBlueSkyK9_spect[97];
static const double ColorBlueSkyC4_spect[97];
static const double ColorBlueSkyC14_spect[97];
static const double ColorBlueSkyE4_spect[97];
static const double ColorBlueSkyM1_spect[97];
static const double ColorBlueSky2B1_spect[97];
static const double ColorBlueSkyT7_spect[97];
static const double ColorBlueSkyU19_spect[97];
static const double ColorBlueSkyU2_spect[97];
static const double ColorBlueSkyT17_spect[97];
static const double ColorBlackM8_spect[97];
static const double ColorBlackM12_spect[97];
static const double ColorBlackM13_spect[97];
static const double ColorWhite2B12_spect[97];
static const double ColorWhite2B14_spect[97];
static const double JDC468_Blackred97_spect[97];
static const double JDC468_Blackredbl443_spect[97];
static const double JDC468_Blackbl27_spect[97];
static const double JDC468_Blackbl28_spect[97];
static const double JDC468_Blackgr214_spect[97];
static const double JDC468_Blackbl436_spect[97];
static const double JDC468_Whitebl455_spect[97];
static const double JDC468_Blackvio101_spect[97];
static const double JDC468_Whitebl92_spect[97];
static const double JDC468_Greyredbl94_spect[97];
static const double JDC468_Blue32_spect[97];
static const double JDC468_Blue236_spect[97];
static const double JDC468_Gre300_spect[97];
static const double JDC468_Blue340_spect[97];
static const double JDC468_Gree110_spect[97];
static const double JDC468_Gree457_spect[97];
static const double JDC468_Yel241_spect[97];
static const double JDC468_Ora321_spect[97];
static const double JDC468_Yellow353_spect[97];
static const double JDC468_Mag465_spect[97];
static const double JDC468_Mag333_spect[97];
static const double JDC468_Mag203_spect[97];
static const double JDC468_OraO18_spect[97]; //468 O18
static const double JDC468_OraD17_spect[97]; //468 D17
static const double Fictif_61greyspect[97];//468 K15
static const double JDC468_K15_87greyspect[97];
static const double JDC468_YelN10_spect[97]; //468 N10
static const double JDC468_GreN7_spect[97]; //468 N7
static const double JDC468_GreA10_spect[97]; //468 A10
static const double JDC468_GreK7_spect[97]; //468 K7
static const double JDC468_PurE24_spect[97]; //468 E24
static const double JDC468_BluH10_spect[97];//468 H10
static const double ColabSkin35_15_17_spect[97];//Skin L 35
static const double ColabSkin57_22_18_spect[97];//Skin L 57
@ -195,7 +318,63 @@ public:
static const double ColabSkin70_7_32_spect[97];//Skin L 77
static const double ColabSky60_0_m31_spect[97];//Sky L=60
static const double ColabSky42_0_m24_spect[97];//Sky L=42
static const double J570_BlueB6_spect[97];//blue Cyan
static const double J570_BlueB15_spect[97];//blue Cyan
static const double J570_BlueC2_spect[97];//blue Cyan
static const double J570_BlueC14_spect[97];//blue Cyan
static const double J570_BlueC16_spect[97];//blue Cyan
static const double J570_BlueF1_spect[97];//blue Cyan
static const double J570_BlueF2_spect[97];//blue Cyan
static const double J570_BlueF10_spect[97];//blue Cyan
static const double J570_BlueF13_spect[97];//blue Cyan
static const double J570_BlueG9_spect[97];//blue Cyan
static const double J570_BlueG19_spect[97];//blue Cyan
static const double J570_BlueI5_spect[97];//blue Cyan
static const double J570_BlueH15_spect[97];//blue Cyan
static const double J570_BlueI3_spect[97];//blue Cyan
static const double J570_BlueI19_spect[97];//blue Cyan
static const double J570_BlueJ4_spect[97];//blue Cyan
static const double J570_BlueJ6_spect[97];//blue Cyan
static const double J570_BlueJ11_spect[97];//blue Cyan
static const double J570_BlueJ13_spect[97];//blue Cyan
static const double J570_BlueK5_spect[97];//blue Cyan
static const double J570_BlueN1_spect[97];//blue Cyan
static const double J570_BlueN4_spect[97];//blue Cyan
static const double J570_BlueO19_spect[97];//blue Cyan
static const double J570_BlueU8_spect[97];//blue Cyan
static const double J570_NeuN8_spect[97];//neutral
static const double J570_NeuN9_spect[97];//neutral
static const double J570_NeuO8_spect[97];//neutral
static const double J570_NeuO11_spect[97];//neutral
static const double J570_NeuD5_spect[97];//neutral
static const double J570_NeuE11_spect[97];//neutral
static const double J570_NeuK16_spect[97];//neutral
static const double J570_NeuM3_spect[97];//neutral
static const double J570_NeuN18_spect[97];//neutral
static const double J570_NeuQ1_spect[97];//neutral
static const double J570_NeuS7_spect[97];//neutral
static const double J570_NeuV10_spect[97];//neutral
static const double J570_NeuW18_spect[97];//neutral
static const double J570_NeuZ14_spect[97];//neutral
static const double J570_NeuC18_spect[97];//neutral
static const double J570_NeuD17_spect[97];//neutral
static const double J570_NeuJ11_spect[97];//neutral
static const double J570_NeuL4_spect[97];//neutral
static const double Colorlab_n72_n2_spect[97];
static const double Colorlab_10_n70_spect[97];
static const double Colorlab_n33_n70_spect[97];
static const double Colorlab_n8_n74_spect[97];
static const double Colorlab_19_n69_spect[97];
static const double Colorlab_n80_10_spect[97];
static const double Colorlab_n80_26_spect[97];
static const double Colorlab_n80_5_9_5_9spect[97];
// static const double Colorlab_n57_5_6_9spect[97];
/*
static const double JDC468_greyc14_66_spect[97];
static const double JDC468_greym13_325_spect[97];
static const double JDC468_greyf26_156_spect[97];
*/
static void spectrum_to_xyz_daylight (double _m1, double _m2, double &x, double &y, double &z);
static void spectrum_to_xyz_blackbody (double _temp, double &x, double &y, double &z);
static void spectrum_to_xyz_preset (const double* spec_intens, double &x, double &y, double &z);

View File

@ -48,7 +48,11 @@ const float Daub4_anal16[2][16] ALIGNED16 = {//Daub 14
{0.f, 0.f, 0.055049715f, 0.28039564f, 0.515574245f, 0.33218624f, -0.10175691f, -0.158417505f, 0.05042335f, 0.057001725f, -0.026891225f, -0.01171997f, 0.008874895f, 0.0003037575f, -0.0012739524f, 0.0002501134f},
{ -0.0002501134f, -0.0012739524f, -0.0003037575f, 0.008874895f, 0.01171997f , -0.026891225f, -0.057001725f, 0.05042335f, 0.158417505f, -0.10175691f, -0.33218624f, 0.515574245f, -0.28039564f, 0.055049715f, 0.f, 0.f}
};
// if necessary ?? we can add D20 !!
/*
const double Daub4_anal22[2][22] ALIGNED16 = {//Daub 20
{0., 0., 0.01885858, 0.13306109, 0.37278754, 0.48681406, 0.19881887, -0.1766681, -0.13855494, 0.09006372, 0.0658015, -0.05048328, -0.02082962, 0.0234849, 0.0025502185, -0.0075895, 0.0009866625, 0.0014088433, -0.00048497392, -0.0000823545, 0.00006617718, -0.000009379205},
{0.000009379205, -0.00006617718, 0.0000823545, 0.00048497392, -0.0014088433, -0.0009866627, 0.0075895, -0.0025502185, -0.0234849, 0.02082962, 0.05048328, -0.0658015, -0.09006372, 0.13855494, 0.1766681, -0.19881887, -0.48681406, -0.37278754, -0.13306109, -0.01885858, 0., 0.}
};
*/
}

View File

@ -21,8 +21,7 @@
#include <memory>
#include <cmath>
#include <cstring>
#include <glib.h>
#include <glib/gstdio.h>
#include <glibmm/ustring.h>
#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;
@ -1209,6 +1209,41 @@ void WavCurve::Set(const std::vector<double> &curvePoints)
}
}
Wavblcurve::Wavblcurve() {}
void Wavblcurve::Reset()
{
lutblcurve.reset();
}
void Wavblcurve::Set(const Curve &pCurve)
{
if (pCurve.isIdentity()) {
Reset(); // raise this value if the quality suffers from this number of samples
return;
}
lutblcurve(501); // raise this value if the quality suffers from this number of samples
for (int i = 0; i < 501; i++) {
lutblcurve[i] = pCurve.getVal(double(i) / 500.);
}
}
void Wavblcurve::Set(const std::vector<double> &curvePoints)
{
if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) {
FlatCurve tcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2);
tcurve.setIdentityValue(0.);
Set(tcurve);
} else {
Reset();
}
}
WavOpacityCurveRG::WavOpacityCurveRG() {}
@ -1243,6 +1278,43 @@ void WavOpacityCurveRG::Set(const std::vector<double> &curvePoints)
}
WavOpacityCurveSH::WavOpacityCurveSH() {}
void WavOpacityCurveSH::Reset()
{
lutOpacityCurveSH.reset();
}
void WavOpacityCurveSH::Set(const Curve &pCurve)
{
if (pCurve.isIdentity()) {
Reset(); // raise this value if the quality suffers from this number of samples
return;
}
lutOpacityCurveSH(501); // raise this value if the quality suffers from this number of samples
for (int i = 0; i < 501; i++) {
lutOpacityCurveSH[i] = pCurve.getVal(double(i) / 500.);
}
}
void WavOpacityCurveSH::Set(const std::vector<double> &curvePoints)
{
if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) {
FlatCurve tcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2);
tcurve.setIdentityValue(0.);
Set(tcurve);
} else {
Reset();
}
}
WavOpacityCurveBY::WavOpacityCurveBY() {}
void WavOpacityCurveBY::Reset()
@ -2186,7 +2258,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

View File

@ -22,21 +22,23 @@
#include <string>
#include <vector>
#include <glibmm/ustring.h>
#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<float>(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<float>(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:
@ -625,6 +627,30 @@ public:
}
};
class Wavblcurve
{
private:
LUTf lutblcurve; // 0xffff range
void Set(const Curve &pCurve);
public:
virtual ~Wavblcurve() {};
Wavblcurve();
void Reset();
// void Set(const std::vector<double> &curvePoints, bool &opautili);
void Set(const std::vector<double> &curvePoints);
float operator[](float index) const
{
return lutblcurve[index];
}
operator bool (void) const
{
return lutblcurve;
}
};
class WavOpacityCurveRG
{
private:
@ -647,6 +673,32 @@ public:
return lutOpacityCurveRG;
}
};
class WavOpacityCurveSH
{
private:
LUTf lutOpacityCurveSH; // 0xffff range
void Set(const Curve &pCurve);
public:
virtual ~WavOpacityCurveSH() {};
WavOpacityCurveSH();
void Reset();
// void Set(const std::vector<double> &curvePoints, bool &opautili);
void Set(const std::vector<double> &curvePoints);
float operator[](float index) const
{
return lutOpacityCurveSH[index];
}
operator bool (void) const
{
return lutOpacityCurveSH;
}
};
class WavOpacityCurveBY
{
private:
@ -940,7 +992,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;
};

View File

@ -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,19 +1179,27 @@ 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;
}
}
}
}
@ -1193,7 +1207,7 @@ void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use
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;

View File

@ -62,12 +62,8 @@
$Date: 2018/06/01 20:36:25 $
*/
#define DCRAW_VERSION "9.28"
//#define DCRAW_VERSION "9.28"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#define _USE_MATH_DEFINES
#include <cctype>
#include <cerrno>
#include <fcntl.h>
@ -94,9 +90,12 @@
#ifdef WIN32
#include <sys/utime.h>
#include <winsock2.h>
#define snprintf _snprintf
#ifndef strcasecmp
#define strcasecmp stricmp
#endif
#ifndef strncasecmp
#define strncasecmp strnicmp
#endif
typedef __int64 INT64;
typedef unsigned __int64 UINT64;
#else
@ -158,7 +157,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; }
@ -4433,6 +4431,10 @@ void CLASS foveon_interpolate()
void CLASS crop_masked_pixels()
{
if (data_error) {
return;
}
int row, col;
unsigned r, c, m, mblack[8], zero, val;
@ -6896,7 +6898,7 @@ it under the terms of the one of two licenses as you choose:
break;
case 50778:
case 50779:
if( get2() == 21 )
if( get2() != 17 ) // 17 is Standard light A
cm_D65 = (tag-50778);
break;
case 50829: /* ActiveArea */
@ -9094,6 +9096,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
if (load_raw == &CLASS sony_arw2_load_raw) { // RT: arw2 scale fix
black <<= 2;
tiff_bps += 2;
} else if (load_raw == &CLASS panasonic_load_raw) {
tiff_bps = RT_pana_info.bpp;
}
{ /* Check for RawTherapee table overrides and extensions */
int black_level, white_level;
@ -9864,6 +9868,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;
@ -10043,6 +10048,9 @@ canon_a5:
} else if (!strncmp(model, "X-A3", 4) || !strncmp(model, "X-A5", 4)) {
width = raw_width = 6016;
height = raw_height = 4014;
} else if (!strcmp(model, "X-Pro3") || !strcmp(model, "X-T3") || !strcmp(model, "X-T30")) {
width = raw_width = 6384;
height = raw_height = 4182;
}
top_margin = (raw_height - height) >> 2 << 1;
left_margin = (raw_width - width ) >> 2 << 1;
@ -11017,7 +11025,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

View File

@ -24,13 +24,15 @@
#include "dcrop.h"
#include "image8.h"
#include "imagefloat.h"
#include "improccoordinator.h"
#include "labimage.h"
#include "mytime.h"
#include "procparams.h"
#include "refreshmap.h"
#include "rt_math.h"
#include "color.h"
#include "../rtgui/editcallbacks.h"
#include "guidedfilter.h"
namespace
{
@ -174,8 +176,6 @@ void Crop::update(int todo)
int widIm = parent->fw;//full image
int heiIm = parent->fh;
bool needstransform = parent->ipf.needsTransform();
if (todo & (M_INIT | M_LINDENOISE | M_HDR)) {
MyMutex::MyLock lock(parent->minit); // Also used in improccoord
@ -796,6 +796,7 @@ void Crop::update(int todo)
}
}
const bool needstransform = parent->ipf.needsTransform(skips(parent->fw, skip), skips(parent->fh, skip), parent->imgsrc->getRotateDegree(), parent->imgsrc->getMetaData());
// transform
if (needstransform || ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled)) {
if (!transCrop) {
@ -814,10 +815,7 @@ void Crop::update(int todo)
baseCrop = transCrop;
}
} else {
if (transCrop) {
delete transCrop;
}
transCrop = nullptr;
}
@ -848,6 +846,7 @@ void Crop::update(int todo)
parent->ipf.workingtrc(workingCrop, workingCrop, cw, ch, 5, params.icm.workingProfile, params.icm.workingTRCGamma, params.icm.workingTRCSlope, parent->getCustomTransformOut(), false, true, true);
}
}
double rrm, ggm, bbm;
DCPProfileApplyState as;
DCPProfile *dcpProf = parent->imgsrc->getDCP(params.icm, as);
@ -857,6 +856,7 @@ void Crop::update(int todo)
params.toneCurve.saturation, parent->rCurve, parent->gCurve, parent->bCurve, parent->colourToningSatLimit, parent->colourToningSatLimitOpacity, parent->ctColorCurve, parent->ctOpacityCurve, parent->opautili, parent->clToningcurve, parent->cl2Toningcurve,
parent->customToneCurve1, parent->customToneCurve2, parent->beforeToneCurveBW, parent->afterToneCurveBW, rrm, ggm, bbm,
parent->bwAutoR, parent->bwAutoG, parent->bwAutoB, dcpProf, as, histToneCurve);
if (workingCrop != baseCrop) {
delete workingCrop;
}
@ -997,22 +997,184 @@ void Crop::update(int todo)
}
WavCurve wavCLVCurve;
Wavblcurve wavblcurve;
WavOpacityCurveRG waOpacityCurveRG;
WavOpacityCurveSH waOpacityCurveSH;
WavOpacityCurveBY waOpacityCurveBY;
WavOpacityCurveW waOpacityCurveW;
WavOpacityCurveWL waOpacityCurveWL;
LUTf wavclCurve;
params.wavelet.getCurves(wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL);
params.wavelet.getCurves(wavCLVCurve, wavblcurve, waOpacityCurveRG, waOpacityCurveSH, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL);
LabImage *unshar = nullptr;
Glib::ustring provis;
LabImage *provradius = nullptr;
bool procont = WaveParams.expcontrast;
bool prochro = WaveParams.expchroma;
bool proedge = WaveParams.expedge;
bool profin = WaveParams.expfinal;
bool proton = WaveParams.exptoning;
bool pronois = WaveParams.expnoise;
if(WaveParams.showmask) {
// WaveParams.showmask = false;
// WaveParams.expclari = true;
}
if (WaveParams.softrad > 0.f) {
provradius = new LabImage(labnCrop->W, labnCrop->H);
provradius->CopyFrom(labnCrop);
}
if ((WaveParams.ushamethod == "sharp" || WaveParams.ushamethod == "clari") && WaveParams.expclari && WaveParams.CLmethod != "all") {
unshar = new LabImage(labnCrop->W, labnCrop->H);
provis = params.wavelet.CLmethod;
params.wavelet.CLmethod = "all";
parent->ipf.ip_wavelet(labnCrop, labnCrop, kall, WaveParams, wavCLVCurve, wavblcurve, waOpacityCurveRG, waOpacityCurveSH, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, parent->wavclCurve, skip);
unshar->CopyFrom(labnCrop);
params.wavelet.CLmethod = provis;
WaveParams.expcontrast = false;
WaveParams.expchroma = false;
WaveParams.expedge = false;
WaveParams.expfinal = false;
WaveParams.exptoning = false;
WaveParams.expnoise = false;
}
parent->ipf.ip_wavelet(labnCrop, labnCrop, kall, WaveParams, wavCLVCurve, wavblcurve, waOpacityCurveRG, waOpacityCurveSH, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, parent->wavclCurve, skip);
if ((WaveParams.ushamethod == "sharp" || WaveParams.ushamethod == "clari") && WaveParams.expclari && WaveParams.CLmethod != "all") {
WaveParams.expcontrast = procont;
WaveParams.expchroma = prochro;
WaveParams.expedge = proedge;
WaveParams.expfinal = profin;
WaveParams.exptoning = proton;
WaveParams.expnoise = pronois;
if (WaveParams.softrad > 0.f) {
array2D<float> ble(labnCrop->W, labnCrop->H);
array2D<float> guid(labnCrop->W, labnCrop->H);
Imagefloat *tmpImage = nullptr;
tmpImage = new Imagefloat(labnCrop->W, labnCrop->H);
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int ir = 0; ir < labnCrop->H ; ir++)
for (int jr = 0; jr < labnCrop->W; jr++) {
float X, Y, Z;
float L = provradius->L[ir][jr];
float a = provradius->a[ir][jr];
float b = provradius->b[ir][jr];
Color::Lab2XYZ(L, a, b, X, Y, Z);
guid[ir][jr] = Y / 32768.f;
float La = labnCrop->L[ir][jr];
float aa = labnCrop->a[ir][jr];
float ba = labnCrop->b[ir][jr];
Color::Lab2XYZ(La, aa, ba, X, Y, Z);
tmpImage->r(ir, jr) = X;
tmpImage->g(ir, jr) = Y;
tmpImage->b(ir, jr) = Z;
ble[ir][jr] = Y / 32768.f;
}
double epsilmax = 0.0001;
double epsilmin = 0.00001;
double aepsil = (epsilmax - epsilmin) / 90.f;
double bepsil = epsilmax - 100.f * aepsil;
double epsil = aepsil * WaveParams.softrad + bepsil;
float blur = 10.f / skip * (0.0001f + 0.8f * WaveParams.softrad);
rtengine::guidedFilter(guid, ble, ble, blur, epsil, false);
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int ir = 0; ir < labnCrop->H; ir++)
for (int jr = 0; jr < labnCrop->W; jr++) {
float X = tmpImage->r(ir, jr);
float Y = 32768.f * ble[ir][jr];
float Z = tmpImage->b(ir, jr);
float L, a, b;
Color::XYZ2Lab(X, Y, Z, L, a, b);
labnCrop->L[ir][jr] = L;
}
delete tmpImage;
}
}
if ((WaveParams.ushamethod == "sharp" || WaveParams.ushamethod == "clari") && WaveParams.expclari && WaveParams.CLmethod != "all") {
float mL = (float)(WaveParams.mergeL / 100.f);
float mC = (float)(WaveParams.mergeC / 100.f);
float mL0;
float mC0;
float background = 0.f;
int show = 0;
if ((WaveParams.CLmethod == "one" || WaveParams.CLmethod == "inf") && WaveParams.Backmethod == "black") {
mL0 = mC0 = 0.f;
mL = -1.5f * mL;
mC = -mC;
background = 12000.f;
show = 0;
} else if (WaveParams.CLmethod == "sup" && WaveParams.Backmethod == "resid") {
mL0 = mL;
mC0 = mC;
background = 0.f;
show = 0;
} else {
mL0 = mL = mC0 = mC = 0.f;
background = 0.f;
show = 0;
}
float indic = 1.f;
if(WaveParams.showmask){
mL0 = mC0 = -1.f;
indic = -1.f;
mL = fabs(mL);
mC = fabs(mC);
show = 1;
}
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int x = 0; x < labnCrop->H; x++)
for (int y = 0; y < labnCrop->W; y++) {
labnCrop->L[x][y] = LIM((1.f + mL0) * (unshar->L[x][y]) + show * background - mL * indic * labnCrop->L[x][y], 0.f, 32768.f);
labnCrop->a[x][y] = (1.f + mC0) * (unshar->a[x][y]) - mC * indic * labnCrop->a[x][y];
labnCrop->b[x][y] = (1.f + mC0) * (unshar->b[x][y]) - mC * indic * labnCrop->b[x][y];
}
delete unshar;
unshar = NULL;
if (WaveParams.softrad > 0.f) {
delete provradius;
provradius = NULL;
}
}
parent->ipf.ip_wavelet(labnCrop, labnCrop, kall, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, parent->wavclCurve, skip);
}
parent->ipf.softLight(labnCrop);
// }
// }
if (params.colorappearance.enabled) {
float fnum = parent->imgsrc->getMetaData()->getFNumber(); // F number
float fiso = parent->imgsrc->getMetaData()->getISOSpeed() ; // ISO
@ -1197,6 +1359,7 @@ bool Crop::setCropSizes(int rcx, int rcy, int rcw, int rch, int skip, bool inter
parent->ipf.transCoord(parent->fw, parent->fh, bx1, by1, bw, bh, orx, ory, orw, orh);
if (parent->ipf.needsTransform(skips(parent->fw, skip), skips(parent->fh, skip), parent->imgsrc->getRotateDegree(), parent->imgsrc->getMetaData())) {
if (check_need_larger_crop_for_lcp_distortion(parent->fw, parent->fh, orx, ory, orw, orh, *parent->params)) {
// TODO - this is an estimate of the max distortion relative to the image size. ATM it is hardcoded to be 15%, which seems enough. If not, need to revise
int dW = int (double (parent->fw) * 0.15 / (2 * skip));
@ -1231,7 +1394,7 @@ bool Crop::setCropSizes(int rcx, int rcy, int rcw, int rch, int skip, bool inter
orw = min(x2 - x1, parent->fw - orx);
orh = min(y2 - y1, parent->fh - ory);
}
}
leftBorder = skips(rqx1 - bx1, skip);
upperBorder = skips(rqy1 - by1, skip);

View File

@ -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:

View File

@ -215,7 +215,6 @@ void RawImageSource::border_interpolate( int winw, int winh, int lborders, const
// Adapted to RawTherapee by Jacques Desmis 3/2013
// SSE version by Ingo Weyrich 5/2013
#ifdef __SSE2__
#define CLIPV(a) vclampf(a,zerov,c65535v)
void RawImageSource::igv_interpolate(int winw, int winh)
{
static const float eps = 1e-5f, epssq = 1e-5f; //mod epssq -10f =>-5f Jacques 3/2013 to prevent artifact (divide by zero)
@ -284,9 +283,9 @@ void RawImageSource::igv_interpolate(int winw, int winh)
for (col = 0, indx = row * width + col; col < width - 7; col += 8, indx += 8) {
temp1v = LVFU( rawData[row][col] );
temp1v = CLIPV( temp1v );
temp1v = vmaxf(temp1v, ZEROV);
temp2v = LVFU( rawData[row][col + 4] );
temp2v = CLIPV( temp2v );
temp2v = vmaxf(temp2v, ZEROV);
tempv = _mm_shuffle_ps( temp1v, temp2v, _MM_SHUFFLE( 2, 0, 2, 0 ) );
_mm_storeu_ps( &dest1[indx >> 1], tempv );
tempv = _mm_shuffle_ps( temp1v, temp2v, _MM_SHUFFLE( 3, 1, 3, 1 ) );
@ -294,10 +293,10 @@ void RawImageSource::igv_interpolate(int winw, int winh)
}
for (; col < width; col++, indx += 2) {
dest1[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT data
dest1[indx >> 1] = std::max(0.f, rawData[row][col]); //rawData = RT data
col++;
if(col < width)
dest2[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT data
dest2[indx >> 1] = std::max(0.f, rawData[row][col]); //rawData = RT data
}
}
@ -556,42 +555,42 @@ void RawImageSource::igv_interpolate(int winw, int winh)
temp2v = LVFU( src2[(indx + 1) >> 1] );
tempv = _mm_shuffle_ps( temp1v, temp2v, _MM_SHUFFLE( 1, 0, 1, 0 ) );
tempv = _mm_shuffle_ps( tempv, tempv, _MM_SHUFFLE( 3, 1, 2, 0 ) );
_mm_storeu_ps( &green[row][col], CLIPV( tempv ));
_mm_storeu_ps( &green[row][col], vmaxf(tempv, ZEROV));
temp5v = LVFU(redsrc0[indx >> 1]);
temp6v = LVFU(redsrc1[(indx + 1) >> 1]);
temp3v = _mm_shuffle_ps( temp5v, temp6v, _MM_SHUFFLE( 1, 0, 1, 0 ) );
temp3v = _mm_shuffle_ps( temp3v, temp3v, _MM_SHUFFLE( 3, 1, 2, 0 ) );
temp3v = CLIPV( tempv - c65535v * temp3v );
temp3v = vmaxf(tempv - c65535v * temp3v, ZEROV);
_mm_storeu_ps( &red[row][col], temp3v);
temp7v = LVFU(bluesrc0[indx >> 1]);
temp8v = LVFU(bluesrc1[(indx + 1) >> 1]);
temp4v = _mm_shuffle_ps( temp7v, temp8v, _MM_SHUFFLE( 1, 0, 1, 0 ) );
temp4v = _mm_shuffle_ps( temp4v, temp4v, _MM_SHUFFLE( 3, 1, 2, 0 ) );
temp4v = CLIPV( tempv - c65535v * temp4v );
temp4v = vmaxf(tempv - c65535v * temp4v, ZEROV);
_mm_storeu_ps( &blue[row][col], temp4v);
tempv = _mm_shuffle_ps( temp1v, temp2v, _MM_SHUFFLE( 3, 2, 3, 2 ) );
tempv = _mm_shuffle_ps( tempv, tempv, _MM_SHUFFLE( 3, 1, 2, 0 ) );
_mm_storeu_ps( &green[row][col + 4], CLIPV( tempv ));
_mm_storeu_ps( &green[row][col + 4], vmaxf(tempv, ZEROV));
temp3v = _mm_shuffle_ps( temp5v, temp6v, _MM_SHUFFLE( 3, 2, 3, 2 ) );
temp3v = _mm_shuffle_ps( temp3v, temp3v, _MM_SHUFFLE( 3, 1, 2, 0 ) );
temp3v = CLIPV( tempv - c65535v * temp3v );
temp3v = vmaxf(tempv - c65535v * temp3v, ZEROV);
_mm_storeu_ps( &red[row][col + 4], temp3v);
temp4v = _mm_shuffle_ps( temp7v, temp8v, _MM_SHUFFLE( 3, 2, 3, 2 ) );
temp4v = _mm_shuffle_ps( temp4v, temp4v, _MM_SHUFFLE( 3, 1, 2, 0 ) );
temp4v = CLIPV( tempv - c65535v * temp4v );
temp4v = vmaxf(tempv - c65535v * temp4v, ZEROV);
_mm_storeu_ps( &blue[row][col + 4], temp4v);
}
for(; col < width - 7; col++, indx += 2) {
red [row][col] = CLIP(src1[indx >> 1] - 65535.f * redsrc0[indx >> 1]);
green[row][col] = CLIP(src1[indx >> 1]);
blue [row][col] = CLIP(src1[indx >> 1] - 65535.f * bluesrc0[indx >> 1]);
red [row][col] = std::max(0.f, src1[indx >> 1] - 65535.f * redsrc0[indx >> 1]);
green[row][col] = std::max(0.f, src1[indx >> 1]);
blue [row][col] = std::max(0.f, src1[indx >> 1] - 65535.f * bluesrc0[indx >> 1]);
col++;
red [row][col] = CLIP(src2[(indx + 1) >> 1] - 65535.f * redsrc1[(indx + 1) >> 1]);
green[row][col] = CLIP(src2[(indx + 1) >> 1]);
blue [row][col] = CLIP(src2[(indx + 1) >> 1] - 65535.f * bluesrc1[(indx + 1) >> 1]);
red [row][col] = std::max(0.f, src2[(indx + 1) >> 1] - 65535.f * redsrc1[(indx + 1) >> 1]);
green[row][col] = std::max(0.f, src2[(indx + 1) >> 1]);
blue [row][col] = std::max(0.f, src2[(indx + 1) >> 1] - 65535.f * bluesrc1[(indx + 1) >> 1]);
}
}
}// End of parallelization
@ -606,7 +605,6 @@ void RawImageSource::igv_interpolate(int winw, int winh)
free(vdif);
free(hdif);
}
#undef CLIPV
#else
void RawImageSource::igv_interpolate(int winw, int winh)
{
@ -649,7 +647,7 @@ void RawImageSource::igv_interpolate(int winw, int winh)
for (int row = 0; row < height - 0; row++)
for (int col = 0, indx = row * width + col; col < width - 0; col++, indx++) {
int c = FC(row, col);
rgb[c][indx] = CLIP(rawData[row][col]); //rawData = RT data
rgb[c][indx] = std::max(0.f, rawData[row][col]); //rawData = RT data
}
#ifdef _OPENMP
@ -848,9 +846,9 @@ void RawImageSource::igv_interpolate(int winw, int winh)
for(int row = 7; row < height - 7; row++)
for(int col = 7, indx = row * width + col; col < width - 7; col++, indx++) {
red [row][col] = CLIP(rgb[1][indx] - 65535.f * chr[0][indx]);
green[row][col] = CLIP(rgb[1][indx]);
blue [row][col] = CLIP(rgb[1][indx] - 65535.f * chr[1][indx]);
red [row][col] = std::max(0.f, rgb[1][indx] - 65535.f * chr[0][indx]);
green[row][col] = std::max(0.f, rgb[1][indx]);
blue [row][col] = std::max(0.f, rgb[1][indx] - 65535.f * chr[1][indx]);
}
}// End of parallelization
border_interpolate(winw, winh, 8, rawData, red, green, blue);
@ -1071,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]);
}
}
@ -1520,9 +1518,9 @@ BENCHFUN
*/
for(int y = 0; y < TILESIZE && y0 + y < H; y++) {
for (int j = 0; j < TILESIZE && x0 + j < W; j++) {
red[y0 + y][x0 + j] = tile[(y + TILEBORDER) * CACHESIZE + TILEBORDER + j][0];
green[y0 + y][x0 + j] = tile[(y + TILEBORDER) * CACHESIZE + TILEBORDER + j][1];
blue[y0 + y][x0 + j] = tile[(y + TILEBORDER) * CACHESIZE + TILEBORDER + j][2];
red[y0 + y][x0 + j] = std::max(0.f, tile[(y + TILEBORDER) * CACHESIZE + TILEBORDER + j][0]);
green[y0 + y][x0 + j] = std::max(0.f, tile[(y + TILEBORDER) * CACHESIZE + TILEBORDER + j][1]);
blue[y0 + y][x0 + j] = std::max(0.f, tile[(y + TILEBORDER) * CACHESIZE + TILEBORDER + j][2]);
}
}

View File

@ -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 ;
}
}

View File

@ -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);

View File

@ -16,8 +16,6 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <glib.h>
#include <glib/gstdio.h>
#include "curves.h"
#include <cmath>
#include <vector>
@ -65,23 +63,23 @@ DiagonalCurve::DiagonalCurve (const std::vector<double>& 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<double>& 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];

Some files were not shown because too many files have changed in this diff Show More