forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Initial JPEG XL support for image input/output (AcademySoftware…
…Foundation#4055) Preliminary support for JPEG XL. A variety of additions are needed, but this is a good start. Top items on our to-do list (not necessarily in priority order): - [ ] Document in builtinformats.rst - [ ] Handle different pixel types -- right now, always reads/writes float. - [ ] Compression options - [ ] EXIF - [ ] Test cases in the testsuite --------- Signed-off-by: Peter Kovář <[email protected]>
- Loading branch information
Showing
10 changed files
with
858 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,6 @@ _coverage/ | |
/*.exr | ||
/*.tif | ||
/*.jpg | ||
/*.jxl | ||
/*.tx | ||
/*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/AcademySoftwareFoundation/OpenImageIO | ||
# | ||
# Module to find libjxl | ||
# | ||
# Will define: | ||
# - JXL_FOUND | ||
# - JXL_INCLUDES directory to include for libjxl headers | ||
# - JXL_LIBRARIES libraries to link to | ||
|
||
include (FindPackageHandleStandardArgs) | ||
|
||
find_path(JXL_INCLUDE_DIR | ||
NAMES jxl/decode.h jxl/encode.h) | ||
mark_as_advanced(JXL_INCLUDE_DIR) | ||
|
||
if (JXL_INCLUDE_DIR) | ||
file (STRINGS "${JXL_INCLUDE_DIR}/jxl/version.h" TMP REGEX "^#define JPEGXL_MAJOR_VERSION .*$") | ||
string (REGEX MATCHALL "[0-9]+" JPEGXL_MAJOR_VERSION ${TMP}) | ||
file (STRINGS "${JXL_INCLUDE_DIR}/jxl/version.h" TMP REGEX "^#define JPEGXL_MINOR_VERSION .*$") | ||
string (REGEX MATCHALL "[0-9]+" JPEGXL_MINOR_VERSION ${TMP}) | ||
file (STRINGS "${JXL_INCLUDE_DIR}/jxl/version.h" TMP REGEX "^#define JPEGXL_PATCH_VERSION .*$") | ||
string (REGEX MATCHALL "[0-9]+" JPEGXL_PATCH_VERSION ${TMP}) | ||
set (JXL_VERSION "${JPEGXL_MAJOR_VERSION}.${JPEGXL_MINOR_VERSION}.${JPEGXL_PATCH_VERSION}") | ||
endif () | ||
|
||
find_library(JXL_LIBRARY | ||
NAMES jxl) | ||
mark_as_advanced ( | ||
JXL_LIBRARY | ||
JXL_VERSION | ||
) | ||
|
||
find_library(JXL_THREADS_LIBRARY | ||
NAMES jxl_threads) | ||
mark_as_advanced(JXL_THREADS_LIBRARY) | ||
|
||
find_package_handle_standard_args(JXL | ||
REQUIRED_VARS JXL_LIBRARY JXL_THREADS_LIBRARY JXL_INCLUDE_DIR) | ||
|
||
if(JXL_FOUND) | ||
set(JXL_LIBRARIES ${JXL_LIBRARY} ${JXL_THREADS_LIBRARY}) | ||
set(JXL_INCLUDES ${JXL_INCLUDE_DIR}) | ||
endif(JXL_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/AcademySoftwareFoundation/OpenImageIO | ||
|
||
if (JXL_FOUND) | ||
add_oiio_plugin (jxlinput.cpp jxloutput.cpp | ||
INCLUDE_DIRS ${JXL_INCLUDE_DIRS} | ||
LINK_LIBRARIES ${JXL_LIBRARIES} | ||
DEFINITIONS "-DUSE_JXL") | ||
else() | ||
message (WARNING "JPEG XL plugin will not be built") | ||
endif() |
Oops, something went wrong.