Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ option(USE_JXL "Enable JPEG XL support" ON)
option(USE_WEBP "Enable WebP support" ON)
option(USE_AVIF "Enable AVIF support" ON)
option(USE_HEIF "Enable HEIF/HEIC support" ON)
option(USE_ULTRAHDR "Enable UltraHDR (gain-map JPEG) export support" ON)
option(USE_XCF "Enable XCF support" ON)
option(USE_ISOBMFF "Enable ISOBMFF support" ON)
option(USE_LIBRAW "Enable LibRaw support" ON)
Expand Down
21 changes: 21 additions & 0 deletions data/darktableconfig.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,27 @@
<shortdescription>AVIF chroma subsampling</shortdescription>
<longdescription/>
</dtconfig>
<dtconfig>
<name>plugins/imageio/format/ultrahdr/quality</name>
<type min="0" max="100">int</type>
<default>95</default>
<shortdescription>UltraHDR base image JPEG quality</shortdescription>
<longdescription/>
</dtconfig>
<dtconfig>
<name>plugins/imageio/format/ultrahdr/gainmap_quality</name>
<type min="0" max="100">int</type>
<default>95</default>
<shortdescription>UltraHDR gain map JPEG quality</shortdescription>
<longdescription/>
</dtconfig>
<dtconfig>
<name>plugins/imageio/format/ultrahdr/gainmap_downscale</name>
<type min="0" max="2">int</type>
<default>0</default>
<shortdescription>UltraHDR gain map resolution (0 full, 1 half, 2 quarter)</shortdescription>
<longdescription/>
</dtconfig>
<dtconfig>
<name>plugins/imageio/format/heif/bitdepth</name>
<type>
Expand Down
16 changes: 16 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,22 @@ if(USE_HEIF)
endif()
endif()

# Reset on every configure so a stale value cannot keep the module enabled
# when USE_ULTRAHDR is turned off or libuhdr disappears.
set(UltraHDR_FOUND OFF CACHE INTERNAL "")
if(USE_ULTRAHDR)
# libultrahdr has no CMake CONFIG package, so locate it via pkg-config.
# NOTE: the pkg-config module and link name are "libuhdr" (NOT "libultrahdr").
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(UltraHDR IMPORTED_TARGET libuhdr)
if(UltraHDR_FOUND)
# Cache so src/imageio/format/CMakeLists.txt can gate the module on it.
set(UltraHDR_FOUND ON CACHE INTERNAL "")
endif()
endif()
endif()

# For now we use the LibRaw submodule
if(USE_LIBRAW)
if(DONT_USE_INTERNAL_LIBRAW)
Expand Down
7 changes: 7 additions & 0 deletions src/imageio/format/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ if(libavif_FOUND)
set_target_properties(avif_format PROPERTIES OUTPUT_NAME avif)
endif()

if(UltraHDR_FOUND)
list(APPEND MODULES "ultrahdr_format")
add_library(ultrahdr_format MODULE "ultrahdr.c")
target_link_libraries(ultrahdr_format PRIVATE PkgConfig::UltraHDR)
set_target_properties(ultrahdr_format PROPERTIES OUTPUT_NAME ultrahdr)
endif()

if(TARGET xcf)
list(APPEND MODULES "gimp_xcf")
add_library(gimp_xcf MODULE "xcf.c")
Expand Down
Loading