From b72b375f25b4860df993f181e4d1dee30f4acb90 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Mon, 11 Aug 2025 12:09:53 -0400 Subject: [PATCH 01/71] fix: discard generated pystubs when in GHA environment Re: #4854 Currently, we use `cibuildwheel`'s test-command to both generate new type stubs and validate existing type stubs. Typically, this results in the generation of `{dist_path}/OpenImageIO/__init__.pyi`, where `{dist_path}` is the directory in which the generated .whl lives. This is fine -- necessary, even -- for locally generating the python stubs, but the addition of an "OpenImageIO" directory causes problems for our "upload_pypi" github task. This PR is a workaround, which forces the stub generation script to use $PWD as the output path (instead of `{dist_path}`), which should be suitable for stub validation purposes. In the future, we will have to revisit this, if we decide to replace the local python-stubs generation process with an automated CI-based process. Signed-off-by: Zach Lewis --- src/python/stubs/generate_stubs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/python/stubs/generate_stubs.py b/src/python/stubs/generate_stubs.py index 37826c1b52..829e2bb77a 100644 --- a/src/python/stubs/generate_stubs.py +++ b/src/python/stubs/generate_stubs.py @@ -157,6 +157,8 @@ def main() -> None: import os import sys + _is_in_github_actions_env = os.environ.get("GITHUB_ACTIONS", "false").lower() == "true" + parser = argparse.ArgumentParser() parser.add_argument( "--out-path", @@ -171,6 +173,11 @@ def main() -> None: ) args = parser.parse_args() out_path = pathlib.Path(args.out_path) + + if _is_in_github_actions_env: + print("Running in GitHub Actions environment, using current working directory for output.") + out_path = pathlib.Path.cwd() + print(f"Stub output directory: {out_path}") # perform import so we can see the traceback if it fails. @@ -194,7 +201,7 @@ def main() -> None: ) + new_text dest_path.write_text(new_text) - if args.validate_path and os.environ.get("GITHUB_ACTIONS", "false").lower() == "true": + if args.validate_path and _is_in_github_actions_env: # in CI, validate that what has been committed to the repo is what we expect. validate_path = pathlib.Path(args.validate_path) From 06508712ce18b3a9b9cc48aa553b9ef07a207bd1 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 22 Aug 2025 14:06:29 -0400 Subject: [PATCH 02/71] Revert "fix: discard generated pystubs when in GHA environment" This reverts commit b72b375f25b4860df993f181e4d1dee30f4acb90. Signed-off-by: Zach Lewis --- src/python/stubs/generate_stubs.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/python/stubs/generate_stubs.py b/src/python/stubs/generate_stubs.py index 829e2bb77a..37826c1b52 100644 --- a/src/python/stubs/generate_stubs.py +++ b/src/python/stubs/generate_stubs.py @@ -157,8 +157,6 @@ def main() -> None: import os import sys - _is_in_github_actions_env = os.environ.get("GITHUB_ACTIONS", "false").lower() == "true" - parser = argparse.ArgumentParser() parser.add_argument( "--out-path", @@ -173,11 +171,6 @@ def main() -> None: ) args = parser.parse_args() out_path = pathlib.Path(args.out_path) - - if _is_in_github_actions_env: - print("Running in GitHub Actions environment, using current working directory for output.") - out_path = pathlib.Path.cwd() - print(f"Stub output directory: {out_path}") # perform import so we can see the traceback if it fails. @@ -201,7 +194,7 @@ def main() -> None: ) + new_text dest_path.write_text(new_text) - if args.validate_path and _is_in_github_actions_env: + if args.validate_path and os.environ.get("GITHUB_ACTIONS", "false").lower() == "true": # in CI, validate that what has been committed to the repo is what we expect. validate_path = pathlib.Path(args.validate_path) From 90e1500674e70ec78c790d75cb1b0868ae293842 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 22 Aug 2025 14:12:03 -0400 Subject: [PATCH 03/71] ci(wheels): Create separate step for uploading typestubs Also raise minimum Python installation for macos-arm to 3.9 Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 7addba1a43..3795c43646 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -157,9 +157,16 @@ jobs: name: cibw-wheels-${{ matrix.python }}-${{ matrix.manylinux }} path: | ./wheelhouse/*.whl + + - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + with: + name: stubs-${{ matrix.python }}-${{ matrix.manylinux }} + path: | ./wheelhouse/OpenImageIO/__init__.pyi - # if stub validation fails we want to upload the stubs for users to review - if: success() || failure() + # if stub validation fails we want to upload the stubs for users to review. + # keep the python build in sync with the version specified in tool.cibuildwheel.overrides + # section of pyproject.toml + if: always() && contains(matrix.python, 'cp311-manylinux') # --------------------------------------------------------------------------- # Linux ARM Wheels @@ -219,9 +226,16 @@ jobs: name: cibw-wheels-${{ matrix.python }}-${{ matrix.manylinux }} path: | ./wheelhouse/*.whl + + - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + with: + name: stubs-${{ matrix.python }}-${{ matrix.manylinux }} + path: | ./wheelhouse/OpenImageIO/__init__.pyi - # if stub validation fails we want to upload the stubs for users to review - if: success() || failure() + # if stub validation fails we want to upload the stubs for users to review. + # keep the python build in sync with the version specified in tool.cibuildwheel.overrides + # section of pyproject.toml + if: always() && contains(matrix.python, 'cp311-manylinux') # --------------------------------------------------------------------------- # macOS Wheels @@ -317,9 +331,8 @@ jobs: - name: Install Python uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - # https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64 with: - python-version: '3.8' + python-version: '3.9' - name: Build wheels From f915b47fde853707f0e74d0fd8eb27b0c532c26f Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 22 Aug 2025 14:47:13 -0400 Subject: [PATCH 04/71] ci(wheels): build wheels for CPython 3.14 Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 21 +++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 3795c43646..acb2908d74 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -108,6 +108,10 @@ jobs: manylinux: manylinux_2_28 python: cp313-manylinux_x86_64 arch: x86_64 + - build: CPython 3.14 64 bits manylinux_2_28 + manylinux: manylinux_2_28 + python: cp314-manylinux_x86_64 + arch: x86_64 # ------------------------------------------------------------------- # CPython 64 bits manylinux2014 # ------------------------------------------------------------------- @@ -131,6 +135,10 @@ jobs: manylinux: manylinux2014 python: cp313-manylinux_x86_64 arch: x86_64 + - build: CPython 3.14 64 bits manylinux2014 + manylinux: manylinux2014 + python: cp314-manylinux_x86_64 + arch: x86_64 steps: - name: Checkout repo @@ -204,6 +212,10 @@ jobs: manylinux: manylinux2014 python: cp313-manylinux_aarch64 arch: aarch64 + - build: CPython 3.14 ARM 64 bits manylinux2014 + manylinux: manylinux2014 + python: cp314-manylinux_aarch64 + arch: aarch64 steps: - name: Checkout repo @@ -268,6 +280,9 @@ jobs: - build: CPython 3.13 64 bits python: cp313-macosx_x86_64 arch: x86_64 + - build: CPython 3.14 64 bits + python: cp314-macosx_x86_64 + arch: x86_64 steps: - name: Checkout repo @@ -324,6 +339,9 @@ jobs: - build: CPython 3.13 ARM 64 bits python: cp313-macosx_arm64 arch: arm64 + - build: CPython 3.14 ARM 64 bits + python: cp314-macosx_arm64 + arch: arm64 steps: - name: Checkout repo @@ -378,6 +396,9 @@ jobs: - build: CPython 3.13 64 bits python: cp313-win_amd64 arch: AMD64 + - build: CPython 3.14 64 bits + python: cp314-win_amd64 + arch: AMD64 steps: - name: Checkout repo diff --git a/pyproject.toml b/pyproject.toml index 55e8847431..c65eff0b8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,12 +16,12 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "License :: OSI Approved :: Apache Software License", "Topic :: Multimedia :: Graphics", "Topic :: Multimedia :: Video", From 245fb81a15ad6b1a4bacc52afbddcd4afca5214f Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 22 Aug 2025 16:19:18 -0400 Subject: [PATCH 05/71] testing(wheels): mac-x86 -- cmake disable sys path Signed-off-by: Zach Lewis --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index c65eff0b8e..5a6c002839 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,6 +95,8 @@ if.platform-system = "darwin" if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" +cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" +cmake.define.CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH = "OFF" [tool.cibuildwheel] build-verbosity = 1 From 0561eadc20eeb04e9f47e6afa9b68a2132c24d7e Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 22 Aug 2025 16:21:53 -0400 Subject: [PATCH 06/71] Revert "ci(wheels): build wheels for CPython 3.14" This reverts commit 8e39b72800a3928ec62ab2dbeed042684973ebdc. Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 21 --------------------- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index acb2908d74..3795c43646 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -108,10 +108,6 @@ jobs: manylinux: manylinux_2_28 python: cp313-manylinux_x86_64 arch: x86_64 - - build: CPython 3.14 64 bits manylinux_2_28 - manylinux: manylinux_2_28 - python: cp314-manylinux_x86_64 - arch: x86_64 # ------------------------------------------------------------------- # CPython 64 bits manylinux2014 # ------------------------------------------------------------------- @@ -135,10 +131,6 @@ jobs: manylinux: manylinux2014 python: cp313-manylinux_x86_64 arch: x86_64 - - build: CPython 3.14 64 bits manylinux2014 - manylinux: manylinux2014 - python: cp314-manylinux_x86_64 - arch: x86_64 steps: - name: Checkout repo @@ -212,10 +204,6 @@ jobs: manylinux: manylinux2014 python: cp313-manylinux_aarch64 arch: aarch64 - - build: CPython 3.14 ARM 64 bits manylinux2014 - manylinux: manylinux2014 - python: cp314-manylinux_aarch64 - arch: aarch64 steps: - name: Checkout repo @@ -280,9 +268,6 @@ jobs: - build: CPython 3.13 64 bits python: cp313-macosx_x86_64 arch: x86_64 - - build: CPython 3.14 64 bits - python: cp314-macosx_x86_64 - arch: x86_64 steps: - name: Checkout repo @@ -339,9 +324,6 @@ jobs: - build: CPython 3.13 ARM 64 bits python: cp313-macosx_arm64 arch: arm64 - - build: CPython 3.14 ARM 64 bits - python: cp314-macosx_arm64 - arch: arm64 steps: - name: Checkout repo @@ -396,9 +378,6 @@ jobs: - build: CPython 3.13 64 bits python: cp313-win_amd64 arch: AMD64 - - build: CPython 3.14 64 bits - python: cp314-win_amd64 - arch: AMD64 steps: - name: Checkout repo diff --git a/pyproject.toml b/pyproject.toml index 5a6c002839..ff6cfb50b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,12 +16,12 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", "License :: OSI Approved :: Apache Software License", "Topic :: Multimedia :: Graphics", "Topic :: Multimedia :: Video", From 45e1b1eefc1da05a121d8762ecc5ce756d97ab2e Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Mon, 1 Sep 2025 15:46:46 -0400 Subject: [PATCH 07/71] python: Uptick min required python to 3.9 Signed-off-by: Zach Lewis --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ff6cfb50b8..4f4efab416 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ "Topic :: Multimedia :: Video :: Display", "Topic :: Software Development :: Libraries :: Python Modules", ] -requires-python = ">= 3.8" +requires-python = ">= 3.9" dependencies = [ "numpy>=1.19", ] From 3203f60b89597cd588628c26dd7a051c9c8b2c96 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 12 Sep 2025 12:31:32 -0400 Subject: [PATCH 08/71] testing: _never_ find MacOS Framework include paths during CI Signed-off-by: Zach Lewis --- src/cmake/compiler.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake index bb12996b1a..d6962ebd1a 100644 --- a/src/cmake/compiler.cmake +++ b/src/cmake/compiler.cmake @@ -674,7 +674,7 @@ if (DEFINED ENV{${PROJECT_NAME}_CI}) if (APPLE) # Keep Mono framework from being incorrectly searched for include # files on GitHub Actions CI. - set(CMAKE_FIND_FRAMEWORK LAST) + set(CMAKE_FIND_FRAMEWORK NEVER) endif () endif () From 225d83c2ca4287dac05d4946b1ff855d3ca2e212 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 12 Sep 2025 12:39:43 -0400 Subject: [PATCH 09/71] fix: Revert last commit; move "...FRAMEWORK NEVER" to dependency_utils Signed-off-by: Zach Lewis --- src/cmake/compiler.cmake | 2 +- src/cmake/dependency_utils.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake index d6962ebd1a..bb12996b1a 100644 --- a/src/cmake/compiler.cmake +++ b/src/cmake/compiler.cmake @@ -674,7 +674,7 @@ if (DEFINED ENV{${PROJECT_NAME}_CI}) if (APPLE) # Keep Mono framework from being incorrectly searched for include # files on GitHub Actions CI. - set(CMAKE_FIND_FRAMEWORK NEVER) + set(CMAKE_FIND_FRAMEWORK LAST) endif () endif () diff --git a/src/cmake/dependency_utils.cmake b/src/cmake/dependency_utils.cmake index 02c764fd03..7e2177a7aa 100644 --- a/src/cmake/dependency_utils.cmake +++ b/src/cmake/dependency_utils.cmake @@ -40,7 +40,7 @@ endif () # Search for regular libraries before searching for macOS frameworks. if (APPLE) - set_cache (CMAKE_FIND_FRAMEWORK LAST + set_cache (CMAKE_FIND_FRAMEWORK NEVER DOC "Set relative priority of finding frameworks vs. regular libraries" ADVANCED) endif () From 68d2495f3b8f7b71f2934c891d8d069bef5b9d92 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 12 Sep 2025 12:44:09 -0400 Subject: [PATCH 10/71] ci(wheels-macos-x86): Go back to using the Ninja generator Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 3795c43646..e29f964369 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -283,7 +283,7 @@ jobs: env: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} - CMAKE_GENERATOR: "Unix Makefiles" + #CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. USE_Libheif: 'OFF' From 5907d5e9ec9bc4104a9763a8abacc7f2dd5427d8 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 12 Sep 2025 12:52:15 -0400 Subject: [PATCH 11/71] ci(wheels-macos-x86): force CIBW to find clang etc. Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index e29f964369..8db5428fec 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -284,9 +284,18 @@ jobs: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} #CMAKE_GENERATOR: "Unix Makefiles" - # TODO: Re-enable HEIF when we provide a build recipe that does - # not include GPL-licensed dynamic libraries. - USE_Libheif: 'OFF' + CIBW_ENVIRONMENT: > + CMAKE_GENERATOR=Ninja + CMAKE_C_COMPILER=$(xcrun -find clang) + CMAKE_CXX_COMPILER=$(xcrun -find clang++) + # Add your extra CMake args below (e.g., OpenEXR/Imath pins) + CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER + -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON + -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR + -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" + # TODO: Re-enable HEIF when we provide a build recipe that does + # not include GPL-licensed dynamic libraries. + USE_Libheif: 'OFF' - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: From 76fb6519cca75973e72885ce68bf811b90cf6336 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 12 Sep 2025 13:06:56 -0400 Subject: [PATCH 12/71] ci(wheels-macos-x86): set MACOSX_DEPLOYMENT_TARGET to "10.13", not "11" Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 4 ++++ pyproject.toml | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 8db5428fec..a4d168f394 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -284,15 +284,19 @@ jobs: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} #CMAKE_GENERATOR: "Unix Makefiles" + MACOSX_DEPLOYMENT_TARGET: "10.13" CIBW_ENVIRONMENT: > CMAKE_GENERATOR=Ninja CMAKE_C_COMPILER=$(xcrun -find clang) CMAKE_CXX_COMPILER=$(xcrun -find clang++) # Add your extra CMake args below (e.g., OpenEXR/Imath pins) + CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 + -DIGNORE_HOMEBREWED_DEPS=ON # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. USE_Libheif: 'OFF' diff --git a/pyproject.toml b/pyproject.toml index 4f4efab416..0d2443e733 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,14 +89,16 @@ if.platform-system = "darwin" if.platform-machine = "arm64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "arm64" +cmake.define.MACOSX_DEPLOYMENT_TARGET = "11" [[tool.scikit-build.overrides]] if.platform-system = "darwin" if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" -cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" -cmake.define.CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH = "OFF" +cmake.define.MACOSX_DEPLOYMENT_TARGET = "10.13" +#cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" +#cmake.define.CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH = "OFF" [tool.cibuildwheel] build-verbosity = 1 @@ -112,8 +114,6 @@ test-command = "oiiotool --buildinfo" [tool.cibuildwheel.macos.environment] SKBUILD_CMAKE_ARGS = "-DLINKSTATIC=1; -DIGNORE_HOMEBREWED_DEPS=1" -# C++17 - std::filesystem is only available in macOS 10.15 and later; ARM compatibility introduced in 11. -MACOSX_DEPLOYMENT_TARGET = "11" # Optimize for size (not speed). SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel" From f6cff040552e469c43080667a16ee69405906245 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Fri, 12 Sep 2025 13:14:05 -0400 Subject: [PATCH 13/71] ci(wheels-macos-x86): set cmake min policy to 3.5 globally Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index a4d168f394..09a5329cf5 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -293,13 +293,14 @@ jobs: CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON - -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR - -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DIGNORE_HOMEBREWED_DEPS=ON - # TODO: Re-enable HEIF when we provide a build recipe that does - # not include GPL-licensed dynamic libraries. - USE_Libheif: 'OFF' + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR + -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" + # TODO: Re-enable HEIF when we provide a build recipe that does + # not include GPL-licensed dynamic libraries. + USE_Libheif: 'OFF' - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: From 99f4974cf1e599e61c83fb33ffe6fb48b303aa73 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sat, 13 Sep 2025 14:36:21 -0400 Subject: [PATCH 14/71] ci(wheels-macos-x86): hack -- try to force cmake-3 in pyproj reqs Because CMake-4 is apparently causing difficulties all of a sudden when building yaml-cpp Signed-off-by: Zach Lewis --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0d2443e733..54b4b55aee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,8 @@ oiiotool = "OpenImageIO:_command_line" build-backend = "scikit_build_core.build" requires = [ "scikit-build-core>=0.10.6,<1", - "pybind11>=2.13,<3", + "pybind11>=2.9,<3", + "cmake-3", # Workaround for an issue with one of OCIO's auto-built dependencies (yaml-cpp) ] [tool.scikit-build] From 5e108a9c51480596438133eeb292373327f802fd Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sat, 13 Sep 2025 14:40:31 -0400 Subject: [PATCH 15/71] Revert "ci(wheels-macos-x86): hack -- try to force cmake-3 in pyproj reqs" This reverts commit a92ea7f03c3e2844c2d0c3f03037f85b0a34ab6f. Signed-off-by: Zach Lewis --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 54b4b55aee..0d2443e733 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,8 +49,7 @@ oiiotool = "OpenImageIO:_command_line" build-backend = "scikit_build_core.build" requires = [ "scikit-build-core>=0.10.6,<1", - "pybind11>=2.9,<3", - "cmake-3", # Workaround for an issue with one of OCIO's auto-built dependencies (yaml-cpp) + "pybind11>=2.13,<3", ] [tool.scikit-build] From 02d9fe68670dfb199612564431be4ae356714bee Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 14:27:49 -0400 Subject: [PATCH 16/71] build(yaml-cpp): fix for cmake-4 Signed-off-by: Zach Lewis --- src/cmake/build_yaml-cpp.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmake/build_yaml-cpp.cmake b/src/cmake/build_yaml-cpp.cmake index 05cab6187f..1de3b876a8 100644 --- a/src/cmake/build_yaml-cpp.cmake +++ b/src/cmake/build_yaml-cpp.cmake @@ -25,6 +25,7 @@ build_dependency_with_cmake(yaml-cpp -D YAML_CPP_BUILD_CONTRIB=OFF -D YAML_BUILD_SHARED_LIBS=${yaml-cpp_BUILD_SHARED_LIBS} -D CMAKE_INSTALL_LIBDIR=lib + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 ) set (yaml-cpp_ROOT ${yaml-cpp_LOCAL_INSTALL_DIR}) From 473efad8900406f87a91f1616521dd49c5edf21c Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 14:37:53 -0400 Subject: [PATCH 17/71] ci(wheels-macos-x86): update CMAKE_OSX_DEPLOYMENT_TARGET = 10.15 Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 3 +-- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 09a5329cf5..2fbfe0d305 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -284,7 +284,6 @@ jobs: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} #CMAKE_GENERATOR: "Unix Makefiles" - MACOSX_DEPLOYMENT_TARGET: "10.13" CIBW_ENVIRONMENT: > CMAKE_GENERATOR=Ninja CMAKE_C_COMPILER=$(xcrun -find clang) @@ -293,7 +292,7 @@ jobs: CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DIGNORE_HOMEBREWED_DEPS=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR diff --git a/pyproject.toml b/pyproject.toml index 0d2443e733..98f8c05c46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ oiiotool = "OpenImageIO:_command_line" build-backend = "scikit_build_core.build" requires = [ "scikit-build-core>=0.10.6,<1", - "pybind11>=2.13,<3", + "pybind11>=2.9,<3" ] [tool.scikit-build] @@ -89,14 +89,14 @@ if.platform-system = "darwin" if.platform-machine = "arm64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "arm64" -cmake.define.MACOSX_DEPLOYMENT_TARGET = "11" +cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "11" [[tool.scikit-build.overrides]] if.platform-system = "darwin" if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" -cmake.define.MACOSX_DEPLOYMENT_TARGET = "10.13" +cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "10.15" #cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" #cmake.define.CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH = "OFF" From 00e19fb7623e4c4dc9e1650303f46c629da3c4e1 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 14:43:29 -0400 Subject: [PATCH 18/71] ci(wheels-macos-x86): try setting $MACOS_DEPLOYMENT_TARGET = 10.15 Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 2fbfe0d305..adf00fe424 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -283,16 +283,15 @@ jobs: env: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} + MACOSX_DEPLOYMENT_TARGET: 10.15 #CMAKE_GENERATOR: "Unix Makefiles" CIBW_ENVIRONMENT: > - CMAKE_GENERATOR=Ninja CMAKE_C_COMPILER=$(xcrun -find clang) CMAKE_CXX_COMPILER=$(xcrun -find clang++) # Add your extra CMake args below (e.g., OpenEXR/Imath pins) CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DIGNORE_HOMEBREWED_DEPS=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR From 38a1853df2b9f6e46f09b26959508fd683dcb96b Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 14:57:40 -0400 Subject: [PATCH 19/71] ci(wheels-macos-x86): try removing possibly conflicting ignore-homebrew Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index adf00fe424..572b35d637 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -292,7 +292,6 @@ jobs: CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON - -DIGNORE_HOMEBREWED_DEPS=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" From 94c32b4fd7b818300fa68b0d8d2aa9713859774f Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 15:03:52 -0400 Subject: [PATCH 20/71] ci(wheels-macos-x86): try unsetting $CMAKE_ARGS env var Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 572b35d637..4ec0179c6b 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -290,11 +290,11 @@ jobs: CMAKE_CXX_COMPILER=$(xcrun -find clang++) # Add your extra CMake args below (e.g., OpenEXR/Imath pins) - CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER - -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR - -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" + # CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER + # -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON + # -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + # -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR + # -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. USE_Libheif: 'OFF' From d5c7debc27f98ae1e82843fd2ef445ab35e629a9 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 15:08:32 -0400 Subject: [PATCH 21/71] ci(wheels-macos-x86): try unsetting entire CIBW_ENV var Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 4ec0179c6b..46ce2c1e7f 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -284,17 +284,7 @@ jobs: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} MACOSX_DEPLOYMENT_TARGET: 10.15 - #CMAKE_GENERATOR: "Unix Makefiles" - CIBW_ENVIRONMENT: > - CMAKE_C_COMPILER=$(xcrun -find clang) - CMAKE_CXX_COMPILER=$(xcrun -find clang++) - # Add your extra CMake args below (e.g., OpenEXR/Imath pins) - - # CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER - # -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON - # -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - # -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR - # -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" + CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. USE_Libheif: 'OFF' From 1e8ccfb59fcb7c23389608e9dc16c81d6290eb66 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 15:34:57 -0400 Subject: [PATCH 22/71] build hack: update OpenEXR default autobuild ver to 3.4.0 ...to match what's getting pulled in by homebrew on the macos-13 sys images... ...because we're having trouble building the macos x86 wheels. This isn't a proper solution, but I'm interested to see if it helps the builds complete. Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 2 +- src/cmake/build_OpenEXR.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 46ce2c1e7f..0c9843ce5b 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -284,7 +284,7 @@ jobs: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} MACOSX_DEPLOYMENT_TARGET: 10.15 - CMAKE_GENERATOR: "Unix Makefiles" + #CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. USE_Libheif: 'OFF' diff --git a/src/cmake/build_OpenEXR.cmake b/src/cmake/build_OpenEXR.cmake index 849716fb8d..67ebd8a50b 100644 --- a/src/cmake/build_OpenEXR.cmake +++ b/src/cmake/build_OpenEXR.cmake @@ -3,7 +3,7 @@ # https://github.com/AcademySoftwareFoundation/OpenImageIO -set_cache (OpenEXR_BUILD_VERSION 3.2.4 "OpenEXR version for local builds") +set_cache (OpenEXR_BUILD_VERSION 3.4.0 "OpenEXR version for local builds") set (OpenEXR_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenEXR") set (OpenEXR_GIT_TAG "v${OpenEXR_BUILD_VERSION}") set_cache (OpenEXR_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} From 7834a5c45262eff2c7580ad8f6b1df682cd7953e Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 15:39:19 -0400 Subject: [PATCH 23/71] ci(wheels-macosx-x86): try turning off CMAKE_USE_SYSTEM_PATH Signed-off-by: Zach Lewis --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 98f8c05c46..50f92fc837 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,7 +97,7 @@ if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "10.15" -#cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" +cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" #cmake.define.CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH = "OFF" [tool.cibuildwheel] From a7ea69faf896391efa65294711e285ee09689632 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 15:42:07 -0400 Subject: [PATCH 24/71] Revert "build hack: update OpenEXR default autobuild ver to 3.4.0" This reverts commit 86885603374109ce84791ae2c09b39dc3a3f86e1. Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 2 +- src/cmake/build_OpenEXR.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 0c9843ce5b..46ce2c1e7f 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -284,7 +284,7 @@ jobs: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} MACOSX_DEPLOYMENT_TARGET: 10.15 - #CMAKE_GENERATOR: "Unix Makefiles" + CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. USE_Libheif: 'OFF' diff --git a/src/cmake/build_OpenEXR.cmake b/src/cmake/build_OpenEXR.cmake index 67ebd8a50b..849716fb8d 100644 --- a/src/cmake/build_OpenEXR.cmake +++ b/src/cmake/build_OpenEXR.cmake @@ -3,7 +3,7 @@ # https://github.com/AcademySoftwareFoundation/OpenImageIO -set_cache (OpenEXR_BUILD_VERSION 3.4.0 "OpenEXR version for local builds") +set_cache (OpenEXR_BUILD_VERSION 3.2.4 "OpenEXR version for local builds") set (OpenEXR_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenEXR") set (OpenEXR_GIT_TAG "v${OpenEXR_BUILD_VERSION}") set_cache (OpenEXR_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} From a1b540a71e8ec22a23e4c7086480513a8d56fdb5 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sun, 14 Sep 2025 15:46:22 -0400 Subject: [PATCH 25/71] ci(wheels-macos-x86): debug -- list brew-installed OpenEXRs Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 46ce2c1e7f..111d7da320 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -277,14 +277,18 @@ jobs: uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: '3.9' - + - name: List possible OpenEXR installs + run: | + brew list --versions | grep -E 'openexr|imath' || echo "No brew OpenEXR/Imath" + pkg-config --list-all | grep -E 'OpenEXR|Imath' || true + - name: Build wheels uses: pypa/cibuildwheel@d4a2945fcc8d13f20a1b99d461b8e844d5fc6e23 # v2.21.1 env: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} MACOSX_DEPLOYMENT_TARGET: 10.15 - CMAKE_GENERATOR: "Unix Makefiles" + #CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. USE_Libheif: 'OFF' From b98b88a7586572c60b94b928bf024659af8dea88 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 07:22:43 -0400 Subject: [PATCH 26/71] ci(wheels-macos-x86): try re-enabling CMAKE_FIND_FRAMEWORK=NEVER Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 111d7da320..6d95da40c4 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -277,6 +277,7 @@ jobs: uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: '3.9' + - name: List possible OpenEXR installs run: | brew list --versions | grep -E 'openexr|imath' || echo "No brew OpenEXR/Imath" diff --git a/pyproject.toml b/pyproject.toml index 50f92fc837..b4a0699770 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,7 +113,7 @@ skip = [ test-command = "oiiotool --buildinfo" [tool.cibuildwheel.macos.environment] -SKBUILD_CMAKE_ARGS = "-DLINKSTATIC=1; -DIGNORE_HOMEBREWED_DEPS=1" +SKBUILD_CMAKE_ARGS = "-DLINKSTATIC=1; -DIGNORE_HOMEBREWED_DEPS=1; -DCMAKE_FIND_FRAMEWORK=NEVER" # Optimize for size (not speed). SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel" From 72b23d94247458158cf7c232531d7f7552dbdbb5 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Thu, 14 Aug 2025 10:53:49 -0700 Subject: [PATCH 27/71] ci: Add a VFX Platform 2026 CI job (#4856) And a bunch of other minor updates: * Change from 'testing' to regular containers * Add forgotten 'export' * Update default self-build pybind11 to 3.0.0 --------- Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 29 ++++++++++++++++++--------- src/build-scripts/build_pybind11.bash | 2 +- src/cmake/build_pybind11.cmake | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2dfb761b1..a1bcb4b784 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -253,12 +253,12 @@ jobs: - desc: VFX2023 gcc11/C++17 py3.10 exr3.1 ocio2.2 nametag: linux-vfx2023 runner: ubuntu-latest - container: aswftesting/ci-osl:2023-clang15 + container: aswf/ci-osl:2023-clang15 python_ver: "3.10" simd: "avx2,f16c" fmt_ver: 10.1.1 pybind11_ver: v2.10.0 - setenvs: PUGIXML_VERSION=v1.13 + setenvs: export PUGIXML_VERSION=v1.13 - desc: VFX2023 icc/C++17 py3.10 exr3.1 ocio2.1 qt5.15 nametag: linux-vfx2023.icc runner: ubuntu-latest @@ -294,17 +294,17 @@ jobs: - desc: VFX2024 gcc11/C++17 py3.11 exr3.2 ocio2.3 nametag: linux-vfx2024 runner: ubuntu-latest - container: aswftesting/ci-osl:2024-clang17 + container: aswf/ci-oiio:2024 python_ver: "3.11" simd: "avx2,f16c" fmt_ver: 10.1.1 pybind11_ver: v2.12.0 benchmark: 1 - setenvs: PUGIXML_VERSION=v1.14 + setenvs: export PUGIXML_VERSION=v1.14 - desc: VFX2024 clang/C++17 py3.11 exr3.2 ocio2.3 nametag: linux-vfx2024.clang runner: ubuntu-latest - container: aswftesting/ci-osl:2024-clang17 + container: aswf/ci-oiio:2024 cc_compiler: clang cxx_compiler: clang++ python_ver: "3.11" @@ -312,21 +312,32 @@ jobs: fmt_ver: 10.1.1 pybind11_ver: v2.12.0 benchmark: 1 - setenvs: PUGIXML_VERSION=v1.14 + setenvs: export PUGIXML_VERSION=v1.14 - desc: VFX2025 gcc11/C++17 py3.11 exr3.3 ocio2.4 nametag: linux-vfx2025 runner: ubuntu-latest - container: aswftesting/ci-oiio:2025 + container: aswf/ci-oiio:2025 + cxx_std: 17 python_ver: "3.11" simd: "avx2,f16c" fmt_ver: 11.1.4 pybind11_ver: v2.13.6 benchmark: 1 - setenvs: PUGIXML_VERSION=v1.15 + setenvs: export PUGIXML_VERSION=v1.15 + - desc: VFX2026 gcc14/C++20 py3.13 exr3.4 ocio2.4 + nametag: linux-vfx2026 + runner: ubuntu-latest + container: aswf/ci-oiio:2026 + cxx_std: 20 + python_ver: "3.13" + simd: "avx2,f16c" + pybind11_ver: v3.0.0 + benchmark: 1 + # setenvs: export - desc: Sanitizers nametag: sanitizer runner: ubuntu-latest - container: aswf/ci-osl:2024-clang17 + container: aswf/ci-oiio:2024 cc_compiler: clang cxx_compiler: clang++ build_type: Debug diff --git a/src/build-scripts/build_pybind11.bash b/src/build-scripts/build_pybind11.bash index 7623608eb7..41151444ad 100755 --- a/src/build-scripts/build_pybind11.bash +++ b/src/build-scripts/build_pybind11.bash @@ -11,7 +11,7 @@ set -ex # Repo and branch/tag/commit of pybind11 to download if we don't have it yet PYBIND11_REPO=${PYBIND11_REPO:=https://github.com/pybind/pybind11.git} -PYBIND11_VERSION=${PYBIND11_VERSION:=v2.12.0} +PYBIND11_VERSION=${PYBIND11_VERSION:=v3.0.0} # Where to put pybind11 repo source (default to the ext area) PYBIND11_SRC_DIR=${PYBIND11_SRC_DIR:=${PWD}/ext/pybind11} diff --git a/src/cmake/build_pybind11.cmake b/src/cmake/build_pybind11.cmake index 21c7afb07f..83a0aebb8a 100644 --- a/src/cmake/build_pybind11.cmake +++ b/src/cmake/build_pybind11.cmake @@ -6,7 +6,7 @@ # pybind11 by hand! ###################################################################### -set_cache (pybind11_BUILD_VERSION 2.12.0 "pybind11 version for local builds") +set_cache (pybind11_BUILD_VERSION 3.0.0 "pybind11 version for local builds") set (pybind11_GIT_REPOSITORY "https://github.com/pybind/pybind11") set (pybind11_GIT_TAG "v${pybind11_BUILD_VERSION}") set_cache (pybind11_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} From d88f0556822fc805e11c6179ee4372c5bbcdb488 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Fri, 15 Aug 2025 08:12:52 +0200 Subject: [PATCH 28/71] build: fix build on NetBSD (#4857) Signed-off-by: Zach Lewis --- src/include/OpenImageIO/strutil.h | 1 + src/include/OpenImageIO/typedesc.h | 2 +- src/libOpenImageIO/imagebufalgo_compare.cpp | 11 +++++----- src/libOpenImageIO/maketexture.cpp | 2 +- src/libOpenImageIO/printinfo.cpp | 6 +++--- src/libtexture/environment.cpp | 4 ++-- src/libutil/fmath_test.cpp | 2 +- src/libutil/strutil.cpp | 23 ++++++++++++++++++++- src/oiiotool/printinfo.cpp | 4 ++-- src/testtex/testtex.cpp | 2 +- 10 files changed, 40 insertions(+), 17 deletions(-) diff --git a/src/include/OpenImageIO/strutil.h b/src/include/OpenImageIO/strutil.h index 07460b09e0..32d5af41bd 100644 --- a/src/include/OpenImageIO/strutil.h +++ b/src/include/OpenImageIO/strutil.h @@ -15,6 +15,7 @@ #pragma once #include +#include #include #include #include diff --git a/src/include/OpenImageIO/typedesc.h b/src/include/OpenImageIO/typedesc.h index 75902281c7..91aa88ccc9 100644 --- a/src/include/OpenImageIO/typedesc.h +++ b/src/include/OpenImageIO/typedesc.h @@ -409,7 +409,7 @@ template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::UINT64; }; template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::INT64; }; template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::INT64; }; -#if defined(__GNUC__) && __WORDSIZE == 64 && !(defined(__APPLE__) && defined(__MACH__)) +#if defined(__GNUC__) && __WORDSIZE == 64 && !(defined(__APPLE__) && defined(__MACH__)) || defined(__NetBSD__) // Some platforms consider int64_t and long long to be different types, even // though they are actually the same size. static_assert(!std::is_same_v); diff --git a/src/libOpenImageIO/imagebufalgo_compare.cpp b/src/libOpenImageIO/imagebufalgo_compare.cpp index 09de210540..f8cc4f58fc 100644 --- a/src/libOpenImageIO/imagebufalgo_compare.cpp +++ b/src/libOpenImageIO/imagebufalgo_compare.cpp @@ -80,11 +80,11 @@ ImageBufAlgo::PixelStats::operator=(PixelStats&& other) inline void val(ImageBufAlgo::PixelStats& p, int c, float value) { - if (isnan(value)) { + if (std::isnan(value)) { ++p.nancount[c]; return; } - if (isinf(value)) { + if (std::isinf(value)) { ++p.infcount[c]; return; } @@ -217,10 +217,11 @@ compare_value(ImageBuf::ConstIterator& a, int chan, VALT aval, bool& warned, float failthresh, float warnthresh, float failrelative, float warnrelative) { - if (!isfinite(aval) || !isfinite(bval)) { - if (isnan(aval) == isnan(bval) && isinf(aval) == isinf(bval)) + if (!std::isfinite(aval) || !std::isfinite(bval)) { + if (std::isnan(aval) == std::isnan(bval) + && std::isinf(aval) == std::isinf(bval)) return; // NaN may match NaN, Inf may match Inf - if (isfinite(result.maxerror)) { + if (std::isfinite(result.maxerror)) { // non-finite errors trump finite ones result.maxerror = std::numeric_limits::infinity(); result.maxx = a.x(); diff --git a/src/libOpenImageIO/maketexture.cpp b/src/libOpenImageIO/maketexture.cpp index 0af79ac74e..934d17b56e 100644 --- a/src/libOpenImageIO/maketexture.cpp +++ b/src/libOpenImageIO/maketexture.cpp @@ -347,7 +347,7 @@ check_nan_block(const ImageBuf& src, ROI roi, int& found_nonfinite) for (int x = x0; x < x1; ++x) { src.getpixel(x, y, pel); for (int c = 0; c < spec.nchannels; ++c) { - if (!isfinite(pel[c])) { + if (!std::isfinite(pel[c])) { spin_lock lock(maketx_mutex); // if (found_nonfinite < 3) // std::cerr << "maketx ERROR: Found " << pel[c] diff --git a/src/libOpenImageIO/printinfo.cpp b/src/libOpenImageIO/printinfo.cpp index 8f5d7e0e5e..5e451630f5 100644 --- a/src/libOpenImageIO/printinfo.cpp +++ b/src/libOpenImageIO/printinfo.cpp @@ -78,9 +78,9 @@ stats_num(float val, int maxval, bool round) // Ensure uniform printing of NaN and Inf on all platforms using Strutil::fmt::format; std::string result; - if (isnan(val)) + if (std::isnan(val)) result = "nan"; - else if (isinf(val)) + else if (std::isinf(val)) result = "inf"; else if (maxval == 0) { result = format("{:f}", val); @@ -245,7 +245,7 @@ print_deep_stats(std::ostream& out, string_view indent, const ImageBuf& input, for (unsigned int s = 0; s < samples; ++s) { for (int c = 0; c < nchannels; ++c) { float d = input.deep_value(x, y, z, c, s); - if (!isfinite(d)) { + if (!std::isfinite(d)) { if (nonfinites++ == 0) { nonfinite_pixel.setValue(x, y, z); nonfinite_pixel_samp = s; diff --git a/src/libtexture/environment.cpp b/src/libtexture/environment.cpp index cc25fe4d73..a103bfcbd1 100644 --- a/src/libtexture/environment.cpp +++ b/src/libtexture/environment.cpp @@ -268,9 +268,9 @@ vector_to_latlong(const Imath::V3f& R, bool y_is_up, float& s, float& t) t = 0.5f - atan2f(R.z, hypotf(R.x, R.y)) / (float)M_PI; } // learned from experience, beware NaNs - if (isnan(s)) + if (std::isnan(s)) s = 0.0f; - if (isnan(t)) + if (std::isnan(t)) t = 0.0f; } diff --git a/src/libutil/fmath_test.cpp b/src/libutil/fmath_test.cpp index 9105914be4..2634efe563 100644 --- a/src/libutil/fmath_test.cpp +++ b/src/libutil/fmath_test.cpp @@ -550,7 +550,7 @@ test_half_convert_accuracy() && Imath::finitef(H[i])) { ++nwrong; Strutil::print("wrong {} 0b{} h={}, f={} {}\n", i, bin16(i), H[i], - F[i], isnan(f) ? "(nan)" : ""); + F[i], std::isnan(f) ? "(nan)" : ""); } } diff --git a/src/libutil/strutil.cpp b/src/libutil/strutil.cpp index 816cd9f88e..ef0d80e7a7 100644 --- a/src/libutil/strutil.cpp +++ b/src/libutil/strutil.cpp @@ -67,7 +67,7 @@ static std::mutex output_mutex; // On systems that support it, get a location independent locale. #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) \ || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) \ - || defined(__GLIBC__) + || defined(__GLIBC__) || defined(__NetBSD__) static locale_t c_loc = newlocale(LC_ALL_MASK, "C", nullptr); #elif defined(_WIN32) static _locale_t c_loc = _create_locale(LC_ALL, "C"); @@ -526,6 +526,14 @@ strcasecmp(const char* a, const char* b) return strcasecmp_l(a, b, c_loc); #elif defined(_WIN32) return _stricmp_l(a, b, c_loc); +#elif defined(__NetBSD__) + const unsigned char *us1 = (const unsigned char*)a, + *us2 = (const unsigned char*)b; + + while (tolower_l(*us1, c_loc) == tolower_l(*us2++, c_loc)) + if (*us1++ == '\0') + return (0); + return (tolower_l(*us1, c_loc) - tolower_l(*--us2, c_loc)); #else # error("need equivalent of strcasecmp_l on this platform"); #endif @@ -541,6 +549,19 @@ strncasecmp(const char* a, const char* b, size_t size) return strncasecmp_l(a, b, size, c_loc); #elif defined(_WIN32) return _strnicmp_l(a, b, size, c_loc); +#elif defined(__NetBSD__) + if (size != 0) { + const unsigned char *us1 = (const unsigned char*)a, + *us2 = (const unsigned char*)b; + + do { + if (tolower_l(*us1, c_loc) != tolower_l(*us2++, c_loc)) + return (tolower_l(*us1, c_loc) - tolower_l(*--us2, c_loc)); + if (*us1++ == '\0') + break; + } while (--size != 0); + } + return (0); #else # error("need equivalent of strncasecmp_l on this platform"); #endif diff --git a/src/oiiotool/printinfo.cpp b/src/oiiotool/printinfo.cpp index f90a685f3a..9728cb1608 100644 --- a/src/oiiotool/printinfo.cpp +++ b/src/oiiotool/printinfo.cpp @@ -58,9 +58,9 @@ print_nums(std::ostream& out, int n, const T* val, string_view sep = " ", if (i) Strutil::print(out, "{}", sep); float v = float(val[i]); - if (isnan(v)) + if (std::isnan(v)) Strutil::print(out, "nan"); - else if (isinf(v)) + else if (std::isinf(v)) Strutil::print(out, "inf"); else Strutil::print(out, "{:.9f}", v); diff --git a/src/testtex/testtex.cpp b/src/testtex/testtex.cpp index fe8b327651..82ee772292 100644 --- a/src/testtex/testtex.cpp +++ b/src/testtex/testtex.cpp @@ -1557,7 +1557,7 @@ do_tex_thread_workout(int iterations, int mythread) } // Force the compiler to not optimize away the "other work" for (int c = 0; c < nchannels; ++c) - OIIO_ASSERT(!isnan(result[c])); + OIIO_ASSERT(!std::isnan(result[c])); } From 052f1f8a1cf0d8bb5bb22cc3ab027212cd55638d Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Fri, 15 Aug 2025 07:33:26 -0700 Subject: [PATCH 29/71] ci: Lock down to ci-oiio container with correct llvm components (#4859) Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1bcb4b784..8c3f9836fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -294,7 +294,7 @@ jobs: - desc: VFX2024 gcc11/C++17 py3.11 exr3.2 ocio2.3 nametag: linux-vfx2024 runner: ubuntu-latest - container: aswf/ci-oiio:2024 + container: aswf/ci-oiio:2024.2 python_ver: "3.11" simd: "avx2,f16c" fmt_ver: 10.1.1 @@ -304,7 +304,7 @@ jobs: - desc: VFX2024 clang/C++17 py3.11 exr3.2 ocio2.3 nametag: linux-vfx2024.clang runner: ubuntu-latest - container: aswf/ci-oiio:2024 + container: aswf/ci-oiio:2024.2 cc_compiler: clang cxx_compiler: clang++ python_ver: "3.11" @@ -337,7 +337,7 @@ jobs: - desc: Sanitizers nametag: sanitizer runner: ubuntu-latest - container: aswf/ci-oiio:2024 + container: aswf/ci-oiio:2024.2 cc_compiler: clang cxx_compiler: clang++ build_type: Debug From 689b7193ef6f1c7c6033f68c93f267a0df9703c9 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Mon, 18 Aug 2025 11:09:59 -0700 Subject: [PATCH 30/71] ci: Bump webp and openexr for "latest versions" test (#4861) * Test against alpha of openexr 3.4. * Document that we build against several things we know work but hadn't updated INSTALL.md in a while. --------- Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 6 +++--- INSTALL.md | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c3f9836fe..4b98a635ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -387,7 +387,7 @@ jobs: EXTRA_DEP_PACKAGES="clang-format-17" CLANG_FORMAT_EXE=clang-format-17 - - desc: latest releases gcc13 C++20 py3.12 avx2 exr3.3 ocio2.4 + - desc: latest releases gcc13 C++20 py3.12 avx2 exr3.4 ocio2.4 nametag: linux-latest-releases runner: ubuntu-24.04 cc_compiler: gcc-13 @@ -395,7 +395,7 @@ jobs: cxx_std: 20 fmt_ver: 11.2.0 opencolorio_ver: v2.4.2 - openexr_ver: v3.3.4 + openexr_ver: v3.4-alpha pybind11_ver: v3.0.0 python_ver: "3.12" simd: avx2,f16c @@ -405,7 +405,7 @@ jobs: OPENJPEG_VERSION=v2.5.3 PTEX_VERSION=v2.4.3 PUGIXML_VERSION=v1.15 - WEBP_VERSION=v1.5.0 + WEBP_VERSION=v1.6.0 FREETYPE_VERSION=VER-2-13-3 USE_OPENVDB=0 - desc: bleeding edge gcc14 C++23 py3.12 OCIO/libtiff/exr-main avx2 diff --git a/INSTALL.md b/INSTALL.md index 8c574afe2e..0f3afdaec4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -17,11 +17,11 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * C++17 or higher (also builds with C++20 and C++23) * The default build mode is C++17. This can be controlled by via the CMake configuration flag: `-DCMAKE_CXX_STANDARD=20`, etc. - * Compilers: gcc 9.3 - 14.2, clang 5 - 19, MSVS 2017 - 2022 (v19.14 + * Compilers: gcc 9.3 - 14.2, clang 5 - 20, MSVS 2017 - 2022 (v19.14 and up), Intel icc 19+, Intel OneAPI C++ compiler 2022+. - * CMake >= 3.18.2 (tested through 4.0) - * Imath >= 3.1 (tested through 3.1.x and main) - * OpenEXR >= 3.1 (tested through 3.3 and main) + * CMake >= 3.18.2 (tested through 4.1) + * Imath >= 3.1 (tested through 3.2 and main) + * OpenEXR >= 3.1 (tested through 3.4 and main) * libTIFF >= 4.0 (tested through 4.7 and master) * OpenColorIO >= 2.2 (tested through 2.4 and main) * libjpeg >= 8 (tested through jpeg9e), or libjpeg-turbo >= 2.1 (tested @@ -49,12 +49,12 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * If you want support for camera "RAW" formats: * LibRaw >= 0.20 (tested though 0.21.4 and master) * If you want support for a wide variety of video formats: - * ffmpeg >= 4.0 (tested through 7.0) + * ffmpeg >= 4.0 (tested through 7.1) * If you want support for jpeg 2000 images: * OpenJpeg >= 2.0 (tested through 2.5.3; we recommend 2.4 or higher for multithreading support) * If you want support for OpenVDB files: - * OpenVDB >= 9.0 (tested through 12.0). + * OpenVDB >= 9.0 (tested through 12.1). * If you want to use TBB as the thread pool: * TBB >= 2018 (tested through 2021 and OneTBB) * If you want support for converting to and from OpenCV data structures, @@ -69,7 +69,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * If you want support for DICOM medical image files: * DCMTK >= 3.6.1 (tested through 3.6.9) * If you want support for WebP images: - * WebP >= 1.1 (tested through 1.5) + * WebP >= 1.1 (tested through 1.6) * If you want support for Ptex: * Ptex >= 2.3.1 (probably works for older; tested through 2.4.3) * If you want to be able to do font rendering into images: From eae73dadf7fc79a20c79f6493340ca10d9d7efe1 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Tue, 19 Aug 2025 12:09:25 -0700 Subject: [PATCH 31/71] feat: color space renaming to adhere to CIF conventions (#4860) This doesn't really change any of the color management algorithms per se, or change how we use OCIO. That will come later. But this tries as best as we can to shift to CIF recommended interop names for color spaces. * "srgb_rec709_scene" as the canonical name for what we used to refer to as "sRGB". * "lin_rec709_scene" as the canonical name for what we used to refer to as "lin_rec709" and several other names. * "lin_ap1_scene" as the canonical name for ACEScg. * Stop setting "oiio:Gamma" metadata (though we still accept it for back compatibility), instead using space names like "g22_rec709_scene" and so on. We never came across files with truly arbitrary gamma. If I've done it right, the old names will continue to be accepted as aliases. I recognize that changing the output (when printing metadata) to the canonical names might be an inconvenience at first, but in the long run, I think it's better to comply with the conventions that will be used for USD, MaterialX, and OpenEXR. I'm fine with the new wordy and pedantic names as what is stored underneath as the "oiio:ColorSpace" alias or stored in an OpenEXR file in the colorInteropID metadata. But I gotta say, from a UI/UX perspective, I do not feel good about replacing "srgb" and "acescg" as things that are easy to type and are known/understood by the vast majority of OIIO users with a change to these wonky, error-prone, hard-to-type names. So I'm very uncertain about changing oiiotool documentation, say, away from the short and widely understood aliases. Seeking feedback on what to do here! --------- Signed-off-by: Larry Gritz Co-authored-by: Doug Walker Signed-off-by: Zach Lewis --- src/bmp.imageio/bmpinput.cpp | 2 +- src/build-scripts/build_opencolorio.bash | 2 +- src/cmake/build_OpenColorIO.cmake | 2 +- src/dds.imageio/ddsinput.cpp | 6 +- src/doc/builtinplugins.rst | 12 ---- src/doc/oiiotool.rst | 29 ++++---- src/doc/pythonbindings.rst | 8 +-- src/doc/stdmetadata.rst | 42 +++++------- src/gif.imageio/gifinput.cpp | 2 +- src/hdr.imageio/hdrinput.cpp | 2 +- src/heif.imageio/heifinput.cpp | 2 +- src/iconvert/iconvert.cpp | 5 +- src/include/OpenImageIO/color.h | 10 +++ src/iv/imageviewer.cpp | 4 +- src/iv/ivgl.cpp | 5 +- src/jpeg.imageio/jpeginput.cpp | 2 +- src/jpeg.imageio/jpegoutput.cpp | 2 +- src/jpeg2000.imageio/jpeg2000input.cpp | 4 +- src/libOpenImageIO/color_ocio.cpp | 68 ++++++++++++------- src/libOpenImageIO/exif.cpp | 2 +- src/libOpenImageIO/imagebufalgo_test.cpp | 6 +- src/oiiotool/oiiotool.cpp | 2 +- src/png.imageio/png_pvt.h | 33 ++++++--- src/png.imageio/pnginput.cpp | 18 ++++- src/raw.imageio/rawinput.cpp | 13 ++-- src/targa.imageio/targainput.cpp | 2 +- src/term.imageio/termoutput.cpp | 2 +- src/tiff.imageio/tiffinput.cpp | 2 +- src/tiff.imageio/tiffoutput.cpp | 2 +- src/webp.imageio/webpinput.cpp | 2 +- testsuite/bmp/ref/out.txt | 62 ++++++++--------- testsuite/dds/ref/out.txt | 18 ++--- testsuite/gif/ref/out.txt | 30 ++++---- testsuite/gpsread/ref/out-alt.txt | 4 +- testsuite/gpsread/ref/out-jpeg9d.txt | 4 +- testsuite/gpsread/ref/out.txt | 4 +- testsuite/hdr/ref/out.txt | 2 +- testsuite/heif/ref/out-libheif1.12-orient.txt | 6 +- testsuite/heif/ref/out-libheif1.4.txt | 8 +-- testsuite/heif/ref/out-libheif1.5.txt | 8 +-- testsuite/heif/ref/out-libheif1.9-alt2.txt | 6 +- .../heif/ref/out-libheif1.9-with-av1-alt2.txt | 8 +-- .../heif/ref/out-libheif1.9-with-av1.txt | 8 +-- testsuite/heif/ref/out-libheif1.9.txt | 6 +- testsuite/ico/ref/out.txt | 2 +- testsuite/jpeg-corrupt/ref/out-alt.txt | 4 +- testsuite/jpeg-corrupt/ref/out-alt2.txt | 6 +- testsuite/jpeg-corrupt/ref/out-alt3.txt | 6 +- testsuite/jpeg-corrupt/ref/out-alt4.txt | 6 +- testsuite/jpeg-corrupt/ref/out.txt | 6 +- testsuite/jpeg-metadata/ref/out.txt | 16 ++--- testsuite/jpeg2000-j2kp4files/ref/out-alt.txt | 18 ++--- .../jpeg2000-j2kp4files/ref/out-spinux.txt | 18 ++--- testsuite/jpeg2000-j2kp4files/ref/out.txt | 18 ++--- testsuite/oiiotool-attribs/ref/out-jpeg9d.txt | 10 +-- testsuite/oiiotool-attribs/ref/out.txt | 10 +-- testsuite/png/ref/out-libpng15.txt | 8 +-- testsuite/png/ref/out.txt | 8 +-- testsuite/psd/ref/out-linuxarm.txt | 58 ++++++++-------- testsuite/psd/ref/out.txt | 58 ++++++++-------- testsuite/python-imageinput/ref/out-alt.txt | 2 +- testsuite/python-imageinput/ref/out-alt2.txt | 2 +- .../python-imageinput/ref/out-py37-jpeg9d.txt | 2 +- .../ref/out-python3-win-2.txt | 2 +- .../python-imageinput/ref/out-python3-win.txt | 2 +- .../python-imageinput/ref/out-python3.txt | 2 +- testsuite/python-imageinput/ref/out.txt | 2 +- testsuite/raw/ref/out-libraw-0.20.2-gh.txt | 14 ++-- testsuite/raw/ref/out-libraw0.20.0-gh.txt | 14 ++-- testsuite/raw/ref/out-libraw0.20.0.txt | 14 ++-- testsuite/raw/ref/out-libraw0.21.0-gh.txt | 14 ++-- testsuite/raw/ref/out-libraw0.21.0-mac.txt | 16 ++--- testsuite/raw/ref/out.txt | 16 ++--- testsuite/rla/ref/out.txt | 6 +- testsuite/tiff-suite/ref/out-alt.txt | 4 +- testsuite/tiff-suite/ref/out-alt2.txt | 4 +- testsuite/tiff-suite/ref/out-jpeg9b.txt | 4 +- testsuite/tiff-suite/ref/out-jpeg9d-alt.txt | 4 +- testsuite/tiff-suite/ref/out.txt | 4 +- testsuite/webp/ref/out-webp1.1.txt | 8 +-- 80 files changed, 450 insertions(+), 405 deletions(-) diff --git a/src/bmp.imageio/bmpinput.cpp b/src/bmp.imageio/bmpinput.cpp index 888a43e7ec..a39d0b2061 100644 --- a/src/bmp.imageio/bmpinput.cpp +++ b/src/bmp.imageio/bmpinput.cpp @@ -262,7 +262,7 @@ BmpInput::open(const std::string& name, ImageSpec& newspec, // Default presumption is that a BMP file is meant to look reasonable on a // display, so assume it's sRGB. This is not really correct -- see the // comments below. - m_spec.attribute("oiio:ColorSpace", "sRGB"); + m_spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); #if 0 if (m_dib_header.size >= WINDOWS_V4 && m_dib_header.cs_type == CSType::CalibratedRGB) { diff --git a/src/build-scripts/build_opencolorio.bash b/src/build-scripts/build_opencolorio.bash index 09a175e3fc..0dddc2971e 100755 --- a/src/build-scripts/build_opencolorio.bash +++ b/src/build-scripts/build_opencolorio.bash @@ -11,7 +11,7 @@ set -ex # Which OCIO to retrieve, how to build it OPENCOLORIO_REPO=${OPENCOLORIO_REPO:=https://github.com/AcademySoftwareFoundation/OpenColorIO.git} -OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v2.3.2} +OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v2.4.2} # Where to install the final results LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext} diff --git a/src/cmake/build_OpenColorIO.cmake b/src/cmake/build_OpenColorIO.cmake index a04ae95308..136ec9d1ab 100644 --- a/src/cmake/build_OpenColorIO.cmake +++ b/src/cmake/build_OpenColorIO.cmake @@ -6,7 +6,7 @@ # OpenColorIO by hand! ###################################################################### -set_cache (OpenColorIO_BUILD_VERSION 2.4.1 "OpenColorIO version for local builds") +set_cache (OpenColorIO_BUILD_VERSION 2.4.2 "OpenColorIO version for local builds") set (OpenColorIO_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenColorIO") set (OpenColorIO_GIT_TAG "v${OpenColorIO_BUILD_VERSION}") set_cache (OpenColorIO_BUILD_SHARED_LIBS OFF #ON diff --git a/src/dds.imageio/ddsinput.cpp b/src/dds.imageio/ddsinput.cpp index 98a7d28ccd..53f80ed487 100644 --- a/src/dds.imageio/ddsinput.cpp +++ b/src/dds.imageio/ddsinput.cpp @@ -838,14 +838,16 @@ DDSInput::seek_subimage(int subimage, int miplevel) case DDS_FORMAT_BC7_UNORM_SRGB: case DDS_FORMAT_R8G8B8A8_UNORM_SRGB: case DDS_FORMAT_B8G8R8A8_UNORM_SRGB: - case DDS_FORMAT_B8G8R8X8_UNORM_SRGB: colorspace = "sRGB"; break; + case DDS_FORMAT_B8G8R8X8_UNORM_SRGB: + colorspace = "srgb_rec709_scene"; + break; } } // linear color space for HDR-ish images if (colorspace == nullptr && (basetype == TypeDesc::HALF || basetype == TypeDesc::FLOAT)) - colorspace = "lin_rec709"; + colorspace = "lin_rec709_scene"; m_spec.set_colorspace(colorspace); diff --git a/src/doc/builtinplugins.rst b/src/doc/builtinplugins.rst index 93772b0bfc..3a9c7d3972 100644 --- a/src/doc/builtinplugins.rst +++ b/src/doc/builtinplugins.rst @@ -688,9 +688,6 @@ preferred except when legacy file access is required. - string - Color space (see Section :ref:`sec-metadata-color`). We currently assume that any RGBE files encountered are linear with sRGB primaries. - * - ``oiio:Gamma`` - - float - - the gamma correction specified in the RGBE header (if it's gamma corrected). * - ``heif:Orientation`` - int - If the configuration option ``heif:reorient`` is nonzero and @@ -1771,9 +1768,6 @@ files use the file extension :file:`.png`. * - ``oiio:ColorSpace`` - string - Color space (see Section :ref:`sec-metadata-color`). - * - ``oiio:Gamma`` - - float - - the gamma correction value (if specified). * - ``ICCProfile`` - uint8[] - The ICC color profile. A variety of other ``ICCProfile:*`` attributes @@ -2370,9 +2364,6 @@ software developed at Wavefront. RLA files commonly use the file extension * - ``oiio:ColorSpace`` - string - Color space (see Section :ref:`sec-metadata-color`). - * - ``oiio:Gamma`` - - float - - the gamma correction value (if specified). **Configuration settings for RLA input** @@ -2611,9 +2602,6 @@ http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf * - ``oiio:ColorSpace`` - string - Color space (see Section :ref:`sec-metadata-color`). - * - ``oiio:Gamma`` - - float - - the gamma correction value (if specified). If the TGA file contains a thumbnail, its dimensions will be stored in the attributes ``"thumbnail_width"``, ``"thumbnail_height"``, and diff --git a/src/doc/oiiotool.rst b/src/doc/oiiotool.rst index 38f41e0d14..d7b0f0fdd8 100644 --- a/src/doc/oiiotool.rst +++ b/src/doc/oiiotool.rst @@ -709,13 +709,19 @@ Color convert an image ---------------------- This command linearizes a JPEG assumed to be in sRGB, saving as an HDRI -OpenEXR file:: +OpenEXR file in ACEScg color space:: - oiiotool photo.jpg --colorconvert sRGB linear -o output.exr + oiiotool photo.jpg --colorconvert srgb acescg -o output.exr And the other direction:: - oiiotool render.exr --colorconvert linear sRGB -o fortheweb.png + oiiotool render.exr --colorconvert acescg srgb -o fortheweb.png + +Above, we're using the short aliases "srgb" and "acescg", but it's also fine +to use the canonical Color Interop Forum names:: + + oiiotool photo.jpg --colorconvert srgb_rec709_scene lin_ap1_scene -o output.exr + oiiotool render.exr --colorconvert lin_ap1_scene srgb_rec709_scene -o fortheweb.png This converts between two named color spaces (presumably defined by your facility's OpenColorIO configuration):: @@ -1608,7 +1614,7 @@ Writing images oiiotool in.tif -otex out.tx - oiiotool in.jpg --colorconvert sRGB linear -d uint16 -otex out.tx + oiiotool in.jpg --colorconvert srgb_rec709_scene lin_rec709_scene -d uint16 -otex out.tx oiiotool --pattern:checker 512x512 3 -d uint8 -otex:wrap=periodic checker.tx @@ -4352,15 +4358,12 @@ current top image. Many of the color management commands depend on an installation of OpenColorIO (http://opencolorio.org). -If OIIO has been compiled with OpenColorIO support and the environment -variable `$OCIO` is set to point to a valid OpenColorIO configuration file, -you will have access to all the color spaces that are known by that OCIO -configuration. Alternately, you can use the `--colorconfig` option to -explicitly point to a configuration file. If no valid configuration file is -found (either in `$OCIO` or specified by `--colorconfig}` or OIIO was not -compiled with OCIO support, then the only color space transformats available -are `linear` to `Rec709` (and vice versa) and `linear` to `sRGB` (and vice -versa). +If the environment variable `$OCIO` is set to point to a valid OpenColorIO +configuration file, you will have access to all the color spaces that are +known by that OCIO configuration. Alternately, you can use the +`--colorconfig` option to explicitly point to a configuration file. If no +valid configuration file is found (either in `$OCIO` or specified by +`--colorconfig`), then the built-in OCIO "default" config will be used. If you ask for :program:`oiiotool` help (`oiiotool --help`), at the very bottom you will see the list of all color spaces, looks, and displays that diff --git a/src/doc/pythonbindings.rst b/src/doc/pythonbindings.rst index a423c48966..1565a65860 100644 --- a/src/doc/pythonbindings.rst +++ b/src/doc/pythonbindings.rst @@ -729,7 +729,7 @@ Section :ref:`sec-ImageSpec`, is replicated for Python. .. code-block:: python spec = ImageSpec(...) - spec.set_colorspace ("sRGB") + spec.set_colorspace ("srgb_rec709_scene") .. py:method:: ImageSpec.undefined () @@ -3961,12 +3961,12 @@ details. .. code-block:: python spec = oiio.ImageSpec() - oiio.set_colorspace (spec, "lin_rec709") + oiio.set_colorspace (spec, "lin_rec709_scene") This function was added in OpenImageIO 3.0. -.. py:method:: set_colorspace_rec709_gamma (spec, name) +.. py:method:: set_colorspace_rec709_gamma (spec, gamma) Set the metadata of the `spec` to reflect Rec709 color primaries and the given gamma. @@ -3992,7 +3992,7 @@ details. # ib is an ImageBuf cs = ib.spec().get_string_attribute("oiio:ColorSpace") - if oiio.equivalent_colorspace(cs, "sRGB") : + if oiio.equivalent_colorspace(cs, "srgb_rec709_scene") : print ("The image is sRGB") This function was added in OpenImageIO 3.0. diff --git a/src/doc/stdmetadata.rst b/src/doc/stdmetadata.rst index 5ec22ce0c7..0e70f8315c 100644 --- a/src/doc/stdmetadata.rst +++ b/src/doc/stdmetadata.rst @@ -139,34 +139,24 @@ Color information .. option:: "oiio:ColorSpace" : string - The name of the color space of the color channels. Values include: + The name of the color space of the color channels. This can be the name of + any documented Color Interop Forum standard token, or any color space, + alias, or role known to OpenColorIO. Common values include: - - `"scene_linear"` : Color pixel values are known to be scene-linear and - using facility-default color primaries as defined by the OpenColorIO - configuration. - - `"lin_srgb"`, `"lin_rec709"` : Color pixel values are known to be - linear and using sRGB/Rec709 color primaries. Note that `"linear"` is - treated as a synonym. - - `"sRGB"` : Using standard sRGB response and primaries. - - `"Rec709"` : Using standard Rec709 response and primaries. - - `"ACEScg"` : ACEScg color space encoding. - - `"AdobeRGB"` : Adobe RGB color space. - - `"KodakLog"` : Kodak logarithmic color space. - - `"g22_rec709"` : Rec709/sRGB primaries, but using a response curve + - `"lin_rec709_scene"`, : Color pixel values are known to be linear + scene-referred and using sRGB/Rec709 color primaries. Note that + `"lin_rec709"` is treated as a synonym. + - `"lin_ap1_scene"`, `"ACEScg"` : ACEScg color space encoding. + - `"lin_ap0_scene"` : ACES2065-1, the recommended ACES space for + interchange and archiving. + - `"srgb_rec709_scene"` : Using standard (piecewise) sRGB response and + primaries. The token `"sRGB"` is treated as a synonym. + - `"g22_rec709_scene"` : Rec709/sRGB primaries, but using a response curve corresponding to gamma 2.2. - - `"g18_rec709"` : Rec709/sRGB primaries, but using a response curve - corresponding to gamma 1.8. - - `"GammaX.Y"` : Color values have been gamma corrected - (raised to the power :math:`1/\gamma`). The `X.Y` is the numeric value - of the gamma exponent. - - *arbitrary* : The name of any color space known to OpenColorIO (if - OCIO support is present). - -.. option:: "oiio:Gamma" : float - - If the color space is "GammaX.Y", this value is the gamma exponent. - (Optional/deprecated; if present, it should match the suffix of the color - space.) + + Additionally, `"scene_linear"` is a role that is appropriate for color + pixel values are known to be scene-linear and using facility-default color + primaries as defined by the OpenColorIO configuration. .. option:: "oiio:BorderColor" : float[nchannels] diff --git a/src/gif.imageio/gifinput.cpp b/src/gif.imageio/gifinput.cpp index b0e033cac0..09a7fd0c61 100644 --- a/src/gif.imageio/gifinput.cpp +++ b/src/gif.imageio/gifinput.cpp @@ -259,7 +259,7 @@ GIFInput::read_subimage_metadata(ImageSpec& newspec) newspec.nchannels = 4; newspec.default_channel_names(); newspec.alpha_channel = 4; - newspec.set_colorspace("sRGB"); + newspec.set_colorspace("srgb_rec709_scene"); m_previous_disposal_method = m_disposal_method; m_disposal_method = DISPOSAL_UNSPECIFIED; diff --git a/src/hdr.imageio/hdrinput.cpp b/src/hdr.imageio/hdrinput.cpp index 650e403b58..850899d89d 100644 --- a/src/hdr.imageio/hdrinput.cpp +++ b/src/hdr.imageio/hdrinput.cpp @@ -291,7 +291,7 @@ HdrInput::RGBE_ReadHeader() if (!line.size()) return false; - m_spec.set_colorspace("lin_rec709"); + m_spec.set_colorspace("lin_rec709_scene"); // presume linear w/ srgb primaries -- seems like the safest assumption // for this old file format. diff --git a/src/heif.imageio/heifinput.cpp b/src/heif.imageio/heifinput.cpp index 48bb7fb892..be92acf9f4 100644 --- a/src/heif.imageio/heifinput.cpp +++ b/src/heif.imageio/heifinput.cpp @@ -243,7 +243,7 @@ HeifInput::seek_subimage(int subimage, int miplevel) m_himage.get_height(heif_channel_interleaved), bits / 8, TypeUInt8); - m_spec.set_colorspace("sRGB"); + m_spec.set_colorspace("srgb_rec709_scene"); #if LIBHEIF_HAVE_VERSION(1, 12, 0) // Libheif >= 1.12 added API call to find out if the image is associated diff --git a/src/iconvert/iconvert.cpp b/src/iconvert/iconvert.cpp index 8a2da09e4e..bcc8aef7ca 100644 --- a/src/iconvert/iconvert.cpp +++ b/src/iconvert/iconvert.cpp @@ -221,9 +221,10 @@ adjust_spec(ImageInput* in, ImageOutput* out, const ImageSpec& inspec, if (outspec.nchannels != inspec.nchannels) nocopy = true; - outspec.attribute("oiio:Gamma", gammaval); + if (gammaval != 1.0f) + outspec.attribute("oiio:Gamma", gammaval); if (sRGB) { - outspec.set_colorspace("sRGB"); + outspec.set_colorspace("srgb_rec709_scene"); if (!strcmp(in->format_name(), "jpeg") || outspec.find_attribute("Exif:ColorSpace")) outspec.attribute("Exif:ColorSpace", 1); diff --git a/src/include/OpenImageIO/color.h b/src/include/OpenImageIO/color.h index ab579b430d..e284e6c337 100644 --- a/src/include/OpenImageIO/color.h +++ b/src/include/OpenImageIO/color.h @@ -13,6 +13,16 @@ #include +// +// Some general color management information materials to have handy: +// - CIF recommendations for scene referred color spaces for rendering and +// textures: +// https://github.com/AcademySoftwareFoundation/ColorInterop/blob/main/Recommendations/01_TextureAssetColorSpaces/TextureAssetColorSpaces.md +// - CIF recommendations for display referred color spaces: +// https://docs.google.com/document/d/1MmBG4a3Dr6S6EO781WjK-xZW7QdHpuo-zd7wtMvG1Rs +// + + OIIO_NAMESPACE_BEGIN /// The ColorProcessor encapsulates a baked color transformation, suitable for diff --git a/src/iv/imageviewer.cpp b/src/iv/imageviewer.cpp index 6b7695ab2f..12db1aa772 100644 --- a/src/iv/imageviewer.cpp +++ b/src/iv/imageviewer.cpp @@ -53,8 +53,8 @@ namespace { inline bool IsSpecSrgb(const ImageSpec& spec) { - return Strutil::iequals(spec.get_string_attribute("oiio:ColorSpace"), - "sRGB"); + return equivalent_colorspace(spec.get_string_attribute("oiio:ColorSpace"), + "srgb_rec709_scene"); } } // namespace diff --git a/src/iv/ivgl.cpp b/src/iv/ivgl.cpp index 9e34ca21b4..2d773d674c 100644 --- a/src/iv/ivgl.cpp +++ b/src/iv/ivgl.cpp @@ -2198,8 +2198,9 @@ IvGL::typespec_to_opengl(const ImageSpec& spec, int nchannels, GLenum& gltype, break; } - bool issrgb = Strutil::iequals(spec.get_string_attribute("oiio:ColorSpace"), - "sRGB"); + bool issrgb + = equivalent_colorspace(spec.get_string_attribute("oiio:ColorSpace"), + "srgb_rec709_scene"); glinternalformat = nchannels; if (nchannels == 1) { diff --git a/src/jpeg.imageio/jpeginput.cpp b/src/jpeg.imageio/jpeginput.cpp index 2220c17e56..092072aa5d 100644 --- a/src/jpeg.imageio/jpeginput.cpp +++ b/src/jpeg.imageio/jpeginput.cpp @@ -258,7 +258,7 @@ JpgInput::open(const std::string& name, ImageSpec& newspec) return false; // Assume JPEG is in sRGB unless the Exif or XMP tags say otherwise. - m_spec.set_colorspace("sRGB"); + m_spec.set_colorspace("srgb_rec709_scene"); if (m_cinfo.jpeg_color_space == JCS_CMYK) m_spec.attribute("jpeg:ColorSpace", "CMYK"); diff --git a/src/jpeg.imageio/jpegoutput.cpp b/src/jpeg.imageio/jpegoutput.cpp index 56a306541f..f6058deb25 100644 --- a/src/jpeg.imageio/jpegoutput.cpp +++ b/src/jpeg.imageio/jpegoutput.cpp @@ -269,7 +269,7 @@ JpgOutput::open(const std::string& name, const ImageSpec& newspec, } if (equivalent_colorspace(m_spec.get_string_attribute("oiio:ColorSpace"), - "sRGB")) + "srgb_rec709_scene")) m_spec.attribute("Exif:ColorSpace", 1); // Write EXIF info diff --git a/src/jpeg2000.imageio/jpeg2000input.cpp b/src/jpeg2000.imageio/jpeg2000input.cpp index ac16ee0bed..b68b48cd0e 100644 --- a/src/jpeg2000.imageio/jpeg2000input.cpp +++ b/src/jpeg2000.imageio/jpeg2000input.cpp @@ -360,7 +360,7 @@ Jpeg2000Input::ojph_read_header() m_spec = ImageSpec(w, h, ch, dtype); m_spec.default_channel_names(); m_spec.attribute("oiio:BitsPerSample", siz.get_bit_depth(0)); - m_spec.set_colorspace("sRGB"); + m_spec.set_colorspace("srgb_rec709_scene"); return true; } @@ -607,7 +607,7 @@ Jpeg2000Input::open(const std::string& name, ImageSpec& p_spec) m_spec.full_height = m_image->y1; m_spec.attribute("oiio:BitsPerSample", maxPrecision); - m_spec.set_colorspace("sRGB"); + m_spec.set_colorspace("srgb_rec709_scene"); if (m_image->icc_profile_len && m_image->icc_profile_buf) { m_spec.attribute("ICCProfile", diff --git a/src/libOpenImageIO/color_ocio.cpp b/src/libOpenImageIO/color_ocio.cpp index 91b2663ef0..6e3de0f3c3 100644 --- a/src/libOpenImageIO/color_ocio.cpp +++ b/src/libOpenImageIO/color_ocio.cpp @@ -423,7 +423,7 @@ class ColorConfig::Impl { // ColorConfig utility to take inventory of the color spaces available. -// It sets up knowledge of "linear", "sRGB", "Rec709", etc, +// It sets up knowledge of "linear", "srgb_rec709_scene", "Rec709", etc, // even if the underlying OCIO configuration lacks them. void ColorConfig::Impl::inventory() @@ -463,7 +463,10 @@ ColorConfig::Impl::inventory() add("default", 0, linflags); add("rgb", 0, linflags); add("RGB", 0, linflags); + add("lin_rec709_scene", 0, linflags); add("lin_srgb", 0, linflags); + add("lin_rec709", 0, linflags); + add("srgb_rec709_scene", 1, CSInfo::is_srgb); add("sRGB", 1, CSInfo::is_srgb); add("Rec709", 2, CSInfo::is_Rec709); @@ -578,24 +581,28 @@ ColorConfig::Impl::classify_by_name(CSInfo& cs) // General heuristics based on the names -- for a few canonical names, // believe them! Woe be unto the poor soul who names a color space "sRGB" // or "ACEScg" and it's really something entirely different. - if (Strutil::iequals(cs.name, "sRGB") + if (Strutil::iequals(cs.name, "srgb_rec709_scene") || Strutil::iequals(cs.name, "srgb_tx") || Strutil::iequals(cs.name, "srgb_texture") || Strutil::iequals(cs.name, "srgb texture") - || Strutil::iequals(cs.name, "sRGB - Texture")) { + || Strutil::iequals(cs.name, "srgb_rec709_scene") + || Strutil::iequals(cs.name, "sRGB - Texture") + || Strutil::iequals(cs.name, "sRGB")) { cs.setflag(CSInfo::is_srgb, srgb_alias); - } else if (Strutil::iequals(cs.name, "Rec709")) { - cs.setflag(CSInfo::is_Rec709, Rec709_alias); - } else if (Strutil::iequals(cs.name, "lin_srgb") + } else if (Strutil::iequals(cs.name, "lin_rec709_scene") || Strutil::iequals(cs.name, "lin_rec709") || Strutil::iequals(cs.name, "Linear Rec.709 (sRGB)") + || Strutil::iequals(cs.name, "lin_srgb") || Strutil::iequals(cs.name, "linear")) { cs.setflag(CSInfo::is_lin_srgb | CSInfo::is_linear_response, lin_srgb_alias); } else if (Strutil::iequals(cs.name, "ACEScg") + || Strutil::iequals(cs.name, "lin_ap1_scene") || Strutil::iequals(cs.name, "lin_ap1")) { cs.setflag(CSInfo::is_ACEScg | CSInfo::is_linear_response, ACEScg_alias); + } else if (Strutil::iequals(cs.name, "Rec709")) { + cs.setflag(CSInfo::is_Rec709, Rec709_alias); } #ifdef OIIO_SITE_spi // Ugly SPI-specific hacks, so sorry @@ -613,13 +620,13 @@ ColorConfig::Impl::classify_by_name(CSInfo& cs) // Set up some canonical names if (cs.flags() & CSInfo::is_srgb) - cs.canonical = "sRGB"; - else if (cs.flags() & CSInfo::is_Rec709) - cs.canonical = "Rec709"; + cs.canonical = "srgb_rec709_scene"; else if (cs.flags() & CSInfo::is_lin_srgb) - cs.canonical = "lin_srgb"; + cs.canonical = "lin_rec709_scene"; else if (cs.flags() & CSInfo::is_ACEScg) - cs.canonical = "ACEScg"; + cs.canonical = "lin_ap1_scene"; + else if (cs.flags() & CSInfo::is_Rec709) + cs.canonical = "Rec709"; if (cs.canonical.size()) { DBG("classify by name identified '{}' as canonical {}\n", cs.name, cs.canonical); @@ -673,13 +680,13 @@ ColorConfig::Impl::classify_by_conversions(CSInfo& cs) // Set up some canonical names if (cs.flags() & CSInfo::is_srgb) - cs.canonical = "sRGB"; - else if (cs.flags() & CSInfo::is_Rec709) - cs.canonical = "Rec709"; + cs.canonical = "srgb_rec709_scene"; else if (cs.flags() & CSInfo::is_lin_srgb) - cs.canonical = "lin_srgb"; + cs.canonical = "lin_rec709_scene"; else if (cs.flags() & CSInfo::is_ACEScg) - cs.canonical = "ACEScg"; + cs.canonical = "lin_ap1_scene"; + else if (cs.flags() & CSInfo::is_Rec709) + cs.canonical = "Rec709"; } @@ -726,7 +733,8 @@ ColorConfig::Impl::identify_builtin_equivalents() if (auto n = IdentifyBuiltinColorSpace("srgb_tx")) { if (CSInfo* cs = find(n)) { cs->setflag(CSInfo::is_srgb, srgb_alias); - DBG("Identified {} = builtin '{}'\n", "srgb", cs->name); + DBG("Identified {} = builtin '{}'\n", "srgb_rec709_scene", + cs->name); } } else { DBG("No config space identified as srgb\n"); @@ -736,7 +744,7 @@ ColorConfig::Impl::identify_builtin_equivalents() if (CSInfo* cs = find(n)) { cs->setflag(CSInfo::is_lin_srgb | CSInfo::is_linear_response, lin_srgb_alias); - DBG("Identified {} = builtin '{}'\n", "lin_srgb", cs->name); + DBG("Identified {} = builtin '{}'\n", "lin_rec709_scene", cs->name); } } else { DBG("No config space identified as lin_srgb\n"); @@ -1344,14 +1352,19 @@ ColorConfig::Impl::resolve(string_view name) const // Maybe it's an informal alias of common names? spin_rw_write_lock lock(m_mutex); - if (Strutil::iequals(name, "sRGB") && !srgb_alias.empty()) + if ((Strutil::iequals(name, "sRGB") + || Strutil::iequals(name, "srgb_rec709_scene")) + && !srgb_alias.empty()) return srgb_alias; if ((Strutil::iequals(name, "lin_srgb") || Strutil::iequals(name, "lin_rec709") + || Strutil::iequals(name, "lin_rec709_scene") || Strutil::iequals(name, "linear")) && lin_srgb_alias.size()) return lin_srgb_alias; - if (Strutil::iequals(name, "ACEScg") && !ACEScg_alias.empty()) + if ((Strutil::iequals(name, "ACEScg") + || Strutil::iequals(name, "lin_ap1_scene")) + && !ACEScg_alias.empty()) return ACEScg_alias; if (Strutil::iequals(name, "scene_linear") && !scene_linear_alias.empty()) { return scene_linear_alias; @@ -2808,7 +2821,7 @@ ColorConfig::set_colorspace(ImageSpec& spec, string_view colorspace) const // including some format-specific things that we don't want to propagate // from input to output if we know that color space transformations have // occurred. - if (!equivalent(colorspace, "sRGB")) + if (!equivalent(colorspace, "srgb_rec709_scene")) spec.erase_attribute("Exif:ColorSpace"); spec.erase_attribute("tiff:ColorSpace"); spec.erase_attribute("tiff:PhotometricInterpretation"); @@ -2822,16 +2835,19 @@ ColorConfig::set_colorspace_rec709_gamma(ImageSpec& spec, float gamma) const { gamma = std::round(gamma * 100.0f) / 100.0f; if (fabsf(gamma - 1.0f) <= 0.01f) { - set_colorspace(spec, "lin_srgb"); - // Presume that Targa files are sRGB primaries + set_colorspace(spec, "lin_rec709_scene"); } else if (fabsf(gamma - 1.8f) <= 0.01f) { - set_colorspace(spec, "g18_rec709"); + set_colorspace(spec, "g18_rec709_scene"); spec.attribute("oiio:Gamma", 1.8f); } else if (fabsf(gamma - 2.2f) <= 0.01f) { - set_colorspace(spec, "g22_rec709"); + set_colorspace(spec, "g22_rec709_scene"); spec.attribute("oiio:Gamma", 2.2f); + } else if (fabsf(gamma - 2.4f) <= 0.01f) { + set_colorspace(spec, "g24_rec709_scene"); + spec.attribute("oiio:Gamma", 2.4f); } else { - set_colorspace(spec, Strutil::fmt::format("Gamma{:.2}", gamma)); + set_colorspace(spec, Strutil::fmt::format("g{}_rec709_scene", + std::lround(gamma * 10.0f))); spec.attribute("oiio:Gamma", gamma); } } diff --git a/src/libOpenImageIO/exif.cpp b/src/libOpenImageIO/exif.cpp index d7e8863410..5b3252c88b 100644 --- a/src/libOpenImageIO/exif.cpp +++ b/src/libOpenImageIO/exif.cpp @@ -1226,7 +1226,7 @@ decode_exif(cspan exif, ImageSpec& spec) // Exif spec says that anything other than 0xffff==uncalibrated // should be interpreted to be sRGB. if (cs != 0xffff) - spec.set_colorspace("sRGB"); + spec.set_colorspace("srgb_rec709_scene"); } // Look for a maker note offset, now that we have seen all the metadata diff --git a/src/libOpenImageIO/imagebufalgo_test.cpp b/src/libOpenImageIO/imagebufalgo_test.cpp index 6560922b32..3ea14c46bc 100644 --- a/src/libOpenImageIO/imagebufalgo_test.cpp +++ b/src/libOpenImageIO/imagebufalgo_test.cpp @@ -1143,13 +1143,15 @@ void test_color_management() { ColorConfig config; - auto processor = config.createColorProcessor("lin_srgb", "srgb"); + auto processor = config.createColorProcessor("lin_rec709_scene", + "srgb_rec709_scene"); // These color spaces might not be found if the site running this test // has a weirdo OCIO config that doesn't contain those names. If we fail, // try again using the built-in config (OCIO 2.2+) and hope for the best. if (!processor) processor = ColorConfig("ocio://default") - .createColorProcessor("lin_srgb", "srgb"); + .createColorProcessor("lin_rec709_scene", + "srgb_rec709_scene"); OIIO_CHECK_ASSERT(processor); // Test the IBA::colorconvert version that works on a color at a time diff --git a/src/oiiotool/oiiotool.cpp b/src/oiiotool/oiiotool.cpp index 294c298540..1416231118 100644 --- a/src/oiiotool/oiiotool.cpp +++ b/src/oiiotool/oiiotool.cpp @@ -5729,7 +5729,7 @@ output_file(Oiiotool& ot, cspan argv) || Strutil::iends_with(filename, ".jpeg") || Strutil::iends_with(filename, ".gif") || Strutil::iends_with(filename, ".webp"))) - outcolorspace = string_view("sRGB"); + outcolorspace = string_view("srgb_rec709_scene"); if (outcolorspace.empty() && (Strutil::iends_with(filename, ".ppm") || Strutil::iends_with(filename, ".pnm"))) diff --git a/src/png.imageio/png_pvt.h b/src/png.imageio/png_pvt.h index 85ac6ec74d..659a8e045b 100644 --- a/src/png.imageio/png_pvt.h +++ b/src/png.imageio/png_pvt.h @@ -224,7 +224,7 @@ read_info(png_structp& sp, png_infop& ip, int& bit_depth, int& color_type, int srgb_intent; double gamma = 0.0; if (png_get_sRGB(sp, ip, &srgb_intent)) { - spec.set_colorspace("sRGB"); + spec.set_colorspace("srgb_rec709_scene"); } else if (png_get_gAMA(sp, ip, &gamma) && gamma > 0.0) { // Round gamma to the nearest hundredth to prevent stupid // precision choices and make it easier for apps to make @@ -235,7 +235,7 @@ read_info(png_structp& sp, png_infop& ip, int& bit_depth, int& color_type, set_colorspace_rec709_gamma(spec, g); } else { // If there's no info at all, assume sRGB. - set_colorspace(spec, "sRGB"); + set_colorspace(spec, "srgb_rec709_scene"); } if (png_get_valid(sp, ip, PNG_INFO_iCCP)) { @@ -595,17 +595,32 @@ write_info(png_structp& sp, png_infop& ip, int& color_type, ImageSpec& spec, convert_alpha = spec.alpha_channel != -1 && !spec.get_int_attribute("oiio:UnassociatedAlpha", 0); - gamma = spec.get_float_attribute("oiio:Gamma", 1.0); + string_view colorspace = spec.get_string_attribute("oiio:ColorSpace", + "srgb_rec709_scene"); + const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); + srgb = false; + if (colorconfig.equivalent(colorspace, "srgb_rec709_scene")) { + srgb = true; + gamma = 1.0f; + } else if (colorconfig.equivalent(colorspace, "g22_rec709_scene")) { + gamma = 2.2f; + } else if (colorconfig.equivalent(colorspace, "g24_rec709_scene")) { + gamma = 2.4f; + } else if (colorconfig.equivalent(colorspace, "g18_rec709_scene")) { + gamma = 1.8f; + } else { + gamma = spec.get_float_attribute("oiio:Gamma", 1.0f); + // obsolete "oiio:Gamma" attrib for back compatibility + } - const ColorConfig& colorconfig = ColorConfig::default_colorconfig(); - string_view colorspace = spec.get_string_attribute("oiio:ColorSpace"); if (colorconfig.equivalent(colorspace, "scene_linear") - || colorconfig.equivalent(colorspace, "lin_rec709")) { + || colorconfig.equivalent(colorspace, "lin_rec709_scene")) { if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) return "Could not set PNG gAMA chunk"; png_set_gAMA(sp, ip, 1.0); srgb = false; } else if (Strutil::istarts_with(colorspace, "Gamma")) { + // Back compatible, this is DEPRECATED(3.1) Strutil::parse_word(colorspace); float g = Strutil::from_string(colorspace); if (g >= 0.01f && g <= 10.0f /* sanity check */) @@ -614,19 +629,19 @@ write_info(png_structp& sp, png_infop& ip, int& color_type, ImageSpec& spec, return "Could not set PNG gAMA chunk"; png_set_gAMA(sp, ip, 1.0f / gamma); srgb = false; - } else if (colorconfig.equivalent(colorspace, "g22_rec709")) { + } else if (colorconfig.equivalent(colorspace, "g22_rec709_scene")) { gamma = 2.2f; if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) return "Could not set PNG gAMA chunk"; png_set_gAMA(sp, ip, 1.0f / gamma); srgb = false; - } else if (colorconfig.equivalent(colorspace, "g18_rec709")) { + } else if (colorconfig.equivalent(colorspace, "g18_rec709_scene")) { gamma = 1.8f; if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) return "Could not set PNG gAMA chunk"; png_set_gAMA(sp, ip, 1.0f / gamma); srgb = false; - } else if (colorconfig.equivalent(colorspace, "sRGB")) { + } else if (colorconfig.equivalent(colorspace, "srgb_rec709_scene")) { if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) return "Could not set PNG gAMA and cHRM chunk"; png_set_sRGB_gAMA_and_cHRM(sp, ip, PNG_sRGB_INTENT_ABSOLUTE); diff --git a/src/png.imageio/pnginput.cpp b/src/png.imageio/pnginput.cpp index 4947b3b6a7..21ae6d91b4 100644 --- a/src/png.imageio/pnginput.cpp +++ b/src/png.imageio/pnginput.cpp @@ -170,11 +170,23 @@ PNGInput::open(const std::string& name, ImageSpec& newspec) return false; } - m_gamma = m_spec.get_float_attribute("oiio:Gamma", 1.0f); string_view colorspace = m_spec.get_string_attribute("oiio:ColorSpace", - "sRGB"); + "srgb_rec709_scene"); const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); - m_srgb = colorconfig.equivalent(colorspace, "sRGB"); + m_srgb = false; + if (colorconfig.equivalent(colorspace, "srgb_rec709_scene")) { + m_srgb = true; + m_gamma = 1.0f; + } else if (colorconfig.equivalent(colorspace, "g22_rec709_scene")) { + m_gamma = 2.2f; + } else if (colorconfig.equivalent(colorspace, "g24_rec709_scene")) { + m_gamma = 2.4f; + } else if (colorconfig.equivalent(colorspace, "g18_rec709_scene")) { + m_gamma = 1.8f; + } else { + m_gamma = m_spec.get_float_attribute("oiio:Gamma", 1.0f); + // obsolete "oiio:Gamma" attrib for back compatibility + } newspec = spec(); m_next_scanline = 0; diff --git a/src/raw.imageio/rawinput.cpp b/src/raw.imageio/rawinput.cpp index d6b281f9a6..b164ea1d51 100644 --- a/src/raw.imageio/rawinput.cpp +++ b/src/raw.imageio/rawinput.cpp @@ -9,6 +9,7 @@ #include +#include #include #include #include @@ -565,18 +566,22 @@ RawInput::open_raw(bool unpack, bool process, const std::string& name, // might request a particular color space, like "ACES". Note that a // request for "sRGB-linear" will give you sRGB primaries with a linear // response. - std::string cs = config.get_string_attribute("raw:ColorSpace", "sRGB"); + const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); + std::string cs = config.get_string_attribute("raw:ColorSpace", + "srgb_rec709_scene"); if (Strutil::iequals(cs, "raw")) { // Values straight from the chip m_processor->imgdata.params.output_color = 0; m_processor->imgdata.params.gamm[0] = 1.0; m_processor->imgdata.params.gamm[1] = 1.0; - } else if (Strutil::iequals(cs, "sRGB")) { + } else if (colorconfig.equivalent(cs, "srgb_rec709_scene") + || Strutil::iequals(cs, "sRGB") /* Necessary? */) { // Request explicit sRGB, including usual sRGB response m_processor->imgdata.params.output_color = 1; m_processor->imgdata.params.gamm[0] = 1.0 / 2.4; m_processor->imgdata.params.gamm[1] = 12.92; - } else if (Strutil::iequals(cs, "sRGB-linear") + } else if (colorconfig.equivalent(cs, "lin_rec709_scene") + || Strutil::iequals(cs, "sRGB-linear") || Strutil::iequals(cs, "lin_srgb") || Strutil::iequals(cs, "lin_rec709") || Strutil::iequals(cs, "linear") /* DEPRECATED */) { @@ -584,7 +589,7 @@ RawInput::open_raw(bool unpack, bool process, const std::string& name, m_processor->imgdata.params.output_color = 1; m_processor->imgdata.params.gamm[0] = 1.0; m_processor->imgdata.params.gamm[1] = 1.0; - cs = "lin_rec709"; + cs = "lin_rec709_scene"; } else if (Strutil::iequals(cs, "Adobe")) { // Request Adobe color space with 2.2 gamma (no linear toe) m_processor->imgdata.params.output_color = 2; diff --git a/src/targa.imageio/targainput.cpp b/src/targa.imageio/targainput.cpp index 2a5aca30eb..984f772ffa 100644 --- a/src/targa.imageio/targainput.cpp +++ b/src/targa.imageio/targainput.cpp @@ -524,7 +524,7 @@ TGAInput::get_thumbnail(ImageBuf& thumb, int subimage) // the thumbnail is in the same format as the main image but // uncompressed. ImageSpec thumbspec(res[0], res[1], m_spec.nchannels, TypeUInt8); - thumbspec.set_colorspace("sRGB"); + thumbspec.set_colorspace("srgb_rec709_scene"); thumb.reset(thumbspec); int bytespp = (m_tga.bpp == 15) ? 2 : (m_tga.bpp / 8); int palbytespp = (m_tga.cmap_size == 15) ? 2 : (m_tga.cmap_size / 8); diff --git a/src/term.imageio/termoutput.cpp b/src/term.imageio/termoutput.cpp index f551eb3a93..968005b567 100644 --- a/src/term.imageio/termoutput.cpp +++ b/src/term.imageio/termoutput.cpp @@ -140,7 +140,7 @@ TermOutput::output() { // Color convert in place to sRGB, or it won't look right std::string cspace = m_buf.spec()["oiio:ColorSpace"].get(); - ImageBufAlgo::colorconvert(m_buf, m_buf, cspace, "sRGB"); + ImageBufAlgo::colorconvert(m_buf, m_buf, cspace, "srgb_rec709_scene"); string_view method(m_method); if (method.empty()) { diff --git a/src/tiff.imageio/tiffinput.cpp b/src/tiff.imageio/tiffinput.cpp index 6f12aba102..ac360d2c32 100644 --- a/src/tiff.imageio/tiffinput.cpp +++ b/src/tiff.imageio/tiffinput.cpp @@ -1314,7 +1314,7 @@ TIFFInput::readspec(bool read_meta) // Exif spec says that anything other than 0xffff==uncalibrated // should be interpreted to be sRGB. if (m_spec.get_int_attribute("Exif:ColorSpace") != 0xffff) - m_spec.attribute("oiio:ColorSpace", "sRGB"); + m_spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); // NOTE: We must set "oiio:ColorSpace" explicitly, not call // set_colorspace, or it will erase several other TIFF attribs we // need to preserve. diff --git a/src/tiff.imageio/tiffoutput.cpp b/src/tiff.imageio/tiffoutput.cpp index 41a1ede293..efac72345b 100644 --- a/src/tiff.imageio/tiffoutput.cpp +++ b/src/tiff.imageio/tiffoutput.cpp @@ -882,7 +882,7 @@ TIFFOutput::open(const std::string& name, const ImageSpec& userspec, } if (equivalent_colorspace(m_spec.get_string_attribute("oiio:ColorSpace"), - "sRGB")) + "srgb_rec709_scene")) m_spec.attribute("Exif:ColorSpace", 1); // Deal with missing XResolution or YResolution, or a PixelAspectRatio diff --git a/src/webp.imageio/webpinput.cpp b/src/webp.imageio/webpinput.cpp index 37b88b4fd7..408310b88a 100644 --- a/src/webp.imageio/webpinput.cpp +++ b/src/webp.imageio/webpinput.cpp @@ -162,7 +162,7 @@ WebpInput::open(const std::string& name, ImageSpec& spec, m_spec = ImageSpec(w, h, (m_demux_flags & ALPHA_FLAG) ? 4 : 3, TypeUInt8); m_scanline_size = m_spec.scanline_bytes(); - m_spec.set_colorspace("sRGB"); // webp is always sRGB + m_spec.set_colorspace("srgb_rec709_scene"); // webp is always sRGB if (m_demux_flags & ANIMATION_FLAG) { m_spec.attribute("oiio:Movie", 1); m_frame_count = (int)WebPDemuxGetI(m_demux, WEBP_FF_FRAME_COUNT); diff --git a/testsuite/bmp/ref/out.txt b/testsuite/bmp/ref/out.txt index 4db114732c..13fc651063 100644 --- a/testsuite/bmp/ref/out.txt +++ b/testsuite/bmp/ref/out.txt @@ -4,7 +4,7 @@ Reading ../oiio-images/bmpsuite/g01bg.bmp channel list: R, G, B bmp:bitsperpixel: 1 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g01bg.bmp" and "g01bg.bmp" PASS Reading ../oiio-images/bmpsuite/g01bw.bmp @@ -13,7 +13,7 @@ Reading ../oiio-images/bmpsuite/g01bw.bmp channel list: R, G, B bmp:bitsperpixel: 1 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g01bw.bmp" and "g01bw.bmp" PASS Reading ../oiio-images/bmpsuite/g01p1.bmp @@ -22,7 +22,7 @@ Reading ../oiio-images/bmpsuite/g01p1.bmp channel list: R, G, B bmp:bitsperpixel: 1 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g01p1.bmp" and "g01p1.bmp" PASS Reading ../oiio-images/bmpsuite/g01wb.bmp @@ -31,7 +31,7 @@ Reading ../oiio-images/bmpsuite/g01wb.bmp channel list: R, G, B bmp:bitsperpixel: 1 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g01wb.bmp" and "g01wb.bmp" PASS Reading ../oiio-images/bmpsuite/g04.bmp @@ -40,7 +40,7 @@ Reading ../oiio-images/bmpsuite/g04.bmp channel list: R, G, B bmp:bitsperpixel: 4 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g04.bmp" and "g04.bmp" PASS Reading ../oiio-images/bmpsuite/g04p4.bmp @@ -49,7 +49,7 @@ Reading ../oiio-images/bmpsuite/g04p4.bmp channel list: R, G, B bmp:bitsperpixel: 4 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g04p4.bmp" and "g04p4.bmp" PASS Reading ../oiio-images/bmpsuite/g04rle.bmp @@ -59,7 +59,7 @@ Reading ../oiio-images/bmpsuite/g04rle.bmp compression: "rle4" bmp:bitsperpixel: 4 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g04rle.bmp" and "g04rle.bmp" PASS Reading ../oiio-images/bmpsuite/g08.bmp @@ -68,7 +68,7 @@ Reading ../oiio-images/bmpsuite/g08.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08.bmp" and "g08.bmp" PASS Reading ../oiio-images/bmpsuite/g08os2.bmp @@ -77,7 +77,7 @@ Reading ../oiio-images/bmpsuite/g08os2.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 1 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08os2.bmp" and "g08os2.bmp" PASS Reading ../oiio-images/bmpsuite/g08p64.bmp @@ -86,7 +86,7 @@ Reading ../oiio-images/bmpsuite/g08p64.bmp channel list: Y bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08p64.bmp" and "g08p64.bmp" PASS Reading ../oiio-images/bmpsuite/g08p256.bmp @@ -95,7 +95,7 @@ Reading ../oiio-images/bmpsuite/g08p256.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08p256.bmp" and "g08p256.bmp" PASS Reading ../oiio-images/bmpsuite/g08pi64.bmp @@ -104,7 +104,7 @@ Reading ../oiio-images/bmpsuite/g08pi64.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08pi64.bmp" and "g08pi64.bmp" PASS Reading ../oiio-images/bmpsuite/g08pi256.bmp @@ -113,7 +113,7 @@ Reading ../oiio-images/bmpsuite/g08pi256.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08pi256.bmp" and "g08pi256.bmp" PASS Reading ../oiio-images/bmpsuite/g08res11.bmp @@ -125,7 +125,7 @@ Reading ../oiio-images/bmpsuite/g08res11.bmp YResolution: 3937 bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08res11.bmp" and "g08res11.bmp" PASS Reading ../oiio-images/bmpsuite/g08res21.bmp @@ -137,7 +137,7 @@ Reading ../oiio-images/bmpsuite/g08res21.bmp YResolution: 3937 bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08res21.bmp" and "g08res21.bmp" PASS Reading ../oiio-images/bmpsuite/g08res22.bmp @@ -149,7 +149,7 @@ Reading ../oiio-images/bmpsuite/g08res22.bmp YResolution: 7874 bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08res22.bmp" and "g08res22.bmp" PASS Reading ../oiio-images/bmpsuite/g08s0.bmp @@ -158,7 +158,7 @@ Reading ../oiio-images/bmpsuite/g08s0.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08s0.bmp" and "g08s0.bmp" PASS Reading ../oiio-images/bmpsuite/g08w124.bmp @@ -167,7 +167,7 @@ Reading ../oiio-images/bmpsuite/g08w124.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08w124.bmp" and "g08w124.bmp" PASS Reading ../oiio-images/bmpsuite/g08w125.bmp @@ -176,7 +176,7 @@ Reading ../oiio-images/bmpsuite/g08w125.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08w125.bmp" and "g08w125.bmp" PASS Reading ../oiio-images/bmpsuite/g08w126.bmp @@ -185,7 +185,7 @@ Reading ../oiio-images/bmpsuite/g08w126.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08w126.bmp" and "g08w126.bmp" PASS Reading ../oiio-images/bmpsuite/g08rle.bmp @@ -195,7 +195,7 @@ Reading ../oiio-images/bmpsuite/g08rle.bmp compression: "rle8" bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08rle.bmp" and "g08rle.bmp" PASS Reading ../oiio-images/bmpsuite/g08offs.bmp @@ -204,7 +204,7 @@ Reading ../oiio-images/bmpsuite/g08offs.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g08offs.bmp" and "g08offs.bmp" PASS Reading ../oiio-images/bmpsuite/g24.bmp @@ -212,7 +212,7 @@ Reading ../oiio-images/bmpsuite/g24.bmp SHA-1: B1FB63649469F31D02D7AD065D3128EE04CC662E channel list: R, G, B bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g24.bmp" and "g24.bmp" PASS Reading ../oiio-images/bmpsuite/g32bf.bmp @@ -220,7 +220,7 @@ Reading ../oiio-images/bmpsuite/g32bf.bmp SHA-1: D8807C680B17C70CB33B43AC072E0A9121C551B4 channel list: R, G, B, A bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g32bf.bmp" and "g32bf.bmp" PASS Reading ../oiio-images/bmpsuite/g32def.bmp @@ -228,7 +228,7 @@ Reading ../oiio-images/bmpsuite/g32def.bmp SHA-1: D8807C680B17C70CB33B43AC072E0A9121C551B4 channel list: R, G, B, A bmp:version: 3 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g32def.bmp" and "g32def.bmp" PASS Reading ../oiio-images/bmpsuite/g16bf555.bmp @@ -238,7 +238,7 @@ Reading ../oiio-images/bmpsuite/g16bf555.bmp bmp:bitsperpixel: 16 bmp:version: 3 oiio:BitsPerSample: 5 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g16bf555.bmp" and "g16bf555.bmp" PASS Reading ../oiio-images/bmpsuite/g16bf565.bmp @@ -248,7 +248,7 @@ Reading ../oiio-images/bmpsuite/g16bf565.bmp bmp:bitsperpixel: 16 bmp:version: 3 oiio:BitsPerSample: 5 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g16bf565.bmp" and "g16bf565.bmp" PASS Reading ../oiio-images/bmpsuite/g16def555.bmp @@ -258,7 +258,7 @@ Reading ../oiio-images/bmpsuite/g16def555.bmp bmp:bitsperpixel: 16 bmp:version: 3 oiio:BitsPerSample: 5 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmpsuite/g16def555.bmp" and "g16def555.bmp" PASS Reading src/g01bg2-v5.bmp @@ -269,7 +269,7 @@ src/g01bg2-v5.bmp : 127 x 64, 3 channel, uint8 bmp XResolution: 2835 YResolution: 2835 bmp:version: 5 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "src/g01bg2-v5.bmp" and "g01bg2-v5.bmp" PASS Reading src/PRINTER.BMP @@ -278,7 +278,7 @@ src/PRINTER.BMP : 160 x 120, 3 channel, uint8 bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 1 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "src/PRINTER.BMP" and "PRINTER.BMP" PASS Reading ../oiio-images/bmp/gracehopper.bmp @@ -288,7 +288,7 @@ Reading ../oiio-images/bmp/gracehopper.bmp ResolutionUnit: "m" XResolution: 2835 YResolution: 2835 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/bmp/gracehopper.bmp" and "gracehopper.bmp" PASS oiiotool ERROR: read : "src/decodecolormap-corrupt.bmp": Possible corrupted header, invalid palette size diff --git a/testsuite/dds/ref/out.txt b/testsuite/dds/ref/out.txt index 5ca18c59a0..43c5a59564 100644 --- a/testsuite/dds/ref/out.txt +++ b/testsuite/dds/ref/out.txt @@ -41,14 +41,14 @@ Reading ../oiio-images/dds/dds_bc6hu.dds channel list: R, G, B compression: "BC6HU" textureformat: "Plain Texture" - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" Reading ../oiio-images/dds/dds_bc6hu_hdr.dds ../oiio-images/dds/dds_bc6hu_hdr.dds : 128 x 64, 3 channel, half dds SHA-1: 86FE86288649F5375DB51CDF19C91C3651992726 channel list: R, G, B compression: "BC6HU" textureformat: "Plain Texture" - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" Reading ../oiio-images/dds/dds_bc7.dds ../oiio-images/dds/dds_bc7.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 18D1977AD74C3C19E5B30459D212EBC8C7F8BC54 @@ -184,49 +184,49 @@ Reading ../oiio-images/dds/dds_dxgi_bc1_srgb.dds channel list: R, G, B, A compression: "DXT1" textureformat: "Plain Texture" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/dds/dds_dxgi_bc2_srgb.dds ../oiio-images/dds/dds_dxgi_bc2_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: D99494018941ADCA11EAE469D8C6E598DA37A8BF channel list: R, G, B, A compression: "DXT3" textureformat: "Plain Texture" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/dds/dds_dxgi_bc3_srgb.dds ../oiio-images/dds/dds_dxgi_bc3_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 75F9FCD1920A00966F2FE13DF40F4FB0A6CD8DED channel list: R, G, B, A compression: "DXT5" textureformat: "Plain Texture" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/dds/dds_dxgi_bc7_srgb.dds ../oiio-images/dds/dds_dxgi_bc7_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 91DBAC0E5ED54D5BBEECA4C48AB704FA9F7FE317 channel list: R, G, B, A compression: "BC7" textureformat: "Plain Texture" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/dds/dds_dxgi_rgba8_srgb.dds ../oiio-images/dds/dds_dxgi_rgba8_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 61986C7E2D4F402B4A268AE5187AAFAF1647C0E6 channel list: R, G, B, A textureformat: "Plain Texture" oiio:BitsPerSample: 32 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/dds/dds_dxgi_bgra8_srgb.dds ../oiio-images/dds/dds_dxgi_bgra8_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 61986C7E2D4F402B4A268AE5187AAFAF1647C0E6 channel list: R, G, B, A textureformat: "Plain Texture" oiio:BitsPerSample: 32 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/dds/dds_dxgi_bgrx8_srgb.dds ../oiio-images/dds/dds_dxgi_bgrx8_srgb.dds : 16 x 8, 3 channel, uint8 dds SHA-1: 6BF57CCCCF14021926285CE97D25AEC150324476 channel list: R, G, B textureformat: "Plain Texture" oiio:BitsPerSample: 32 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/dds/dds_dxgi_rgb10a2.dds ../oiio-images/dds/dds_dxgi_rgb10a2.dds : 16 x 8, 4 channel, uint8 dds SHA-1: F38B31F89991752DAB792DC9FF29F7F7DE0E7911 diff --git a/testsuite/gif/ref/out.txt b/testsuite/gif/ref/out.txt index 94e422a0bb..3fef48ff09 100644 --- a/testsuite/gif/ref/out.txt +++ b/testsuite/gif/ref/out.txt @@ -6,21 +6,21 @@ Reading ../oiio-images/gif/gif_animation.gif channel list: R, G, B, A FramesPerSecond: 100/123 (0.813008) gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:Movie: 1 subimage 1: 30 x 30, 4 channel, uint8 gif SHA-1: D69F1E35C727EEC9E3DF750374E41D42192DFFBE channel list: R, G, B, A FramesPerSecond: 100/123 (0.813008) gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:Movie: 1 subimage 2: 30 x 30, 4 channel, uint8 gif SHA-1: 3897B49CE5378D3C65590497269B1BB3F9D7630F channel list: R, G, B, A FramesPerSecond: 100/123 (0.813008) gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:Movie: 1 Reading ../oiio-images/gif/gif_oiio_logo_with_alpha.gif ../oiio-images/gif/gif_oiio_logo_with_alpha.gif : 135 x 135, 4 channel, uint8 gif @@ -28,37 +28,37 @@ Reading ../oiio-images/gif/gif_oiio_logo_with_alpha.gif channel list: R, G, B, A ImageDescription: "oiio logo with alpha" gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/gif/gif_tahoe.gif ../oiio-images/gif/gif_tahoe.gif : 2048 x 1536, 4 channel, uint8 gif SHA-1: 4E76899178CDAA94690E52CD18E07B810E40A273 channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/gif/gif_tahoe_interlaced.gif ../oiio-images/gif/gif_tahoe_interlaced.gif : 2048 x 1536, 4 channel, uint8 gif SHA-1: 4E76899178CDAA94690E52CD18E07B810E40A273 channel list: R, G, B, A gif:Interlacing: 1 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/gif/gif_bluedot.gif ../oiio-images/gif/gif_bluedot.gif : 1 x 1, 4 channel, uint8 gif SHA-1: EE0202803A0133BDA7BC40AC63091DCC58A4225B channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/gif/gif_diagonal_interlaced.gif ../oiio-images/gif/gif_diagonal_interlaced.gif : 200 x 200, 4 channel, uint8 gif SHA-1: CE1C613BB8B7EE80673B640CA3E392345C8C9FF4 channel list: R, G, B, A gif:Interlacing: 1 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/gif/gif_triangle_interlaced.gif ../oiio-images/gif/gif_triangle_interlaced.gif : 200 x 200, 4 channel, uint8 gif SHA-1: 44F8A0F4F39AB3ED532268B9EB45E09548925345 channel list: R, G, B, A gif:Interlacing: 1 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/gif/gif_test_disposal_method.gif ../oiio-images/gif/gif_test_disposal_method.gif : 50 x 50, 4 channel, uint8 gif 4 subimages: 50x50 [u8,u8,u8,u8], 50x50 [u8,u8,u8,u8], 50x50 [u8,u8,u8,u8], 50x50 [u8,u8,u8,u8] @@ -66,29 +66,29 @@ Reading ../oiio-images/gif/gif_test_disposal_method.gif SHA-1: 30839F361083DA6893F6A29B4F4628DCFBF9F1B5 channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" subimage 1: 50 x 50, 4 channel, uint8 gif SHA-1: 214A1EE026296A399D8A530C44275FC5BDFBA3BA channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" subimage 2: 50 x 50, 4 channel, uint8 gif SHA-1: 298C45330E7FAF68A6922C521EA766CA1594B1A4 channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" subimage 3: 50 x 50, 4 channel, uint8 gif SHA-1: 6D46A3F714B4BD68D289B9A945FF2716F1EB3A64 channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/gif/gif_test_loop_count.gif ../oiio-images/gif/gif_test_loop_count.gif : 20 x 20, 4 channel, uint8 gif SHA-1: C4AA837A5833B05CFCA50BD090D42AEB033069E1 channel list: R, G, B, A gif:Interlacing: 0 gif:LoopCount: 12345 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:LoopCount: 12345 Reading tahoe-tiny.gif tahoe-tiny.gif : 128 x 96, 4 channel, uint8 gif @@ -97,6 +97,6 @@ tahoe-tiny.gif : 128 x 96, 4 channel, uint8 gif FramesPerSecond: 100/100 (1) gif:Interlacing: 0 gif:LoopCount: 0 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:LoopCount: 0 oiio:Movie: 1 diff --git a/testsuite/gpsread/ref/out-alt.txt b/testsuite/gpsread/ref/out-alt.txt index 2fb35b79c5..c627986120 100644 --- a/testsuite/gpsread/ref/out-alt.txt +++ b/testsuite/gpsread/ref/out-alt.txt @@ -29,7 +29,7 @@ Reading ../oiio-images/tahoe-gps.jpg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading tahoe-gps.jpg tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 @@ -58,4 +58,4 @@ tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/gpsread/ref/out-jpeg9d.txt b/testsuite/gpsread/ref/out-jpeg9d.txt index 13c9139069..72d6be65f2 100644 --- a/testsuite/gpsread/ref/out-jpeg9d.txt +++ b/testsuite/gpsread/ref/out-jpeg9d.txt @@ -29,7 +29,7 @@ Reading ../oiio-images/tahoe-gps.jpg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading tahoe-gps.jpg tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: A74C7DF2B01825DCB6881407AE77C11DC56AB741 @@ -58,4 +58,4 @@ tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/gpsread/ref/out.txt b/testsuite/gpsread/ref/out.txt index 1da5572089..3e36ee7c64 100644 --- a/testsuite/gpsread/ref/out.txt +++ b/testsuite/gpsread/ref/out.txt @@ -29,7 +29,7 @@ Reading ../oiio-images/tahoe-gps.jpg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading tahoe-gps.jpg tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 @@ -58,4 +58,4 @@ tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/hdr/ref/out.txt b/testsuite/hdr/ref/out.txt index 23aa29bf05..a6259f4031 100644 --- a/testsuite/hdr/ref/out.txt +++ b/testsuite/hdr/ref/out.txt @@ -2,7 +2,7 @@ Reading MtTamWest.hdr MtTamWest.hdr : 1214 x 732, 3 channel, float hdr channel list: R, G, B Orientation: 1 (normal) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" Stats Min: 0.000183 0.000240 0.000000 (float) Stats Max: 3.875000 3.875000 4.875000 (float) Stats Avg: 0.220837 0.352995 0.493945 (float) diff --git a/testsuite/heif/ref/out-libheif1.12-orient.txt b/testsuite/heif/ref/out-libheif1.12-orient.txt index 2f6ce9f4ca..a3102659c6 100644 --- a/testsuite/heif/ref/out-libheif1.12-orient.txt +++ b/testsuite/heif/ref/out-libheif1.12-orient.txt @@ -38,7 +38,7 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E @@ -95,7 +95,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:OriginalOrientation: 8 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -144,4 +144,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/heif/ref/out-libheif1.4.txt b/testsuite/heif/ref/out-libheif1.4.txt index 11a6e3c543..ba85f95394 100644 --- a/testsuite/heif/ref/out-libheif1.4.txt +++ b/testsuite/heif/ref/out-libheif1.4.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E @@ -100,7 +100,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -149,4 +149,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/heif/ref/out-libheif1.5.txt b/testsuite/heif/ref/out-libheif1.5.txt index 88a06c0b02..8fb8e93fdf 100644 --- a/testsuite/heif/ref/out-libheif1.5.txt +++ b/testsuite/heif/ref/out-libheif1.5.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E @@ -100,7 +100,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -149,4 +149,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/heif/ref/out-libheif1.9-alt2.txt b/testsuite/heif/ref/out-libheif1.9-alt2.txt index 091c0f378e..e24120d453 100644 --- a/testsuite/heif/ref/out-libheif1.9-alt2.txt +++ b/testsuite/heif/ref/out-libheif1.9-alt2.txt @@ -38,7 +38,7 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8064B23A1A995B0D6525AFB5248EEC6C730BBB6C @@ -95,7 +95,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -144,4 +144,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt b/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt index 5b3298e565..2433705c6b 100644 --- a/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt +++ b/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8064B23A1A995B0D6525AFB5248EEC6C730BBB6C @@ -100,7 +100,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -149,4 +149,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/heif/ref/out-libheif1.9-with-av1.txt b/testsuite/heif/ref/out-libheif1.9-with-av1.txt index 6d7074e131..40d4b662df 100644 --- a/testsuite/heif/ref/out-libheif1.9-with-av1.txt +++ b/testsuite/heif/ref/out-libheif1.9-with-av1.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E @@ -100,7 +100,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -149,4 +149,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/heif/ref/out-libheif1.9.txt b/testsuite/heif/ref/out-libheif1.9.txt index efe5c1ff56..2ddc23c253 100644 --- a/testsuite/heif/ref/out-libheif1.9.txt +++ b/testsuite/heif/ref/out-libheif1.9.txt @@ -38,7 +38,7 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E @@ -95,7 +95,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -144,4 +144,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/ico/ref/out.txt b/testsuite/ico/ref/out.txt index b78639c7ee..0d15e10147 100644 --- a/testsuite/ico/ref/out.txt +++ b/testsuite/ico/ref/out.txt @@ -29,7 +29,7 @@ Reading ../oiio-images/ico/oiio.ico SHA-1: F44C9B94AB7D612F62A4DC29FD9C56FD173F2614 channel list: R, G, B, A oiio:BitsPerSample: 2 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:UnassociatedAlpha: 1 subimage 7: 48 x 48, 4 channel, uint8 ico SHA-1: 127700A3DACBF25FCD800642D78F8EE91EDE24B9 diff --git a/testsuite/jpeg-corrupt/ref/out-alt.txt b/testsuite/jpeg-corrupt/ref/out-alt.txt index 8a35becc09..4a99ac71ec 100644 --- a/testsuite/jpeg-corrupt/ref/out-alt.txt +++ b/testsuite/jpeg-corrupt/ref/out-alt.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: 6CBB7DB602A67DB300AB28842F20F6DCA02B82B1 @@ -17,6 +17,6 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" corrupt-icc-4551.jpg DCT coefficient (lossy) or spatial difference (lossless) out of range diff --git a/testsuite/jpeg-corrupt/ref/out-alt2.txt b/testsuite/jpeg-corrupt/ref/out-alt2.txt index bee745a168..bd34d53c33 100644 --- a/testsuite/jpeg-corrupt/ref/out-alt2.txt +++ b/testsuite/jpeg-corrupt/ref/out-alt2.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: FB711E5A0E4440C6B7C7A94835C44706569FFB78 @@ -17,7 +17,7 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" corrupt-icc-4551.jpg DCT coefficient (lossy) or spatial difference (lossless) out of range Reading src/corrupt-icc-4552.jpg @@ -43,4 +43,4 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Unknown" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/jpeg-corrupt/ref/out-alt3.txt b/testsuite/jpeg-corrupt/ref/out-alt3.txt index 9e46327702..1211dd48d6 100644 --- a/testsuite/jpeg-corrupt/ref/out-alt3.txt +++ b/testsuite/jpeg-corrupt/ref/out-alt3.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: 6CBB7DB602A67DB300AB28842F20F6DCA02B82B1 @@ -17,7 +17,7 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" corrupt-icc-4551.jpg Reading src/corrupt-icc-4552.jpg src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg @@ -42,4 +42,4 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Unknown" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/jpeg-corrupt/ref/out-alt4.txt b/testsuite/jpeg-corrupt/ref/out-alt4.txt index cea03aac20..7920812ec5 100644 --- a/testsuite/jpeg-corrupt/ref/out-alt4.txt +++ b/testsuite/jpeg-corrupt/ref/out-alt4.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: FB711E5A0E4440C6B7C7A94835C44706569FFB78 @@ -17,7 +17,7 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" corrupt-icc-4551.jpg DCT coefficient out of range Reading src/corrupt-icc-4552.jpg @@ -43,4 +43,4 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Unknown" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/jpeg-corrupt/ref/out.txt b/testsuite/jpeg-corrupt/ref/out.txt index 3e8ec08ade..13ae421558 100644 --- a/testsuite/jpeg-corrupt/ref/out.txt +++ b/testsuite/jpeg-corrupt/ref/out.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: 6CBB7DB602A67DB300AB28842F20F6DCA02B82B1 @@ -17,7 +17,7 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" corrupt-icc-4551.jpg DCT coefficient (lossy) or spatial difference (lossless) out of range Reading src/corrupt-icc-4552.jpg @@ -43,4 +43,4 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Unknown" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/jpeg-metadata/ref/out.txt b/testsuite/jpeg-metadata/ref/out.txt index fe4a7b489a..86cee1f4ec 100644 --- a/testsuite/jpeg-metadata/ref/out.txt +++ b/testsuite/jpeg-metadata/ref/out.txt @@ -10,7 +10,7 @@ src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg Blender:Scene: "Scene" Blender:Time: "00:00:00:01" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "src/blender-render.jpg" and "no-attribs.jpg" PASS Reading no-attribs.jpg @@ -21,7 +21,7 @@ no-attribs.jpg : 640 x 480, 3 channel, uint8 jpeg Exif:ExifVersion: "0230" Exif:FlashPixVersion: "0100" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading src/blender-render.jpg src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg SHA-1: A60D05FC42FDEE2FC8907531E3641C17D7C1E3AB @@ -34,7 +34,7 @@ src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg Blender:Scene: "Scene" Blender:Time: "00:00:00:01" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "src/blender-render.jpg" and "with-attribs.jpg" PASS Reading with-attribs.jpg @@ -52,7 +52,7 @@ with-attribs.jpg : 640 x 480, 3 channel, uint8 jpeg Exif:ExifVersion: "0230" Exif:FlashPixVersion: "0100" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading src/blender-render.jpg src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg SHA-1: A60D05FC42FDEE2FC8907531E3641C17D7C1E3AB @@ -65,7 +65,7 @@ src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg Blender:Scene: "Scene" Blender:Time: "00:00:00:01" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "src/blender-render.jpg" and "with-attribs-and-desc.jpg" PASS Reading with-attribs-and-desc.jpg @@ -84,7 +84,7 @@ with-attribs-and-desc.jpg : 640 x 480, 3 channel, uint8 jpeg Exif:ExifVersion: "0230" Exif:FlashPixVersion: "0100" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading src/blender-render.jpg src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg SHA-1: A60D05FC42FDEE2FC8907531E3641C17D7C1E3AB @@ -97,7 +97,7 @@ src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg Blender:Scene: "Scene" Blender:Time: "00:00:00:01" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "src/blender-render.jpg" and "with-colon-desc.jpg" PASS Reading with-colon-desc.jpg @@ -109,4 +109,4 @@ with-colon-desc.jpg : 640 x 480, 3 channel, uint8 jpeg Exif:ExifVersion: "0230" Exif:FlashPixVersion: "0100" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/jpeg2000-j2kp4files/ref/out-alt.txt b/testsuite/jpeg2000-j2kp4files/ref/out-alt.txt index 01d4b71ff5..f9db17bce9 100644 --- a/testsuite/jpeg2000-j2kp4files/ref/out-alt.txt +++ b/testsuite/jpeg2000-j2kp4files/ref/out-alt.txt @@ -3,7 +3,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file1.jp2 SHA-1: 746B1B44D0E5EE3999B1350B2A4245D679A617F7 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file1.jp2" and "file1.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 @@ -11,7 +11,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 SHA-1: FB4746F0C4909CE8FED60C0179B70B2EEA0C0BA9 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file2.jp2" and "file2.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 @@ -19,7 +19,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 SHA-1: B8A8FBF015263C072B051839F6BE645E7F27C671 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file3.jp2" and "file3.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 @@ -27,7 +27,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 SHA-1: A45171430806BA3E74705675C855A781FC04BE44 channel list: Y oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file4.jp2" and "file4.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 @@ -52,7 +52,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file5.jp2" and "file5.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 @@ -60,7 +60,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 SHA-1: 3A29DFAD0AA3F910AA2D37007989A4CC6E7BDE2A channel list: Y oiio:BitsPerSample: 12 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file6.jp2" and "file6.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 @@ -87,7 +87,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 16 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file7.jp2" and "file7.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 @@ -112,7 +112,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file8.jp2" and "file8.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 @@ -120,6 +120,6 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 SHA-1: 501807547A6F9B8FA61EF7A4FD9AB7B369E7800C channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file9.jp2" and "file9.jp2" PASS diff --git a/testsuite/jpeg2000-j2kp4files/ref/out-spinux.txt b/testsuite/jpeg2000-j2kp4files/ref/out-spinux.txt index bfeefe4bf8..7456d8abb3 100644 --- a/testsuite/jpeg2000-j2kp4files/ref/out-spinux.txt +++ b/testsuite/jpeg2000-j2kp4files/ref/out-spinux.txt @@ -3,7 +3,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file1.jp2 SHA-1: 746B1B44D0E5EE3999B1350B2A4245D679A617F7 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file1.jp2" and "file1.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 @@ -11,7 +11,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 SHA-1: FB4746F0C4909CE8FED60C0179B70B2EEA0C0BA9 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file2.jp2" and "file2.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 @@ -19,7 +19,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 SHA-1: B8A8FBF015263C072B051839F6BE645E7F27C671 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file3.jp2" and "file3.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 @@ -27,7 +27,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 SHA-1: A45171430806BA3E74705675C855A781FC04BE44 channel list: Y oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file4.jp2" and "file4.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 @@ -52,7 +52,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file5.jp2" and "file5.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 @@ -60,7 +60,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 SHA-1: 3A29DFAD0AA3F910AA2D37007989A4CC6E7BDE2A channel list: Y oiio:BitsPerSample: 12 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file6.jp2" and "file6.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 @@ -87,7 +87,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 16 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file7.jp2" and "file7.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 @@ -112,7 +112,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file8.jp2" and "file8.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 @@ -120,6 +120,6 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 SHA-1: 9784D248E95A47CDB3D0B260C7FBFFE2A4A2D492 channel list: Y oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file9.jp2" and "file9.jp2" PASS diff --git a/testsuite/jpeg2000-j2kp4files/ref/out.txt b/testsuite/jpeg2000-j2kp4files/ref/out.txt index 9e3d4bfeb5..4dff77ce4a 100644 --- a/testsuite/jpeg2000-j2kp4files/ref/out.txt +++ b/testsuite/jpeg2000-j2kp4files/ref/out.txt @@ -3,7 +3,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file1.jp2 SHA-1: 746B1B44D0E5EE3999B1350B2A4245D679A617F7 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file1.jp2" and "file1.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 @@ -11,7 +11,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 SHA-1: 668A651D2B8C3B99CCCC560F993F5BBD33F2B3E7 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file2.jp2" and "file2.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 @@ -19,7 +19,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 SHA-1: B8A8FBF015263C072B051839F6BE645E7F27C671 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file3.jp2" and "file3.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 @@ -27,7 +27,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 SHA-1: A45171430806BA3E74705675C855A781FC04BE44 channel list: Y oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file4.jp2" and "file4.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 @@ -52,7 +52,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file5.jp2" and "file5.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 @@ -60,7 +60,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 SHA-1: 3A29DFAD0AA3F910AA2D37007989A4CC6E7BDE2A channel list: Y oiio:BitsPerSample: 12 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file6.jp2" and "file6.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 @@ -87,7 +87,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 16 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file7.jp2" and "file7.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 @@ -112,7 +112,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file8.jp2" and "file8.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 @@ -120,6 +120,6 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 SHA-1: 501807547A6F9B8FA61EF7A4FD9AB7B369E7800C channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../j2kp4files_v1_5/testfiles_jp2/file9.jp2" and "file9.jp2" PASS diff --git a/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt b/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt index 53fdd4bf66..44c9f84775 100644 --- a/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt +++ b/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt @@ -15,7 +15,7 @@ nomakegps.jpg : 2048 x 1536, 3 channel, uint8 jpeg Exif:WhiteBalance: 0 (auto) Exif:YCbCrPositioning: 1 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading nomake.jpg nomake.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: A74C7DF2B01825DCB6881407AE77C11DC56AB741 @@ -43,7 +43,7 @@ nomake.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading nogps.jpg nogps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: A74C7DF2B01825DCB6881407AE77C11DC56AB741 @@ -62,13 +62,13 @@ nogps.jpg : 2048 x 1536, 3 channel, uint8 jpeg Exif:WhiteBalance: 0 (auto) Exif:YCbCrPositioning: 1 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading noattribs.jpg noattribs.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: A74C7DF2B01825DCB6881407AE77C11DC56AB741 channel list: R, G, B jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" initial keywords= after adding, keywords=foo; bar after clearing, keywords= @@ -156,4 +156,4 @@ tahoe-icc.jpg : 128 x 96, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/oiiotool-attribs/ref/out.txt b/testsuite/oiiotool-attribs/ref/out.txt index 529742aad2..482ae7a842 100644 --- a/testsuite/oiiotool-attribs/ref/out.txt +++ b/testsuite/oiiotool-attribs/ref/out.txt @@ -15,7 +15,7 @@ nomakegps.jpg : 2048 x 1536, 3 channel, uint8 jpeg Exif:WhiteBalance: 0 (auto) Exif:YCbCrPositioning: 1 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading nomake.jpg nomake.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 @@ -43,7 +43,7 @@ nomake.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading nogps.jpg nogps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 @@ -62,13 +62,13 @@ nogps.jpg : 2048 x 1536, 3 channel, uint8 jpeg Exif:WhiteBalance: 0 (auto) Exif:YCbCrPositioning: 1 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading noattribs.jpg noattribs.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 channel list: R, G, B jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" initial keywords= after adding, keywords=foo; bar after clearing, keywords= @@ -156,4 +156,4 @@ tahoe-icc.jpg : 128 x 96, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/png/ref/out-libpng15.txt b/testsuite/png/ref/out-libpng15.txt index fa0337a2a5..c0b9d66580 100644 --- a/testsuite/png/ref/out-libpng15.txt +++ b/testsuite/png/ref/out-libpng15.txt @@ -7,7 +7,7 @@ Reading ../oiio-images/png/oiio-logo-no-alpha.png ResolutionUnit: "inch" XResolution: 72 YResolution: 72 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/png/oiio-logo-no-alpha.png" and "oiio-logo-no-alpha.png" PASS Reading ../oiio-images/png/oiio-logo-with-alpha.png @@ -19,14 +19,14 @@ Reading ../oiio-images/png/oiio-logo-with-alpha.png ResolutionUnit: "inch" XResolution: 72 YResolution: 72 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/png/oiio-logo-with-alpha.png" and "oiio-logo-with-alpha.png" PASS Reading exif.png exif.png : 64 x 64, 3 channel, uint8 png SHA-1: 7CB41FEA50720B48BE0C145E1473982B23E9AB77 channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" alphagamma: 1 x 1, 4 channel, float png channel list: R, G, B, A @@ -74,7 +74,7 @@ gimp_gradient: ICCProfile:profile_size: 672 ICCProfile:profile_version: "4.4.0" ICCProfile:rendering_intent: "Perceptual" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Stats Min: 0 0 0 0 (of 255) Stats Max: 255 255 0 255 (of 255) Stats Avg: 142.37 105.72 0.00 154.72 (of 255) diff --git a/testsuite/png/ref/out.txt b/testsuite/png/ref/out.txt index 7345811808..fccb90cc61 100644 --- a/testsuite/png/ref/out.txt +++ b/testsuite/png/ref/out.txt @@ -7,7 +7,7 @@ Reading ../oiio-images/png/oiio-logo-no-alpha.png ResolutionUnit: "inch" XResolution: 72 YResolution: 72 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/png/oiio-logo-no-alpha.png" and "oiio-logo-no-alpha.png" PASS Reading ../oiio-images/png/oiio-logo-with-alpha.png @@ -19,7 +19,7 @@ Reading ../oiio-images/png/oiio-logo-with-alpha.png ResolutionUnit: "inch" XResolution: 72 YResolution: 72 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Comparing "../oiio-images/png/oiio-logo-with-alpha.png" and "oiio-logo-with-alpha.png" PASS Reading exif.png @@ -30,7 +30,7 @@ exif.png : 64 x 64, 3 channel, uint8 png Exif:FlashPixVersion: "0100" Exif:FocalLength: 45.7 (45.7 mm) Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" alphagamma: 1 x 1, 4 channel, float png channel list: R, G, B, A @@ -78,7 +78,7 @@ gimp_gradient: ICCProfile:profile_size: 672 ICCProfile:profile_version: "4.4.0" ICCProfile:rendering_intent: "Perceptual" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Stats Min: 0 0 0 0 (of 255) Stats Max: 255 255 0 255 (of 255) Stats Avg: 142.37 105.72 0.00 154.72 (of 255) diff --git a/testsuite/psd/ref/out-linuxarm.txt b/testsuite/psd/ref/out-linuxarm.txt index 9f8240224e..0928d038b1 100644 --- a/testsuite/psd/ref/out-linuxarm.txt +++ b/testsuite/psd/ref/out-linuxarm.txt @@ -42,7 +42,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" photoshop:LayerName: 1, 2, 3 @@ -91,7 +91,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -141,7 +141,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -191,7 +191,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "3" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -246,7 +246,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" photoshop:LayerName: 1, 2, 3 @@ -296,7 +296,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -347,7 +347,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -398,7 +398,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "3" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -555,7 +555,7 @@ Reading ../oiio-images/psd/psd_indexed_trans.psd IPTC:MetadataDate: "2011-08-29T11:54:09-04:00" IPTC:ModifyDate: "2011-08-29T11:54:09-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 2 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -645,7 +645,7 @@ Reading ../oiio-images/psd/psd_rgb_8.psd IPTC:MetadataDate: "2011-08-25T17:40-04:00" IPTC:ModifyDate: "2011-08-25T17:40-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -735,7 +735,7 @@ Reading ../oiio-images/psd/psd_rgb_16.psd IPTC:MetadataDate: "2011-08-25T17:39:49-04:00" IPTC:ModifyDate: "2011-08-25T17:39:49-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -878,7 +878,7 @@ Reading ../oiio-images/psd/psd_rgba_8.psd IPTC:MetadataDate: "2011-08-25T17:39:28-04:00" IPTC:ModifyDate: "2011-08-25T17:39:28-04:00" IPTC:OriginalDocumentID: "xmp.did:037A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -925,7 +925,7 @@ Reading ../oiio-images/psd/psd_rgba_8.psd IPTC:MetadataDate: "2011-08-25T17:39:28-04:00" IPTC:ModifyDate: "2011-08-25T17:39:28-04:00" IPTC:OriginalDocumentID: "xmp.did:037A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer 1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1025,7 +1025,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1075,7 +1075,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "1" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1126,7 +1126,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "2" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1177,7 +1177,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "3" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1230,7 +1230,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1277,7 +1277,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer 0" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1326,7 +1326,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "line1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1375,7 +1375,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "line2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1522,7 +1522,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1573,7 +1573,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Blue_Lagoon" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1625,7 +1625,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1677,7 +1677,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1735,7 +1735,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1786,7 +1786,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Blue_Lagoon" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1838,7 +1838,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1890,7 +1890,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" diff --git a/testsuite/psd/ref/out.txt b/testsuite/psd/ref/out.txt index e9c7ab37d3..b5cc8594d7 100644 --- a/testsuite/psd/ref/out.txt +++ b/testsuite/psd/ref/out.txt @@ -42,7 +42,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" photoshop:LayerName: 1, 2, 3 @@ -91,7 +91,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -141,7 +141,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -191,7 +191,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "3" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -246,7 +246,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" photoshop:LayerName: 1, 2, 3 @@ -296,7 +296,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -347,7 +347,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -398,7 +398,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "3" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -555,7 +555,7 @@ Reading ../oiio-images/psd/psd_indexed_trans.psd IPTC:MetadataDate: "2011-08-29T11:54:09-04:00" IPTC:ModifyDate: "2011-08-29T11:54:09-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 2 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -645,7 +645,7 @@ Reading ../oiio-images/psd/psd_rgb_8.psd IPTC:MetadataDate: "2011-08-25T17:40-04:00" IPTC:ModifyDate: "2011-08-25T17:40-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -735,7 +735,7 @@ Reading ../oiio-images/psd/psd_rgb_16.psd IPTC:MetadataDate: "2011-08-25T17:39:49-04:00" IPTC:ModifyDate: "2011-08-25T17:39:49-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -878,7 +878,7 @@ Reading ../oiio-images/psd/psd_rgba_8.psd IPTC:MetadataDate: "2011-08-25T17:39:28-04:00" IPTC:ModifyDate: "2011-08-25T17:39:28-04:00" IPTC:OriginalDocumentID: "xmp.did:037A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -925,7 +925,7 @@ Reading ../oiio-images/psd/psd_rgba_8.psd IPTC:MetadataDate: "2011-08-25T17:39:28-04:00" IPTC:ModifyDate: "2011-08-25T17:39:28-04:00" IPTC:OriginalDocumentID: "xmp.did:037A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer 1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1025,7 +1025,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1075,7 +1075,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "1" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1126,7 +1126,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "2" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1177,7 +1177,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "3" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1230,7 +1230,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1277,7 +1277,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer 0" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1326,7 +1326,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "line1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1375,7 +1375,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "line2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1522,7 +1522,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1573,7 +1573,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Blue_Lagoon" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1625,7 +1625,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1677,7 +1677,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1735,7 +1735,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1786,7 +1786,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Blue_Lagoon" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1838,7 +1838,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1890,7 +1890,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" oiio:subimagename: "Layer2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" diff --git a/testsuite/python-imageinput/ref/out-alt.txt b/testsuite/python-imageinput/ref/out-alt.txt index c5fcbe285b..7183df6b78 100644 --- a/testsuite/python-imageinput/ref/out-alt.txt +++ b/testsuite/python-imageinput/ref/out-alt.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "sRGB" + oiio:ColorSpace = "srgb_rec709_scene" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-alt2.txt b/testsuite/python-imageinput/ref/out-alt2.txt index f42c2fa3d9..a3eed8e9a5 100644 --- a/testsuite/python-imageinput/ref/out-alt2.txt +++ b/testsuite/python-imageinput/ref/out-alt2.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "sRGB" + oiio:ColorSpace = "srgb_rec709_scene" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-py37-jpeg9d.txt b/testsuite/python-imageinput/ref/out-py37-jpeg9d.txt index 46dade8692..246c484257 100644 --- a/testsuite/python-imageinput/ref/out-py37-jpeg9d.txt +++ b/testsuite/python-imageinput/ref/out-py37-jpeg9d.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "sRGB" + oiio:ColorSpace = "srgb_rec709_scene" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-python3-win-2.txt b/testsuite/python-imageinput/ref/out-python3-win-2.txt index 3559ddf17d..3420ab62a8 100644 --- a/testsuite/python-imageinput/ref/out-python3-win-2.txt +++ b/testsuite/python-imageinput/ref/out-python3-win-2.txt @@ -8,7 +8,7 @@ Opened "C:/a/OpenImageIO/OpenImageIO/build/testsuite/oiio-images/tahoe-gps.jpg" alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "sRGB" + oiio:ColorSpace = "srgb_rec709_scene" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-python3-win.txt b/testsuite/python-imageinput/ref/out-python3-win.txt index b7468f587b..0f08533526 100644 --- a/testsuite/python-imageinput/ref/out-python3-win.txt +++ b/testsuite/python-imageinput/ref/out-python3-win.txt @@ -8,7 +8,7 @@ Opened "D:/a/OpenImageIO/OpenImageIO/build/testsuite/oiio-images/tahoe-gps.jpg" alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "sRGB" + oiio:ColorSpace = "srgb_rec709_scene" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-python3.txt b/testsuite/python-imageinput/ref/out-python3.txt index 9275931750..0d15bac4b0 100644 --- a/testsuite/python-imageinput/ref/out-python3.txt +++ b/testsuite/python-imageinput/ref/out-python3.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "sRGB" + oiio:ColorSpace = "srgb_rec709_scene" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out.txt b/testsuite/python-imageinput/ref/out.txt index f42c2fa3d9..a3eed8e9a5 100644 --- a/testsuite/python-imageinput/ref/out.txt +++ b/testsuite/python-imageinput/ref/out.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "sRGB" + oiio:ColorSpace = "srgb_rec709_scene" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/raw/ref/out-libraw-0.20.2-gh.txt b/testsuite/raw/ref/out-libraw-0.20.2-gh.txt index 15d9f2f2af..bec9f0c940 100644 --- a/testsuite/raw/ref/out-libraw-0.20.2-gh.txt +++ b/testsuite/raw/ref/out-libraw-0.20.2-gh.txt @@ -76,7 +76,7 @@ Exif:SubsecTimeDigitized: "00" Exif:SubsecTimeOriginal: "00" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 2076, 1024, 1584, 1024 raw:cam_xyz: 0.6844, -0.0996, -0.0856, -0.3876, 1.1761, 0.2396, -0.0593, 0.1772, 0.6198, 0, 0, 0 @@ -167,7 +167,7 @@ Nikon:PhaseDetectAF: 0 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -241,7 +241,7 @@ Fujifilm:Rating: 0 Fujifilm:ShutterType: 0 Fujifilm:WB_Preset: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 131.532, 80, 97.3451, 80 raw:cam_xyz: 1.0004, -0.3219, -0.1201, -0.7036, 1.5047, 0.2107, -0.1863, 0.2565, 0.7736, 0, 0, 0 @@ -332,7 +332,7 @@ Nikon:PhaseDetectAF: 0 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -379,7 +379,7 @@ Exif:Sharpness: 1 (soft) Exif:ShutterSpeedValue: 8.32193 (1/319 s) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Olympus:AFFineTune: 0 Olympus:AFPoint: 0 @@ -449,7 +449,7 @@ Exif:ShutterSpeedValue: 7.96578 (1/249 s) Exif:SubjectDistanceRange: 3 (distant) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Pentax:AFAdjustment: 0 Pentax:AFPoint: -2 @@ -524,7 +524,7 @@ Exif:Sharpness: 0 (normal) Exif:ShutterSpeedValue: 5.90689 (1/59 s) Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 1972, 1024, 1632, 1024 raw:cam_xyz: 0.9847, -0.3091, -0.0928, -0.8485, 1.6345, 0.2225, -0.0715, 0.0595, 0.7103, 0, 0, 0 diff --git a/testsuite/raw/ref/out-libraw0.20.0-gh.txt b/testsuite/raw/ref/out-libraw0.20.0-gh.txt index 7b80e3a174..c6b813c1b7 100644 --- a/testsuite/raw/ref/out-libraw0.20.0-gh.txt +++ b/testsuite/raw/ref/out-libraw0.20.0-gh.txt @@ -77,7 +77,7 @@ Exif:SubsecTimeDigitized: "00" Exif:SubsecTimeOriginal: "00" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 2076, 1024, 1584, 1024 raw:cam_xyz: 0.6844, -0.0996, -0.0856, -0.3876, 1.1761, 0.2396, -0.0593, 0.1772, 0.6198, 0, 0, 0 @@ -167,7 +167,7 @@ Nikon:PhaseDetectAF: 0 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -240,7 +240,7 @@ Fujifilm:Rating: 0 Fujifilm:ShutterType: 0 Fujifilm:WB_Preset: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 131.532, 80, 97.3451, 80 raw:cam_xyz: 1.0004, -0.3219, -0.1201, -0.7036, 1.5047, 0.2107, -0.1863, 0.2565, 0.7736, 0, 0, 0 @@ -330,7 +330,7 @@ Nikon:PhaseDetectAF: 0 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -376,7 +376,7 @@ Exif:Sharpness: 1 (soft) Exif:ShutterSpeedValue: 8.32193 (1/319 s) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Olympus:AFFineTune: 0 Olympus:AFPoint: 0 @@ -445,7 +445,7 @@ Exif:ShutterSpeedValue: 7.96578 (1/249 s) Exif:SubjectDistanceRange: 3 (distant) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Pentax:AFAdjustment: 0 Pentax:AFPoint: -2 @@ -519,7 +519,7 @@ Exif:Sharpness: 0 (normal) Exif:ShutterSpeedValue: 5.90689 (1/59 s) Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 1972, 1024, 1632, 1024 raw:cam_xyz: 0.9847, -0.3091, -0.0928, -0.8485, 1.6345, 0.2225, -0.0715, 0.0595, 0.7103, 0, 0, 0 diff --git a/testsuite/raw/ref/out-libraw0.20.0.txt b/testsuite/raw/ref/out-libraw0.20.0.txt index 0ef132cb8d..8bceb81d29 100644 --- a/testsuite/raw/ref/out-libraw0.20.0.txt +++ b/testsuite/raw/ref/out-libraw0.20.0.txt @@ -76,7 +76,7 @@ Exif:SubsecTimeDigitized: "00" Exif:SubsecTimeOriginal: "00" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 2076, 1024, 1584, 1024 raw:cam_xyz: 0.6844, -0.0996, -0.0856, -0.3876, 1.1761, 0.2396, -0.0593, 0.1772, 0.6198, 0, 0, 0 @@ -166,7 +166,7 @@ Nikon:PhaseDetectAF: 0 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -239,7 +239,7 @@ Fujifilm:Rating: 0 Fujifilm:ShutterType: 0 Fujifilm:WB_Preset: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 131.532, 80, 97.3451, 80 raw:cam_xyz: 1.0004, -0.3219, -0.1201, -0.7036, 1.5047, 0.2107, -0.1863, 0.2565, 0.7736, 0, 0, 0 @@ -329,7 +329,7 @@ Nikon:PhaseDetectAF: 0 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -375,7 +375,7 @@ Exif:Sharpness: 1 (soft) Exif:ShutterSpeedValue: 8.32193 (1/319 s) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Olympus:AFFineTune: 0 Olympus:AFPoint: 0 @@ -434,7 +434,7 @@ Exif:MaxApertureValue: 925/256 (3.61328) Exif:MeteringMode: 5 (pattern) Exif:ShutterSpeedValue: 8.64386 (1/399 s) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" Panasonic:AFPoint: -1 Panasonic:BlackLevel: 0, 0, 0, 0, 0, 0, 0, 0 Panasonic:CameraFormat: 8 @@ -484,7 +484,7 @@ Exif:ShutterSpeedValue: 7.96578 (1/249 s) Exif:SubjectDistanceRange: 3 (distant) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Pentax:AFAdjustment: 0 Pentax:AFPoint: -2 diff --git a/testsuite/raw/ref/out-libraw0.21.0-gh.txt b/testsuite/raw/ref/out-libraw0.21.0-gh.txt index c0ec71295b..e0afdb021a 100644 --- a/testsuite/raw/ref/out-libraw0.21.0-gh.txt +++ b/testsuite/raw/ref/out-libraw0.21.0-gh.txt @@ -73,7 +73,7 @@ Exif:SubsecTimeDigitized: "00" Exif:SubsecTimeOriginal: "00" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 2076, 1024, 1584, 1024 raw:cam_xyz: 0.6844, -0.0996, -0.0856, -0.3876, 1.1761, 0.2396, -0.0593, 0.1772, 0.6198, 0, 0, 0 @@ -161,7 +161,7 @@ Nikon:NEFCompression: 3 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -233,7 +233,7 @@ Fujifilm:Rating: 0 Fujifilm:ShutterType: 0 Fujifilm:WB_Preset: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 131, 80, 97, 80 raw:cam_xyz: 1.0004, -0.3219, -0.1201, -0.7036, 1.5047, 0.2107, -0.1863, 0.2565, 0.7736, 0, 0, 0 @@ -321,7 +321,7 @@ Nikon:NEFCompression: 3 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -368,7 +368,7 @@ Exif:Sharpness: 1 (soft) Exif:ShutterSpeedValue: 8.32193 (1/319 s) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Olympus:AFFineTune: 255 Olympus:AFFineTuneAdj: -32768, -32768, -32768 @@ -439,7 +439,7 @@ Exif:ShutterSpeedValue: 7.96578 (1/249 s) Exif:SubjectDistanceRange: 3 (distant) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Pentax:AFAdjustment: 0 Pentax:AFPoint: -2 @@ -514,7 +514,7 @@ Exif:Sharpness: 0 (normal) Exif:ShutterSpeedValue: 5.90689 (1/59 s) Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 1972, 1024, 1632, 1024 raw:cam_xyz: 0.9847, -0.3091, -0.0928, -0.8485, 1.6345, 0.2225, -0.0715, 0.0595, 0.7103, 0, 0, 0 diff --git a/testsuite/raw/ref/out-libraw0.21.0-mac.txt b/testsuite/raw/ref/out-libraw0.21.0-mac.txt index 0bd527d728..76ba8ad88b 100644 --- a/testsuite/raw/ref/out-libraw0.21.0-mac.txt +++ b/testsuite/raw/ref/out-libraw0.21.0-mac.txt @@ -73,7 +73,7 @@ Exif:SubsecTimeDigitized: "00" Exif:SubsecTimeOriginal: "00" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 2076, 1024, 1584, 1024 raw:cam_xyz: 0.6844, -0.0996, -0.0856, -0.3876, 1.1761, 0.2396, -0.0593, 0.1772, 0.6198, 0, 0, 0 @@ -161,7 +161,7 @@ Nikon:NEFCompression: 3 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -233,7 +233,7 @@ Fujifilm:Rating: 0 Fujifilm:ShutterType: 0 Fujifilm:WB_Preset: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 131, 80, 97, 80 raw:cam_xyz: 1.0004, -0.3219, -0.1201, -0.7036, 1.5047, 0.2107, -0.1863, 0.2565, 0.7736, 0, 0, 0 @@ -321,7 +321,7 @@ Nikon:NEFCompression: 3 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -368,7 +368,7 @@ Exif:Sharpness: 1 (soft) Exif:ShutterSpeedValue: 8.32193 (1/319 s) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Olympus:AFFineTune: 255 Olympus:AFFineTuneAdj: -32768, -32768, -32768 @@ -429,7 +429,7 @@ Exif:MaxApertureValue: 925/256 (3.61328) Exif:MeteringMode: 5 (pattern) Exif:ShutterSpeedValue: 8.64386 (1/399 s) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" Panasonic:AFPoint: -1 Panasonic:BlackLevel: 0, 0, 0, 0, 0, 0, 0, 0 Panasonic:CameraFormat: 8 @@ -480,7 +480,7 @@ Exif:ShutterSpeedValue: 7.96578 (1/249 s) Exif:SubjectDistanceRange: 3 (distant) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Pentax:AFAdjustment: 0 Pentax:AFPoint: -2 @@ -555,7 +555,7 @@ Exif:Sharpness: 0 (normal) Exif:ShutterSpeedValue: 5.90689 (1/59 s) Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 1972, 1024, 1632, 1024 raw:cam_xyz: 0.9847, -0.3091, -0.0928, -0.8485, 1.6345, 0.2225, -0.0715, 0.0595, 0.7103, 0, 0, 0 diff --git a/testsuite/raw/ref/out.txt b/testsuite/raw/ref/out.txt index 2ca2e3aa8f..d29bc262d1 100644 --- a/testsuite/raw/ref/out.txt +++ b/testsuite/raw/ref/out.txt @@ -75,7 +75,7 @@ Exif:SubsecTimeDigitized: "00" Exif:SubsecTimeOriginal: "00" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 2076, 1024, 1584, 1024 raw:cam_xyz: 0.6844, -0.0996, -0.0856, -0.3876, 1.1761, 0.2396, -0.0593, 0.1772, 0.6198, 0, 0, 0 @@ -166,7 +166,7 @@ Nikon:PhaseDetectAF: 0 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -238,7 +238,7 @@ Fujifilm:Rating: 0 Fujifilm:ShutterType: 0 Fujifilm:WB_Preset: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 131.532, 80, 97.3451, 80 raw:cam_xyz: 1.0004, -0.3219, -0.1201, -0.7036, 1.5047, 0.2107, -0.1863, 0.2565, 0.7736, 0, 0, 0 @@ -328,7 +328,7 @@ Nikon:PhaseDetectAF: 0 Nikon:ShootingMode: 0 Nikon:VRMode: 0 - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 463, 256, 396, 256 raw:cam_xyz: 0.7171, -0.1986, -0.0648, -0.8085, 1.5555, 0.2718, -0.217, 0.2512, 0.7457, 0, 0, 0 @@ -375,7 +375,7 @@ Exif:Sharpness: 1 (soft) Exif:ShutterSpeedValue: 8.32193 (1/319 s) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Olympus:AFFineTune: 0 Olympus:AFPoint: 0 @@ -434,7 +434,7 @@ Exif:MaxApertureValue: 925/256 (3.61328) Exif:MeteringMode: 5 (pattern) Exif:ShutterSpeedValue: 8.64386 (1/399 s) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" Panasonic:AFPoint: -1 Panasonic:BlackLevel: 0, 0, 0, 0, 0, 0, 0, 0 Panasonic:CanonFocalUnits: 1 @@ -480,7 +480,7 @@ Exif:ShutterSpeedValue: 7.96578 (1/249 s) Exif:SubjectDistanceRange: 3 (distant) Exif:WhiteBalance: 1 (manual) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 Pentax:AFAdjustment: 0 Pentax:AFPoint: -1 @@ -555,7 +555,7 @@ Exif:Sharpness: 0 (normal) Exif:ShutterSpeedValue: 5.90689 (1/59 s) Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "lin_rec709" + oiio:ColorSpace: "lin_rec709_scene" oiio:MakerNoteOffset: 0 raw:cam_mul: 1972, 1024, 1632, 1024 raw:cam_xyz: 0.9847, -0.3091, -0.0928, -0.8485, 1.6345, 0.2225, -0.0715, 0.0595, 0.7103, 0, 0, 0 diff --git a/testsuite/rla/ref/out.txt b/testsuite/rla/ref/out.txt index ac300fd1fb..562515dc73 100644 --- a/testsuite/rla/ref/out.txt +++ b/testsuite/rla/ref/out.txt @@ -90,7 +90,7 @@ Reading ../oiio-images/rla/imgmake_rgba_nc10.rla compression: "rle" HostComputer: "hawk073.spimageworks.com" oiio:BitsPerSample: 10 - oiio:ColorSpace: "lin_srgb" + oiio:ColorSpace: "lin_rec709_scene" rla:Aspect: " 1.333" rla:BlueChroma: 0.14, 0.14, 0.08 rla:ColorChannel: "rgb" @@ -193,7 +193,7 @@ Reading ../oiio-images/rla/imgmake_rgba_nc16.rla compression: "rle" HostComputer: "hawk073.spimageworks.com" oiio:BitsPerSample: 16 - oiio:ColorSpace: "lin_srgb" + oiio:ColorSpace: "lin_rec709_scene" rla:Aspect: " 1.333" rla:BlueChroma: 0.14, 0.14, 0.08 rla:ColorChannel: "rgb" @@ -296,7 +296,7 @@ Reading ../oiio-images/rla/imgmake_rgba_nc8.rla compression: "rle" HostComputer: "hawk073.spimageworks.com" oiio:BitsPerSample: 8 - oiio:ColorSpace: "lin_srgb" + oiio:ColorSpace: "lin_rec709_scene" rla:Aspect: " 1.333" rla:BlueChroma: 0.14, 0.14, 0.08 rla:ColorChannel: "rgb" diff --git a/testsuite/tiff-suite/ref/out-alt.txt b/testsuite/tiff-suite/ref/out-alt.txt index 7e8c427564..20a7ce2efb 100644 --- a/testsuite/tiff-suite/ref/out-alt.txt +++ b/testsuite/tiff-suite/ref/out-alt.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/tiff-suite/ref/out-alt2.txt b/testsuite/tiff-suite/ref/out-alt2.txt index 56a7a527ef..3a14b41bc5 100644 --- a/testsuite/tiff-suite/ref/out-alt2.txt +++ b/testsuite/tiff-suite/ref/out-alt2.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/tiff-suite/ref/out-jpeg9b.txt b/testsuite/tiff-suite/ref/out-jpeg9b.txt index a82d145af3..354a70c52e 100644 --- a/testsuite/tiff-suite/ref/out-jpeg9b.txt +++ b/testsuite/tiff-suite/ref/out-jpeg9b.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/tiff-suite/ref/out-jpeg9d-alt.txt b/testsuite/tiff-suite/ref/out-jpeg9d-alt.txt index ac69de1657..fb5da67d19 100644 --- a/testsuite/tiff-suite/ref/out-jpeg9d-alt.txt +++ b/testsuite/tiff-suite/ref/out-jpeg9d-alt.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/tiff-suite/ref/out.txt b/testsuite/tiff-suite/ref/out.txt index d3156d758a..30a318664a 100644 --- a/testsuite/tiff-suite/ref/out.txt +++ b/testsuite/tiff-suite/ref/out.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/webp/ref/out-webp1.1.txt b/testsuite/webp/ref/out-webp1.1.txt index b617aed664..f7e0d095de 100644 --- a/testsuite/webp/ref/out-webp1.1.txt +++ b/testsuite/webp/ref/out-webp1.1.txt @@ -2,19 +2,19 @@ Reading ../oiio-images/webp/1.webp ../oiio-images/webp/1.webp : 550 x 368, 3 channel, uint8 webp SHA-1: C8D715F7E492E94E29FFF0E605E0F00F1892FC7A channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/webp/2.webp ../oiio-images/webp/2.webp : 550 x 404, 3 channel, uint8 webp SHA-1: 6679CBF3655C40A6ECE9188DDC136BE18599C138 channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/webp/3.webp ../oiio-images/webp/3.webp : 1280 x 720, 3 channel, uint8 webp SHA-1: AC77455077A5C8E9271B16FCB3A3E520CBA42018 channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/webp/4.webp ../oiio-images/webp/4.webp : 1024 x 772, 3 channel, uint8 webp SHA-1: 8F42E3DCCE6FE15146BA06C440C15B7831F60572 channel list: R, G, B - oiio:ColorSpace: "sRGB" + oiio:ColorSpace: "srgb_rec709_scene" From 482a3941e3dcf19859e8b9620e60d07d4f5c1217 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Wed, 20 Aug 2025 09:21:25 -0700 Subject: [PATCH 32/71] deps: Raise OpenColorIO minimum to 2.3 (#4865) Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 33 ++--- CHANGES.md | 4 +- INSTALL.md | 2 +- src/cmake/externalpackages.cmake | 2 +- src/libOpenImageIO/color_ocio.cpp | 197 ------------------------------ 5 files changed, 23 insertions(+), 215 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b98a635ac..e828f443b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: fail-fast: false matrix: include: - - desc: VP2022 gcc9/C++17 py39 exr3.1 ocio2.1 + - desc: VP2022 gcc9/C++17 py39 exr3.1 ocio2.3 nametag: linux-vfx2022 runner: ubuntu-latest container: aswf/ci-osl:2022-clang11 @@ -57,9 +57,10 @@ jobs: python_ver: 3.9 simd: "avx2,f16c" fmt_ver: 8.1.1 + opencolorio_ver: v2.3.0 pybind11_ver: v2.9.0 setenvs: export FREETYPE_VERSION=VER-2-12-0 - - desc: VP2022 clang13/C++17 py39 avx2 exr3.1 ocio2.1 + - desc: VP2022 clang13/C++17 py39 avx2 exr3.1 ocio2.3 nametag: linux-vfx2022.clang13 runner: ubuntu-latest container: aswf/ci-osl:2022-clang13 @@ -68,12 +69,13 @@ jobs: cc_compiler: clang cxx_compiler: clang++ cxx_std: 17 + opencolorio_ver: v2.3.2 + pybind11_ver: v2.8.1 python_ver: 3.9 simd: "avx2,f16c" fmt_ver: 9.1.0 - pybind11_ver: v2.8.1 setenvs: export FREETYPE_VERSION=VER-2-12-0 - - desc: oldest gcc9.3/C++17 py3.9 exr-3.1 + - desc: oldest gcc9.3/C++17 py3.9 exr3.1 ocio2.3 # Oldest versions of the dependencies that we support. nametag: linux-oldest runner: ubuntu-latest @@ -82,7 +84,7 @@ jobs: old_node: 1 cxx_std: 17 fmt_ver: 7.0.1 - opencolorio_ver: v2.2.1 + opencolorio_ver: v2.3.0 openexr_ver: v3.1.0 pybind11_ver: v2.7.0 python_ver: 3.9 @@ -102,7 +104,7 @@ jobs: old_node: 1 cxx_std: 17 fmt_ver: 7.0.1 - opencolorio_ver: v2.2.1 + opencolorio_ver: v2.3.0 openexr_ver: v3.1.0 pybind11_ver: v2.7.0 python_ver: 3.9 @@ -250,20 +252,21 @@ jobs: fail-fast: false matrix: include: - - desc: VFX2023 gcc11/C++17 py3.10 exr3.1 ocio2.2 + - desc: VFX2023 gcc11/C++17 py3.10 exr3.1 ocio2.3 nametag: linux-vfx2023 runner: ubuntu-latest container: aswf/ci-osl:2023-clang15 + opencolorio_ver: v2.3.0 python_ver: "3.10" simd: "avx2,f16c" fmt_ver: 10.1.1 pybind11_ver: v2.10.0 setenvs: export PUGIXML_VERSION=v1.13 - - desc: VFX2023 icc/C++17 py3.10 exr3.1 ocio2.1 qt5.15 + - desc: VFX2023 icc/C++17 py3.10 exr3.1 ocio2.3 qt5.15 nametag: linux-vfx2023.icc runner: ubuntu-latest container: aswf/ci-osl:2023 - opencolorio_ver: v2.2.1 + opencolorio_ver: v2.3.0 python_ver: "3.10" # simd: "avx2,f16c" fmt_ver: 7.1.3 @@ -275,18 +278,18 @@ jobs: DISABLE_libuhdr=1 # For icc, use fp-model precise to eliminate needless LSB errors # that make test results differ from other platforms. - - desc: VFX2023 icx/C++17 py3.10 exr3.1 ocio2.2 qt5.15 + - desc: VFX2023 icx/C++17 py3.10 exr3.1 ocio2.3 qt5.15 nametag: linux-vfx2023.icx runner: ubuntu-latest container: aswf/ci-osl:2023 cc_compiler: icx cxx_compiler: icpx + opencolorio_ver: v2.3.0 python_ver: "3.10" pybind11_ver: v2.10.0 simd: "avx2,f16c" benchmark: 1 setenvs: export USE_OPENVDB=0 - xOPENCOLORIO_CXX=g++ UHDR_CMAKE_C_COMPILER=gcc UHDR_CMAKE_CXX_COMPILER=g++ # Building libuhdr with icx results in test failures @@ -295,6 +298,7 @@ jobs: nametag: linux-vfx2024 runner: ubuntu-latest container: aswf/ci-oiio:2024.2 + opencolorio_ver: v2.3.2 python_ver: "3.11" simd: "avx2,f16c" fmt_ver: 10.1.1 @@ -307,6 +311,7 @@ jobs: container: aswf/ci-oiio:2024.2 cc_compiler: clang cxx_compiler: clang++ + opencolorio_ver: v2.3.2 python_ver: "3.11" simd: "avx2,f16c" fmt_ver: 10.1.1 @@ -341,7 +346,7 @@ jobs: cc_compiler: clang cxx_compiler: clang++ build_type: Debug - opencolorio_ver: v2.3.2 + opencolorio_ver: v2.4.2 python_ver: "3.11" ctest_test_timeout: "1200" setenvs: export SANITIZE=address,undefined @@ -450,14 +455,14 @@ jobs: PUGIXML_VERSION=v1.14 WEBP_VERSION=v1.4.0 - - desc: clang15 C++17 avx2 exr3.1 ocio2.2 + - desc: clang15 C++17 avx2 exr3.1 ocio2.3 nametag: linux-clang15 runner: ubuntu-22.04 cxx_compiler: clang++-15 cc_compiler: clang-15 cxx_std: 17 fmt_ver: 10.1.1 - opencolorio_ver: v2.2.1 + opencolorio_ver: v2.3.0 openexr_ver: v3.1.13 pybind11_ver: v2.12.0 python_ver: "3.10" diff --git a/CHANGES.md b/CHANGES.md index 53752a7f18..48859d03ec 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,8 +5,8 @@ Release 3.1 (target: Sept 2025?) -- compared to 3.0 - Anticipated supported release: Sep 15, 2025 ### New minimum dependencies and compatibility changes: - -- Anticipated raising of Python minimum to 3.9. +* *Python*: 3.9 minimum (from 3.7) [#4830](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4830) (3.1.4.0) +* *OpenColorIO*: 2.3 minimum (from 2.2) ### ⛰️ New features and public API changes: * *New image file format support:* diff --git a/INSTALL.md b/INSTALL.md index 0f3afdaec4..39d555d379 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -23,7 +23,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * Imath >= 3.1 (tested through 3.2 and main) * OpenEXR >= 3.1 (tested through 3.4 and main) * libTIFF >= 4.0 (tested through 4.7 and master) - * OpenColorIO >= 2.2 (tested through 2.4 and main) + * *OpenColorIO >= 2.3* (tested through 2.4 and main) * libjpeg >= 8 (tested through jpeg9e), or libjpeg-turbo >= 2.1 (tested through 3.1) * zlib >= 1.2.7 (tested through 1.3.1) diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake index 3a47bd7b87..753940d401 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -137,7 +137,7 @@ checked_find_package (Freetype DEFINITIONS USE_FREETYPE=1 ) checked_find_package (OpenColorIO REQUIRED - VERSION_MIN 2.2 + VERSION_MIN 2.3 VERSION_MAX 2.9 ) if (NOT OPENCOLORIO_INCLUDES) diff --git a/src/libOpenImageIO/color_ocio.cpp b/src/libOpenImageIO/color_ocio.cpp index 6e3de0f3c3..03623221de 100644 --- a/src/libOpenImageIO/color_ocio.cpp +++ b/src/libOpenImageIO/color_ocio.cpp @@ -728,7 +728,6 @@ ColorConfig::Impl::identify_builtin_equivalents() { if (disable_builtin_configs) return; -#if OCIO_VERSION_HEX >= MAKE_OCIO_VERSION_HEX(2, 3, 0) Timer timer; if (auto n = IdentifyBuiltinColorSpace("srgb_tx")) { if (CSInfo* cs = find(n)) { @@ -760,7 +759,6 @@ ColorConfig::Impl::identify_builtin_equivalents() DBG("No config space identified as acescg\n"); } DBG("identify_builtin_equivalents acescg took {:0.2f}s\n", timer.lap()); -#endif } @@ -768,7 +766,6 @@ ColorConfig::Impl::identify_builtin_equivalents() const char* ColorConfig::Impl::IdentifyBuiltinColorSpace(const char* name) const { -#if OCIO_VERSION_HEX >= MAKE_OCIO_VERSION_HEX(2, 3, 0) if (!config_ || disable_builtin_configs) return nullptr; try { @@ -776,7 +773,6 @@ ColorConfig::Impl::IdentifyBuiltinColorSpace(const char* name) const name); } catch (...) { } -#endif return nullptr; } @@ -835,11 +831,9 @@ ColorConfig::Impl::init(string_view filename) inventory(); // NOTE: inventory already does classify_by_name -#if OCIO_VERSION_HEX >= MAKE_OCIO_VERSION_HEX(2, 3, 0) DBG("\nIDENTIFY BUILTIN EQUIVALENTS\n"); identify_builtin_equivalents(); // OCIO 2.3+ only DBG("OCIO 2.3+ builtin equivalents in {:0.2f} seconds\n", timer.lap()); -#endif #if 1 for (auto&& cs : colorspaces) { @@ -1478,197 +1472,6 @@ class ColorProcessor_OCIO final : public ColorProcessor { -#if OCIO_VERSION_HEX < MAKE_OCIO_VERSION_HEX(2, 2, 0) -// For version 2.2 and later, missing OCIO config will always fall back on -// built-in configs, so we don't need any of these secondary fallback -// heuristics. - -// ColorProcessor that hard-codes sRGB-to-linear -class ColorProcessor_sRGB_to_linear final : public ColorProcessor { -public: - ColorProcessor_sRGB_to_linear() - : ColorProcessor() {}; - ~ColorProcessor_sRGB_to_linear() override {} - - void apply(float* data, int width, int height, int channels, - stride_t chanstride, stride_t xstride, - stride_t ystride) const override - { - if (channels > 3) - channels = 3; - if (channels == 3 && chanstride == sizeof(float)) { - for (int y = 0; y < height; ++y) { - char* d = (char*)data + y * ystride; - for (int x = 0; x < width; ++x, d += xstride) { - simd::vfloat4 r; - r.load((float*)d, 3); - r = sRGB_to_linear(r); - r.store((float*)d, 3); - } - } - } else { - for (int y = 0; y < height; ++y) { - char* d = (char*)data + y * ystride; - for (int x = 0; x < width; ++x, d += xstride) { - char* dc = d; - for (int c = 0; c < channels; ++c, dc += chanstride) - ((float*)dc)[c] = sRGB_to_linear(((float*)dc)[c]); - } - } - } - } -}; - - -// ColorProcessor that hard-codes linear-to-sRGB -class ColorProcessor_linear_to_sRGB final : public ColorProcessor { -public: - ColorProcessor_linear_to_sRGB() - : ColorProcessor() {}; - ~ColorProcessor_linear_to_sRGB() override {} - - void apply(float* data, int width, int height, int channels, - stride_t chanstride, stride_t xstride, - stride_t ystride) const override - { - if (channels > 3) - channels = 3; - if (channels == 3 && chanstride == sizeof(float)) { - for (int y = 0; y < height; ++y) { - char* d = (char*)data + y * ystride; - for (int x = 0; x < width; ++x, d += xstride) { - simd::vfloat4 r; - r.load((float*)d, 3); - r = linear_to_sRGB(r); - r.store((float*)d, 3); - } - } - } else { - for (int y = 0; y < height; ++y) { - char* d = (char*)data + y * ystride; - for (int x = 0; x < width; ++x, d += xstride) { - char* dc = d; - for (int c = 0; c < channels; ++c, dc += chanstride) - ((float*)dc)[c] = linear_to_sRGB(((float*)dc)[c]); - } - } - } - } -}; - - - -// ColorProcessor that hard-codes Rec709-to-linear -class ColorProcessor_Rec709_to_linear final : public ColorProcessor { -public: - ColorProcessor_Rec709_to_linear() - : ColorProcessor() {}; - ~ColorProcessor_Rec709_to_linear() override {} - - void apply(float* data, int width, int height, int channels, - stride_t chanstride, stride_t xstride, - stride_t ystride) const override - { - if (channels > 3) - channels = 3; - for (int y = 0; y < height; ++y) { - char* d = (char*)data + y * ystride; - for (int x = 0; x < width; ++x, d += xstride) { - char* dc = d; - for (int c = 0; c < channels; ++c, dc += chanstride) - ((float*)d)[c] = Rec709_to_linear(((float*)d)[c]); - } - } - } -}; - - -// ColorProcessor that hard-codes linear-to-Rec709 -class ColorProcessor_linear_to_Rec709 final : public ColorProcessor { -public: - ColorProcessor_linear_to_Rec709() - : ColorProcessor() {}; - ~ColorProcessor_linear_to_Rec709() override {} - - void apply(float* data, int width, int height, int channels, - stride_t chanstride, stride_t xstride, - stride_t ystride) const override - { - if (channels > 3) - channels = 3; - for (int y = 0; y < height; ++y) { - char* d = (char*)data + y * ystride; - for (int x = 0; x < width; ++x, d += xstride) { - char* dc = d; - for (int c = 0; c < channels; ++c, dc += chanstride) - ((float*)d)[c] = linear_to_Rec709(((float*)d)[c]); - } - } - } -}; - - - -// ColorProcessor that performs gamma correction -class ColorProcessor_gamma final : public ColorProcessor { -public: - ColorProcessor_gamma(float gamma) - : ColorProcessor() - , m_gamma(gamma) {}; - ~ColorProcessor_gamma() override {} - - void apply(float* data, int width, int height, int channels, - stride_t chanstride, stride_t xstride, - stride_t ystride) const override - { - if (channels > 3) - channels = 3; - if (channels == 3 && chanstride == sizeof(float)) { - simd::vfloat4 g = m_gamma; - for (int y = 0; y < height; ++y) { - char* d = (char*)data + y * ystride; - for (int x = 0; x < width; ++x, d += xstride) { - simd::vfloat4 r; - r.load((float*)d, 3); - r = fast_pow_pos(r, g); - r.store((float*)d, 3); - } - } - } else { - for (int y = 0; y < height; ++y) { - char* d = (char*)data + y * ystride; - for (int x = 0; x < width; ++x, d += xstride) { - char* dc = d; - for (int c = 0; c < channels; ++c, dc += chanstride) - ((float*)d)[c] = powf(((float*)d)[c], m_gamma); - } - } - } - } - -private: - float m_gamma; -}; - - -// ColorProcessor that does nothing (identity transform) -class ColorProcessor_Ident final : public ColorProcessor { -public: - ColorProcessor_Ident() - : ColorProcessor() - { - } - ~ColorProcessor_Ident() override {} - void apply(float* /*data*/, int /*width*/, int /*height*/, int /*channels*/, - stride_t /*chanstride*/, stride_t /*xstride*/, - stride_t /*ystride*/) const override - { - } -}; -#endif - - - // ColorProcessor that implements a matrix multiply color transformation. class ColorProcessor_Matrix final : public ColorProcessor { public: From cb5836705570fc660409dfa2437ddaef5ec5759d Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Fri, 22 Aug 2025 13:09:30 -0700 Subject: [PATCH 33/71] admin: Prepare main for 3.2 development (#4864) Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- CHANGES.md | 68 +++++++++++++++++++++--- CMakeLists.txt | 4 +- CREDITS.md | 1 + INSTALL.md | 5 +- SECURITY.md | 3 +- docs/ROADMAP.md | 2 +- docs/dev/RELEASING.md | 32 +++++------ src/doc/Doxyfile | 3 ++ src/include/OpenImageIO/oiioversion.h.in | 7 ++- 9 files changed, 92 insertions(+), 33 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 48859d03ec..9e5d916081 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,12 +1,57 @@ +Release 3.2 (target: Sept 2026?) -- compared to 3.1 +--------------------------------------------------- + +### New minimum dependencies and compatibility changes: +### ⛰️ New features and public API changes: +* *New image file format support:* +* *oiiotool new features and major improvements*: +* *Command line utilities*: +* *ImageBuf/ImageBufAlgo*: +* *ImageCache/TextureSystem*: +* New global attribute queries via OIIO::getattribute(): +* Miscellaneous API changes: +### 🚀 Performance improvements +### 🐛 Fixes and feature enhancements +### 🔧 Internals and developer goodies +### 🏗 Build/test/CI and platform ports +* OIIO's CMake build system and scripts: +* Dependency and platform support: +* Testing and Continuous integration (CI) systems: +### 📚 Notable documentation changes +### 🏢 Project Administration + + +--- +--- + Release 3.1 (target: Sept 2025?) -- compared to 3.0 --------------------------------------------------- -- Anticipated beta: Aug 15, 2025 +- Beta 1: Aug 22, 2025 - Anticipated release candidate: Sep 1, 2025 - Anticipated supported release: Sep 15, 2025 +**NOTE:** We anticipate some additional changes to color management to be +rolled out during the beta period. It will not include any breaks to API or +ABI compatibility, but we do expect some behavior changes. + +**Executive Summary / Highlights:** + - New image file support: Ultra HDR (HDR images in JPEG containers). + - oiiotool new commands: `--layersplit`, `--pastemeta`, `--demosaic`, + `create-dir` and new expression expansion tokens: `IS_CONSTANT`, + `IS_BLACK`, `SUBIMAGES`. + - New IBA image processing functions: `scale()`, `demosaic()`. + - New 2-level namespace scheme that we hope will make it possible in the + future for our annual releases to NOT need to break backward ABI + compatibility. + - Support in Python for `ImageBuf._repr_png_` method allows use of OIIO + inside [Jupyter Notebooks](https://jupyter.org/) to display computed + images. + - Color management improvements to conform to Color Interchange Forum and + OpenEXR new conventions for naming and specifying color spaces. + ### New minimum dependencies and compatibility changes: * *Python*: 3.9 minimum (from 3.7) [#4830](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4830) (3.1.4.0) -* *OpenColorIO*: 2.3 minimum (from 2.2) +* *OpenColorIO*: 2.3 minimum (from 2.2) [#4865](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4865) (3.1.4.0) ### ⛰️ New features and public API changes: * *New image file format support:* @@ -52,6 +97,7 @@ Release 3.1 (target: Sept 2025?) -- compared to 3.0 - *api*: Add new ImageInput::supports() query: "mipmap" [#4800](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4800) (3.1.3.0) * Color management changes - *color mgmt*: Don't assume unlabeled OpenEXR files are lin_rec709 [#4840](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4840) (3.1.4.0) + - *color mgmt*: Color space renaming to adhere to CIF conventions [#4860](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4860) (3.1.4.0) ### 🚀 Performance improvements: @@ -160,7 +206,8 @@ Release 3.1 (target: Sept 2025?) -- compared to 3.0 - *build*: Clean up Windows compilation warnings [#4706](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4706) (3.1.3.0) - *build/python*: Wheel upload_pypi step should only run from main repo [#4820](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4820) (3.1.3.0) - *build*: Fix typo related to finding ccache [#4833](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4833) (3.1.4.0) -* Dependency support: + - *build*: C++23 support [#4844](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4844) (3.1.4.0) +* Dependency and platform support: - *deps*: Support static OCIO self-builds [#4517](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4517) (by zachlewis) (3.1.0.0/3.0.1.0) - *deps*: Add new ref output for libheif updates [#4525](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4525) (3.1.0.0/3.0.1.0) - *build*: Add build recipe for PNG [#4423](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4423) (by zachlewis) (3.1.0.0/3.0.1.0) @@ -174,6 +221,13 @@ Release 3.1 (target: Sept 2025?) -- compared to 3.0 - *tests*: Update ref image for slightly changed freetype accents [#4765](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4765) (3.1.3.0) - *deps/ffmpeg*: Replace deprecated and soon removed avcodec_close with avcodec_free_context [#4837](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4837) (by Vlad Erium) (3.1.4.0) - *build/jpeg2000*: Update jpeg2000input.cpp to include cstdarg [#4836](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4836) (by Peter Kovář) (3.1.4.0) + - *deps*: Raise minimum supported Python from 3.7 to 3.9 [#4830](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4830) (3.1.4.0) + - *deps*: Use get_plane2 introduced by libheif 1.20.2 [#4851](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4851) (by toge) (3.1.4.0) + - *windows*: Include Windows version information on produced binaries [#4696](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4696) (by Jesse Yurkovich) (3.1.3.0) + - windows + ARM64*: Add arm_neon.h include on Windows ARM64 with clang-cl [#4691](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4691) (by Anthony Roberts) + - *build/windows*: Propagate CMAKE_MSVC_RUNTIME_LIBRARY [#4842](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4842) (3.1.4.0) + - *deps*: Raise OpenColorIO minimum to 2.3 (from 2.2) [#4865](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4865) (3.1.4.0) + - *NetBSD*: Fix build on NetBSD [#4857](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4857) (by Thomas Klausner) (3.1.4.0) * Testing and Continuous integration (CI) systems: - *tests*: Improve Ptex testing [#4573](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4573) (3.1.1.0) - *tests*: Better testing coverage of null image reader/writer [#4578](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4578) (3.1.1.0) @@ -217,10 +271,9 @@ Release 3.1 (target: Sept 2025?) -- compared to 3.0 - *ci*: Update linux arm clang reference output [#4782](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4782) (3.1.3.0) - *ci*: Bump 'latest releases' tests to use pybind11 3.0.0 [#4828](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4828) (3.1.4.0) - *ci*: For python stub generation, lock pybind11 to pre-3.0 [#4831](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4831) (3.1.4.0) -* Platform support: - - *windows*: Include Windows version information on produced binaries [#4696](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4696) (by Jesse Yurkovich) (3.1.3.0) - - windows + ARM64*: Add arm_neon.h include on Windows ARM64 with clang-cl [#4691](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4691) (by Anthony Roberts) - - *build/windows*: Propagate CMAKE_MSVC_RUNTIME_LIBRARY [#4842](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4842) (3.1.4.0) + - *ci*: Add a VFX Platform 2026 CI job [#4856](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4856) (3.1.4.0) + - *ci*: Lock down to ci-oiio container with correct llvm components [#4859](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4859) (3.1.4.0) + - *ci*: Bump webp and openexr for "latest versions" test [#4861](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4861) (3.1.4.0) ### 📚 Notable documentation changes: - *docs*: Clarify 'copy_image' example [#4522](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4522) (3.1.0.0/3.0.1.0) @@ -246,6 +299,7 @@ Release 3.1 (target: Sept 2025?) -- compared to 3.0 - *admin*: Update SECURITY to reflect that 2.5 only gets critical fixes now [#4829](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4829) + --- --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 38a72f3c97..ee4b9d413f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required (VERSION 3.18.2...4.0) -set (OpenImageIO_VERSION "3.1.4.0") +set (OpenImageIO_VERSION "3.2.0.0") set (OpenImageIO_VERSION_OVERRIDE "" CACHE STRING "Version override (use with caution)!") mark_as_advanced (OpenImageIO_VERSION_OVERRIDE) @@ -40,7 +40,7 @@ if (CMAKE_VERSION VERSION_LESS 3.21) endif () endif () -# Set up module path for our own cmake modules and add some esential ones +# Set up module path for our own cmake modules and add some essential ones list (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/src/cmake/modules" "${PROJECT_SOURCE_DIR}/src/cmake") diff --git a/CREDITS.md b/CREDITS.md index c857d136e0..027948b69b 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -224,6 +224,7 @@ lg@openimageio.org * Stefan Stavrev * Thiago Ize * Thomas Dinges +* Thomas Klausner * Thomas Mansencal * Till Dechent * Tim D. Smith diff --git a/INSTALL.md b/INSTALL.md index 39d555d379..93ecc92764 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -17,8 +17,9 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * C++17 or higher (also builds with C++20 and C++23) * The default build mode is C++17. This can be controlled by via the CMake configuration flag: `-DCMAKE_CXX_STANDARD=20`, etc. - * Compilers: gcc 9.3 - 14.2, clang 5 - 20, MSVS 2017 - 2022 (v19.14 - and up), Intel icc 19+, Intel OneAPI C++ compiler 2022+. + * Compilers: gcc 9.3 - 14.2, clang 5 - 20 (though we don't actively test + older than 11), MSVS 2017 - 2022 (v19.14 and up), Intel icc 19+, Intel + OneAPI C++ compiler 2022+. * CMake >= 3.18.2 (tested through 4.1) * Imath >= 3.1 (tested through 3.2 and main) * OpenEXR >= 3.1 (tested through 3.4 and main) diff --git a/SECURITY.md b/SECURITY.md index 954d83cda1..1fc108aa7a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,9 +8,10 @@ security vulnerabilities. | Version / branch | Supported | | ----------------- | ---------------------------------------------------- | | main | :white_check_mark: :construction: ALL fixes immediately, but this is a branch under development with a frequently unstable ABI and occasionally unstable API. | +| 3.1.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility. New tagged releases monthly. | | 3.0.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility. New tagged releases monthly. | | 2.5.x | :warning: Bug fixes backported only if critical or upon request (and if we are able to cleanly backport). New tagged releases only occasionally. | -| <= 2.4.x | :x: No longer receiving patches of any kind. | +| < 2.5.x | :x: No longer receiving patches of any kind. | ## Reporting a Vulnerability diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 01e553c292..d685a58637 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -98,6 +98,6 @@ bring it up at a TSC meeting, or on the mail list or Slack channel. ## Parking Here is where we will put things that definitely should be on the roadmap, but -that need not be completed in time for the fall 2024 release of OIIO 3.0. +that need not be completed in time for the fall 2026 release of OIIO 3.2. ... diff --git a/docs/dev/RELEASING.md b/docs/dev/RELEASING.md index 1146799226..3d2233a348 100644 --- a/docs/dev/RELEASING.md +++ b/docs/dev/RELEASING.md @@ -178,7 +178,7 @@ have a heading added at the top for the *next* version. minor releases, so it's ok/encouraged to make a deprecated function from linked to inline, for example (which might allow it to be removed later without an ABI change). - - Major releases (a.b.c.d -> A+1.b.c.d): API compatibility breaks are + - Major releases (a.b.c.d -> A+1.0.0.0): API compatibility breaks are allowed here, so this is the time to completely remove any functions that have already had a full minor release where they had been given deprecation warning macros. @@ -312,22 +312,22 @@ The following are the steps for making the release: For a monthly patch release: - > We have tagged v3.0.1.2 as the latest production release and moved the + > We have tagged v3.1.0.0 as the latest production release and moved the > "release" branch marker to that point. This is guaranteed to be API, - > ABI, and link back-compatible with prior 3.0 releases. Release notes + > ABI, and link back-compatible with prior 3.1 releases. Release notes > can be found at *LINK TO THE GITHUB RELEASE PAGE.* For an annual major/minor release: - > OpenImageIO version 3.0 has been released! Officially tagged as - > "v3.0.0.0", we have also moved the "release" branch tag to this - > position. Henceforth, 3.0 is the supported production release family. - > The API is now frozen -- we promise that subsequent 3.0.x releases + > OpenImageIO version 3.1 has been released! Officially tagged as + > "v3.1.0.0", we have also moved the "release" branch tag to this + > position. Henceforth, 3.1 is the supported production release family. + > The API is now frozen -- we promise that subsequent 3.1.x releases > (which should happen monthly) will not break back-compatibility of API, > ABI, or linkage, compared to this release. Please note that this release > is *not* ABI or link compatible with 2.5 or older releases. > - > Release notes for 3.0 outlining all the changes since last year's + > Release notes for 3.1 outlining all the changes since last year's > release can be found at *LINK TO THE GITHUB RELEASE PAGE.* > (Optionally, you can include a brief summary of the most important > changes in this email.) @@ -344,7 +344,7 @@ The following are the steps for making the release: > backward-compatible with prior versions, warn about that here.) > > Enjoy, and please report any problems. We will continue to make patch - > releases to the 3.0 family roughly monthly, which will contain bug fixes + > releases to the 3.1 family roughly monthly, which will contain bug fixes > and non-breaking enhancements. > > The older 2.5 series of releases is now considered obsolete. We will @@ -357,22 +357,22 @@ The following are the steps for making the release: > not make any compatibility guarantees and don't guarantee continuing API > compatibility in main. > - > (Paste the full set of 3.0 changes here, just copy the appropriate + > (Paste the full set of 3.1 changes here, just copy the appropriate > part of CHANGES.md) For a beta leading up to the annual major/minor release: - > OpenImageIO version 3.0 is now in beta, tagged as "v3.0.0.0-beta". We + > OpenImageIO version 3.1 is now in beta, tagged as "v3.1.0.0-beta". We > will try very hard not to make any further API or ABI changes between > now and the final release (unless it is absolutely necessary to fix - > an important problem identified during beta testing). The final 3.0 + > an important problem identified during beta testing). The final 3.1 > release is scheduled for [DATE GOES HERE], so please try building and > testing the beta so we are sure to find any problems. > - > Release notes for 3.0 outlining all the changes since last year's + > Release notes for 3.1 outlining all the changes since last year's > release are below. > - > (Paste the full set of 3.0 changes here, just copy the appropriate + > (Paste the full set of 3.1 changes here, just copy the appropriate > part of CHANGES.md) @@ -414,9 +414,9 @@ notes process be simpler and more automated. We have been using the [git-cliff](https://github.com/orhun/git-cliff) tool as the starting point for release notes. The command we use is: - git cliff -c src/doc/cliff.toml v1.2.3.4..HEAD > cliff.out.md + git cliff -c src/doc/cliff.toml v3.1.2.3..HEAD > cliff.out.md -where v1.2.3.4 in this example is the tag of the last release. You could also +where v3.1.2.3 in this example is the tag of the last release. You could also use commit hashes to denote the range of changes you want to document. **For monthly patch releases** diff --git a/src/doc/Doxyfile b/src/doc/Doxyfile index ee40d48dcd..82d533b7a4 100644 --- a/src/doc/Doxyfile +++ b/src/doc/Doxyfile @@ -2187,10 +2187,13 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ OIIO_NAMESPACE_END="}" \ OIIO_NAMESPACE_3_0_BEGIN="namespace OIIO {" \ OIIO_NAMESPACE_3_0_END="}" \ + OIIO_NAMESPACE_3_1_BEGIN="namespace OIIO {" \ + OIIO_NAMESPACE_3_1_END="}" \ OIIO_NS_BEGIN="namespace OIIO {" \ OIIO_NS_END="}" \ OIIO_CONSTEXPR17=constexpr \ OIIO_CONSTEXPR20=constexpr \ + OIIO_CONSTEXPR23=constexpr \ OIIO_IB_DEPRECATE_RAW_PTR:= \ OIIO_INLINE_CONSTEXPR="inline constexpr" \ OIIO_PURE_FUNC= \ diff --git a/src/include/OpenImageIO/oiioversion.h.in b/src/include/OpenImageIO/oiioversion.h.in index 08aa99d3e9..b2a1d23ca1 100644 --- a/src/include/OpenImageIO/oiioversion.h.in +++ b/src/include/OpenImageIO/oiioversion.h.in @@ -173,10 +173,9 @@ namespace OIIO = @PROJ_NAMESPACE@; #define OIIO_NS_BEGIN(ver) namespace @PROJ_NAMESPACE@ { namespace ver { #define OIIO_NS_END } } -// Specialty macro: Make something ABI compatible with 3.0 -#define OIIO_NAMESPACE_3_0 @PROJ_NAMESPACE@_v3_0 -#define OIIO_NAMESPACE_3_0_BEGIN namespace OIIO_NAMESPACE_3_0 { -#define OIIO_NAMESPACE_3_0_END } +// Specialty macro: Make something ABI compatible with 3.1 +#define OIIO_NAMESPACE_3_1_BEGIN OIIO_NS_BEGIN(v3_1) +#define OIIO_NAMESPACE_3_1_END OIIO_NS_END // Macro to use names without explicit qualifier #define OIIO_NAMESPACE_USING using namespace @PROJ_NAMESPACE@::@PROJ_VERSION_NAMESPACE@; From eaeb03a42d681c1a423bbef8af13a0a62818d352 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Fri, 22 Aug 2025 14:17:01 -0700 Subject: [PATCH 34/71] ci: Update ABI standard after bumping 3.2 version number (#4868) Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e828f443b4..b6cb7e88a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -368,7 +368,7 @@ jobs: simd: "avx2,f16c" skip_tests: 1 # abi_check: v3.1.3.0 - abi_check: e36031ce4e5e87bdc4dafc6cd611ef6f986882d2 + abi_check: ae5dca7865c9956b43cc04dee00a65ad893e251e setenvs: export OIIO_CMAKE_FLAGS="-DOIIO_BUILD_TOOLS=0 -DOIIO_BUILD_TESTS=0 -DUSE_PYTHON=0" USE_OPENCV=0 USE_FFMPEG=0 USE_PYTHON=0 USE_FREETYPE=0 From cb0388f50f24d37fccff8f3b36337a353a883183 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Fri, 22 Aug 2025 14:20:14 -0700 Subject: [PATCH 35/71] build: Some more minor wheel workflow changes after the py 3.9 bump (#4867) Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b4a0699770..cd12ae1722 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,6 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", From 2f4db3b43c013e5d4508969797396f9c6c89490e Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sat, 23 Aug 2025 10:37:22 -0700 Subject: [PATCH 36/71] build: clean up obsolete logic for old compilers (#4849) * Enforce gcc, clang, and apple clang minimum versions. * Raise advertised minimum clang version to 10.0. Error for clang < 5, which we know is the true minimum because earlier than that won't support C++17 which we require. But in truth, we haven't tested versions older than 10.0 for a long time, so we should not be implying we know older versions will work or that we will support them. * Simplify cases no longer relevant for older gcc and clang. * Remove unneeded gcc guard in simd.h. I think it was important only for gcc 5! But it was also preventing the slightly faster construct from activating for clang. Seems to pass all our CI jobs with this simplified. Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 22 +++++++++++++++++++++- INSTALL.md | 5 ++--- src/cmake/compiler.cmake | 30 +++++++++++++++++++----------- src/include/OpenImageIO/simd.h | 6 +++--- src/libOpenImageIO/CMakeLists.txt | 10 ++-------- src/libutil/CMakeLists.txt | 2 +- src/raw.imageio/rawinput.cpp | 7 +++---- 7 files changed, 51 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6cb7e88a1..4575b84db0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: fmt_ver: 9.1.0 setenvs: export FREETYPE_VERSION=VER-2-12-0 - desc: oldest gcc9.3/C++17 py3.9 exr3.1 ocio2.3 - # Oldest versions of the dependencies that we support. + # Oldest gcc and versions of the dependencies that we support. nametag: linux-oldest runner: ubuntu-latest container: aswf/ci-osl:2022 @@ -93,6 +93,26 @@ jobs: WEBP_VERSION=v1.1.0 PUGIXML_VERSION=v1.8 depcmds: sudo rm -rf /usr/local/include/OpenEXR + - desc: oldest clang10/C++17 py3.9 exr3.1 ocio2.3 + # Oldest clang and versions of the dependencies that we support. + nametag: linux-oldest-clang + runner: ubuntu-latest + container: aswf/ci-osl:2022-clang10 + vfxyear: 2021 + old_node: 1 + cc_compiler: clang + cxx_compiler: clang++ + cxx_std: 17 + fmt_ver: 7.0.1 + opencolorio_ver: v2.3.0 + openexr_ver: v3.1.0 + pybind11_ver: v2.7.0 + python_ver: 3.9 + setenvs: export CMAKE_VERSION=3.18.2 + PTEX_VERSION=v2.3.2 + WEBP_VERSION=v1.1.0 + PUGIXML_VERSION=v1.8 + depcmds: sudo rm -rf /usr/local/include/OpenEXR - desc: hobbled gcc9.3/C++17 py3.9 exr-3.1 no-sse # Use the oldest supported versions of required dependencies, and # disable most optional dependencies and features (no SSE or diff --git a/INSTALL.md b/INSTALL.md index 93ecc92764..c19abf565f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -17,9 +17,8 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * C++17 or higher (also builds with C++20 and C++23) * The default build mode is C++17. This can be controlled by via the CMake configuration flag: `-DCMAKE_CXX_STANDARD=20`, etc. - * Compilers: gcc 9.3 - 14.2, clang 5 - 20 (though we don't actively test - older than 11), MSVS 2017 - 2022 (v19.14 and up), Intel icc 19+, Intel - OneAPI C++ compiler 2022+. + * Compilers: gcc 9.3 - 14.2, **clang 10** - 20, MSVS 2017 - 2022 (v19.14 + and up), Intel icc 19+, Intel OneAPI C++ compiler 2022+. * CMake >= 3.18.2 (tested through 4.1) * Imath >= 3.1 (tested through 3.2 and main) * OpenEXR >= 3.1 (tested through 3.4 and main) diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake index bb12996b1a..6dfad31395 100644 --- a/src/cmake/compiler.cmake +++ b/src/cmake/compiler.cmake @@ -53,6 +53,9 @@ if (CMAKE_COMPILER_IS_GNUCC) OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) message (VERBOSE "Using gcc ${GCC_VERSION} as the compiler") + if (GCC_VERSION VERSION_LESS 9.0) + message (ERROR "gcc minimum version is 9.0") + endif () else () set (GCC_VERSION 0) endif () @@ -71,6 +74,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER MATCHES "[Cc]lan string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" APPLECLANG_VERSION_STRING ${clang_full_version_string}) set (ANY_CLANG_VERSION_STRING ${APPLECLANG_VERSION_STRING}) message (VERBOSE "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${APPLECLANG_VERSION_STRING}") + if (APPLECLANG_VERSION_STRING VERSION_LESS 5.0) + message (ERROR "Apple clang minimum version is 5.0") + elseif (APPLECLANG_VERSION_STRING VERSION_LESS 10.0) + message (WARNING "Apple clang minimum version is 10.0. Older versions might work, but we don't test or support them.") + endif () elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") set (CMAKE_COMPILER_IS_INTELCLANG 1) string (REGEX MATCH "[0-9]+(\\.[0-9]+)+" INTELCLANG_VERSION_STRING ${clang_full_version_string}) @@ -81,6 +89,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER MATCHES "[Cc]lan string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string}) set (ANY_CLANG_VERSION_STRING ${CLANG_VERSION_STRING}) message (VERBOSE "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${CLANG_VERSION_STRING}") + if (CLANG_VERSION_STRING VERSION_LESS 5.0) + message (ERROR "clang minimum version is 5.0") + elseif (CLANG_VERSION_STRING VERSION_LESS 10.0) + message (WARNING "clang minimum version is 10.0. Older versions might work, but we don't test or support them.") + endif () endif () elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel") set (CMAKE_COMPILER_IS_INTEL 1) @@ -157,11 +170,10 @@ if (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG) add_compile_options ("-Qunused-arguments") # Don't warn if we ask it not to warn about warnings it doesn't know add_compile_options ("-Wunknown-warning-option") - if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 3.6 OR - APPLECLANG_VERSION_STRING VERSION_GREATER 6.1) + if (CLANG_VERSION_STRING OR APPLECLANG_VERSION_STRING VERSION_GREATER 6.1) add_compile_options ("-Wno-unused-local-typedefs") endif () - if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 3.9) + if (CLANG_VERSION_STRING) # Don't warn about using unknown preprocessor symbols in `#if` add_compile_options ("-Wno-expansion-to-defined") endif () @@ -174,10 +186,8 @@ if (CMAKE_COMPILER_IS_GNUCC AND NOT (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_I # gcc specific options add_compile_options ("-Wno-unused-local-typedefs") add_compile_options ("-Wno-unused-result") - if (NOT ${GCC_VERSION} VERSION_LESS 7.0) - add_compile_options ("-Wno-aligned-new") - add_compile_options ("-Wno-noexcept-type") - endif () + add_compile_options ("-Wno-aligned-new") + add_compile_options ("-Wno-noexcept-type") endif () if (INTELCLANG_VERSION_STRING VERSION_GREATER_EQUAL 2022.1.0) @@ -284,10 +294,8 @@ endif () # legit problem later. # set (GLIBCXX_USE_CXX11_ABI "" CACHE STRING "For gcc, use the new C++11 library ABI (0|1)") -if (CMAKE_COMPILER_IS_GNUCC AND ${GCC_VERSION} VERSION_GREATER_EQUAL 5.0) - if (NOT ${GLIBCXX_USE_CXX11_ABI} STREQUAL "") - add_compile_definitions (_GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI}) - endif () +if (CMAKE_COMPILER_IS_GNUCC AND NOT ${GLIBCXX_USE_CXX11_ABI} STREQUAL "") + add_compile_definitions (_GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI}) endif () diff --git a/src/include/OpenImageIO/simd.h b/src/include/OpenImageIO/simd.h index ac8589308e..11578c1b7c 100644 --- a/src/include/OpenImageIO/simd.h +++ b/src/include/OpenImageIO/simd.h @@ -3317,7 +3317,7 @@ OIIO_FORCEINLINE const vbool4 vbool4::False () { OIIO_FORCEINLINE const vbool4 vbool4::True () { // Fastest way to fill with all 1 bits is to cmp any value to itself. #if OIIO_SIMD_SSE -# if OIIO_SIMD_AVX && (OIIO_GNUC_VERSION > 50000) +# if OIIO_SIMD_AVX __m128i anyval = _mm_undefined_si128(); # else __m128i anyval = _mm_setzero_si128(); @@ -3676,7 +3676,7 @@ OIIO_FORCEINLINE const vbool8 vbool8::False () { OIIO_FORCEINLINE const vbool8 vbool8::True () { #if OIIO_SIMD_AVX -# if OIIO_SIMD_AVX >= 2 && (OIIO_GNUC_VERSION > 50000) +# if OIIO_SIMD_AVX >= 2 // Fastest way to fill with all 1 bits is to cmp any value to itself. __m256i anyval = _mm256_undefined_si256(); return _mm256_castsi256_ps (_mm256_cmpeq_epi8 (anyval, anyval)); @@ -4413,7 +4413,7 @@ OIIO_FORCEINLINE const vint4 vint4::NegOne () { #if OIIO_SIMD_SSE // Fastest way to fill an __m128 with all 1 bits is to cmpeq_epi8 // any value to itself. -# if OIIO_SIMD_AVX && (OIIO_GNUC_VERSION > 50000) +# if OIIO_SIMD_AVX __m128i anyval = _mm_undefined_si128(); # else __m128i anyval = _mm_setzero_si128(); diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt index f5132edfd0..f2459b2d32 100644 --- a/src/libOpenImageIO/CMakeLists.txt +++ b/src/libOpenImageIO/CMakeLists.txt @@ -15,7 +15,7 @@ if (NOT USE_EXTERNAL_PUGIXML) ../include/OpenImageIO/detail/pugixml/pugixml.hpp ../include/OpenImageIO/detail/pugixml/pugixml.cpp ) - if (CMAKE_COMPILER_IS_GNUCC AND NOT ${GCC_VERSION} VERSION_LESS 6.0) + if (CMAKE_COMPILER_IS_GNUCC) set_source_files_properties (formatspec.cpp xmp.cpp PROPERTIES COMPILE_FLAGS -Wno-error=placement-new) endif () @@ -30,17 +30,11 @@ if (NOT MSVC) PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations") endif() -if (CMAKE_COMPILER_IS_GNUCC AND ${GCC_VERSION} VERSION_GREATER_EQUAL 9.0) +if (CMAKE_COMPILER_IS_GNUCC) set_source_files_properties (../libutil/SHA1.cpp PROPERTIES COMPILE_FLAGS -Wno-stringop-truncation) endif () -if (CMAKE_COMPILER_IS_GNUCC AND ${GCC_VERSION} VERSION_GREATER_EQUAL 6.0 - AND ${GCC_VERSION} VERSION_LESS 7.0) - set_source_files_properties (../openvdb.imageio/openvdbinput.cpp - PROPERTIES COMPILE_FLAGS -Wno-error=strict-overflow) -endif () - set (libOpenImageIO_srcs imagebufalgo.cpp imagebufalgo_pixelmath.cpp diff --git a/src/libutil/CMakeLists.txt b/src/libutil/CMakeLists.txt index d8927804c7..526aa6f023 100644 --- a/src/libutil/CMakeLists.txt +++ b/src/libutil/CMakeLists.txt @@ -9,7 +9,7 @@ set (libOpenImageIO_Util_srcs argparse.cpp benchmark.cpp strutil.cpp sysutil.cpp thread.cpp timer.cpp typedesc.cpp ustring.cpp xxhash.cpp) -if (CMAKE_COMPILER_IS_GNUCC AND NOT ${GCC_VERSION} VERSION_LESS 9.0) +if (CMAKE_COMPILER_IS_GNUCC) set_property (SOURCE SHA1.cpp APPEND PROPERTY COMPILE_OPTIONS -Wno-stringop-truncation) endif () diff --git a/src/raw.imageio/rawinput.cpp b/src/raw.imageio/rawinput.cpp index b164ea1d51..5d8bae4f8f 100644 --- a/src/raw.imageio/rawinput.cpp +++ b/src/raw.imageio/rawinput.cpp @@ -17,14 +17,13 @@ #include #include -#if OIIO_GNUC_VERSION || OIIO_CLANG_VERSION >= 50000 +#if OIIO_GNUC_VERSION || OIIO_CLANG_VERSION // fix warnings in libraw headers: use of auto_ptr # pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif -#if OIIO_CPLUSPLUS_VERSION >= 17 \ - && ((OIIO_CLANG_VERSION && OIIO_CLANG_VERSION < 110000) \ - || OIIO_APPLE_CLANG_VERSION) +#if (OIIO_CLANG_VERSION && OIIO_CLANG_VERSION < 110000) \ + || OIIO_APPLE_CLANG_VERSION // libraw uses auto_ptr, which is not in C++17 at all for clang, though // it does seem to be for gcc. So for clang, alias it to unique_ptr. namespace std { From 4c182e0365f57517d8c232672da19b5809b682bb Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Fri, 29 Aug 2025 19:55:00 +0300 Subject: [PATCH 37/71] exr: OpenEXR 3.4 supports two compression types for HTJ2K (#4871) `htj2k32` or `htj2k256` compression options. Signed-off-by: Todica Ionut Signed-off-by: Zach Lewis --- src/doc/builtinplugins.rst | 4 ++-- src/openexr.imageio/exrinput.cpp | 7 +++++-- src/openexr.imageio/exrinput_c.cpp | 7 +++++-- src/openexr.imageio/exroutput.cpp | 10 +++++++--- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/doc/builtinplugins.rst b/src/doc/builtinplugins.rst index 3a9c7d3972..847010c9d4 100644 --- a/src/doc/builtinplugins.rst +++ b/src/doc/builtinplugins.rst @@ -1540,8 +1540,8 @@ The official OpenEXR site is http://www.openexr.com/. * - ``compression`` - string - one of: ``"none"``, ``"rle"``, ``"zip"``, ``"zips"``, ``"piz"``, - ``"pxr24"``, ``"b44"``, ``"b44a"``, ``"dwaa"``, ``"dwab"`` or ``"htj2k"``. - (``"htj2k"`` is only supported with OpenEXR 3.4 or later.) + ``"pxr24"``, ``"b44"``, ``"b44a"``, ``"dwaa"``, ``"dwab"``, ``"htj2k256"`` or ``"htj2k32"``. + (``"htj2k256"`` and ``"htj2k32"`` are only supported with OpenEXR 3.4 or later.) If the writer receives a request for a compression type it does not recognize or is not supported by the version of OpenEXR on the system, it will use ``"zip"`` by default. For ``"dwaa"`` and diff --git a/src/openexr.imageio/exrinput.cpp b/src/openexr.imageio/exrinput.cpp index 94293a3fd2..dbd6cddba5 100644 --- a/src/openexr.imageio/exrinput.cpp +++ b/src/openexr.imageio/exrinput.cpp @@ -431,8 +431,11 @@ OpenEXRInput::PartInfo::parse_header(OpenEXRInput* in, case Imf::B44A_COMPRESSION: comp = "b44a"; break; case Imf::DWAA_COMPRESSION: comp = "dwaa"; break; case Imf::DWAB_COMPRESSION: comp = "dwab"; break; -#ifdef IMF_HTJ2K_COMPRESSION - case Imf::HTJ2K_COMPRESSION: comp = "htj2k"; break; +#ifdef IMF_HTJ2K256_COMPRESSION + case EXR_COMPRESSION_HTJ2K256: comp = "htj2k256"; break; +#endif +#ifdef IMF_HTJ2K32_COMPRESSION + case EXR_COMPRESSION_HTJ2K32: comp = "htj2k32"; break; #endif default: break; } diff --git a/src/openexr.imageio/exrinput_c.cpp b/src/openexr.imageio/exrinput_c.cpp index 00489b5b8d..9b72a2891d 100644 --- a/src/openexr.imageio/exrinput_c.cpp +++ b/src/openexr.imageio/exrinput_c.cpp @@ -568,8 +568,11 @@ OpenEXRCoreInput::PartInfo::parse_header(OpenEXRCoreInput* in, case EXR_COMPRESSION_B44A: comp = "b44a"; break; case EXR_COMPRESSION_DWAA: comp = "dwaa"; break; case EXR_COMPRESSION_DWAB: comp = "dwab"; break; -#ifdef IMF_HTJ2K_COMPRESSION - case EXR_COMPRESSION_HTJ2K: comp = "htj2k"; break; +#ifdef IMF_HTJ2K256_COMPRESSION + case EXR_COMPRESSION_HTJ2K256: comp = "htj2k256"; break; +#endif +#ifdef IMF_HTJ2K32_COMPRESSION + case EXR_COMPRESSION_HTJ2K32: comp = "htj2k32"; break; #endif default: break; } diff --git a/src/openexr.imageio/exroutput.cpp b/src/openexr.imageio/exroutput.cpp index 6fa387f178..3e7e967f45 100644 --- a/src/openexr.imageio/exroutput.cpp +++ b/src/openexr.imageio/exroutput.cpp @@ -961,9 +961,13 @@ OpenEXROutput::put_parameter(const std::string& name, TypeDesc type, header.compression() = Imf::DWAA_COMPRESSION; else if (Strutil::iequals(str, "dwab")) header.compression() = Imf::DWAB_COMPRESSION; -#ifdef IMF_HTJ2K_COMPRESSION - else if (Strutil::iequals(str, "htj2k")) - header.compression() = Imf::HTJ2K_COMPRESSION; +#ifdef IMF_HTJ2K256_COMPRESSION + else if (Strutil::iequals(str, "htj2k256")) + header.compression() = Imf::HTJ2K256_COMPRESSION; +#endif +#ifdef IMF_HTJ2K32_COMPRESSION + else if (Strutil::iequals(str, "htj2k32")) + header.compression() = Imf::HTJ2K32_COMPRESSION; #endif } return true; From d38ab1fd04407653c8c9b5a691afff8d11dee37e Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sun, 31 Aug 2025 14:36:03 -0700 Subject: [PATCH 38/71] build: ffmpeg 8 support (#4870) * Try a build against ffmpeg 8 -- seems to work out of the box, so document that we support that version in INSTALL.md. * Augment FindFFmpeg.cmake to correctly identify 7.1 and 8.0 by the very non-intuitive versioning scheme of ffmpeg's headers. * Add a FFMPEG_EXTRA_LIBRARIES variable to FindFFmpeg.cmake to allow us to easily inject extra library dependencies (coincidentally, I need this at work to force it to use static libraries). Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- INSTALL.md | 2 +- src/cmake/modules/FindFFmpeg.cmake | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index c19abf565f..7c5abc63b3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -49,7 +49,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * If you want support for camera "RAW" formats: * LibRaw >= 0.20 (tested though 0.21.4 and master) * If you want support for a wide variety of video formats: - * ffmpeg >= 4.0 (tested through 7.1) + * ffmpeg >= 4.0 (tested through 8.0) * If you want support for jpeg 2000 images: * OpenJpeg >= 2.0 (tested through 2.5.3; we recommend 2.4 or higher for multithreading support) diff --git a/src/cmake/modules/FindFFmpeg.cmake b/src/cmake/modules/FindFFmpeg.cmake index c49e9623f8..ea73e7b505 100644 --- a/src/cmake/modules/FindFFmpeg.cmake +++ b/src/cmake/modules/FindFFmpeg.cmake @@ -73,7 +73,11 @@ if (FFMPEG_INCLUDES) REGEX "^#define LIBAVCODEC_VERSION_MICRO .*$") string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MICRO "${TMP}") set (LIBAVCODEC_VERSION "${LIBAVCODEC_VERSION_MAJOR}.${LIBAVCODEC_VERSION_MINOR}.${LIBAVCODEC_VERSION_MICRO}") - if (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 61.3.100) + if (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 62.11.100) + set (FFMPEG_VERSION 8.0) + elseif (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 61.19.101) + set (FFMPEG_VERSION 7.1) + elseif (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 61.3.100) set (FFMPEG_VERSION 7.0) elseif (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 60.31.102) set (FFMPEG_VERSION 6.1) @@ -130,6 +134,7 @@ if (FFmpeg_FOUND) ${FFMPEG_LIBAVFORMAT} ${FFMPEG_LIBAVUTIL} ${FFMPEG_LIBSWSCALE} + ${FFMPEG_EXTRA_LIBRARIES} ) endif () From 8330a8a694fc9c8a4b8760ccc28b9aca06523056 Mon Sep 17 00:00:00 2001 From: Alex Fuller Date: Sun, 7 Sep 2025 07:47:26 +1000 Subject: [PATCH 39/71] build: Look for boost headers for OpenVDBs older than 12 (#4873) Signed-off-by: Alex Fuller Signed-off-by: Zach Lewis --- src/cmake/modules/FindOpenVDB.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cmake/modules/FindOpenVDB.cmake b/src/cmake/modules/FindOpenVDB.cmake index 7d9b879565..d4e18fd8d4 100644 --- a/src/cmake/modules/FindOpenVDB.cmake +++ b/src/cmake/modules/FindOpenVDB.cmake @@ -89,6 +89,16 @@ if (OpenVDB_FOUND) set_property(TARGET OpenVDB::openvdb APPEND PROPERTY IMPORTED_LOCATION "${OPENVDB_LIBRARIES}") endif () + + # Note: OpenVDB older than 12 needs Boost headers. + if (OpenVDB_VERSION VERSION_LESS 12) + find_package (Boost) + if (Boost_FOUND) + list(APPEND OPENVDB_INCLUDES ${Boost_INCLUDE_DIRS}) + else() + unset(OpenVDB_FOUND) + endif() + endif() endif () MARK_AS_ADVANCED( From 1fceaa15be3bffe7c4d40d75acc3d8a88d0eafcb Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Mon, 8 Sep 2025 20:02:08 -0700 Subject: [PATCH 40/71] feat(oiiotool): allow easy splitting of subimages by name (#4874) Say you need to take a multi-part exr file and split it into separate files for each part. (Note: what OpenEXR calls "parts", OIIO calls "subimages.") You could do this oiiotool multipart.exr --sisplit -o:all=1 "part.%04d.exr" But this would name the parts part.0001.exr, part.0002.exr, etc. Maybe you would prefer to split them into files that contain the subimage name rather than just the inscrutible index number (which may also not be consistent across files)? You could try this dance to loop over the subimages and write each one with a name extracted from its metadata: oiiotool multipart.exr --for i {TOP.SUBIMAGES} --dup --subimage {i} -o "subimage_{TOP.'oiio:subimagename'}.exr That works, but that's a little awkward and hard to remember off the top of your head. Perhaps instead we would prefer a simpler version: oiiotool multipart.exr --sisplit -o:all=1 "part.{TOP.'oiio:subimagename'}.exr" This PR makes that last command work. It actually only required a small change, which is that the function that handles the `-o` command needs to defer the evaluation of the expression subsitution in the filename to occur separately for each subimage being output, rather than just once for the whole `-o:all=1` (which would have baked the FIRST subimage name into all the output file names). Docs are updated to give examples of how to do this. Also fixed a silly typo in the test script. Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- src/doc/oiiotool.rst | 30 ++++++++++++++++++------- src/oiiotool/oiiotool.cpp | 3 +++ testsuite/oiiotool-subimage/ref/out.txt | 12 ++++++++-- testsuite/oiiotool-subimage/run.py | 6 +++-- 4 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/doc/oiiotool.rst b/src/doc/oiiotool.rst index d7b0f0fdd8..ebbf0f0253 100644 --- a/src/doc/oiiotool.rst +++ b/src/doc/oiiotool.rst @@ -868,11 +868,17 @@ Split a multi-image file into separate files -------------------------------------------- Take a multi-image TIFF file, split into its constituent subimages and -output each one to a different file, with names `sub0001.tif`, -`sub0002.tif`, etc.:: +output each one to a different file, with names `sub.0001.tif`, +`sub.0002.tif`, etc.:: - oiiotool multi.tif -sisplit -o:all=1 sub%04d.tif + oiiotool multi.tif -sisplit -o:all=1 sub.%04d.tif +Take a multi-image OpenEXR file (called "multi-part" in OpenEXR parlance), +split into its constituent subimages and output each one to a different file, +with names `sub.beauty.exr`, `sub.albedo.exr`, etc., using the name of each +subimage according to its metadata:: + + oiiotool multi.exr -sisplit -o:all=1 "sub.{TOP.'oiio:subimagename'}.exr" | @@ -1498,17 +1504,25 @@ Writing images Output all images currently on the stack using a pattern. See further explanation below. - The `all=n` option causes *all* images on the image stack to be output, - with the filename argument used as a pattern assumed to contain a `%d`, - which will be substituted with the index of the image (beginning with - *n*). For example, to take a multi-image TIFF and extract all the - subimages and save them as separate files:: + The `all=n` option causes *all* images on the image stack to be output. If + the *filename* argument contains expression substitution notation, the + substitution will be re-evaluated for each image output. Also, if the + *filename* argument contains a `%d`, that will be substituted with the + index of the image (beginning with *n*). For example, to take a + multi-image TIFF and extract all the subimages and save them as separate + files:: oiiotool multi.tif -sisplit -o:all=1 sub%04d.tif This will output the subimges as separate files `sub0001.tif`, `sub0002.tif`, and so on. + Expression substitution can be used to insert the subimage name + into each filename:: + + oiiotool multi.tif -sisplit -o:all=1 "sub.{TOP.'oiio:subimagename'}.tif" + + .. option:: -otex -oenv diff --git a/src/oiiotool/oiiotool.cpp b/src/oiiotool/oiiotool.cpp index 1416231118..cdb30e7d87 100644 --- a/src/oiiotool/oiiotool.cpp +++ b/src/oiiotool/oiiotool.cpp @@ -5556,6 +5556,9 @@ output_file(Oiiotool& ot, cspan argv) remove_all_cmd(newcmd); new_argv[0] = newcmd.c_str(); ImageRecRef saved_curimg = ot.curimg; // because we'll overwrite it + // Revert back to the UN-expression-substituted filename. It will get + // expression substitution in the subsequent call to output_file. + filename = argv[1]; for (int i = 0; i < nimages; ++i) { if (i < nimages - 1) ot.curimg = ot.image_stack[i]; diff --git a/testsuite/oiiotool-subimage/ref/out.txt b/testsuite/oiiotool-subimage/ref/out.txt index ac5f1689a5..bea9addee5 100644 --- a/testsuite/oiiotool-subimage/ref/out.txt +++ b/testsuite/oiiotool-subimage/ref/out.txt @@ -1,5 +1,13 @@ -Reading gpgr.exr -gpgr.exr : 64 x 64, 3 channel, half openexr +subimage.layerA.exr : 64 x 64, 3 channel, half openexr + SHA-1: 0C27059220A256F197900FB4EB8C7CF63349A26B +subimage.layerB.exr : 64 x 64, 3 channel, half openexr + SHA-1: 0E19BEFEF868E356A6A4C6450DA9A7B17DD11E12 +subimage.layerC.exr : 64 x 64, 3 channel, half openexr + SHA-1: CFAF4AFC253320AC35B8E9014C6D750768354059 +subimage.layerD.exr : 64 x 64, 3 channel, half openexr + SHA-1: 5FFA4616F46509627873D2C53744E47E2F492719 +Reading jpgr.exr +jpgr.exr : 64 x 64, 3 channel, half openexr 4 subimages: 64x64 [h,h,h], 64x64 [h,h,h], 64x64 [h,h,h], 64x64 [h,h,h] subimage 0: 64 x 64, 3 channel, half openexr SHA-1: 0C27059220A256F197900FB4EB8C7CF63349A26B diff --git a/testsuite/oiiotool-subimage/run.py b/testsuite/oiiotool-subimage/run.py index 98778300c3..2d00cf8c6c 100755 --- a/testsuite/oiiotool-subimage/run.py +++ b/testsuite/oiiotool-subimage/run.py @@ -24,10 +24,12 @@ command += oiiotool ("subimages-4.exr --subimage 3 -o subimageD3.exr") command += oiiotool ("subimages-4.exr --subimage layerB -o subimageB1.exr") command += oiiotool ("subimages-2.exr --sisplit -o:all=1 subimage%d.exr") +command += oiiotool ("subimages-4.exr --sisplit -o:all=1 \"subimage.{TOP.'oiio:subimagename'}.exr\"") +command += info_command ("subimage.layerA.exr subimage.layerB.exr subimage.layerC.exr subimage.layerD.exr", verbose=False) # test that we can set attributes on individual subimages -command += oiiotool ("subimages-4.exr --attrib:subimages=0 Beatle John --attrib:subimages=1 Beatle Paul --attrib:subimages=2 Beatle George --attrib:subimages=3 Beatle Ringo -o gpgr.exr") -command += info_command ("-a -v gpgr.exr", safematch=1) +command += oiiotool ("subimages-4.exr --attrib:subimages=0 Beatle John --attrib:subimages=1 Beatle Paul --attrib:subimages=2 Beatle George --attrib:subimages=3 Beatle Ringo -o jpgr.exr") +command += info_command ("-a -v jpgr.exr", safematch=1) # Test extraction of MIP levels command += oiiotool ("../common/textures/grid.tx --selectmip 4 -o mip4.tif") From 5300edf518426b22c5f25b7eb0acad36782ccc44 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Tue, 9 Sep 2025 15:54:17 -0700 Subject: [PATCH 41/71] build: several OpenEXR and OpenJPH build related fixes (#4875) Original changes and goal: * Bump our "latest releases" CI tests to OpenEXR 3.4.0 * cleanup: dead guard removal for openexr -- our minimum OpenEXR release supports float vectors, so we don't need any `#if` guards for it anymore. * Fix warnings related to mixing Core and C++ library constants for H2J2K compression enums within a switch statement (only noticed on ARM Linux with Clang 18). But it seems that OpenEXR 3.4's auto-building of OpenJPH (to support exr's new h2j2k compression methods) revealed that our CI wasn't building and testing against OpenJPG as well as we thought. So: * Clean up some openjph API use and type mismatches * Suppress warnings on clang and recent gcc versions had with the OpenJPH headers and our use of them. * Fix our test scripts and reference output for the htj2k tests; I think maybe they weren't running at all before, and nad some incorrect file paths. Finally, * When no OpenEXR is found, update the auto-build version to 3.3.5. I wish I could go all the way to 3.4.0, but the OpenEXR 3.4.0 currently auto-builds OpenJPH in a way that (I think incorrectly) installs the OpenJPH components in ways that can overwrite or break existing installations. * Remove FindOpenJPH.cmake, the nomenclature clashes with the lowercase "openjph" used by the new OpenJPH exported cmake configs. * But those are only generated for OpenJPH >= 0.21.2, so make that our new minimum. (This only affects OIIO 3.1 and higher, so it's safe to do this.) --------- Signed-off-by: Larry Gritz Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 24 ++++---- INSTALL.md | 2 + src/build-scripts/build_openexr.bash | 2 +- src/cmake/build_OpenEXR.cmake | 2 +- src/cmake/externalpackages.cmake | 2 +- src/cmake/modules/FindOpenJPH.cmake | 57 ------------------- src/jpeg2000.imageio/jpeg2000input.cpp | 36 +++++++----- src/jpeg2000.imageio/jpeg2000output.cpp | 8 ++- src/openexr.imageio/exrinput.cpp | 13 +---- src/openexr.imageio/exrinput_c.cpp | 1 - testsuite/htj2k/ref/out.txt | 6 +- testsuite/htj2k/run.py | 6 +- .../ref/out.err-alt3-exr33.txt | 4 ++ 13 files changed, 59 insertions(+), 104 deletions(-) delete mode 100644 src/cmake/modules/FindOpenJPH.cmake create mode 100644 testsuite/oiiotool-readerror/ref/out.err-alt3-exr33.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4575b84db0..10f291d66b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -420,7 +420,7 @@ jobs: cxx_std: 20 fmt_ver: 11.2.0 opencolorio_ver: v2.4.2 - openexr_ver: v3.4-alpha + openexr_ver: v3.4.0 pybind11_ver: v3.0.0 python_ver: "3.12" simd: avx2,f16c @@ -511,44 +511,44 @@ jobs: depcmds: | sudo rm -rf /usr/local/include/OpenEXR sudo rm -rf /usr/local/lib64/cmake/{IlmBase,OpenEXR} - - desc: Linux ARM latest releases gcc14 C++20 py3.12 exr3.3 ocio2.4 + - desc: Linux ARM latest releases gcc14 C++20 py3.12 exr3.4 ocio2.4 nametag: linux-arm-latest-releases runner: ubuntu-24.04-arm cc_compiler: gcc-14 cxx_compiler: g++-14 cxx_std: 20 - fmt_ver: 11.1.4 + fmt_ver: 11.2.0 opencolorio_ver: v2.4.2 - openexr_ver: v3.3.3 + openexr_ver: v3.4.0 pybind11_ver: v3.0.0 python_ver: "3.12" - setenvs: export LIBJPEGTURBO_VERSION=3.1.0 - LIBRAW_VERSION=0.21.3 + setenvs: export LIBJPEGTURBO_VERSION=3.1.1 + LIBRAW_VERSION=0.21.4 LIBTIFF_VERSION=v4.7.0 OPENJPEG_VERSION=v2.5.3 PTEX_VERSION=v2.4.3 PUGIXML_VERSION=v1.15 - WEBP_VERSION=v1.5.0 + WEBP_VERSION=v1.6.0 FREETYPE_VERSION=VER-2-13-3 USE_OPENVDB=0 - - desc: Linux ARM latest releases clang18 C++20 py3.12 exr3.3 ocio2.4 + - desc: Linux ARM latest releases clang18 C++20 py3.12 exr3.4 ocio2.4 nametag: linux-arm-latest-releases-clang runner: ubuntu-24.04-arm cc_compiler: clang-18 cxx_compiler: clang++-18 cxx_std: 20 - fmt_ver: 11.1.4 + fmt_ver: 11.2.0 opencolorio_ver: v2.4.2 - openexr_ver: v3.3.3 + openexr_ver: v3.4.0 pybind11_ver: v3.0.0 python_ver: "3.12" setenvs: export LIBJPEGTURBO_VERSION=3.1.0 - LIBRAW_VERSION=0.21.3 + LIBRAW_VERSION=0.21.4 LIBTIFF_VERSION=v4.7.0 OPENJPEG_VERSION=v2.5.3 PTEX_VERSION=v2.4.3 PUGIXML_VERSION=v1.15 - WEBP_VERSION=v1.5.0 + WEBP_VERSION=v1.6.0 FREETYPE_VERSION=VER-2-13-3 USE_OPENVDB=0 diff --git a/INSTALL.md b/INSTALL.md index 7c5abc63b3..9a1c32b831 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -80,6 +80,8 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * libjxl >= 0.10.1 (tested through 0.11.1) * If you want support for "Ultra HDR" inside JPEG images: * libuhdr >= 1.3 (tested through 1.4) + * If you want support for j2c files: + * OpenJPH >= 0.21 (tested through 0.22) * We use PugiXML for XML parsing. There is a version embedded in the OIIO tree, but if you want to use an external, system-installed version (as may be required by some software distributions with policies against diff --git a/src/build-scripts/build_openexr.bash b/src/build-scripts/build_openexr.bash index 64c03623b4..1f7eb9ddda 100755 --- a/src/build-scripts/build_openexr.bash +++ b/src/build-scripts/build_openexr.bash @@ -11,7 +11,7 @@ set -ex # Which OpenEXR to retrieve, how to build it OPENEXR_REPO=${OPENEXR_REPO:=https://github.com/AcademySoftwareFoundation/openexr.git} -OPENEXR_VERSION=${OPENEXR_VERSION:=v3.2.4} +OPENEXR_VERSION=${OPENEXR_VERSION:=v3.3.5} # Where to install the final results LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext} diff --git a/src/cmake/build_OpenEXR.cmake b/src/cmake/build_OpenEXR.cmake index 849716fb8d..190e48ddf1 100644 --- a/src/cmake/build_OpenEXR.cmake +++ b/src/cmake/build_OpenEXR.cmake @@ -3,7 +3,7 @@ # https://github.com/AcademySoftwareFoundation/OpenImageIO -set_cache (OpenEXR_BUILD_VERSION 3.2.4 "OpenEXR version for local builds") +set_cache (OpenEXR_BUILD_VERSION 3.3.5 "OpenEXR version for local builds") set (OpenEXR_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenEXR") set (OpenEXR_GIT_TAG "v${OpenEXR_BUILD_VERSION}") set_cache (OpenEXR_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake index 753940d401..fc9cfc48dc 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -176,7 +176,7 @@ checked_find_package (OpenJPEG VERSION_MIN 2.0 # Note: Recent OpenJPEG versions have exported cmake configs, but we don't # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. -checked_find_package (OpenJPH VERSION_MIN 0.21) +checked_find_package (openjph VERSION_MIN 0.21.2) checked_find_package (OpenVDB VERSION_MIN 9.0 diff --git a/src/cmake/modules/FindOpenJPH.cmake b/src/cmake/modules/FindOpenJPH.cmake deleted file mode 100644 index 4e6ea4a17b..0000000000 --- a/src/cmake/modules/FindOpenJPH.cmake +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright Contributors to the OpenImageIO project. -# SPDX-License-Identifier: Apache-2.0 -# https://github.com/AcademySoftwareFoundation/OpenImageIO - -# Module to find OPENJPH. -# -# This module will first look into the directories defined by the variables: -# - OPENJPH_ROOT -# -# This module defines the following variables: -# -# OPENJPH_INCLUDES - where to find ojph_arg.h -# OPENJPH_LIBRARIES - list of libraries to link against when using OPENJPH. -# OPENJPH_FOUND - True if OPENJPH was found. -# OPENJPH_VERSION - Set to the OPENJPH version found -include (FindPackageHandleStandardArgs) -include (FindPackageMessage) -include (SelectLibraryConfigurations) - -if(DEFINED OPENJPH_ROOT) - set(_openjph_pkgconfig_path "${OPENJPH_ROOT}/lib/pkgconfig") - if(EXISTS "${_openjph_pkgconfig_path}") - set(ENV{PKG_CONFIG_PATH} "${_openjph_pkgconfig_path}:$ENV{PKG_CONFIG_PATH}") - endif() -endif() - - -find_package(PkgConfig QUIET) -if(PKG_CONFIG_FOUND) - pkg_check_modules(OPENJPH_PC QUIET openjph) -endif() - -if(OPENJPH_PC_FOUND) - set(OPENJPH_FOUND TRUE) - set(OPENJPH_VERSION ${OPENJPH_PC_VERSION}) - set(OPENJPH_INCLUDES ${OPENJPH_PC_INCLUDE_DIRS}) - set(OPENJPH_LIBRARY_DIRS ${OPENJPH_PC_LIBDIR}) - set(OPENJPH_LIBRARIES ${OPENJPH_PC_LIBRARIES}) - - if(NOT OPENJPH_FIND_QUIETLY) - FIND_PACKAGE_MESSAGE(OPENJPH - "Found OPENJPH via pkg-config: v${OPENJPH_VERSION} ${OPENJPH_LIBRARIES}" - "[${OPENJPH_INCLUDES}][${OPENJPH_LIBRARIES}]" - ) - endif() -else() - set(OPENJPH_FOUND FALSE) - set(OPENJPH_VERSION 0.0.0) - set(OPENJPH_INCLUDES "") - set(OPENJPH_LIBRARIES "") - if(NOT OPENJPH_FIND_QUIETLY) - FIND_PACKAGE_MESSAGE(OPENJPH - "Could not find OPENJPH via pkg-config" - "[${OPENJPH_INCLUDES}][${OPENJPH_LIBRARIES}]" - ) - endif() -endif() \ No newline at end of file diff --git a/src/jpeg2000.imageio/jpeg2000input.cpp b/src/jpeg2000.imageio/jpeg2000input.cpp index b68b48cd0e..871c295c4e 100644 --- a/src/jpeg2000.imageio/jpeg2000input.cpp +++ b/src/jpeg2000.imageio/jpeg2000input.cpp @@ -18,7 +18,10 @@ #ifdef USE_OPENJPH # include # include +OIIO_PRAGMA_WARNING_PUSH +OIIO_GCC_PRAGMA(GCC diagnostic ignored "-Wdelete-incomplete") # include +OIIO_PRAGMA_WARNING_POP # include # include #endif @@ -273,7 +276,13 @@ class jph_infile : public ojph::infile_base { return ioproxy->seek(offset, origin); } ojph::si64 tell() { return ioproxy->tell(); }; - bool eof() { return ioproxy->tell() == ioproxy->size(); } + bool eof() + { + int64_t pos = ioproxy->tell(); + if (pos < 0) + return false; // Error condition, not EOF + return pos == static_cast(ioproxy->size()); + } void close() { ioproxy->close(); @@ -385,17 +394,16 @@ Jpeg2000Input::ojph_read_image() // We are going to read the whole image into the buffer, since with openjph // its hard to easily grab part of the image. if (codestream.is_planar()) { - for (ojph::ui32 c = 0; c < ch; ++c) - - for (ojph::ui32 i = 0; i < h; ++i) { + for (int c = 0; c < ch; ++c) + for (int i = 0; i < h; ++i) { ojph::ui32 comp_num; ojph::line_buf* line = codestream.pull(comp_num); const ojph::si32* sp = line->i32; - assert(comp_num == c); + OIIO_DASSERT(int(comp_num) == c); if (m_spec.format == TypeDesc::UCHAR) { unsigned char* dout = &m_buf[i * w * ch]; dout += c; - for (ojph::ui32 j = w; j > 0; j--, dout += ch) { + for (int j = w; j > 0; j--, dout += ch) { *dout = *sp++; } } @@ -403,24 +411,23 @@ Jpeg2000Input::ojph_read_image() unsigned short* dout = (unsigned short*)&m_buf[buffer_bpp * (i * w * ch)]; dout += c; - for (ojph::ui32 j = w; j > 0; j--, dout += ch) { + for (int j = w; j > 0; j--, dout += ch) { *dout = bit_range_convert(*sp++, file_bit_depth, buffer_bpp * 8); } } } - } else { - for (ojph::ui32 i = 0; i < h; ++i) { - for (ojph::ui32 c = 0; c < ch; ++c) { + for (int i = 0; i < h; ++i) { + for (int c = 0; c < ch; ++c) { ojph::ui32 comp_num; ojph::line_buf* line = codestream.pull(comp_num); const ojph::si32* sp = line->i32; - assert(comp_num == c); + OIIO_DASSERT(int(comp_num) == c); if (m_spec.format == TypeDesc::UCHAR) { unsigned char* dout = &m_buf[i * w * ch]; dout += c; - for (ojph::ui32 j = w; j > 0; j--, dout += ch) { + for (int j = w; j > 0; j--, dout += ch) { *dout = *sp++; } } @@ -428,7 +435,7 @@ Jpeg2000Input::ojph_read_image() unsigned short* dout = (unsigned short*)&m_buf[buffer_bpp * (i * w * ch)]; dout += c; - for (ojph::ui32 j = w; j > 0; j--, dout += ch) { + for (int j = w; j > 0; j--, dout += ch) { *dout = bit_range_convert(*sp++, file_bit_depth, buffer_bpp * 8); } @@ -480,6 +487,9 @@ Jpeg2000Input::open(const std::string& name, ImageSpec& p_spec) jph_infile* jphinfile = new jph_infile(ioproxy()); ojph_reader = true; ojph::message_error* default_error = ojph::get_error(); + // Disable the default OpenJPH error stream to prevent unwanted error output. + // Errors will be handled by the custom error handler (Oiio_Reader_Error_handler) configured below. + ojph::set_error_stream(nullptr); try { Oiio_Reader_Error_handler error_handler(default_error); diff --git a/src/jpeg2000.imageio/jpeg2000output.cpp b/src/jpeg2000.imageio/jpeg2000output.cpp index f5af21f473..869f663e6d 100644 --- a/src/jpeg2000.imageio/jpeg2000output.cpp +++ b/src/jpeg2000.imageio/jpeg2000output.cpp @@ -27,7 +27,10 @@ # include # include # include +OIIO_PRAGMA_WARNING_PUSH +OIIO_GCC_PRAGMA(GCC diagnostic ignored "-Wdelete-incomplete") # include +OIIO_PRAGMA_WARNING_POP # include #endif @@ -760,8 +763,9 @@ Jpeg2000Output::create_jph_image() siz.set_num_components(m_spec.nchannels); ojph::point subsample(1, 1); // Default subsample - for (ojph::ui32 c = 0; c < m_spec.nchannels; ++c) - siz.set_component(c, subsample, output_depth, is_signed); + for (int c = 0; c < m_spec.nchannels; ++c) + siz.set_component(static_cast(c), subsample, output_depth, + is_signed); ojph::size tile_size(0, 0); ojph::point tile_offset(0, 0); diff --git a/src/openexr.imageio/exrinput.cpp b/src/openexr.imageio/exrinput.cpp index dbd6cddba5..09913c0319 100644 --- a/src/openexr.imageio/exrinput.cpp +++ b/src/openexr.imageio/exrinput.cpp @@ -41,10 +41,8 @@ OIIO_GCC_PRAGMA(GCC diagnostic ignored "-Wunused-parameter") #include #include #include +#include #include -#if OPENEXR_HAS_FLOATVECTOR -# include -#endif #include #include #include @@ -432,10 +430,10 @@ OpenEXRInput::PartInfo::parse_header(OpenEXRInput* in, case Imf::DWAA_COMPRESSION: comp = "dwaa"; break; case Imf::DWAB_COMPRESSION: comp = "dwab"; break; #ifdef IMF_HTJ2K256_COMPRESSION - case EXR_COMPRESSION_HTJ2K256: comp = "htj2k256"; break; + case Imf::HTJ2K256_COMPRESSION: comp = "htj2k256"; break; #endif #ifdef IMF_HTJ2K32_COMPRESSION - case EXR_COMPRESSION_HTJ2K32: comp = "htj2k32"; break; + case Imf::HTJ2K32_COMPRESSION: comp = "htj2k32"; break; #endif default: break; } @@ -459,9 +457,7 @@ OpenEXRInput::PartInfo::parse_header(OpenEXRInput* in, const Imf::KeyCodeAttribute* kcattr; const Imf::ChromaticitiesAttribute* crattr; const Imf::RationalAttribute* rattr; -#if OPENEXR_HAS_FLOATVECTOR const Imf::FloatVectorAttribute* fvattr; -#endif const Imf::StringVectorAttribute* svattr; const Imf::DoubleAttribute* dattr; const Imf::V2dAttribute* v2dattr; @@ -529,8 +525,6 @@ OpenEXRInput::PartInfo::parse_header(OpenEXRInput* in, ustrvec[i] = strvec[i]; TypeDesc sv(TypeDesc::STRING, ustrvec.size()); spec.attribute(oname, sv, &ustrvec[0]); -#if OPENEXR_HAS_FLOATVECTOR - } else if (type == "floatvector" && (fvattr = header->findTypedAttribute( @@ -538,7 +532,6 @@ OpenEXRInput::PartInfo::parse_header(OpenEXRInput* in, std::vector fvec = fvattr->value(); TypeDesc fv(TypeDesc::FLOAT, fvec.size()); spec.attribute(oname, fv, &fvec[0]); -#endif } else if (type == "double" && (dattr = header->findTypedAttribute( name))) { diff --git a/src/openexr.imageio/exrinput_c.cpp b/src/openexr.imageio/exrinput_c.cpp index 9b72a2891d..44609173bf 100644 --- a/src/openexr.imageio/exrinput_c.cpp +++ b/src/openexr.imageio/exrinput_c.cpp @@ -629,7 +629,6 @@ OpenEXRCoreInput::PartInfo::parse_header(OpenEXRCoreInput* in, case EXR_ATTR_FLOAT_VECTOR: { TypeDesc fv(TypeDesc::FLOAT, (size_t)attr->floatvector->length); spec.attribute(oname, fv, attr->floatvector->arr); - break; } diff --git a/testsuite/htj2k/ref/out.txt b/testsuite/htj2k/ref/out.txt index 84204b12c8..ef3176dd3a 100644 --- a/testsuite/htj2k/ref/out.txt +++ b/testsuite/htj2k/ref/out.txt @@ -1,6 +1,6 @@ -Comparing "../../../../../../../Volumes/git/OpenImageIO/build/testsuite/oiio-images/tahoe-gps.jpg" and "test.j2c" +Comparing "../oiio-images/tahoe-gps.jpg" and "test.j2c" PASS -Comparing "../../../../../../../Volumes/git/OpenImageIO/build/testsuite/oiio-images/dpx_nuke_10bits_rgb.dpx" and "testdpx.j2c" +Comparing "../oiio-images/dpx/dpx_nuke_10bits_rgb.dpx" and "testdpx.j2c" PASS -Comparing "../../../../../../../Volumes/git/OpenImageIO/build/testsuite/oiio-images/tahoe-gps.jpg" and "testcompress.j2c" +Comparing "../oiio-images/tahoe-gps.jpg" and "testcompress.j2c" PASS diff --git a/testsuite/htj2k/run.py b/testsuite/htj2k/run.py index 006174e482..4d34433685 100644 --- a/testsuite/htj2k/run.py +++ b/testsuite/htj2k/run.py @@ -13,13 +13,13 @@ command += diff_command(OIIO_TESTSUITE_IMAGEDIR+"/tahoe-gps.jpg", "test.j2c") -command += oiiotool(OIIO_TESTSUITE_IMAGEDIR+"/dpx_nuke_10bits_rgb.dpx" +command += oiiotool(OIIO_TESTSUITE_IMAGEDIR+"/dpx/dpx_nuke_10bits_rgb.dpx" " -o testdpx.j2c") -command += diff_command(OIIO_TESTSUITE_IMAGEDIR+"/dpx_nuke_10bits_rgb.dpx", "testdpx.j2c") +command += diff_command(OIIO_TESTSUITE_IMAGEDIR+"/dpx/dpx_nuke_10bits_rgb.dpx", "testdpx.j2c") command += oiiotool(OIIO_TESTSUITE_IMAGEDIR+"/tahoe-gps.jpg" " --attrib qstep 0.03 -o testcompress.j2c") -command += diff_command(OIIO_TESTSUITE_IMAGEDIR+"/tahoe-gps.jpg", "testcompress.j2c", extraargs="-fail 0.11") \ No newline at end of file +command += diff_command(OIIO_TESTSUITE_IMAGEDIR+"/tahoe-gps.jpg", "testcompress.j2c", extraargs="-fail 0.11") diff --git a/testsuite/oiiotool-readerror/ref/out.err-alt3-exr33.txt b/testsuite/oiiotool-readerror/ref/out.err-alt3-exr33.txt new file mode 100644 index 0000000000..eb3360aa93 --- /dev/null +++ b/testsuite/oiiotool-readerror/ref/out.err-alt3-exr33.txt @@ -0,0 +1,4 @@ +src/incomplete.exr: (EXR_ERR_BAD_CHUNK_LEADER) Preparing to read scanline 125 (chunk 125), found corrupt leader: packed size 220, file offset 12254, size 12288 +oiiotool ERROR: read : "src/incomplete.exr": Failed OpenEXR read: Unable to query scanline information +Full command line was: +> oiiotool src/incomplete.exr -o out.exr From 4405685dd53b995accebe22b2224a1a107a74a8a Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Thu, 11 Sep 2025 16:26:16 -0700 Subject: [PATCH 42/71] ci: Test freetype 2.14 and document that it works (#4876) Freetype 2.14 was recently released and just became the default for homebrew. It seems that no changes are needed on our end and no output references even need to change! Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 6 +++--- INSTALL.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10f291d66b..197dd8480b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -431,7 +431,7 @@ jobs: PTEX_VERSION=v2.4.3 PUGIXML_VERSION=v1.15 WEBP_VERSION=v1.6.0 - FREETYPE_VERSION=VER-2-13-3 + FREETYPE_VERSION=VER-2-14-0 USE_OPENVDB=0 - desc: bleeding edge gcc14 C++23 py3.12 OCIO/libtiff/exr-main avx2 nametag: linux-bleeding-edge @@ -529,7 +529,7 @@ jobs: PTEX_VERSION=v2.4.3 PUGIXML_VERSION=v1.15 WEBP_VERSION=v1.6.0 - FREETYPE_VERSION=VER-2-13-3 + FREETYPE_VERSION=VER-2-14-0 USE_OPENVDB=0 - desc: Linux ARM latest releases clang18 C++20 py3.12 exr3.4 ocio2.4 nametag: linux-arm-latest-releases-clang @@ -549,7 +549,7 @@ jobs: PTEX_VERSION=v2.4.3 PUGIXML_VERSION=v1.15 WEBP_VERSION=v1.6.0 - FREETYPE_VERSION=VER-2-13-3 + FREETYPE_VERSION=VER-2-14-0 USE_OPENVDB=0 diff --git a/INSTALL.md b/INSTALL.md index 9a1c32b831..dbb89247ae 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -73,7 +73,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * If you want support for Ptex: * Ptex >= 2.3.1 (probably works for older; tested through 2.4.3) * If you want to be able to do font rendering into images: - * Freetype >= 2.10.0 (tested through 2.13) + * Freetype >= 2.10.0 (tested through 2.14) * If you want to be able to read "ultra-HDR" embedded in JPEG files: * libultrahdr >= 1.3 (tested through 1.4) * If you want support for JPEG XL images: From db809dd12e8a126be315e05b0401d7bc4489e504 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Sat, 13 Sep 2025 16:10:56 -0400 Subject: [PATCH 43/71] feat: CICP metadata support for PNG (#4746) This PR addresses the primary concern of #4678 -- implement support for reading and writing the `cICP` chunk for PNGs. CICP (Coding Independent Code Points) is a means for using a tuple of integers to communicate characteristics of a variety of, traditionally, video encodings. The tuple is a series of four values that map to integer enumerations (codified in [ITU-T H.273](https://www.itu.int/rec/T-REC-H.273-202407-I/en)) representing a certain ColourPrimaries, TransferCharacteristics, and MatrixCoefficients, as well as a VideoFullRangeFlag. In particular, CICP is used for describing HDR encodings to browsers and image viewers capable of displaying the image as intended. For example, if one were to write P3-D65 PQ-encoded RGB values to a PNG, it will only look "correct" if there's an appropriate `cICP` chunk describing the primaries (14) and transfer function (16); without such metadata, PQ-encoded images will appear significantly darker and lower in contrast. Internally, CICP metadata is stored in a `int[4]` type `CICP` ImageSpec attribute. This PR adds the following: - An oiiotool `--cicp` flag for setting, modifying, or removing CICP metadata for the top image - Methods for reading and writing PNG `cICP` chunk metadata <--> ImageSpec `CICP` - Tests I've included tests. I've also embedded CICP metadata in the existing 16-bit test png in the testsuite. But to see what this is all about with your own eyes, you can quickly convert a scene-linear AP0-encoded EXR to a PQ-encoded P3D65 HDR PNG with the following command: `$ oiiotool -i input_linap0.exr --ociodisplay:from=ACES2065-1 "ST2084-P3-D65 - Display" "ACES 1.1 - HDR Video (1000 nits & P3 lim)" --cicp "12,16,0,1" -o output_p3d65pq.png` If you compare in a capable image viewer on a capable display the image produced with the above command compared to another one that lacks CICP metadata, you should see a pretty significant difference: `$ oiiotool -i output_p3d65pq.png --cicp "" -o output_no_cicp.png` ("Preview" on a ~5 year old Macbook should suffice). --------- Signed-off-by: Zach Lewis --- src/doc/oiiotool.rst | 9 ++++ src/doc/stdmetadata.rst | 11 +++++ src/include/OpenImageIO/imageio.h | 6 +++ src/libOpenImageIO/formatspec.cpp | 2 + src/oiiotool/oiiotool.cpp | 57 +++++++++++++++++++++++++ src/png.imageio/png_pvt.h | 31 ++++++++++++-- src/png.imageio/pnginput.cpp | 9 +++- src/png.imageio/pngoutput.cpp | 3 ++ testsuite/png/ref/out-libpng15.txt | 16 +++++++ testsuite/png/ref/out.txt | 13 ++++++ testsuite/png/ref/test16.png | Bin 1317 -> 1334 bytes testsuite/png/run.py | 12 +++++- testsuite/python-imagespec/ref/out.txt | 13 +++--- 13 files changed, 171 insertions(+), 11 deletions(-) diff --git a/src/doc/oiiotool.rst b/src/doc/oiiotool.rst index ebbf0f0253..f7decdafc1 100644 --- a/src/doc/oiiotool.rst +++ b/src/doc/oiiotool.rst @@ -4690,6 +4690,15 @@ will be printed with the command `oiiotool --colorconfiginfo`. This was added to OpenImageIO 2.5. +.. option:: --cicp ,,, + + The `--cicp` command adds, modifies, or removes a `"CICP"` attribute + belonging to the top image, stored as an array of four integers. + The integers represent, in order, the color primaries, transfer + function, color matrix (for YUV colorspaces), and + video-full-range-flag. + + This was added to OpenImageIO 3.1. | diff --git a/src/doc/stdmetadata.rst b/src/doc/stdmetadata.rst index 0e70f8315c..646d348355 100644 --- a/src/doc/stdmetadata.rst +++ b/src/doc/stdmetadata.rst @@ -164,6 +164,17 @@ Color information window that are not overlapping the pixel data window. If not supplied, the default is black (0 in all channels). +.. option:: "CICP" : int[4] + + The CICP color space information, as defined by + `ITU-T H.273 `_. This is an array + of four integers, with the following meanings: + + - `[0]` : color primaries + - `[1]` : transfer characteristics + - `[2]` : matrix coefficients + - `[3]` : full range flag + .. option:: "ICCProfile" : uint8[] "ICCProfile:...various..." : ...various types... diff --git a/src/include/OpenImageIO/imageio.h b/src/include/OpenImageIO/imageio.h index 20d40e98df..f7576a2060 100644 --- a/src/include/OpenImageIO/imageio.h +++ b/src/include/OpenImageIO/imageio.h @@ -1087,6 +1087,9 @@ class OIIO_API ImageInput { /// - `"exif"` : /// Can this format store Exif camera data? /// + /// - `"cicp"` : + /// Does this format support embedding CICP metadata? + /// /// - `"ioproxy"` : /// Does this format reader support reading from an `IOProxy`? /// @@ -2527,6 +2530,9 @@ class OIIO_API ImageOutput { /// Does this format allow 0x0 sized images, i.e. an image file /// with metadata only and no pixels? /// + /// - `"cicp"` : + /// Does this format support embedding CICP metadata? + /// /// This list of queries may be extended in future releases. Since this /// can be done simply by recognizing new query strings, and does not /// require any new API entry points, addition of support for new diff --git a/src/libOpenImageIO/formatspec.cpp b/src/libOpenImageIO/formatspec.cpp index 3bb9226eaa..ec317e0f14 100644 --- a/src/libOpenImageIO/formatspec.cpp +++ b/src/libOpenImageIO/formatspec.cpp @@ -1295,6 +1295,8 @@ void ImageSpec::set_colorspace(string_view colorspace) { ColorConfig::default_colorconfig().set_colorspace(*this, colorspace); + // Invalidate potentially contradictory metadata + erase_attribute("CICP"); } diff --git a/src/oiiotool/oiiotool.cpp b/src/oiiotool/oiiotool.cpp index cdb30e7d87..bf75e18870 100644 --- a/src/oiiotool/oiiotool.cpp +++ b/src/oiiotool/oiiotool.cpp @@ -2248,6 +2248,60 @@ icc_read(Oiiotool& ot, cspan argv) } +// Set, modify, or remove the top image's CICP (ITU-T H.273) metadata. +class OpSetCICP final : public OiiotoolOp { +public: + OpSetCICP(Oiiotool& ot, string_view opname, cspan argv) + : OiiotoolOp(ot, opname, argv, 1) + { + inplace(true); // This action operates in-place + cicp = args(1); + } + OpSetCICP(Oiiotool& ot, string_view opname, int argc, const char* argv[]) + : OpSetCICP(ot, opname, { argv, span_size_t(argc) }) + { + } + bool setup() override + { + ir(0)->metadata_modified(true); + return true; + } + bool impl(span img) override + { + // Because this is an in-place operation, img[0] is the same as + // img[1]. + if (cicp.empty()) { + img[0]->specmod().erase_attribute("CICP"); + return true; + } + std::vector vals { 0, 0, 0, 1 }; + auto p = img[0]->spec().find_attribute("CICP", + TypeDesc(TypeDesc::INT, 4)); + if (p) { + const int* existing = static_cast(p->data()); + for (int i = 0; i < 4; ++i) + vals[i] = existing[i]; + } + Strutil::extract_from_list_string(vals, cicp); + img[0]->specmod().attribute("CICP", TypeDesc(TypeDesc::INT, 4), + vals.data()); + return true; + } + +private: + string_view cicp; +}; + + +// --cicp +static void +action_cicp(Oiiotool& ot, cspan argv) +{ + OpSetCICP op(ot, "cicp", argv); + op(); +} + + // --colorconfig static void @@ -7176,6 +7230,9 @@ Oiiotool::getargs(int argc, char* argv[]) ap.arg("--iccread %s:FILENAME") .help("Add the contents of the file to the top image as its ICC profile") .OTACTION(icc_read); + ap.arg("--cicp %s:CICP") + .help("Set or modifiy CICP metadata for supporting output formats (e.g., \"12,16,0,1\")") //; selectively persist existing values if not specified (e.g., \",,,0\")") + .OTACTION(action_cicp); // clang-format on if (ap.parse_args(argc, (const char**)argv) < 0) { diff --git a/src/png.imageio/png_pvt.h b/src/png.imageio/png_pvt.h index 659a8e045b..a6a7c06609 100644 --- a/src/png.imageio/png_pvt.h +++ b/src/png.imageio/png_pvt.h @@ -40,7 +40,7 @@ For further information see the following mailing list threads: OIIO_PLUGIN_NAMESPACE_BEGIN #define ICC_PROFILE_ATTR "ICCProfile" - +#define CICP_ATTR "CICP" namespace PNG_pvt { @@ -224,7 +224,7 @@ read_info(png_structp& sp, png_infop& ip, int& bit_depth, int& color_type, int srgb_intent; double gamma = 0.0; if (png_get_sRGB(sp, ip, &srgb_intent)) { - spec.set_colorspace("srgb_rec709_scene"); + spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); } else if (png_get_gAMA(sp, ip, &gamma) && gamma > 0.0) { // Round gamma to the nearest hundredth to prevent stupid // precision choices and make it easier for apps to make @@ -235,7 +235,7 @@ read_info(png_structp& sp, png_infop& ip, int& bit_depth, int& color_type, set_colorspace_rec709_gamma(spec, g); } else { // If there's no info at all, assume sRGB. - set_colorspace(spec, "srgb_rec709_scene"); + spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); } if (png_get_valid(sp, ip, PNG_INFO_iCCP)) { @@ -326,6 +326,16 @@ read_info(png_structp& sp, png_infop& ip, int& bit_depth, int& color_type, interlace_type = png_get_interlace_type(sp, ip); +#ifdef PNG_cICP_SUPPORTED + { + png_byte pri = 0, trc = 0, mtx = 0, vfr = 0; + if (png_get_cICP(sp, ip, &pri, &trc, &mtx, &vfr)) { + int cicp[4] = { pri, trc, mtx, vfr }; + spec.attribute(CICP_ATTR, TypeDesc(TypeDesc::INT, 4), cicp); + } + } +#endif + #ifdef PNG_eXIf_SUPPORTED // Recent version of PNG and libpng (>= 1.6.32, I think) have direct // support for Exif chunks. Older versions don't support it, and I'm not @@ -713,6 +723,21 @@ write_info(png_structp& sp, png_infop& ip, int& color_type, ImageSpec& spec, (png_uint_32)(yres * scale), unittype); } +#ifdef PNG_cICP_SUPPORTED + const ParamValue* p = spec.find_attribute(CICP_ATTR, + TypeDesc(TypeDesc::INT, 4)); + if (p) { + const int* int_vals = static_cast(p->data()); + png_byte vals[4]; + for (int i = 0; i < 4; ++i) + vals[i] = static_cast(int_vals[i]); + if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) + return "Could not set PNG cICP chunk"; + // libpng will only write the chunk if the third byte is 0 + png_set_cICP(sp, ip, vals[0], vals[1], (png_byte)0, vals[3]); + } +#endif + #ifdef PNG_eXIf_SUPPORTED std::vector exifBlob; encode_exif(spec, exifBlob, endian::big); diff --git a/src/png.imageio/pnginput.cpp b/src/png.imageio/pnginput.cpp index 21ae6d91b4..0b875e6210 100644 --- a/src/png.imageio/pnginput.cpp +++ b/src/png.imageio/pnginput.cpp @@ -18,7 +18,14 @@ class PNGInput final : public ImageInput { const char* format_name(void) const override { return "png"; } int supports(string_view feature) const override { - return (feature == "ioproxy" || feature == "exif"); + return (feature == "ioproxy" +#ifdef PNG_eXIf_SUPPORTED + || feature == "exif" +#endif +#ifdef PNG_cICP_SUPPORTED + || feature == "cicp" +#endif + ); } bool valid_file(Filesystem::IOProxy* ioproxy) const override; bool open(const std::string& name, ImageSpec& newspec) override; diff --git a/src/png.imageio/pngoutput.cpp b/src/png.imageio/pngoutput.cpp index 1b5c2c3850..00e11947c9 100644 --- a/src/png.imageio/pngoutput.cpp +++ b/src/png.imageio/pngoutput.cpp @@ -24,6 +24,9 @@ class PNGOutput final : public ImageOutput { return (feature == "alpha" || feature == "ioproxy" #ifdef PNG_eXIf_SUPPORTED || feature == "exif" +#endif +#ifdef PNG_cICP_SUPPORTED + || feature == "cicp" #endif ); } diff --git a/testsuite/png/ref/out-libpng15.txt b/testsuite/png/ref/out-libpng15.txt index c0b9d66580..2c46ae17af 100644 --- a/testsuite/png/ref/out-libpng15.txt +++ b/testsuite/png/ref/out-libpng15.txt @@ -26,6 +26,10 @@ Reading exif.png exif.png : 64 x 64, 3 channel, uint8 png SHA-1: 7CB41FEA50720B48BE0C145E1473982B23E9AB77 channel list: R, G, B + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:FocalLength: 45.7 (45.7 mm) + Exif:WhiteBalance: 0 (auto) oiio:ColorSpace: "srgb_rec709_scene" alphagamma: 1 x 1, 4 channel, float png @@ -86,5 +90,17 @@ gimp_gradient: Monochrome: No smallalpha.png : 1 x 1, 4 channel, uint8 png Pixel (0, 0): 240 108 119 1 (0.94117653 0.42352945 0.4666667 0.003921569) +cicp: + 16 x 16, 4 channel, float png + channel list: R, G, B, A + oiio:ColorSpace: "srgb_rec709_scene" +removed_cicp: + 16 x 16, 4 channel, float png + channel list: R, G, B, A + oiio:ColorSpace: "srgb_rec709_scene" +remove_cicp_via_set_colorspace: + 16 x 16, 4 channel, float png + channel list: R, G, B, A + oiio:ColorSpace: "g22_rec709_display" Comparing "test16.png" and "ref/test16.png" PASS diff --git a/testsuite/png/ref/out.txt b/testsuite/png/ref/out.txt index fccb90cc61..49b9933234 100644 --- a/testsuite/png/ref/out.txt +++ b/testsuite/png/ref/out.txt @@ -90,5 +90,18 @@ gimp_gradient: Monochrome: No smallalpha.png : 1 x 1, 4 channel, uint8 png Pixel (0, 0): 240 108 119 1 (0.94117653 0.42352945 0.4666667 0.003921569) +cicp: + 16 x 16, 4 channel, float png + channel list: R, G, B, A + CICP: 1, 13, 0, 1 + oiio:ColorSpace: "srgb_rec709_scene" +removed_cicp: + 16 x 16, 4 channel, float png + channel list: R, G, B, A + oiio:ColorSpace: "srgb_rec709_scene" +remove_cicp_via_set_colorspace: + 16 x 16, 4 channel, float png + channel list: R, G, B, A + oiio:ColorSpace: "g22_rec709_display" Comparing "test16.png" and "ref/test16.png" PASS diff --git a/testsuite/png/ref/test16.png b/testsuite/png/ref/test16.png index bc7b6d986cc098ac9301c4dd112a12040f760aa7..0c1ff186ec83b0652a9b326ce8dbe383a7e5beac 100644 GIT binary patch delta 420 zcmZ3=wT)|naykP`vZr$ZBQFEvoJ?yY1_lPk;vjb?X7l5|!9Wg6x}&cn1H;CC?mvmF zK)ynLqiJ#!!Mvv!wUw6QUeBtR|yOZRx=nF#0%!^3bX;5BbOTCnda-u zpaoQPYNBCJfU%w-5E`VUmMK^%xHy|Q85&ra8k!h7x*1v;7+RW}m;eQhoeWLQTwECh8JK`(I011-dnN-5kY)tp7n4&Mtt`EqBg23k&U`nwVjv9xx3spM z1F}R)Tq8>IGc)t8obz+?i-HRhlT#T$-iy=q-aUCc Date: Sat, 13 Sep 2025 14:36:19 -0700 Subject: [PATCH 44/71] feat(webp): Support reading/writing the ICCProfile attribute (#4878) Enable ICCProfile attribute support for WEBP for both input and output. Like other formats this support is passive; pixel data will not be altered by the mere presence of the ICCProfile attribute (i.e. it functions like other informational metadata only). The WebP API is a bit odd when it comes to writing the ICCProfile. We must use the "mux" API set; the "advanced" API is apparently not advanced enough to add the metadata to the file. This wouldn't be too bad except that the mux API is at odds with how we write out the data. Before: When it comes time to do the file write, we would pass our own file writer into webp. The writes would go straight to disk. Now: If ICC profile data is necessary to write, we let webp use its own writer to write to memory. We then assemble the in-memory file and the ICC profile data together and pass that entire package to our writer as a final step. When no ICC profile data is used, the old write behavior is kept. Added `oiiotool` test variations which uses ICC profiles with WEBP. --------- Signed-off-by: Jesse Yurkovich Signed-off-by: Zach Lewis --- src/doc/builtinplugins.rst | 4 + src/webp.imageio/CMakeLists.txt | 2 +- src/webp.imageio/webpinput.cpp | 17 ++- src/webp.imageio/webpoutput.cpp | 126 +++++++++++++----- testsuite/oiiotool-attribs/ref/out-jpeg9d.txt | 22 +++ testsuite/oiiotool-attribs/ref/out.txt | 22 +++ testsuite/oiiotool-attribs/ref/test-webp.icc | Bin 0 -> 560 bytes testsuite/oiiotool-attribs/run.py | 4 + 8 files changed, 162 insertions(+), 35 deletions(-) create mode 100644 testsuite/oiiotool-attribs/ref/test-webp.icc diff --git a/src/doc/builtinplugins.rst b/src/doc/builtinplugins.rst index 847010c9d4..f660bd8684 100644 --- a/src/doc/builtinplugins.rst +++ b/src/doc/builtinplugins.rst @@ -3073,6 +3073,10 @@ open standard for lossy-compressed images for use on the web. * - ImageSpec Attribute - Type - WebP header data or explanation + * - ``ICCProfile`` + - uint8[] + - The ICC color profile. A variety of other ``ICCProfile:*`` attributes + may also be present, extracted from the main profile. * - ``oiio:Movie`` - int - If nonzero, indicates that it's a multi-subimage file intended to diff --git a/src/webp.imageio/CMakeLists.txt b/src/webp.imageio/CMakeLists.txt index 1c09dc634d..dc33f06461 100644 --- a/src/webp.imageio/CMakeLists.txt +++ b/src/webp.imageio/CMakeLists.txt @@ -4,7 +4,7 @@ if (WebP_FOUND) add_oiio_plugin (webpinput.cpp webpoutput.cpp - LINK_LIBRARIES WebP::webp WebP::webpdemux + LINK_LIBRARIES WebP::webp WebP::webpdemux WebP::libwebpmux DEFINITIONS "USE_WEBP=1") else () message (STATUS "WebP plugin will not be built") diff --git a/src/webp.imageio/webpinput.cpp b/src/webp.imageio/webpinput.cpp index 408310b88a..09cc08c4cd 100644 --- a/src/webp.imageio/webpinput.cpp +++ b/src/webp.imageio/webpinput.cpp @@ -195,11 +195,20 @@ WebpInput::open(const std::string& name, ImageSpec& spec, } if (m_demux_flags & ICCP_FLAG && WebPDemuxGetChunk(m_demux, "ICCP", 1, &chunk_iter)) { - // FIXME: This is where we would extract an ICC profile. Come back - // to this when I have found an example webp containing an ICC - // profile that I can use as a test case, otherwise I'm just - // guessing. + cspan icc_span(chunk_iter.chunk.bytes, chunk_iter.chunk.size); + m_spec.attribute("ICCProfile", + TypeDesc(TypeDesc::UINT8, icc_span.size_bytes()), + icc_span.data()); + + std::string errormsg; + const bool ok = decode_icc_profile(icc_span, m_spec, errormsg); WebPDemuxReleaseChunkIterator(&chunk_iter); + + if (!ok && OIIO::get_int_attribute("imageinput:strict")) { + errorfmt("Possible corrupt file, could not decode ICC profile: {}\n", + errormsg); + return false; + } } // Make space for the decoded image diff --git a/src/webp.imageio/webpoutput.cpp b/src/webp.imageio/webpoutput.cpp index 281f95f004..3e65ed30e8 100644 --- a/src/webp.imageio/webpoutput.cpp +++ b/src/webp.imageio/webpoutput.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -44,6 +45,8 @@ class WebpOutput final : public ImageOutput { m_scanline_size = 0; ioproxy_clear(); } + + bool write_complete_data(); }; @@ -119,11 +122,9 @@ WebpOutput::open(const std::string& name, const ImageSpec& spec, OpenMode mode) // Lossless encoding (0=lossy(default), 1=lossless). m_webp_config.lossless = int(is_lossless); - m_webp_picture.use_argb = m_webp_config.lossless; - m_webp_picture.width = m_spec.width; - m_webp_picture.height = m_spec.height; - m_webp_picture.writer = WebpImageWriter; - m_webp_picture.custom_ptr = (void*)ioproxy(); + m_webp_picture.use_argb = m_webp_config.lossless; + m_webp_picture.width = m_spec.width; + m_webp_picture.height = m_spec.height; // forcing UINT8 format m_spec.set_format(TypeDesc::UINT8); @@ -137,6 +138,94 @@ WebpOutput::open(const std::string& name, const ImageSpec& spec, OpenMode mode) } +bool +WebpOutput::write_complete_data() +{ + // Check if we have an optional ICC Profile to write. + const unsigned char* icc_data = nullptr; + uint32_t icc_data_length = 0; + bool has_icc_data = false; + const ParamValue* icc_profile_parameter = m_spec.find_attribute( + "ICCProfile"); + if (icc_profile_parameter != nullptr) { + icc_data = (const unsigned char*)icc_profile_parameter->data(); + icc_data_length = icc_profile_parameter->type().size(); + has_icc_data = (icc_data && icc_data_length > 0); + } + + // If we have ICC data, encode to memory first. This is required in order + // to use the WebPMux assembly API below. + WebPMemoryWriter wrt; + if (has_icc_data) { + WebPMemoryWriterInit(&wrt); + m_webp_picture.writer = WebPMemoryWrite; + m_webp_picture.custom_ptr = &wrt; + } else { + m_webp_picture.writer = WebpImageWriter; + m_webp_picture.custom_ptr = (void*)ioproxy(); + } + + if (m_spec.nchannels == 4) { + if (m_convert_alpha) { + // WebP requires unassociated alpha, and it's sRGB. + // Handle this all by wrapping an IB around it. + ImageSpec specwrap(m_spec.width, m_spec.height, 4, TypeUInt8); + ImageBuf bufwrap(specwrap, cspan(m_uncompressed_image)); + ROI rgbroi(0, m_spec.width, 0, m_spec.height, 0, 1, 0, 3); + ImageBufAlgo::pow(bufwrap, bufwrap, 2.2f, rgbroi); + ImageBufAlgo::unpremult(bufwrap, bufwrap); + ImageBufAlgo::pow(bufwrap, bufwrap, 1.0f / 2.2f, rgbroi); + } + + WebPPictureImportRGBA(&m_webp_picture, m_uncompressed_image.data(), + m_scanline_size); + } else { + WebPPictureImportRGB(&m_webp_picture, m_uncompressed_image.data(), + m_scanline_size); + } + + if (!WebPEncode(&m_webp_config, &m_webp_picture)) { + errorfmt("Failed to encode {} as WebP image", m_filename); + if (has_icc_data) { + WebPMemoryWriterClear(&wrt); + } + close(); + return false; + } + + // If there's no ICC data to write, we are done at this point. + bool ok = true; + + // Otherwise, assemble the final WebP package and write it out. + if (has_icc_data) { + WebPMux* mux = WebPMuxNew(); + + WebPData image_data = { wrt.mem, wrt.size }; + WebPMuxSetImage(mux, &image_data, false); + + WebPData icc_chunk = { icc_data, size_t(icc_data_length) }; + WebPMuxSetChunk(mux, "ICCP", &icc_chunk, false); + + WebPData assembly; + if (WebPMuxAssemble(mux, &assembly) != WEBP_MUX_OK) { + errorfmt("Failed to assemble {} as WebP image", m_filename); + WebPMuxDelete(mux); + WebPMemoryWriterClear(&wrt); + return false; + } + + ok = ioproxy()->write(assembly.bytes, assembly.size) == assembly.size; + + WebPDataClear(&assembly); + WebPMuxDelete(mux); + WebPMemoryWriterClear(&wrt); + } + + return ok; +} + + + bool WebpOutput::write_scanline(int y, int z, TypeDesc format, const void* data, stride_t xstride) @@ -150,32 +239,9 @@ WebpOutput::write_scanline(int y, int z, TypeDesc format, const void* data, data = to_native_scanline(format, data, xstride, scratch, m_dither, y, z); memcpy(&m_uncompressed_image[y * m_scanline_size], data, m_scanline_size); + /* If this was the final scanline, we are done. */ if (y == m_spec.height - 1) { - if (m_spec.nchannels == 4) { - if (m_convert_alpha) { - // WebP requires unassociated alpha, and it's sRGB. - // Handle this all by wrapping an IB around it. - ImageSpec specwrap(m_spec.width, m_spec.height, 4, TypeUInt8); - ImageBuf bufwrap(specwrap, - cspan(m_uncompressed_image)); - ROI rgbroi(0, m_spec.width, 0, m_spec.height, 0, 1, 0, 3); - ImageBufAlgo::pow(bufwrap, bufwrap, 2.2f, rgbroi); - ImageBufAlgo::unpremult(bufwrap, bufwrap); - ImageBufAlgo::pow(bufwrap, bufwrap, 1.0f / 2.2f, rgbroi); - } - - WebPPictureImportRGBA(&m_webp_picture, m_uncompressed_image.data(), - m_scanline_size); - } else { - WebPPictureImportRGB(&m_webp_picture, m_uncompressed_image.data(), - m_scanline_size); - } - - if (!WebPEncode(&m_webp_config, &m_webp_picture)) { - errorfmt("Failed to encode {} as WebP image", m_filename); - close(); - return false; - } + return write_complete_data(); } return true; } diff --git a/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt b/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt index 44c9f84775..04737c6557 100644 --- a/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt +++ b/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt @@ -157,3 +157,25 @@ tahoe-icc.jpg : 128 x 96, 3 channel, uint8 jpeg ICCProfile:rendering_intent: "Perceptual" jpeg:subsampling: "4:2:0" oiio:ColorSpace: "srgb_rec709_scene" +Reading tahoe-icc.webp +tahoe-icc.webp : 128 x 96, 3 channel, uint8 webp + SHA-1: 407D97F3D62F90C7F9A78AF85989ED3C06C59523 + channel list: R, G, B + ICCProfile: 0, 0, 2, 48, 65, 68, 66, 69, 2, 16, 0, 0, 109, 110, 116, 114, ... [560 x uint8] + ICCProfile:attributes: "Reflective, Glossy, Positive, Color" + ICCProfile:cmm_type: 1094992453 + ICCProfile:color_space: "RGB" + ICCProfile:copyright: "Copyright 1999 Adobe Systems Incorporated" + ICCProfile:creation_date: "1999:06:03 00:00:00" + ICCProfile:creator_signature: "41444245" + ICCProfile:device_class: "Display device profile" + ICCProfile:flags: "Not Embedded, Independent" + ICCProfile:manufacturer: "6e6f6e65" + ICCProfile:model: "0" + ICCProfile:platform_signature: "Apple Computer, Inc." + ICCProfile:profile_connection_space: "XYZ" + ICCProfile:profile_description: "Adobe RGB (1998)" + ICCProfile:profile_size: 560 + ICCProfile:profile_version: "2.1.0" + ICCProfile:rendering_intent: "Perceptual" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/oiiotool-attribs/ref/out.txt b/testsuite/oiiotool-attribs/ref/out.txt index 482ae7a842..b51b530a60 100644 --- a/testsuite/oiiotool-attribs/ref/out.txt +++ b/testsuite/oiiotool-attribs/ref/out.txt @@ -157,3 +157,25 @@ tahoe-icc.jpg : 128 x 96, 3 channel, uint8 jpeg ICCProfile:rendering_intent: "Perceptual" jpeg:subsampling: "4:2:0" oiio:ColorSpace: "srgb_rec709_scene" +Reading tahoe-icc.webp +tahoe-icc.webp : 128 x 96, 3 channel, uint8 webp + SHA-1: 407D97F3D62F90C7F9A78AF85989ED3C06C59523 + channel list: R, G, B + ICCProfile: 0, 0, 2, 48, 65, 68, 66, 69, 2, 16, 0, 0, 109, 110, 116, 114, ... [560 x uint8] + ICCProfile:attributes: "Reflective, Glossy, Positive, Color" + ICCProfile:cmm_type: 1094992453 + ICCProfile:color_space: "RGB" + ICCProfile:copyright: "Copyright 1999 Adobe Systems Incorporated" + ICCProfile:creation_date: "1999:06:03 00:00:00" + ICCProfile:creator_signature: "41444245" + ICCProfile:device_class: "Display device profile" + ICCProfile:flags: "Not Embedded, Independent" + ICCProfile:manufacturer: "6e6f6e65" + ICCProfile:model: "0" + ICCProfile:platform_signature: "Apple Computer, Inc." + ICCProfile:profile_connection_space: "XYZ" + ICCProfile:profile_description: "Adobe RGB (1998)" + ICCProfile:profile_size: 560 + ICCProfile:profile_version: "2.1.0" + ICCProfile:rendering_intent: "Perceptual" + oiio:ColorSpace: "srgb_rec709_scene" diff --git a/testsuite/oiiotool-attribs/ref/test-webp.icc b/testsuite/oiiotool-attribs/ref/test-webp.icc new file mode 100644 index 0000000000000000000000000000000000000000..fe2cab55e60201fc39020cceb18e1cd340e45d9c GIT binary patch literal 560 zcmZQzU@~xYadKr6U|`72D=7+ccT$Lmj8b4f&%nmO%m4<7$;AbZ0RcWBPF{XqDnt~S z{C16j5yZc&3o;8?h6pxSazRlEP~9IOHcCk?PG(?WGyt-*%S#G?;*4{EY>}jFFna@t zT@(`J3=}^CWb>s%*jGU8BnbNnh+PEq1W?Tvkot5mn~4L&PJ*yyKRDfvmM3c;1dC8@c^3Z8k%`9%f!MTsS;DL}Ol_knaV2tpKsLQDgw z(Lxg}N<{(`4-n%%2ZF Date: Sun, 14 Sep 2025 01:50:42 +0200 Subject: [PATCH 45/71] feat(ffmpeg): Read CICP metadata, and add test (#4882) The actual CICP reading code is trivial. Also recognize mkv (Matroska) extension for the test. Add test using Matroska + VP9, to maximize the chance of an ffmpeg build supporting them. They are royalty free, built into ffmpeg and relatively old. Signed-off-by: Brecht Van Lommel Signed-off-by: Zach Lewis --- src/cmake/testing.cmake | 3 + src/doc/builtinplugins.rst | 3 + src/ffmpeg.imageio/ffmpeginput.cpp | 12 +++- testsuite/ffmpeg/ref/out-ffmpeg-6.1.txt | 87 ++++++++++++++++++++++++ testsuite/ffmpeg/ref/out-ffmpeg8.0.txt | 87 ++++++++++++++++++++++++ testsuite/ffmpeg/ref/vp9_display_p3.mkv | Bin 0 -> 5455 bytes testsuite/ffmpeg/run.py | 10 +++ 7 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 testsuite/ffmpeg/ref/out-ffmpeg-6.1.txt create mode 100644 testsuite/ffmpeg/ref/out-ffmpeg8.0.txt create mode 100644 testsuite/ffmpeg/ref/vp9_display_p3.mkv create mode 100755 testsuite/ffmpeg/run.py diff --git a/src/cmake/testing.cmake b/src/cmake/testing.cmake index 0bbc77c716..113b993242 100644 --- a/src/cmake/testing.cmake +++ b/src/cmake/testing.cmake @@ -250,6 +250,9 @@ macro (oiio_add_all_tests) ENABLEVAR ENABLE_FITS IMAGEDIR fits-images URL http://www.cv.nrao.edu/fits/data/tests/) + oiio_add_tests (ffmpeg + ENABLEVAR ENABLE_FFMPEG + FOUNDVAR FFmpeg_FOUND) oiio_add_tests (gif FOUNDVAR GIF_FOUND ENABLEVAR ENABLE_GIF IMAGEDIR oiio-images/gif URL "Recent checkout of OpenImageIO-images") diff --git a/src/doc/builtinplugins.rst b/src/doc/builtinplugins.rst index f660bd8684..81d72c911a 100644 --- a/src/doc/builtinplugins.rst +++ b/src/doc/builtinplugins.rst @@ -1433,6 +1433,9 @@ Some special attributes are used for movie files: * - ``ffmpeg:TimeCode`` - string - Start time timecode + * - ``CICP`` + - int[4] + - Coding-independent code points to describe the color profile. diff --git a/src/ffmpeg.imageio/ffmpeginput.cpp b/src/ffmpeg.imageio/ffmpeginput.cpp index 7cfaf601b2..ae1be13b7d 100644 --- a/src/ffmpeg.imageio/ffmpeginput.cpp +++ b/src/ffmpeg.imageio/ffmpeginput.cpp @@ -180,9 +180,9 @@ ffmpeg_input_imageio_create() // QuickTime / MOV // raw MPEG-4 video // MPEG-1 Systems / MPEG program stream -OIIO_EXPORT const char* ffmpeg_input_extensions[] = { - "avi", "mov", "qt", "mp4", "m4a", "3gp", "3g2", "mj2", "m4v", "mpg", nullptr -}; +OIIO_EXPORT const char* ffmpeg_input_extensions[] + = { "avi", "mov", "qt", "mp4", "m4a", "3gp", + "3g2", "mj2", "m4v", "mpg", "mkv", nullptr }; OIIO_PLUGIN_EXPORTS_END @@ -531,6 +531,12 @@ FFmpegInput::open(const std::string& name, ImageSpec& spec) m_spec.attribute("oiio:BitsPerSample", m_codec_context->bits_per_raw_sample); m_spec.attribute("ffmpeg:codec_name", m_codec_context->codec->long_name); + /* The ffmpeg enums are documented to match CICP values, except the color range. */ + const int cicp[4] + = { m_codec_context->color_primaries, m_codec_context->color_trc, + m_codec_context->colorspace, + m_codec_context->color_range == AVCOL_RANGE_MPEG ? 0 : 1 }; + m_spec.attribute("CICP", TypeDesc(TypeDesc::INT, 4), cicp); m_nsubimages = m_frames; spec = m_spec; m_filename = name; diff --git a/testsuite/ffmpeg/ref/out-ffmpeg-6.1.txt b/testsuite/ffmpeg/ref/out-ffmpeg-6.1.txt new file mode 100644 index 0000000000..82b00b1a10 --- /dev/null +++ b/testsuite/ffmpeg/ref/out-ffmpeg-6.1.txt @@ -0,0 +1,87 @@ +Reading ref/vp9_display_p3.mkv +ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie + 7 subimages: 192x108 [u8,u8,u8] + subimage 0: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: E65FAFBDA14543571188F8A84F75E1567E13148C + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 1: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 8D54A542C4E6A47A4F8829993001786BA62288DF + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 2: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 8D54A542C4E6A47A4F8829993001786BA62288DF + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 3: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 8D54A542C4E6A47A4F8829993001786BA62288DF + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 4: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: D9B0B8782048AEE24C4DF767E2B0969EBAB9D36B + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 5: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: C6B5666BB0A937A59762B8FE846BF50FED40889E + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 6: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 63516D95A1BB56E9E9483F9BCFC4305851A8BC54 + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 diff --git a/testsuite/ffmpeg/ref/out-ffmpeg8.0.txt b/testsuite/ffmpeg/ref/out-ffmpeg8.0.txt new file mode 100644 index 0000000000..988ef28210 --- /dev/null +++ b/testsuite/ffmpeg/ref/out-ffmpeg8.0.txt @@ -0,0 +1,87 @@ +Reading ref/vp9_display_p3.mkv +ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie + 7 subimages: 192x108 [u8,u8,u8] + subimage 0: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: C882152FF48CB068931C2710175659A9D0493C08 + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 1: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 1E2EB62F7BDD2DAC5C6FBDE582EE19978DC7C290 + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 2: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 1E2EB62F7BDD2DAC5C6FBDE582EE19978DC7C290 + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 3: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 1E2EB62F7BDD2DAC5C6FBDE582EE19978DC7C290 + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 4: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 35565DB895AB1CA413192B7F25A1890718CFC0F5 + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 5: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 338C9A82B74CE3B291DAD6564AE7C060AE6D9267 + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 + subimage 6: 192 x 108, 3 channel, uint8 FFmpeg movie + SHA-1: 90BC91EAA745A9C897EEDEC0D34BAAF1D40B1C7C + channel list: R, G, B + CICP: 12, 1, 1, 1 + DATE: "2025/09/13 21:58:33" + ENCODER: "Lavf61.7.100" + FramesPerSecond: 24/1 (24) + SCENE: "Scene" + ffmpeg:codec_name: "Google VP9" + oiio:BitsPerSample: 0 + oiio:Movie: 1 + oiio:subimages: 7 diff --git a/testsuite/ffmpeg/ref/vp9_display_p3.mkv b/testsuite/ffmpeg/ref/vp9_display_p3.mkv new file mode 100644 index 0000000000000000000000000000000000000000..b98a42fa3b19987bbb3bde6eab99ccaf27c72e38 GIT binary patch literal 5455 zcmb`LbyO7Ex5tN&l|a>q(e$jx?`SR z?|tug-&*g#ch)&)t^GNBf6qSq{I{tgD{#0}I21+d;@3KcqD!4Xv7|yG9ZfyloZanB zr6PWzFeoaeMzA#s;P)V-AyUfl=xB!p8TvLTA!0O2VPx{fRvKl{kAEz3%?kTp)`1ct z_SYG)X1BFQSqMtyACp!C@#`>z6uJLL4WRLt=>PBbJD?XaglUCBQP&c3ps4kcplz4G@-?%7GW?b`&kZAr*WLvD{sB;LJ8UpY2k7oT zVcrpJJ&*-~!=xoOA<_|v&$*xT1G$BOJiH9gd4%}|g?V|c2jU^{Fbyz7`IkeOhPkDa zrS(7>1ReoV2CGOz)TJZ-T|W03^Ntwv|0##{z()u?Qd&!0Qd3?<`PUuX+`@lNE?!N$C%CN|;+j0^gs9?=8_f zTcFV71p|VbqD_!%Z%BHX)TYHriBumMzZ-ez)xVt&LPYl zK@i~csue-^x@VU8%KapSBx1pSB-WiTABH&IclFXne3|7g2Ii?%nO%IfZkM_S!Uf== z%oTcpKXHzD*tDHD(WT?8Gx|nq6+MPB_34$tk11F;NSVIgV@W)vw^+FEbUI~?8FE=n zSk(#9e2(ZN)jv~L&0bd}7I`tWM>RGHxrsqtX=3ucdg#{LUWmL$msSiUsY=INy50Je zOi?WJL=`s3Hj_fi#gwW7Si_@Y`1rwygf3_4KL2{GQT&h%a1 z{mJULQ+2xWvM9E4+7(+KwMrn9LT-9OrrtJS`c8uJ*(?bO_|^b^ z;uCEa8VlhS?G;b_g!Xt^uzmcd5zTZ8?<3TKH+(mZTqO| zixXYhR?_+k8e@otV35|&R=gaI4$RH|uwx77AuB3PZP0TRddzP5vo_<=u_Bgndi66r z+#zA z489$iLlY7Vxi6!Qd&Gg&VEi) zvTX&85pCcdeg#mJP-kxJ)AO?q003==5Y)k?pPP^7b;Fa5XPK1LSwL#n`SKAk$DZH+ zj%mL>g=9iv5%JqfUJle_ixmNvbe1-$$)v|_#%T#PJ$Sc6E5Ap z7e@CO_$Tsq8mnx<^<<88?a!t2isC53x=JW$K?^KKxz%M@3 z;Fe(hfU8`+-)I4ojnz6;l-s9j>@{5mgL(`>Un~Mge*k;auOyYTa!Wx}1cLdk(3Vlr zcMbdOC}1hX`bMla(Eu6*r)uv1q)R0wD;MUFig!n?(3Gh%-35T#0q)G>2>^4@XwL`o zH@!P2v5WnyA4td@802IJCW92$k?HY^gX#nwPzP zl)tFQ9U9S_zf|`9rE?Y2y3_m=GiJDZ2Dy0DWJk64xTsA$YY{1Z-kOby?)YoZ)$>o9 zWN)J{C<6SOF|$gp33-pv=L@}gR*>>pbN6~5Y{#DUz_rVk+?ZGgxIdq8wA8058GRY* zXn3_uiA-`K&#Kq zkDYInqxZ`QjG&Ah$Ty!1adc;_dvTDE<8S!|f4K1)*7tjj5n>iYw-4obSICS7mnl^2`KqAL?Lz{LXt_thuSD*TW z114-yq;%UIeco_*87-BA7muC1ZpYfFpZbo06LNO9ydjf)hCfe&H%MuOsl>XNIN+T}kb~xXTCInmJAe0- zpq5JYWrsC(AG|trqQ}(tiW26hCQgaR@DsVJUR`wb2=vXdpw=e}=!XZzIG@V#d_;C^ zd^LFwj-E0HUow;D)zCo&RPbv5Z||kUD2%5=FU4mr+^w@liP1 zdGaI53|Us@@Dv4vUk(2dvQ1aI{Mg$KM7QQU7{2`Qd+FCu2Y=92ET4-?Tlw{Fu7mIw z-TWaD+TPcgRo0SjTDO<-@ZGmxv{EG`s!?Bg2|R2i0%c)r<*D@VTb>W+ zK`ch=1fG5@e$sPs5+e8&JJPUr-E%G)UzH{(D|_*Ixl!bSb!V3|j?cb-{{>g<14=lc zC|Cki8@tkfY%*HVDpf+9i_!*(_pwRuBjMV+)f{SQ*hpXfn#B{%#PYz(QH+T-5D-l@ zq*ARKpP9hI*uvprq*0DhKMA62RVUdF^M7vgNl@kM^;4GBJOQblg{xr(O**mYNCQD3oK_QKY*RYebIq4<0crK;juD1$%}_c zA0nnE@stRRVb;LclH*E_bxnPU%h{YLVB1-DLI)kPIDd?YAW1H;_6We=*)0wy&DQD} z9(Z@Y<3qjRqB-VfSw#b4fMqx7aF1(!`PM=jE#!{EI@%k2iunyyvYl?Xz?y@)xZm6k z$}+avR2RP+UT3(y-sY)AYQZ}nMd-cm-;-iFw6F&>6R$ML31%Vf+LNt15ABbkBRlG< zQB>UH?1@*s22`tdl<>dWAI%pM9BF&Rai>l|BZDvB$FDcO8B*>B1htA^Q*0AD?q6p{ zc9F>dMh^suzfgI=hg^xkm2T3fh>XnVONPmq%Pn7&-WPr_1sJDJJi4U{K$vm0@2%zh z=qaI~?xLI<)(kO}yHqe1lBbR5mj+5sX{DkR6o746MHF(qrQJAvO$5%v;r1bOy=vv~ z>GDY)a^Y7q73MK^I#^^nB@PBdsTL~$PMh=#3!O@YM@9>AaC5)jh*3x^&(#DlE+68g zK4$74PaJV-7oEK^c(f>Uyi@e@deWf~U3a_htt|YMr6~ZLNRGUMAR}Zvh5FFDBQL0o zXsN#55OnBwz}c7Dga^7D6A8USql`X@1p4)q9L5?$Y(`L)_9?5$StyHI92I z>GW&9CFUtkS-E>5 zD`1T3BdFR(;%p1qd0jcZ`93;f4Rg6oj5lQA_<=&PFOg_XI7f8!%G#rz&XSHPvQ8nN z=G`MkuqeX3`WR^No#?vn2VQog(R)q41e8U=D}42@k8CLIFPj5t#tD{<250u(5=N-h zv~n|DNBBteBdhFAPdPPU8G>pHDlHpyh&+u_N}>aCyZqJ-ZAM@$eT;1OG2XYK#Yb2q zmlX@|D_td92m*z3eeO4RR`+Tg_%9CHFFHqYO3SJ^Ifq#lWgv6~eBsjKZXZiBEO9zD zA0p?2Xe4gB$LM;;b+$@#C`0?_>T6e1wezLK4g*HLyKud*NS`!bXA==(PQxaxanX`b zIkEL?Xz;i(8SYB4GeeE&N7ChOG_`1gU$9@masA*qjS{Dh1QqITfmOH;8I7BcGq4Qy z-1&W`lvi2Zn>7GWLL-Ya>`K#q~Pt6!3<3{Z1vG3 z*)b+~fJw{f{-hV5xy`K5%xhnlJZraHp^(h#oAr^7-kk7^Wa5pDAtoJL7&X=lQTNA( z?|igFBWY6wd!Vekdax5G4+~kAA82nm(%7UwAPjL*K-zO(BLnK1_t7NUUPT=c8cE02 zy;o*5LD~g)TB#MOJrG?{VH7hO^o&2NdzfprMg4iKFM0ciIRY4KK1RTvT0O3i`2?&lVuy9id&)fjKy8Ra8Ni{LJ|14!OrNQYeEECCq z93rwScT@=!tD&xGxMCeOn1_Bl4o=*RUPGV!@ zQKabY^S(q41;CGq49hvTLsq_yjB1TJuX85iqsG#Ne#kD8JG;+j%XhU6-e|C#FjOd- ztz+Pg@*&+atLX6Xt&ko>%&%-;^-i0qejNWOA34WSxWgDdG>^BeF*UFY@$?9*5XHk3 zYR?{8H_{UE=Q&oR;o9Mmd4l`owm|g#D_E`;2ZZg$g3G_aK7+oQ*j$n-r#kq0kuUUz zdqv^V%*QX|2FA5sY$yjEx2U8+Q8u?m6)dvumeJC}bD!HAN2XKG_2u~3lbg!6mu5#m zM0t%V;$gkkj9%R}5;(v*uBU+l8rKA(9XL5ZVGowE5{<&U?_8aLxnE0&%gN%U z>^DCcP>J&m;oh@&Cf&oN0~H%pDIINp?07`Nlc4|(KsW&OE|WnX1VCc|0GuR~K)v+@w=mzg!xj>1{19=qP(Wk!uh!{N2&(TP6#Ksb8$}(G literal 0 HcmV?d00001 diff --git a/testsuite/ffmpeg/run.py b/testsuite/ffmpeg/run.py new file mode 100755 index 0000000000..06b8436b80 --- /dev/null +++ b/testsuite/ffmpeg/run.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +# Copyright Contributors to the OpenImageIO project. +# SPDX-License-Identifier: Apache-2.0 +# https://github.com/AcademySoftwareFoundation/OpenImageIO + +imagedir = "ref/" +files = [ "vp9_display_p3.mkv" ] +for f in files: + command = command + info_command (os.path.join(imagedir, f)) From 1c82b52929abac23569c7beff1ed0b942d4a4f8b Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sat, 13 Sep 2025 16:52:03 -0700 Subject: [PATCH 46/71] ci: fix analysis workflow configuration (#4881) Something must have changed with the containers, it was failing on the build step, before ever getting to the actual sonar analysis. Switch to the same container and OCIO version that we use for the regular 2024 era container CI. Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/analysis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 92bd9a6916..bdaa0f8c81 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -87,13 +87,14 @@ jobs: fail-fast: false matrix: include: - - desc: sonar gcc11/C++17 py310 exr3.2 ocio2.3 + - desc: sonar gcc11/C++17 py311 exr3.2 ocio2.3 nametag: static-analysis-sonar os: ubuntu-latest - container: aswf/ci-osl:2024-clang17 + container: aswf/ci-oiio:2024.2 cxx_std: 17 python_ver: "3.11" simd: "avx2,f16c" + opencolorio_ver: v2.3.2 fmt_ver: 10.1.1 pybind11_ver: v2.12.0 coverage: 1 From 497436dbcff66cd88a61b1eadac6a3a75c64b9a4 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sat, 13 Sep 2025 19:02:33 -0700 Subject: [PATCH 47/71] api: Versioned namespace to preserve ABI compatibility between minor releases (#4869) This patch implements the new scheme that we hope will preserve ABI compatibility across minor (yearly) releases. Brief summary: * We will strive to have annual minor releases (e.g., 3.1.x -> 3.2.x) be ABI/link backwards-compatible, as strongly as monthly patch releases (3.1.5 -> 3.1.6) always have been. Every-several-years major releases (3.x -> 4.x) are still a potential full compatibility break. * Consumers of OpenImageIO don't need to change their code, and can just continue to refer to `OIIO::Foo` or `OIIO::Bar()` as always. * Internally, all items in the public OIIO APIs will be in a versioned inner namespace, and will continue to live in the versioned namespace where they were first introduced, forever. (Well, until the next first-digit-changing major release, at which point we will clean up the old cruft and version everything up.) If anything needs to change in an ABI-breaking way, it will be *duplicated* in the newer namespaces, so the old version continues to be available in the old namespace. * The new header nsversions.h contains a long and detailed comment explaining how all the new declarations work. --- Detailed explanation: "Major" or "first digit" releases, which only happen once every several years for us, are full ABI+API breaks. Previously, "minor" or "second digit" releases, which are annual, have fully incompatible ABIs, with separate namespaces to enforce it. Here, we are striving to allow our annual/minor releases to no longer break ABI, to make upgrading easier for downstream users. The basics are that once a symbol is introduced, it will forever live in the namespace of that release. Subsequent release years will have their own namespaces, but will either alias or duplicate the original symbols. This is enabled by our recent (in the lead-up to 3.1) introduction of a split 2-part namespacing scheme. So 3.2 is the first release that has the potential to perserve compatibility with 3.1 in this way. In this PR, I have done this for the whole codebase. It works! -- as measured by being able to have our automated ABI checker show 100% back compatibility with 3.1. So currently, even though this is the nascent 3.2 tree, everything in the public APIs live in the 3.1 ABI namespace. And so they will remain, except for changes that cannot be done without breaking ABI back-compatibility, which will then end up with multiple versions in different versioned namespaces. Let's look this over and decide if we like it. It does involve our developers to do some hoop jumping and take extra care as we develop, to keep things associated with the right namespaces. Users of OpenImageIO shouldn't need to change anything on their end, nor to be aware of this at all. Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/build-steps.yml | 2 +- .github/workflows/ci.yml | 2 +- src/build-scripts/ci-abicheck.bash | 2 +- src/doc/Doxyfile | 2 + src/include/OpenImageIO/argparse.h | 17 +- src/include/OpenImageIO/atomic.h | 18 +- src/include/OpenImageIO/attrdelegate.h | 11 +- src/include/OpenImageIO/benchmark.h | 20 +- src/include/OpenImageIO/bit.h | 17 +- src/include/OpenImageIO/color.h | 31 ++- src/include/OpenImageIO/deepdata.h | 9 +- src/include/OpenImageIO/detail/farmhash.h | 19 +- src/include/OpenImageIO/detail/fmt.h | 17 +- .../OpenImageIO/detail/pugixml/pugixml.cpp | 32 +-- .../OpenImageIO/detail/pugixml/pugixml.hpp | 10 +- src/include/OpenImageIO/errorhandler.h | 4 +- src/include/OpenImageIO/filesystem.h | 29 +- src/include/OpenImageIO/filter.h | 4 +- src/include/OpenImageIO/fmath.h | 20 ++ src/include/OpenImageIO/fstream_mingw.h | 12 +- src/include/OpenImageIO/function_view.h | 8 +- src/include/OpenImageIO/hash.h | 16 +- src/include/OpenImageIO/image_span.h | 35 +-- src/include/OpenImageIO/image_view.h | 4 +- src/include/OpenImageIO/imagebuf.h | 18 +- src/include/OpenImageIO/imagebufalgo.h | 19 +- src/include/OpenImageIO/imagebufalgo_opencv.h | 4 +- src/include/OpenImageIO/imagebufalgo_util.h | 11 +- src/include/OpenImageIO/imagecache.h | 17 +- src/include/OpenImageIO/imageio.h | 93 +++++-- src/include/OpenImageIO/memory.h | 15 +- src/include/OpenImageIO/nsversions.h | 252 ++++++++++++++++++ src/include/OpenImageIO/oiioversion.h.in | 44 +-- src/include/OpenImageIO/optparser.h | 11 +- src/include/OpenImageIO/parallel.h | 53 +++- src/include/OpenImageIO/paramlist.h | 21 +- src/include/OpenImageIO/platform.h | 42 ++- src/include/OpenImageIO/plugin.h | 13 +- src/include/OpenImageIO/refcnt.h | 14 +- src/include/OpenImageIO/simd.h | 30 +-- src/include/OpenImageIO/span.h | 121 +++++---- src/include/OpenImageIO/strided_ptr.h | 9 +- src/include/OpenImageIO/string_view.h | 15 +- src/include/OpenImageIO/strongparam.h | 9 +- src/include/OpenImageIO/strutil.h | 17 +- src/include/OpenImageIO/sysutil.h | 4 +- src/include/OpenImageIO/texture.h | 34 ++- src/include/OpenImageIO/thread.h | 169 +++--------- src/include/OpenImageIO/tiffutils.h | 23 ++ src/include/OpenImageIO/timer.h | 4 +- src/include/OpenImageIO/type_traits.h | 12 +- src/include/OpenImageIO/typedesc.h | 67 ++++- .../OpenImageIO/unordered_map_concurrent.h | 10 +- src/include/OpenImageIO/ustring.h | 23 +- src/include/OpenImageIO/vecparam.h | 20 +- src/include/imageio_pvt.h | 11 +- src/libOpenImageIO/color_ocio.cpp | 20 +- src/libOpenImageIO/deepdata.cpp | 7 +- src/libOpenImageIO/exif.cpp | 26 +- src/libOpenImageIO/formatspec.cpp | 103 +++++-- src/libOpenImageIO/icc.cpp | 5 +- src/libOpenImageIO/imagebuf.cpp | 90 ++----- src/libOpenImageIO/imagebufalgo.cpp | 20 +- src/libOpenImageIO/imagebufalgo_addsub.cpp | 8 +- src/libOpenImageIO/imagebufalgo_channels.cpp | 8 +- src/libOpenImageIO/imagebufalgo_compare.cpp | 24 +- src/libOpenImageIO/imagebufalgo_copy.cpp | 14 +- src/libOpenImageIO/imagebufalgo_deep.cpp | 12 +- src/libOpenImageIO/imagebufalgo_demosaic.cpp | 6 +- .../imagebufalgo_demosaic_prv.h | 4 +- src/libOpenImageIO/imagebufalgo_draw.cpp | 47 ++-- src/libOpenImageIO/imagebufalgo_mad.cpp | 6 +- .../imagebufalgo_minmaxchan.cpp | 8 +- src/libOpenImageIO/imagebufalgo_muldiv.cpp | 10 +- src/libOpenImageIO/imagebufalgo_orient.cpp | 16 +- src/libOpenImageIO/imagebufalgo_pixelmath.cpp | 40 +-- src/libOpenImageIO/imagebufalgo_test.cpp | 34 +-- src/libOpenImageIO/imagebufalgo_xform.cpp | 14 +- src/libOpenImageIO/imagebufalgo_yee.cpp | 4 +- src/libOpenImageIO/imageinput.cpp | 60 ++--- src/libOpenImageIO/imageio.cpp | 37 ++- src/libOpenImageIO/imageioplugin.cpp | 36 ++- src/libOpenImageIO/imageoutput.cpp | 33 ++- src/libOpenImageIO/iptc.cpp | 5 +- src/libOpenImageIO/maketexture.cpp | 15 +- src/libOpenImageIO/xmp.cpp | 5 +- src/libtexture/environment.cpp | 4 +- src/libtexture/imagecache.cpp | 19 +- src/libtexture/imagecache_memory_pvt.h | 4 +- src/libtexture/imagecache_pvt.h | 22 +- src/libtexture/texoptions.cpp | 4 +- src/libtexture/texture3d.cpp | 4 +- src/libtexture/texture_pvt.h | 10 +- src/libtexture/texturesys.cpp | 8 +- src/libutil/SHA1.cpp | 4 +- src/libutil/SHA1.h | 4 +- src/libutil/argparse.cpp | 8 +- src/libutil/benchmark.cpp | 21 +- src/libutil/errorhandler.cpp | 4 +- src/libutil/farmhash.cpp | 29 +- src/libutil/filesystem.cpp | 26 +- src/libutil/filter.cpp | 4 +- src/libutil/hashes.cpp | 4 +- src/libutil/paramlist.cpp | 43 +-- src/libutil/plugin.cpp | 4 +- src/libutil/strutil.cpp | 55 ++-- src/libutil/strutil_test.cpp | 2 +- src/libutil/sysutil.cpp | 24 +- src/libutil/thread.cpp | 93 +++++-- src/libutil/timer.cpp | 4 +- src/libutil/typedesc.cpp | 108 ++++---- src/libutil/ustring.cpp | 4 +- src/libutil/xxhash.cpp | 4 +- src/oiiotool/oiiotool.cpp | 4 +- 114 files changed, 1779 insertions(+), 1008 deletions(-) create mode 100644 src/include/OpenImageIO/nsversions.h diff --git a/.github/workflows/build-steps.yml b/.github/workflows/build-steps.yml index b75e84c32c..cbc2133223 100644 --- a/.github/workflows/build-steps.yml +++ b/.github/workflows/build-steps.yml @@ -203,7 +203,7 @@ jobs: time make sphinx - name: Upload testsuite debugging artifacts uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 - if: ${{ failure() || inputs.build_docs == '1' || inputs.benchmark == '1' }} + if: ${{ failure() || inputs.build_docs == '1' || inputs.benchmark == '1' || inputs.abi_check != '' }} with: name: oiio-${{github.job}}-${{inputs.nametag}} path: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 197dd8480b..bdeebf4cb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -388,7 +388,7 @@ jobs: simd: "avx2,f16c" skip_tests: 1 # abi_check: v3.1.3.0 - abi_check: ae5dca7865c9956b43cc04dee00a65ad893e251e + abi_check: 9bfcce725a3806a3f70c7e838d9d98d6d95c917a setenvs: export OIIO_CMAKE_FLAGS="-DOIIO_BUILD_TOOLS=0 -DOIIO_BUILD_TESTS=0 -DUSE_PYTHON=0" USE_OPENCV=0 USE_FFMPEG=0 USE_PYTHON=0 USE_FREETYPE=0 diff --git a/src/build-scripts/ci-abicheck.bash b/src/build-scripts/ci-abicheck.bash index 88c9c56ad0..5c83f5259e 100755 --- a/src/build-scripts/ci-abicheck.bash +++ b/src/build-scripts/ci-abicheck.bash @@ -41,6 +41,7 @@ for lib in $LIBS ; do fgrep "Binary compatibility:" ${lib}-abi-results.txt echo -e "\x1b[33;0m" done +cp -r compat_reports ${BUILDDIR_NEW}/compat_reports || true # # If the "Binary compatibility" summary results say anything other than 100%, @@ -48,7 +49,6 @@ done # for lib in $LIBS ; do if [[ `fgrep "Binary compatibility:" ${lib}-abi-results.txt | grep -v 100\%` != "" ]] ; then - cp -r compat_reports ${BUILDDIR_NEW}/compat_reports exit 1 fi done diff --git a/src/doc/Doxyfile b/src/doc/Doxyfile index 82d533b7a4..64358b8ed3 100644 --- a/src/doc/Doxyfile +++ b/src/doc/Doxyfile @@ -2189,6 +2189,8 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ OIIO_NAMESPACE_3_0_END="}" \ OIIO_NAMESPACE_3_1_BEGIN="namespace OIIO {" \ OIIO_NAMESPACE_3_1_END="}" \ + OIIO_NAMESPACE_3_2_BEGIN="namespace OIIO {" \ + OIIO_NAMESPACE_3_2_END="}" \ OIIO_NS_BEGIN="namespace OIIO {" \ OIIO_NS_END="}" \ OIIO_CONSTEXPR17=constexpr \ diff --git a/src/include/OpenImageIO/argparse.h b/src/include/OpenImageIO/argparse.h index 5d323830e1..4b598fdf73 100644 --- a/src/include/OpenImageIO/argparse.h +++ b/src/include/OpenImageIO/argparse.h @@ -20,8 +20,12 @@ #include #include +// Define symbols that let client applications determine if newly added +// features are supported. +#define OIIO_ARGPARSE_SUPPORTS_BRIEFUSAGE 1 +#define OIIO_ARGPARSE_SUPPORTS_HUMAN_PARAMNAME 1 -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN ///////////////////////////////////////////////////////////////////////////// @@ -173,7 +177,7 @@ OIIO_NAMESPACE_BEGIN class OIIO_UTIL_API ArgParse { public: - class Arg; // Forward declarion of Arg + class Arg; // Forward declaration of Arg // ------------------------------------------------------------------ /// @defgroup Setting up an ArgParse @@ -782,11 +786,4 @@ class OIIO_UTIL_API ArgParse { void usage() const { print_help(); } }; - - -// Define symbols that let client applications determine if newly added -// features are supported. -#define OIIO_ARGPARSE_SUPPORTS_BRIEFUSAGE 1 -#define OIIO_ARGPARSE_SUPPORTS_HUMAN_PARAMNAME 1 - -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/atomic.h b/src/include/OpenImageIO/atomic.h index 1a91c2a3f0..2113d7d3d8 100644 --- a/src/include/OpenImageIO/atomic.h +++ b/src/include/OpenImageIO/atomic.h @@ -19,11 +19,11 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using std::atomic; -typedef atomic atomic_int; -typedef atomic atomic_ll; +using atomic_int = atomic; +using atomic_ll = atomic; @@ -79,5 +79,17 @@ atomic_fetch_add(atomic& a, double f) } while (true); } +OIIO_NAMESPACE_3_1_END + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using std::atomic; +using atomic_int = atomic; +using atomic_ll = atomic; +using v3_1::atomic_fetch_add; +using v3_1::atomic_max; +using v3_1::atomic_min; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/attrdelegate.h b/src/include/OpenImageIO/attrdelegate.h index f0fc28b0d0..2fadd00da8 100644 --- a/src/include/OpenImageIO/attrdelegate.h +++ b/src/include/OpenImageIO/attrdelegate.h @@ -14,7 +14,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pvt { @@ -229,4 +229,13 @@ template class AttrDelegate { }; +OIIO_NAMESPACE_3_1_END + + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::AttrDelegate; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/benchmark.h b/src/include/OpenImageIO/benchmark.h index 2c8b23a6ef..bfcb8b8235 100644 --- a/src/include/OpenImageIO/benchmark.h +++ b/src/include/OpenImageIO/benchmark.h @@ -24,7 +24,7 @@ #endif -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// DoNotOptimize(val) is a helper function for timing benchmarks that fools /// the compiler into thinking the the location 'val' is used and will not @@ -470,6 +470,24 @@ OIIO_FORCEINLINE void clobber_all_memory() { } #endif +OIIO_UTIL_API std::ostream& operator<<(std::ostream& out, + const Benchmarker& bench); + +OIIO_NAMESPACE_3_1_END +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::Benchmarker; +using v3_1::clobber; +using v3_1::clobber_all_memory; +using v3_1::DoNotOptimize; +using v3_1::time_trial; +using v3_1::timed_thread_wedge; +using v3_1::operator<<; +namespace pvt { +using v3_1::pvt::use_char_ptr; +} +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/bit.h b/src/include/OpenImageIO/bit.h index 1b8265b591..08526f3b85 100644 --- a/src/include/OpenImageIO/bit.h +++ b/src/include/OpenImageIO/bit.h @@ -10,7 +10,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// Standards-compliant bit cast of two equally sized types. This is used @@ -273,4 +273,19 @@ rotl64(uint64_t x, int k) +OIIO_NAMESPACE_3_1_END + + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::bitcast; +using v3_1::bitcast_to_float; +using v3_1::bitcast_to_int; +using v3_1::byteswap; +using v3_1::rotl; +using v3_1::rotl32; +using v3_1::rotl64; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/color.h b/src/include/OpenImageIO/color.h index e284e6c337..46676efe76 100644 --- a/src/include/OpenImageIO/color.h +++ b/src/include/OpenImageIO/color.h @@ -12,6 +12,9 @@ #include #include +// Preprocessor symbol to allow conditional compilation depending on +// whether the ColorProcessor class is exposed (it was not prior to OIIO 1.9). +#define OIIO_HAS_COLORPROCESSOR 1 // // Some general color management information materials to have handy: @@ -23,7 +26,12 @@ // -OIIO_NAMESPACE_BEGIN +// Preprocessor symbol to allow conditional compilation depending on +// whether the ColorConfig returns ColorProcessor shared pointers or raw. +#define OIIO_COLORCONFIG_USES_SHARED_PTR 1 + + +OIIO_NAMESPACE_3_1_BEGIN /// The ColorProcessor encapsulates a baked color transformation, suitable for /// application to raw pixels, or ImageBuf(s). These are generated using @@ -50,17 +58,9 @@ class OIIO_API ColorProcessor { } }; -// Preprocessor symbol to allow conditional compilation depending on -// whether the ColorProcessor class is exposed (it was not prior to OIIO 1.9). -#define OIIO_HAS_COLORPROCESSOR 1 - - -typedef std::shared_ptr ColorProcessorHandle; -// Preprocessor symbol to allow conditional compilation depending on -// whether the ColorConfig returns ColorProcessor shared pointers or raw. -#define OIIO_COLORCONFIG_USES_SHARED_PTR 1 +using ColorProcessorHandle = std::shared_ptr; @@ -445,7 +445,18 @@ class OIIO_API ColorConfig { Impl* getImpl() const { return m_impl.get(); } }; +OIIO_NAMESPACE_3_1_END + +// Compatibility +#ifndef OIIO_DOXYGEN +OIIO_NAMESPACE_BEGIN +using v3_1::ColorProcessorHandle; +OIIO_NAMESPACE_END +#endif + + +OIIO_NAMESPACE_BEGIN /// Utility -- convert sRGB value to linear transfer function, without /// any change in color primaries. diff --git a/src/include/OpenImageIO/deepdata.h b/src/include/OpenImageIO/deepdata.h index d814914872..deec7bebd5 100644 --- a/src/include/OpenImageIO/deepdata.h +++ b/src/include/OpenImageIO/deepdata.h @@ -10,12 +10,7 @@ #include #include -OIIO_NAMESPACE_BEGIN - - -struct TypeDesc; -class ImageSpec; - +OIIO_NAMESPACE_3_1_BEGIN /// A `DeepData` holds the contents of an image of ``deep'' pixels (multiple @@ -209,4 +204,4 @@ class OIIO_API DeepData { }; -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/detail/farmhash.h b/src/include/OpenImageIO/detail/farmhash.h index c5c00652d1..99e9903b7f 100644 --- a/src/include/OpenImageIO/detail/farmhash.h +++ b/src/include/OpenImageIO/detail/farmhash.h @@ -216,7 +216,7 @@ STATIC_INLINE void simpleSwap(T &a, T &b) { #define Hash128to64 OIIO::farmhash::Hash128to64 // namespace NAMESPACE_FOR_HASH_FUNCTIONS { -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace farmhash { namespace inlined { @@ -379,7 +379,8 @@ STATIC_INLINE uint64_t Rotate64(uint64_t val, int shift) { // } // namespace NAMESPACE_FOR_HASH_FUNCTIONS } /*end namespace inlined */ -} /*end namespace farmhash*/ OIIO_NAMESPACE_END +} /*end namespace farmhash*/ +OIIO_NAMESPACE_3_1_END // FARMHASH PORTABILITY LAYER: debug mode or max speed? // One may use -DFARMHASH_DEBUG=1 or -DFARMHASH_DEBUG=0 to force the issue. @@ -506,7 +507,7 @@ STATIC_INLINE uint64_t Rotate64(uint64_t val, int shift) { // namespace NAMESPACE_FOR_HASH_FUNCTIONS { -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN //using namespace OIIO::farmhash; namespace farmhash { namespace inlined { @@ -2184,8 +2185,16 @@ STATIC_INLINE uint128_t Fingerprint128(const char* s, size_t len) { #undef Murk #undef Chunk -OIIO_NAMESPACE_END - #undef STATIC_INLINE +OIIO_NAMESPACE_3_1_END + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +namespace farmhash { +using namespace OIIO::v3_1::farmhash; +} // namespace farmhash +#endif +OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/detail/fmt.h b/src/include/OpenImageIO/detail/fmt.h index 33fed3cb37..b68ea14e02 100644 --- a/src/include/OpenImageIO/detail/fmt.h +++ b/src/include/OpenImageIO/detail/fmt.h @@ -21,12 +21,12 @@ #if OIIO_VERSION_LESS(3, 1, 2) /* DEPRECATED -- remove at next ABI compatibility boundary */ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pvt { OIIO_UTIL_API void log_fmt_error(const char* message); }; -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END #endif // Use the grisu fast floating point formatting for old fmt versions @@ -78,7 +78,7 @@ OIIO_PRAGMA_WARNING_POP #endif -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pvt { @@ -197,4 +197,15 @@ struct array_formatter : format_parser_with_separator { } // namespace pvt +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +namespace pvt { +using v3_1::pvt::array_formatter; +using v3_1::pvt::index_formatter; +} // namespace pvt +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/detail/pugixml/pugixml.cpp b/src/include/OpenImageIO/detail/pugixml/pugixml.cpp index 6b381f9cc3..d764c28f9c 100644 --- a/src/include/OpenImageIO/detail/pugixml/pugixml.cpp +++ b/src/include/OpenImageIO/detail/pugixml/pugixml.cpp @@ -150,17 +150,17 @@ using std::memset; // We put implementation details into an anonymous namespace in source mode, but have to keep it in non-anonymous namespace in header-only mode to prevent binary bloat. #ifdef PUGIXML_HEADER_ONLY -# define PUGI__NS_BEGIN OIIO_NAMESPACE_BEGIN namespace pugi { namespace impl { -# define PUGI__NS_END } } OIIO_NAMESPACE_END +# define PUGI__NS_BEGIN OIIO_NAMESPACE_3_1_BEGIN namespace pugi { namespace impl { +# define PUGI__NS_END } } OIIO_NAMESPACE_3_1_END # define PUGI__FN inline # define PUGI__FN_NO_INLINE inline #else # if defined(_MSC_VER) && _MSC_VER < 1300 // MSVC6 seems to have an amusing bug with anonymous namespaces inside namespaces -# define PUGI__NS_BEGIN OIIO_NAMESPACE_BEGIN namespace pugi { namespace impl { -# define PUGI__NS_END } } OIIO_NAMESPACE_END +# define PUGI__NS_BEGIN OIIO_NAMESPACE_3_1_BEGIN namespace pugi { namespace impl { +# define PUGI__NS_END } } OIIO_NAMESPACE_3_1_END # else -# define PUGI__NS_BEGIN OIIO_NAMESPACE_BEGIN namespace pugi { namespace impl { namespace { -# define PUGI__NS_END } } } OIIO_NAMESPACE_END +# define PUGI__NS_BEGIN OIIO_NAMESPACE_3_1_BEGIN namespace pugi { namespace impl { namespace { +# define PUGI__NS_END } } } OIIO_NAMESPACE_3_1_END # endif # define PUGI__FN # define PUGI__FN_NO_INLINE PUGI__NO_INLINE @@ -168,7 +168,7 @@ using std::memset; // uintptr_t #if (defined(_MSC_VER) && _MSC_VER < 1600) || (defined(__BORLANDC__) && __BORLANDC__ < 0x561) -OIIO_NAMESPACE_BEGIN namespace pugi +OIIO_NAMESPACE_3_1_BEGIN namespace pugi { # ifndef _UINTPTR_T_DEFINED typedef size_t uintptr_t; @@ -177,7 +177,7 @@ OIIO_NAMESPACE_BEGIN namespace pugi typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; -} OIIO_NAMESPACE_END +} OIIO_NAMESPACE_3_1_END #else # include #endif @@ -1048,7 +1048,7 @@ PUGI__NS_END #endif #ifdef PUGIXML_COMPACT -OIIO_NAMESPACE_BEGIN namespace pugi +OIIO_NAMESPACE_3_1_BEGIN namespace pugi { struct xml_attribute_struct { @@ -1091,9 +1091,9 @@ OIIO_NAMESPACE_BEGIN namespace pugi impl::compact_pointer first_attribute; }; -} OIIO_NAMESPACE_END +} OIIO_NAMESPACE_3_1_END #else -OIIO_NAMESPACE_BEGIN namespace pugi +OIIO_NAMESPACE_3_1_BEGIN namespace pugi { struct xml_attribute_struct { @@ -1132,7 +1132,7 @@ OIIO_NAMESPACE_BEGIN namespace pugi xml_attribute_struct* first_attribute; }; -} OIIO_NAMESPACE_END +} OIIO_NAMESPACE_3_1_END #endif PUGI__NS_BEGIN @@ -5071,7 +5071,7 @@ PUGI__NS_BEGIN }; PUGI__NS_END -OIIO_NAMESPACE_BEGIN namespace pugi +OIIO_NAMESPACE_3_1_BEGIN namespace pugi { PUGI__FN xml_writer_file::xml_writer_file(void* file_): file(file_) { @@ -7358,7 +7358,7 @@ OIIO_NAMESPACE_BEGIN namespace pugi { return impl::xml_memory::deallocate; } -} OIIO_NAMESPACE_END +} OIIO_NAMESPACE_3_1_END #if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC)) namespace std @@ -12172,7 +12172,7 @@ PUGI__NS_BEGIN } PUGI__NS_END -OIIO_NAMESPACE_BEGIN namespace pugi +OIIO_NAMESPACE_3_1_BEGIN namespace pugi { #ifndef PUGIXML_NO_EXCEPTIONS PUGI__FN xpath_exception::xpath_exception(const xpath_parse_result& result_): _result(result_) @@ -12953,7 +12953,7 @@ OIIO_NAMESPACE_BEGIN namespace pugi { return query.evaluate_node(*this); } -} OIIO_NAMESPACE_END +} OIIO_NAMESPACE_3_1_END #endif diff --git a/src/include/OpenImageIO/detail/pugixml/pugixml.hpp b/src/include/OpenImageIO/detail/pugixml/pugixml.hpp index a7f1680f36..b39fa832ea 100644 --- a/src/include/OpenImageIO/detail/pugixml/pugixml.hpp +++ b/src/include/OpenImageIO/detail/pugixml/pugixml.hpp @@ -134,13 +134,13 @@ #endif -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pugi {} -OIIO_NAMESPACE_END -namespace pugi = OIIO::pugi; +OIIO_NAMESPACE_3_1_END +namespace pugi = OIIO::v3_1::pugi; -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pugi { // Character type used for all internal storage and operations; depends on PUGIXML_WCHAR_MODE @@ -1457,7 +1457,7 @@ namespace pugi allocation_function PUGIXML_FUNCTION get_memory_allocation_function(); deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function(); } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END #if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC)) namespace std diff --git a/src/include/OpenImageIO/errorhandler.h b/src/include/OpenImageIO/errorhandler.h index 007386903f..ac96204bbd 100644 --- a/src/include/OpenImageIO/errorhandler.h +++ b/src/include/OpenImageIO/errorhandler.h @@ -10,7 +10,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// ErrorHandler is a simple class that accepts error messages /// (classified as errors, severe errors, warnings, info, messages, or @@ -136,4 +136,4 @@ class OIIO_UTIL_API ErrorHandler { int m_verbosity; }; -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/filesystem.h b/src/include/OpenImageIO/filesystem.h index 98eaf617b9..1f4084d93d 100644 --- a/src/include/OpenImageIO/filesystem.h +++ b/src/include/OpenImageIO/filesystem.h @@ -44,20 +44,22 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN #if OIIO_FILESYSTEM_USE_STDIO_FILEBUF // MingW uses GCC to build, but does not support having a wchar_t* passed as argument // of ifstream::open or ofstream::open. To properly support UTF-8 encoding on MingW we must // use the __gnu_cxx::stdio_filebuf GNU extension that can be used with _wfsopen and returned // into a istream which share the same API as ifsteam. The same reasoning holds for ofstream. -typedef basic_ifstream ifstream; -typedef basic_ofstream ofstream; +using ifstream = basic_ifstream; +using ofstream = basic_ofstream; #else -typedef std::ifstream ifstream; -typedef std::ofstream ofstream; +using ifstream = std::ifstream; +using ofstream = std::ofstream; #endif + + /// @namespace Filesystem /// /// @brief Platform-independent utilities for manipulating file names, @@ -243,12 +245,12 @@ OIIO_UTIL_API std::string current_path (); /// Version of std::ifstream.open that can handle UTF-8 paths /// -OIIO_UTIL_API void open (OIIO::ifstream &stream, string_view path, +OIIO_UTIL_API void open (ifstream &stream, string_view path, std::ios_base::openmode mode = std::ios_base::in); /// Version of std::ofstream.open that can handle UTF-8 paths /// -OIIO_UTIL_API void open (OIIO::ofstream &stream, string_view path, +OIIO_UTIL_API void open (ofstream &stream, string_view path, std::ios_base::openmode mode = std::ios_base::out); /// Version of C open() that can handle UTF-8 paths, returning an integer @@ -286,7 +288,7 @@ OIIO_UTIL_API bool write_text_file (string_view filename, string_view str); template bool write_binary_file (string_view filename, cspan data) { - OIIO::ofstream out; + ofstream out; Filesystem::open(out, filename, std::ios::out | std::ios::binary); out.write((const char*)data.data(), data.size() * sizeof(T)); return out.good(); @@ -584,4 +586,15 @@ class OIIO_UTIL_API IOMemReader : public IOProxy { }; // namespace Filesystem +OIIO_NAMESPACE_3_1_END + +// Compatibility +#ifndef OIIO_DOXYGEN +OIIO_NAMESPACE_BEGIN +using ifstream = v3_1::ifstream; +using ofstream = v3_1::ofstream; +namespace Filesystem { +using namespace OIIO::v3_1::Filesystem; +}; // namespace Filesystem OIIO_NAMESPACE_END +#endif diff --git a/src/include/OpenImageIO/filter.h b/src/include/OpenImageIO/filter.h index 93d1a9c099..5bc00f0e1f 100644 --- a/src/include/OpenImageIO/filter.h +++ b/src/include/OpenImageIO/filter.h @@ -12,7 +12,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// Quick structure that describes a filter. /// @@ -156,4 +156,4 @@ class OIIO_UTIL_API Filter2D { }; -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/fmath.h b/src/include/OpenImageIO/fmath.h index e97a748c1b..bb73ff14ea 100644 --- a/src/include/OpenImageIO/fmath.h +++ b/src/include/OpenImageIO/fmath.h @@ -46,6 +46,12 @@ OIIO_NAMESPACE_BEGIN +// NOTE: Almost everything in fmath.h is either inline or templated, and +// therefore can be left in the "current" OIIO namespace, they are never +// visible between translation units. But if this ever comes up as a problem, +// we can just move them into an older v3_1 namespace and appropriate `using` +// directives to alias it into other namespaces. + /// If the caller defines OIIO_FMATH_HEADER_ONLY to nonzero, then 100% of the /// implementation of fmath functions will be defined directly in this header @@ -743,7 +749,10 @@ scaled_conversion(const S& src, F scale, F min, F max) } } +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN /// Convert n consecutive values from the type of S to the type of D. /// The conversion is not a simple cast, but correctly remaps the @@ -1017,6 +1026,11 @@ convert_type (const S &src) } } +OIIO_NAMESPACE_3_1_END + + +OIIO_NAMESPACE_BEGIN +using v3_1::convert_type; /// Helper function to convert channel values between different bit depths. @@ -2272,6 +2286,12 @@ interpolate_linear (float x, span_strided y) // (end miscellaneous numerical methods) //////////////////////////////////////////////////////////////////////////// +OIIO_NAMESPACE_END +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::convert_type; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/fstream_mingw.h b/src/include/OpenImageIO/fstream_mingw.h index 4ac577474f..6a4e860729 100644 --- a/src/include/OpenImageIO/fstream_mingw.h +++ b/src/include/OpenImageIO/fstream_mingw.h @@ -24,7 +24,7 @@ # include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN template> @@ -309,7 +309,15 @@ basic_ofstream<_CharT, _Traits>::close() } // basic_fstream -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END + +// Compatibility +OIIO_NAMESPACE_BEGIN +# ifndef OIIO_DOXYGEN +using v3_1::basic_ifstream; +using v3_1::basic_ofstream; +# endif +OIIO_NAMESPACE_END #endif // #if defined(_WIN32) && defined(__GLIBCXX__) diff --git a/src/include/OpenImageIO/function_view.h b/src/include/OpenImageIO/function_view.h index 5df9842a2e..e945bfe5cf 100644 --- a/src/include/OpenImageIO/function_view.h +++ b/src/include/OpenImageIO/function_view.h @@ -47,7 +47,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// function_view is a lightweight non-owning generic callable @@ -105,4 +105,10 @@ template class function_view { }; +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +using v3_1::function_view; OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/hash.h b/src/include/OpenImageIO/hash.h index 12e58d1616..8424869a97 100644 --- a/src/include/OpenImageIO/hash.h +++ b/src/include/OpenImageIO/hash.h @@ -27,7 +27,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using std::hash; using std::unordered_map; @@ -563,7 +563,7 @@ inline uint128_t Fingerprint128(const Str& s) { class CSHA1; // opaque forward declaration -/// Class that encapsulates SHA-1 hashing, a crypticographic-strength +/// Class that encapsulates SHA-1 hashing, a cryptographic-strength /// 160-bit hash function. It's not as fast as our other hashing /// methods, but has an extremely low chance of having collisions. class OIIO_API SHA1 { @@ -616,4 +616,16 @@ class OIIO_API SHA1 { }; +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +// Replicate the hashing namespaces in v3_1:: inside OIIO:: +namespace fasthash { using namespace OIIO::v3_1::fasthash; } +namespace xxhash { using namespace OIIO::v3_1::xxhash; } +namespace bjhash { using namespace OIIO::v3_1::bjhash; } +namespace murmur { using namespace OIIO::v3_1::murmur; } +namespace farmhash { using namespace OIIO::v3_1::farmhash; } +using v3_1::SHA1; OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/image_span.h b/src/include/OpenImageIO/image_span.h index 5f685eb6ad..2684c15504 100644 --- a/src/include/OpenImageIO/image_span.h +++ b/src/include/OpenImageIO/image_span.h @@ -11,24 +11,8 @@ #include -OIIO_NAMESPACE_BEGIN - -#ifndef OIIO_STRIDE_T_DEFINED -# define OIIO_STRIDE_T_DEFINED -/// Type we use to express how many pixels (or bytes) constitute an image, -/// tile, or scanline. -using imagesize_t = uint64_t; - -/// Type we use for stride lengths between pixels, scanlines, or image -/// planes. -using stride_t = int64_t; - -/// Special value to indicate a stride length that should be -/// auto-computed. -inline constexpr stride_t AutoStride = std::numeric_limits::min(); -#endif - +OIIO_NAMESPACE_3_1_BEGIN /// image_span : a non-owning reference to an image-like n-D array having /// between 2 and 4 dimensions representing channel, x, y, z with each @@ -52,6 +36,8 @@ template class image_span { using stride_type = int64_t; using size_type = uint32_t; + static constexpr stride_t AutoStride = std::numeric_limits::min(); + /// Default ctr -- points to nothing image_span() = default; @@ -385,6 +371,8 @@ as_image_span_writable_bytes(const image_span& src) noexcept src.ystride(), src.zstride(), src.chansize()); } + + /// Verify that the image_span has all its contents lying within the /// contiguous span. OIIO_API bool @@ -402,4 +390,17 @@ image_span_within_span(const image_span& ispan, as_bytes(contiguous)); } +OIIO_NAMESPACE_3_1_END + + +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::as_image_span_bytes; +using v3_1::as_image_span_writable_bytes; +using v3_1::image1d_span; +using v3_1::image2d_span; +using v3_1::image3d_span; +using v3_1::image_span; +using v3_1::image_span_within_span; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/image_view.h b/src/include/OpenImageIO/image_view.h index 6d1bae6102..6811bac5e7 100644 --- a/src/include/OpenImageIO/image_view.h +++ b/src/include/OpenImageIO/image_view.h @@ -12,7 +12,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// image_view : a non-owning reference to an image-like array (indexed by @@ -123,4 +123,4 @@ class OIIO_DEPRECATED("image_view is deprecated. Consider image_span.") }; -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/imagebuf.h b/src/include/OpenImageIO/imagebuf.h index 2015e923db..ad55228101 100644 --- a/src/include/OpenImageIO/imagebuf.h +++ b/src/include/OpenImageIO/imagebuf.h @@ -37,13 +37,7 @@ -OIIO_NAMESPACE_BEGIN - -class ImageBuf; -class ImageBufImpl; // Opaque type for the unique_ptr. -class ImageCache; -class ImageCacheTile; - +OIIO_NAMESPACE_3_1_BEGIN /// Return pixel data window for this ImageSpec as a ROI. @@ -2042,4 +2036,14 @@ class OIIO_API ImageBuf { }; +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +using v3_1::get_roi; +using v3_1::get_roi_full; +using v3_1::InitializePixels; +using v3_1::set_roi; +using v3_1::set_roi_full; OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/imagebufalgo.h b/src/include/OpenImageIO/imagebufalgo.h index 5f8063ccfc..f70cbf72e6 100644 --- a/src/include/OpenImageIO/imagebufalgo.h +++ b/src/include/OpenImageIO/imagebufalgo.h @@ -18,18 +18,14 @@ #include #include #include +#include #include #include #include -OIIO_NAMESPACE_BEGIN - -// forward declarations -class ColorConfig; -class ColorProcessor; -class Filter2D; +OIIO_NAMESPACE_3_1_BEGIN /// @defgroup ImageBufAlgo_intro (ImageBufAlgo common principles) @@ -2707,3 +2703,14 @@ inline bool fit(ImageBuf &dst, const ImageBuf &src, Filter2D *filter, } // end namespace ImageBufAlgo OIIO_NAMESPACE_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::Image_or_Const; +namespace ImageBufAlgo { +using namespace OIIO::v3_1::ImageBufAlgo; +} +#endif +OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/imagebufalgo_opencv.h b/src/include/OpenImageIO/imagebufalgo_opencv.h index 56b0e349a4..7ce0373632 100644 --- a/src/include/OpenImageIO/imagebufalgo_opencv.h +++ b/src/include/OpenImageIO/imagebufalgo_opencv.h @@ -59,7 +59,7 @@ OIIO_PRAGMA_WARNING_POP -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace ImageBufAlgo { @@ -294,4 +294,4 @@ ImageBufAlgo::capture_image(int cameranum, TypeDesc convert) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/imagebufalgo_util.h b/src/include/OpenImageIO/imagebufalgo_util.h index afbc944208..86b145dcab 100644 --- a/src/include/OpenImageIO/imagebufalgo_util.h +++ b/src/include/OpenImageIO/imagebufalgo_util.h @@ -13,11 +13,8 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN -using std::bind; -using std::cref; -using std::ref; using namespace std::placeholders; using std::placeholders::_1; @@ -808,4 +805,10 @@ perpixel_op(const ImageBuf& srcA, const ImageBuf& srcB, } // end namespace ImageBufAlgo +OIIO_NAMESPACE_3_1_END + + +OIIO_NAMESPACE_BEGIN +using namespace std::placeholders; +using std::placeholders::_1; OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/imagecache.h b/src/include/OpenImageIO/imagecache.h index 008b33bf34..20b784601f 100644 --- a/src/include/OpenImageIO/imagecache.h +++ b/src/include/OpenImageIO/imagecache.h @@ -25,16 +25,7 @@ -OIIO_NAMESPACE_BEGIN - -// Forward declarations -class TextureOpt_v2; - -class ImageCachePerThreadInfo; -class ImageCacheFile; -class ImageCacheTile; -class ImageCacheImpl; - +OIIO_NAMESPACE_3_1_BEGIN /// Define an API to an abstract class that manages image files, @@ -1343,8 +1334,8 @@ class OIIO_API ImageCache { ~ImageCache(); private: - friend class TextureSystem; - friend class TextureSystemImpl; + friend class OIIO::TextureSystem; + friend class OIIO::TextureSystemImpl; // PIMPL idiom using Impl = ImageCacheImpl; @@ -1356,4 +1347,4 @@ class OIIO_API ImageCache { }; -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/imageio.h b/src/include/OpenImageIO/imageio.h index f7576a2060..1002d8cf0b 100644 --- a/src/include/OpenImageIO/imageio.h +++ b/src/include/OpenImageIO/imageio.h @@ -39,14 +39,9 @@ #include #include -OIIO_NAMESPACE_BEGIN -class DeepData; -class ImageBuf; -class Timer; -#ifndef OIIO_STRIDE_T_DEFINED -# define OIIO_STRIDE_T_DEFINED +OIIO_NAMESPACE_3_1_BEGIN /// Type we use to express how many pixels (or bytes) constitute an image, /// tile, or scanline. using imagesize_t = uint64_t; @@ -58,7 +53,21 @@ using stride_t = int64_t; /// Special value to indicate a stride length that should be /// auto-computed. inline constexpr stride_t AutoStride = std::numeric_limits::min(); + +OIIO_NAMESPACE_3_1_END + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::imagesize_t; +using v3_1::stride_t; +using v3_1::AutoStride; #endif +OIIO_NAMESPACE_END + + + +OIIO_NAMESPACE_3_1_BEGIN // Signal that this version of ImageBuf has constructors from spans #define OIIO_IMAGEINPUT_IMAGE_SPAN_SUPPORT 1 @@ -75,11 +84,6 @@ typedef bool (*ProgressCallback)(void *opaque_data, float portion_done); -// Forward declaration of IOProxy -namespace Filesystem { - class IOProxy; -} - /// ROI is a small helper struct describing a rectangular region of interest /// in an image. The region is [xbegin,xend) x [begin,yend) x [zbegin,zend), @@ -4107,7 +4111,7 @@ inline bool getattribute(string_view name, TypeDesc type, span value) { OIIO_DASSERT(BaseTypeFromC::value == type.basetype && type.size() == value.size_bytes()); - return OIIO::getattribute(name, type, OIIO::as_writable_bytes(value)); + return OIIO::v3_1::getattribute(name, type, OIIO::as_writable_bytes(value)); } /// A version of `getattribute()` that stores the value in a span of @@ -4222,12 +4226,12 @@ inline std::map> get_extension_map() { std::map> map; - auto all_extensions = OIIO::get_string_attribute("extension_list"); - for (auto oneformat : OIIO::Strutil::splitsv(all_extensions, ";")) { - auto format_exts = OIIO::Strutil::splitsv(oneformat, ":", 2); + auto all_extensions = get_string_attribute("extension_list"); + for (auto oneformat : Strutil::splitsv(all_extensions, ";")) { + auto format_exts = Strutil::splitsv(oneformat, ":", 2); if (format_exts.size() != 2) continue; // something went wrong - map[format_exts[0]] = OIIO::Strutil::splits(format_exts[1], ","); + map[format_exts[0]] = Strutil::splits(format_exts[1], ","); } return map; } @@ -4510,15 +4514,18 @@ OIIO_API void log_time(string_view key, const Timer& timer, int count = 1); // to force correct linkage on some systems OIIO_API void _ImageIO_force_link (); +OIIO_NAMESPACE_3_1_END + ////////////////////////////////////////////////////////////////////////// // DEPRECATED things // -// These are all hidden from ocumentation and internal use, and should trigger -// deprecation warnings if used externally. They will most likely be removed -// entirely before the final release of OIIO 3.0. +// These are all hidden from documentation and internal use, and should +// trigger deprecation warnings if used externally. They will most likely be +// removed entirely before the final release of OIIO 3.0. // #if !defined(OIIO_INTERNAL) && !defined(OIIO_DOXYGEN) +OIIO_NAMESPACE_BEGIN #if OIIO_DISABLE_DEPRECATED < OIIO_MAKE_VERSION(2, 1, 0) // DEPRECATED(2.1): old name @@ -4556,13 +4563,61 @@ inline void debug (const char* fmt, const T1& v1, const Args&... args) } #endif +OIIO_NAMESPACE_END #endif // ////////////////////////////////////////////////////////////////////////// + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +// clang-format on +using v3_1::add_dither; +using v3_1::attribute; +using v3_1::convert_image; +using v3_1::convert_pixel_values; +using v3_1::copy_image; +using v3_1::cspan_from_buffer; +using v3_1::debug; +using v3_1::debugfmt; +using v3_1::declare_imageio_format; +using v3_1::equivalent_colorspace; +using v3_1::errorfmt; +using v3_1::get_extension_map; +using v3_1::get_float_attribute; +using v3_1::get_int_attribute; +using v3_1::get_string_attribute; +using v3_1::getattribute; +using v3_1::geterror; +using v3_1::has_error; +using v3_1::is_imageio_format_name; +using v3_1::log_time; +using v3_1::openimageio_version; +using v3_1::parallel_convert_image; +using v3_1::premult; +using v3_1::ProgressCallback; +using v3_1::roi_intersection; +using v3_1::roi_union; +using v3_1::set_colorspace; +using v3_1::set_colorspace_rec709_gamma; +using v3_1::shutdown; +using v3_1::span_from_buffer; +using v3_1::wrap_black; +using v3_1::wrap_clamp; +using v3_1::wrap_impl; +using v3_1::wrap_mirror; +using v3_1::wrap_periodic; +using v3_1::wrap_periodic_pow2; +namespace pvt { +using v3_1::pvt::append_error; +} +#endif OIIO_NAMESPACE_END + #if FMT_VERSION >= 100000 FMT_BEGIN_NAMESPACE template<> struct formatter : ostream_formatter {}; diff --git a/src/include/OpenImageIO/memory.h b/src/include/OpenImageIO/memory.h index e9b8379fbe..cb71ec4c00 100644 --- a/src/include/OpenImageIO/memory.h +++ b/src/include/OpenImageIO/memory.h @@ -18,7 +18,7 @@ #include #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pvt { @@ -127,4 +127,15 @@ footprint(const std::vector& vec) } // namespace pvt -OIIO_NAMESPACE_END \ No newline at end of file +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +namespace pvt { +using v3_1::pvt::footprint; +using v3_1::pvt::heapsize; +} // namespace pvt +#endif +OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/nsversions.h b/src/include/OpenImageIO/nsversions.h new file mode 100644 index 0000000000..51ae50777f --- /dev/null +++ b/src/include/OpenImageIO/nsversions.h @@ -0,0 +1,252 @@ +// Copyright Contributors to the OpenImageIO project. +// SPDX-License-Identifier: Apache-2.0 +// https://github.com/AcademySoftwareFoundation/OpenImageIO + +// clang-format off + +#ifndef OPENIMAGEIO_NSVERSIONS_H +#define OPENIMAGEIO_NSVERSIONS_H + +#ifndef OPENIMAGEIO_VERSION_H +# error "oiioversion.h must always be included before nsversions.h" +#endif + + +// Establish the namespaces. +// +// The outer namespace defaults to OpenImageIO, but can be overriden at build +// time. "OIIO" is always defined as an alias to this namespace, so client +// software can always say `OIIO:Foo` without needing to know the custom outer +// namespace. +// +// The primary inner namespace is vMAJ_MIN (or in main, vMAJ_MIN_PAT). The +// outer namespace declares the inner namespace as "inline", so anything in it +// is visible in OIIO by default. +// +// But we also keep around all the symbols for older vOLDMAJ_OLDMIN, so that +// we don't lose link/ABI compatibility with apps compiled for older minor +// versions within the same major version family. +// +// +// Here is the scheme we use to maintain ABI compatibility across minor +// version boundaries. +// +// 1. Declarations in the current new namespace +// +// * Pure OIIO internals that are not exposed in the public APIs or +// headers, and therefore generate no externally visible linker symbols. +// * NEW items that will break ABI or API, in main (will be moved into a +// specific version namespace before release). +// +// These declarations perpetually live in the "current" namespace: +// +// OIIO_NAMESPACE_BEGIN +// inline int myfunc() { ... } +// constexpr int myconst = 3; +// template Mytemplate { ... } +// // ONLY if Mytemplate is not used as the type of a parameter +// // or return value of any exposed public OIIO API function! +// // If it ever is, it should be moved to a versioned namespace. +// OIIO_NAMESPACE_END +// +// Because of the inline inner default namespace, user code can just refer +// to these as `OIIO::myfunc()`, `OIIO::myconst`, etc. +// +// 2. Declarations carried over from previous versions and aliased into +// later/current namespaces: +// +// * Anything that was introduced in earlier versions and is enclosed in a +// namespace (like `Filesystem`, `Strutil`, or `ImageBufAlgo`). +// * Existing classes that were introduced in earlier OIIO versions, and +// any modifications that can be amended without breaking their ABIs +// (such as adding a non-virtual method). This also includes templated +// classes used to pass parameters or return values by OIIO's APIs. +// * Functions that were introduced in earlier versions and can simply +// be aliased into subsequent namespaces with `using`. +// * NEW items in the above categories that are logically related to +// existing things should be placed in the oldest namespace where the +// rest of its cohort lives, if that can be done without conflicting with +// existing symbols. +// +// These live in the namespace of the version where they were first +// introduced. Later versions alias these into their namespaces with +// `using`. +// +// OIIO_NAMESPACE_3_1_BEGIN +// class Myclass { ... }; +// template Mytemplate { ... } +// int standalone_func(); +// namespace Group { +// int func_in_group(); +// } +// OIIO_NAMESPACE_3_1_END +// +// // Alias these items into subsequent version namespaces +// OIIO_NAMESPACE_BEGIN +// using v3_1::Myclass; +// using v3_1::Mytemplate; +// using v3_1::standalone_func; +// namespace Group { +// using namespace v3_1::Group; +// // Makes EVERYTHING declared in v3_1::Group alias to +// // within the current namespace's Group. +// } +// OIIO_NAMESPACE_END +// +// 3. Declarations that must be separately defined in each namespace. +// +// * Classes or functions whose declarations in newer versions have changed +// in an ABI-incompatible way. +// * Standalone functions or globals that are not enclosed in a namespace +// and for whatever reason can't simply be pulled into later namespaces +// with the `using` directive. +// +// These must have separate symbols in each versioned namespace to preserve +// ABI compatibility. But it is customary to make the full and most +// efficient implementation in the newer namespace, and the others be +// trivial wrappers (with some small penalty for the double call, but +// that's ok because it's only incurred when linking against a too-new +// version). +// +// Declarations in the .h header: +// +// OIIO_NAMESPACE_3_1_BEGIN +// int myfunc(); +// class Myclass { int foo; ... } +// int anotherfunc(Myclass& m); +// OIIO_NAMESPACE_3_1_END +// +// // Duplicate in subsequent version namespaces +// OIIO_NAMESPACE_BEGIN +// float myfunc(); // changed return value +// class Myclass { float foo; ... } // data layout changed +// int anotherfunc(Myclass& m); // DIFFERENT Myclass! +// OIIO_NAMESPACE_END +// +// Implementation in the .cpp file: +// +// OIIO_NAMESPACE_BEGIN +// // Current namespace gets a full implementation of myfunc: +// float myfunc() { ... } +// +// // New anotherfunc takes new definition of Myclass: +// int anotherfunc(Myclass& m) { ... } +// OIIO_NAMESPACE_END +// +// OIIO_NAMESPACE_3_1_BEGIN +// // Old version +// int myfunc() { ... } +// +// // Old anotherfunc takes old definition of Myclass: +// int anotherfunc(v3_1::Myclass& m) { ... } +// OIIO_NAMESPACE_3_1_END +// + + +// Macros for defining namespaces with an explicit version +#define OIIO_NS_BEGIN(ver) namespace OIIO_OUTER_NAMESPACE { namespace ver { +#define OIIO_NS_END } } + +// Specialty macro: Make something ABI compatible with 3.1 +#define OIIO_NAMESPACE_3_1_BEGIN OIIO_NS_BEGIN(v3_1) +#define OIIO_NAMESPACE_3_1_END OIIO_NS_END + +// Specialty macro: Make something ABI compatible with 3.2 +#define OIIO_NAMESPACE_3_2_BEGIN OIIO_NS_BEGIN(v3_2) +#define OIIO_NAMESPACE_3_2_END OIIO_NS_END + + + +// Forward declarations of important classes +OIIO_NAMESPACE_3_1_BEGIN +// libOpenImageIO_Util +class ArgParse; +class ColorConfig; +class ColorProcessor; +class ErrorHandler; +class Filter1D; +class Filter2D; +class FilterDesc; +class ParamValue; +class ParamValueList; +class ParamValueSpan; +class ScopedTimer; +class Timer; +struct TypeDesc; +class ustring; +class ustringhash; + +// libOpenImageIO +class DeepData; +class ImageBuf; +class ImageBufImpl; +class ImageCache; +class ImageCachePerThreadInfo; +class ImageCacheFile; +class ImageCacheImpl; +class ImageCacheTile; +class ImageInput; +class ImageOutput; +class ImageSpec; +class paropt; +struct ROI; +class TextureOptBatch_v1; +class TextureOpt_v2; +using TextureOpt = TextureOpt_v2; +class TextureSystem; +class TextureSystemImpl; +namespace Filesystem { + class IOProxy; +} +namespace ImageBufAlgo { } +namespace Strutil { } +namespace Sysutil { } +namespace simd { } +OIIO_NAMESPACE_3_1_END + +OIIO_NAMESPACE_BEGIN +// libOpenImageIO_Util +using v3_1::ArgParse; +using v3_1::ColorConfig; +using v3_1::ColorProcessor; +using v3_1::ErrorHandler; +using v3_1::Filter1D; +using v3_1::Filter2D; +using v3_1::FilterDesc; +using v3_1::ParamValue; +using v3_1::ParamValueList; +using v3_1::ParamValueSpan; +using v3_1::ScopedTimer; +using v3_1::Timer; +using v3_1::TypeDesc; +using v3_1::ustring; +using v3_1::ustringhash; + +// libOpenImageIO +using v3_1::DeepData; +using v3_1::ImageBuf; +using v3_1::ImageBufImpl; +using v3_1::ImageCache; +using v3_1::ImageCachePerThreadInfo; +using v3_1::ImageCacheFile; +using v3_1::ImageCacheImpl; +using v3_1::ImageCacheTile; +using v3_1::ImageInput; +using v3_1::ImageOutput; +using v3_1::ImageSpec; +using v3_1::paropt; +using v3_1::ROI; +using v3_1::TextureOptBatch_v1; +using v3_1::TextureOpt_v2; +using TextureOpt = v3_1::TextureOpt_v2; +using TextureOptBatch = v3_1::TextureOptBatch_v1; +using v3_1::TextureSystem; +using v3_1::TextureSystemImpl; +namespace Filesystem { using namespace v3_1::Filesystem; } +namespace ImageBufAlgo { using namespace v3_1::ImageBufAlgo; } +namespace Strutil { using namespace v3_1::Strutil; } +namespace Sysutil { using namespace v3_1::Sysutil; } +namespace simd { using namespace v3_1::simd; } +OIIO_NAMESPACE_END + +#endif /* defined(OPENIMAGEIO_NSVERSIONS_H) */ diff --git a/src/include/OpenImageIO/oiioversion.h.in b/src/include/OpenImageIO/oiioversion.h.in index b2a1d23ca1..7307df5160 100644 --- a/src/include/OpenImageIO/oiioversion.h.in +++ b/src/include/OpenImageIO/oiioversion.h.in @@ -126,39 +126,16 @@ // The primary inner namespace is vMAJ_MIN (or in main, vMAJ_MIN_PAT). The // outer namespace declares the inner namespace as "inline", so anything in it // is visible in OIIO by default. -// -// Current API symbols should declare things in the default namespace, which -// has its version incremented with every minor (yearly) release: -// -// // Foo.h -// OIIO_NAMESPACE_BEGIN /* implicitly means current for this version */ -// void foo(); -// void bar(); -// OIIO_NAMESPACE_END -// -// Because the default inner namespace is "inline", client code can just refer -// to `OIIO::Foo`, and `OIIO::v3_1::Foo` will be found (assuming that v3_1 is -// the current inner namespace). -// -// Things can also be put in an explicit inner namespace, such as -// -// OIIO_NS_BEGIN(v3_0) -// // for declarations that should be visible by explicit request only, -// // such as OIIO::v3_0::bar(). -// int bar(); -// OIIO_NS_END -// -// Currently, everything is defined with OIIO_NAMESPACE_BEGIN/END, and so is -// put in the current-minor-release namespace. But the mechanisms outlined -// above gives us the ability in the future to have multiple ABI (minor -// release) generations of the same facilities existing simultaneously, to -// preserve ABI compatibility even with minor version bumps. -// + +#define OIIO_OUTER_NAMESPACE @PROJ_NAMESPACE@ +#define OIIO_CURRENT_INNER_NAMESPACE @PROJ_VERSION_NAMESPACE@ namespace @PROJ_NAMESPACE@ { // Current version's new inner namespace is inline so it's used by default. inline namespace @PROJ_VERSION_NAMESPACE@ { } + // Legacy namespaces: + namespace v3_1 { } namespace v3_0 { } } namespace OIIO = @PROJ_NAMESPACE@; @@ -169,16 +146,7 @@ namespace OIIO = @PROJ_NAMESPACE@; #define OIIO_NAMESPACE_END } } #define OIIO_CURRENT_NAMESPACE @PROJ_NAMESPACE@::@PROJ_VERSION_NAMESPACE@ -// Macros for defining legacy namespaces with an explicit version -#define OIIO_NS_BEGIN(ver) namespace @PROJ_NAMESPACE@ { namespace ver { -#define OIIO_NS_END } } - -// Specialty macro: Make something ABI compatible with 3.1 -#define OIIO_NAMESPACE_3_1_BEGIN OIIO_NS_BEGIN(v3_1) -#define OIIO_NAMESPACE_3_1_END OIIO_NS_END - -// Macro to use names without explicit qualifier -#define OIIO_NAMESPACE_USING using namespace @PROJ_NAMESPACE@::@PROJ_VERSION_NAMESPACE@; +#include /// Each imageio DSO/DLL should include this statement: diff --git a/src/include/OpenImageIO/optparser.h b/src/include/OpenImageIO/optparser.h index 7286b3d331..b272eb8915 100644 --- a/src/include/OpenImageIO/optparser.h +++ b/src/include/OpenImageIO/optparser.h @@ -15,7 +15,7 @@ #include #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// Parse a string of the form "name=value" and then call @@ -101,5 +101,14 @@ optparser(C& system, const std::string& optstring) return ok; } +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::optparse1; +using v3_1::optparser; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/parallel.h b/src/include/OpenImageIO/parallel.h index 1e4709e4d9..399a187129 100644 --- a/src/include/OpenImageIO/parallel.h +++ b/src/include/OpenImageIO/parallel.h @@ -17,7 +17,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// Split strategies /// DEPRECATED(2.4) @@ -197,6 +197,32 @@ parallel_for_chunked(int64_t begin, int64_t end, int64_t chunksize, paropt opt = paropt(0, paropt::SplitDir::Y, 1)); +#ifndef OIIO_DOXYGEN +// DEPRECATED(3.2) -- old version makes a copy of task instead of &&, ick +OIIO_UTIL_API void +parallel_for(int32_t begin, int32_t end, function_view task, + paropt opt = 0); + +// DEPRECATED(3.2) -- old version makes a copy of task instead of &&, ick +OIIO_UTIL_API void +parallel_for(int64_t begin, int64_t end, function_view task, + paropt opt = 0); + +// DEPRECATED(3.2) -- old version makes a copy of task instead of &&, ick +OIIO_UTIL_API void +parallel_for(uint32_t begin, uint32_t end, function_view task, + paropt opt = 0); + +// DEPRECATED(3.2) -- old version makes a copy of task instead of &&, ick +OIIO_UTIL_API void +parallel_for(uint64_t begin, uint64_t end, function_view task, + paropt opt = 0); +#endif + +OIIO_NAMESPACE_3_1_END + + +OIIO_NAMESPACE_BEGIN /// Parallel "for" loop, for a task that takes a single integer index, run /// it on all indices on the range [begin,end): @@ -211,21 +237,25 @@ parallel_for_chunked(int64_t begin, int64_t end, int64_t chunksize, /// (to aid data coherence and minimize the amount of thread queue /// diddling). The chunk size is chosen automatically. OIIO_UTIL_API void -parallel_for(int32_t begin, int32_t end, function_view task, +parallel_for(int32_t begin, int32_t end, function_view&& task, paropt opt = 0); OIIO_UTIL_API void -parallel_for(int64_t begin, int64_t end, function_view task, +parallel_for(int64_t begin, int64_t end, function_view&& task, paropt opt = 0); OIIO_UTIL_API void -parallel_for(uint32_t begin, uint32_t end, function_view task, +parallel_for(uint32_t begin, uint32_t end, function_view&& task, paropt opt = 0); OIIO_UTIL_API void -parallel_for(uint64_t begin, uint64_t end, function_view task, +parallel_for(uint64_t begin, uint64_t end, function_view&& task, paropt opt = 0); +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN /// Parallel "for" loop, for a task that takes an integer range, run it /// on all indices on the range [begin,end): @@ -295,6 +325,19 @@ parallel_for_2D(int64_t xbegin, int64_t xend, int64_t ybegin, int64_t yend, std::function&& task, paropt opt = 0); +OIIO_NAMESPACE_3_1_END + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::parallel_for_2D; +using v3_1::parallel_for_chunked; +using v3_1::parallel_for_chunked_2D; +using v3_1::parallel_for_range; +using v3_1::parallel_options; +using v3_1::paropt; +using v3_1::SplitDir; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/paramlist.h b/src/include/OpenImageIO/paramlist.h index 4906c16be9..5667a75ed0 100644 --- a/src/include/OpenImageIO/paramlist.h +++ b/src/include/OpenImageIO/paramlist.h @@ -22,7 +22,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// ParamValue holds a named parameter and typed data. Usually, it owns the /// data (holding it in the struct itself if small enough, dynamically @@ -372,15 +372,19 @@ class OIIO_UTIL_API ParamValue { template friend size_t pvt::heapsize(const T&); }; + + /// heapsize specialization for `ParamValue` template<> OIIO_API size_t pvt::heapsize(const ParamValue&); + + /// Factory for a ParamValue that holds a single value of any type supported /// by a corresponding ParamValue constructor (such as int, float, string). template -static ParamValue +inline ParamValue make_pv(string_view name, const T& val) { return ParamValue(name, val); @@ -390,7 +394,7 @@ make_pv(string_view name, const T& val) /// will be interpreted as a C string (TypeString), but all other pointer /// types will just get stored as an opaque pointer (TypePointer). template -static ParamValue +inline ParamValue make_pv(string_view name, T* val) { return ParamValue(name, BaseTypeFromC::value, 1, span(&val, 1)); @@ -842,4 +846,15 @@ class OIIO_UTIL_API ParamValueSpan : public cspan { }; +OIIO_NAMESPACE_3_1_END + + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::make_pv; +using v3_1::ParamValue; +using v3_1::ParamValueList; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/platform.h b/src/include/OpenImageIO/platform.h index 51b16122ec..e4760e5545 100644 --- a/src/include/OpenImageIO/platform.h +++ b/src/include/OpenImageIO/platform.h @@ -531,7 +531,7 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// Class for describing endianness. Test for endianness as /// `if (endian::native == endian::little)` or @@ -615,8 +615,8 @@ inline bool cpu_has_avx512bw() {int i[4]; cpuid(i,7,0); return (i[1] & (1<<30)) inline bool cpu_has_avx512vl() {int i[4]; cpuid(i,7,0); return (i[1] & (0x80000000 /*1<<31*/)) != 0; } // portable aligned malloc -OIIO_API void* aligned_malloc(std::size_t size, std::size_t align); -OIIO_API void aligned_free(void* ptr); +OIIO_UTIL_API void* aligned_malloc(std::size_t size, std::size_t align); +OIIO_UTIL_API void aligned_free(void* ptr); // basic wrappers to new/delete over-aligned types since this isn't guaranteed to be supported until C++17 template @@ -641,6 +641,9 @@ inline void aligned_delete(T* t) { // DEPRECATED(2.6) using std::enable_if_t; +OIIO_NAMESPACE_3_1_END + + // An enable_if helper to be used in template parameters which results in // much shorter symbols: https://godbolt.org/z/sWw4vP // Borrowed from fmtlib. @@ -648,4 +651,37 @@ using std::enable_if_t; # define OIIO_ENABLE_IF(...) std::enable_if_t<(__VA_ARGS__), int> = 0 #endif + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::endian; +using v3_1::littleendian; +using v3_1::bigendian; +using v3_1::aligned_delete; +using v3_1::aligned_free; +using v3_1::aligned_malloc; +using v3_1::aligned_new; +using v3_1::cpuid; +using v3_1::cpu_has_sse2; +using v3_1::cpu_has_sse3; +using v3_1::cpu_has_ssse3; +using v3_1::cpu_has_fma; +using v3_1::cpu_has_sse41; +using v3_1::cpu_has_sse42; +using v3_1::cpu_has_popcnt; +using v3_1::cpu_has_avx; +using v3_1::cpu_has_f16c; +using v3_1::cpu_has_rdrand; +using v3_1::cpu_has_avx2; +using v3_1::cpu_has_avx512f; +using v3_1::cpu_has_avx512dq; +using v3_1::cpu_has_avx512ifma; +using v3_1::cpu_has_avx512pf; +using v3_1::cpu_has_avx512er; +using v3_1::cpu_has_avx512cd; +using v3_1::cpu_has_avx512bw; +using v3_1::cpu_has_avx512vl; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/plugin.h b/src/include/OpenImageIO/plugin.h index 75b32e104c..fc6c0e7d09 100644 --- a/src/include/OpenImageIO/plugin.h +++ b/src/include/OpenImageIO/plugin.h @@ -20,7 +20,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace Plugin { @@ -74,4 +74,15 @@ geterror(bool clear = true); } // namespace Plugin +OIIO_NAMESPACE_3_1_END + + + +// Compatibility: inherit everything from v3_1::Plugin +#ifndef OIIO_DOXYGEN +OIIO_NAMESPACE_BEGIN +namespace Plugin { +using namespace OIIO::v3_1::Plugin; +} OIIO_NAMESPACE_END +#endif diff --git a/src/include/OpenImageIO/refcnt.h b/src/include/OpenImageIO/refcnt.h index 68cacd319c..a234fab19f 100644 --- a/src/include/OpenImageIO/refcnt.h +++ b/src/include/OpenImageIO/refcnt.h @@ -19,7 +19,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN @@ -254,4 +254,16 @@ footprint(const intrusive_ptr& ref) } // namespace pvt +OIIO_NAMESPACE_3_1_END + + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::intrusive_ptr; +using v3_1::intrusive_ptr_add_ref; +using v3_1::intrusive_ptr_release; +using v3_1::RefCnt; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/simd.h b/src/include/OpenImageIO/simd.h index 11578c1b7c..9bb0b97093 100644 --- a/src/include/OpenImageIO/simd.h +++ b/src/include/OpenImageIO/simd.h @@ -281,7 +281,7 @@ #endif -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace simd { @@ -10284,41 +10284,37 @@ OIIO_FORCEINLINE vfloat16 nmsub (const simd::vfloat16& a, const simd::vfloat16& } // end namespace simd -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END /// Custom fmtlib formatters for our SIMD types. -namespace fmt { -template<> struct formatter +template<> struct fmt::formatter : OIIO::pvt::index_formatter {}; -template<> struct formatter +template<> struct fmt::formatter : OIIO::pvt::index_formatter {}; -template<> struct formatter +template<> struct fmt::formatter : OIIO::pvt::index_formatter {}; -template<> struct formatter +template<> struct fmt::formatter : OIIO::pvt::index_formatter {}; -template<> struct formatter +template<> struct fmt::formatter : OIIO::pvt::index_formatter {}; -template<> struct formatter +template<> struct fmt::formatter : OIIO::pvt::index_formatter {}; -template<> struct formatter +template<> struct fmt::formatter : OIIO::pvt::index_formatter {}; -template<> struct formatter +template<> struct fmt::formatter : OIIO::pvt::array_formatter {}; -} // namespace fmt // Allow C++ metaprogramming to understand that the simd types are trivially // copyable (i.e. memcpy to copy simd types is fine). -namespace std { // not necessary in C++17, just say std::is_trivially_copyable #if defined(__INTEL_COMPILER) // Necessary because we have to define the vint types copy constructors on icc -template<> struct is_trivially_copyable : std::true_type {}; -template<> struct is_trivially_copyable : std::true_type {}; -template<> struct is_trivially_copyable : std::true_type {}; +template<> struct std::is_trivially_copyable : std::true_type {}; +template<> struct std::is_trivially_copyable : std::true_type {}; +template<> struct std::is_trivially_copyable : std::true_type {}; #endif -} // namespace std #undef SIMD_DO diff --git a/src/include/OpenImageIO/span.h b/src/include/OpenImageIO/span.h index 72c6bc2d40..f1c49dafdc 100644 --- a/src/include/OpenImageIO/span.h +++ b/src/include/OpenImageIO/span.h @@ -26,8 +26,6 @@ // https://github.com/tcbrindle/span/blob/master/include/tcb/span.hpp -OIIO_NAMESPACE_BEGIN - // Our pre-3.0 implementation had span::size() as a signed value, because we // wrote it at a time that the draft of std::span said it should be signed. // The final C++20 std::span ended up with an unsigned size, like all the @@ -38,8 +36,10 @@ OIIO_NAMESPACE_BEGIN # define OIIO_SPAN_SIZE_IS_UNSIGNED #endif +OIIO_NAMESPACE_3_1_BEGIN + using span_size_t = size_t; -using oiio_span_size_type = OIIO::span_size_t; // back-compat alias +using oiio_span_size_type = span_size_t; // back-compat alias inline constexpr span_size_t dynamic_extent = std::numeric_limits::max(); @@ -263,6 +263,30 @@ class span { return const_reverse_iterator(m_data - 1); } + /// Compare all elements of two spans for equality + template + constexpr bool operator==(span r) { +#if OIIO_CPLUSPLUS_VERSION >= 20 + return std::equal (begin(), end(), r.begin(), r.end()); +#else + auto lsize = size(); + bool same = (lsize == r.size()); + if (lsize != r.size()) + return false; + for (span_size_t i = 0; i < lsize; ++i) + same &= (m_data[i] == r.m_data[i]); + // Note: If they're not the same size, the body of the loop won't run, + // so there can't be a buffer overrun here. + return same; +#endif + } + + /// Compare all elements of two spans for inequality + template + constexpr bool operator!= (span r) { + return !((*this) == r); + } + private: pointer m_data = nullptr; size_type m_size = 0; @@ -276,27 +300,6 @@ using cspan = span; -/// Compare all elements of two spans for equality -template -constexpr bool operator== (span l, span r) { -#if OIIO_CPLUSPLUS_VERSION >= 20 - return std::equal (l.begin(), l.end(), r.begin(), r.end()); -#else - auto lsize = l.size(); - bool same = (lsize == r.size()); - for (span_size_t i = 0; same && i < lsize; ++i) - same &= (l[i] == r[i]); - return same; -#endif -} - -/// Compare all elements of two spans for inequality -template -constexpr bool operator!= (span l, span r) { - return !(l == r); -} - - /// span_strided : a non-owning, mutable reference to a contiguous /// array with known length and optionally non-default strides through the @@ -385,6 +388,26 @@ class span_strided { constexpr reference back() const noexcept { return (*this)[size()-1]; } constexpr pointer data() const noexcept { return m_data; } + /// Compare all elements of two spans for equality + template + constexpr bool operator== (span_strided r) { + auto lsize = size(); + if (lsize != r.size()) + return false; + for (span_size_t i = 0; i < lsize; ++i) + if ((*this)[i] != r[i]) + return false; + // Note: If they're not the same size, the body of the loop won't run, + // so there can't be a buffer overrun here. + return true; + } + + /// Compare all elements of two spans for inequality + template + constexpr bool operator!= (span_strided r) { + return !((*this) == r); + } + private: pointer m_data = nullptr; size_type m_size = 0; @@ -399,25 +422,6 @@ using cspan_strided = span_strided; -/// Compare all elements of two spans for equality -template -constexpr bool operator== (span_strided l, span_strided r) { - auto lsize = l.size(); - if (lsize != r.size()) - return false; - for (span_size_t i = 0; i < lsize; ++i) - if (l[i] != r[i]) - return false; - return true; -} - -/// Compare all elements of two spans for inequality -template -constexpr bool operator!= (span_strided l, span_strided r) { - return !(l == r); -} - - // clang-format on @@ -712,6 +716,34 @@ check_span(span s, const PtrType* ptr, size_t len = 1) } +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::as_bytes; +using v3_1::as_bytes_ref; +using v3_1::as_writable_bytes; +using v3_1::check_span; +using v3_1::cspan; +using v3_1::cspan_strided; +using v3_1::dynamic_extent; +using v3_1::make_cspan; +using v3_1::make_span; +using v3_1::oiio_span_size_type; +using v3_1::span; +using v3_1::span_cast; +using v3_1::span_memcpy; +using v3_1::span_size_t; +using v3_1::span_strided; +using v3_1::span_within; +using v3_1::spancpy; +using v3_1::spanset; +using v3_1::spanzero; +#endif +OIIO_NAMESPACE_END + /// OIIO_ALLOCASPAN is used to allocate smallish amount of memory on the /// stack, equivalent of C99 type var_name[size], and then return a span @@ -719,9 +751,6 @@ check_span(span s, const PtrType* ptr, size_t len = 1) #define OIIO_ALLOCA_SPAN(type, size) span(OIIO_ALLOCA(type, size), size) -OIIO_NAMESPACE_END - - // Declare std::size and std::ssize for our span. namespace std { diff --git a/src/include/OpenImageIO/strided_ptr.h b/src/include/OpenImageIO/strided_ptr.h index b210088fdb..bac6ec71c5 100644 --- a/src/include/OpenImageIO/strided_ptr.h +++ b/src/include/OpenImageIO/strided_ptr.h @@ -11,7 +11,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// strided_ptr looks like a 'T*', but it incorporates a stride, so @@ -133,5 +133,12 @@ template class strided_ptr { }; +OIIO_NAMESPACE_3_1_END + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::strided_ptr; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/string_view.h b/src/include/OpenImageIO/string_view.h index 2d5048fcd9..b959bb9d5d 100644 --- a/src/include/OpenImageIO/string_view.h +++ b/src/include/OpenImageIO/string_view.h @@ -32,7 +32,7 @@ #endif -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// A `string_view` is a non-owning, non-copying, non-allocating reference @@ -509,11 +509,22 @@ OIIO_UTIL_API const char* c_str(string_view str); // DEPRECATED(3.0) template<> inline const char* basic_string_view::c_str() const { - return OIIO::c_str(*this); + return OIIO::v3_1::c_str(*this); } +OIIO_NAMESPACE_3_1_END + + +// Compatibility +#ifndef OIIO_DOXYGEN +OIIO_NAMESPACE_BEGIN +using v3_1::basic_string_view; +using v3_1::c_str; +using v3_1::string_view; +using v3_1::wstring_view; OIIO_NAMESPACE_END +#endif #if FMT_VERSION >= 100000 diff --git a/src/include/OpenImageIO/strongparam.h b/src/include/OpenImageIO/strongparam.h index 9126a49973..62a287e7bb 100644 --- a/src/include/OpenImageIO/strongparam.h +++ b/src/include/OpenImageIO/strongparam.h @@ -9,7 +9,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// StrongParam is used to construct an implementation of a derived type @@ -110,6 +110,7 @@ template struct StrongParam { static_assert(std::is_trivial::value, "Need trivial type"); }; +OIIO_NAMESPACE_3_1_END /// Convenience macro for making strong parameter type Name that is Basetype @@ -121,4 +122,10 @@ template struct StrongParam { } + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::StrongParam; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/strutil.h b/src/include/OpenImageIO/strutil.h index 32d5af41bd..c446c49689 100644 --- a/src/include/OpenImageIO/strutil.h +++ b/src/include/OpenImageIO/strutil.h @@ -56,7 +56,8 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN + /// @namespace Strutil /// /// @brief String-related utilities. @@ -690,6 +691,14 @@ template<> inline uint64_t from_string(string_view s) { auto r = strtoull(std::string(s).c_str(), nullptr, 10); return static_cast(r); } + +template<> inline short from_string(string_view s) { + return static_cast(Strutil::stoi(s)); +} + +template<> inline unsigned short from_string(string_view s) { + return static_cast(Strutil::stoi(s)); +} #endif @@ -1163,7 +1172,11 @@ eval_as_bool(string_view value); } // namespace Strutil +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN // Bring the ever-useful Strutil::print into the OIIO namespace. using Strutil::print; - OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/sysutil.h b/src/include/OpenImageIO/sysutil.h index 16d587668c..00552ff396 100644 --- a/src/include/OpenImageIO/sysutil.h +++ b/src/include/OpenImageIO/sysutil.h @@ -30,7 +30,7 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// @namespace Sysutil /// @@ -186,4 +186,4 @@ class OIIO_UTIL_API Term { } // namespace Sysutil -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/texture.h b/src/include/OpenImageIO/texture.h index e79558e10d..ef9d5a84f8 100644 --- a/src/include/OpenImageIO/texture.h +++ b/src/include/OpenImageIO/texture.h @@ -44,23 +44,7 @@ OIIO_CONCAT_VERSION(TextureOptBatch_v, OIIO_TEXTUREOPTBATCH_VERSION) -#ifndef INCLUDED_IMATHVEC_H -// Placeholder declaration for Imath::V3f if no Imath headers have been -// included. -namespace Imath { -template class Vec3; -using V3f = Vec3; -} -#endif - - -OIIO_NAMESPACE_BEGIN - -// Forward declarations - -class ImageCache; -class TextureSystemImpl; - +OIIO_NAMESPACE_3_1_BEGIN namespace pvt { @@ -289,7 +273,7 @@ class OIIO_API TextureOpt_v2 { }; -using TextureOpt = TextureOpt_current; +using TextureOpt = TextureOpt_v2; @@ -1782,5 +1766,19 @@ class OIIO_API TextureSystem { // Always use TextureSystem::create() and TextureSystem::destroy(). }; +OIIO_NAMESPACE_3_1_END + + +// Compatibility +#ifndef OIIO_DOXYGEN +OIIO_NAMESPACE_BEGIN +namespace Tex { +using namespace v3_1::Tex; +} +namespace pvt { +using v3_1::pvt::EnvLayout; +using v3_1::pvt::TexFormat; +} // namespace pvt OIIO_NAMESPACE_END +#endif diff --git a/src/include/OpenImageIO/thread.h b/src/include/OpenImageIO/thread.h index 18b8c30ffb..b2af0b4122 100644 --- a/src/include/OpenImageIO/thread.h +++ b/src/include/OpenImageIO/thread.h @@ -54,8 +54,7 @@ // http://en.cppreference.com/w/cpp/atomic - -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// Null mutex that can be substituted for a real one to test how much /// overhead is associated with a particular mutex. @@ -82,9 +81,9 @@ template class null_lock { using std::mutex; using std::recursive_mutex; using std::thread; -typedef std::lock_guard lock_guard; -typedef std::lock_guard recursive_lock_guard; -typedef std::lock_guard recursive_timed_lock_guard; +using lock_guard = std::lock_guard; +using recursive_lock_guard = std::lock_guard; +using recursive_timed_lock_guard = std::lock_guard; @@ -270,128 +269,9 @@ class spin_mutex { }; -typedef spin_mutex::lock_guard spin_lock; - - - -#if 0 - -// OLD CODE vvvvvvvv - - -/// Spinning reader/writer mutex. This is just like spin_mutex, except -/// that there are separate locking mechanisms for "writers" (exclusive -/// holders of the lock, presumably because they are modifying whatever -/// the lock is protecting) and "readers" (non-exclusive, non-modifying -/// tasks that may access the protectee simultaneously). -class spin_rw_mutex { -public: - /// Default constructor -- initialize to unlocked. - /// - spin_rw_mutex (void) { m_readers = 0; } - - ~spin_rw_mutex (void) { } - - /// Copy constructor -- initialize to unlocked. - /// - spin_rw_mutex (const spin_rw_mutex &) { m_readers = 0; } - - /// Assignment does not do anything, since lockedness should not - /// transfer. - const spin_rw_mutex& operator= (const spin_rw_mutex&) { return *this; } - - /// Acquire the reader lock. - /// - void read_lock () { - // Spin until there are no writers active - m_locked.lock(); - // Register ourself as a reader - ++m_readers; - // Release the lock, to let other readers work - m_locked.unlock(); - } - - /// Release the reader lock. - /// - void read_unlock () { - --m_readers; // it's atomic, no need to lock to release - } - - /// Acquire the writer lock. - /// - void write_lock () { - // Make sure no new readers (or writers) can start - m_locked.lock(); - // Spin until the last reader is done, at which point we will be - // the sole owners and nobody else (reader or writer) can acquire - // the resource until we release it. -#if OIIO_THREAD_ALLOW_DCLP - while (*(volatile int *)&m_readers > 0) - ; -#else - while (m_readers > 0) - ; -#endif - } - - /// Release the writer lock. - /// - void write_unlock () { - // Let other readers or writers get the lock - m_locked.unlock (); - } - - /// Acquire an exclusive ("writer") lock. - void lock () { write_lock(); } - - /// Release an exclusive ("writer") lock. - void unlock () { write_unlock(); } - - /// Acquire a shared ("reader") lock. - void lock_shared () { read_lock(); } - - /// Release a shared ("reader") lock. - void unlock_shared () { read_unlock(); } - - /// Helper class: scoped read lock for a spin_rw_mutex -- grabs the - /// read lock upon construction, releases the lock when it exits scope. - class read_lock_guard { - public: - read_lock_guard (spin_rw_mutex &fm) : m_fm(fm) { m_fm.read_lock(); } - ~read_lock_guard () { m_fm.read_unlock(); } - private: - read_lock_guard(); // Do not implement - read_lock_guard(const read_lock_guard& other); // Do not implement - read_lock_guard& operator = (const read_lock_guard& other); // Do not implement - spin_rw_mutex & m_fm; - }; - - /// Helper class: scoped write lock for a spin_rw_mutex -- grabs the - /// read lock upon construction, releases the lock when it exits scope. - class write_lock_guard { - public: - write_lock_guard (spin_rw_mutex &fm) : m_fm(fm) { m_fm.write_lock(); } - ~write_lock_guard () { m_fm.write_unlock(); } - private: - write_lock_guard(); // Do not implement - write_lock_guard(const write_lock_guard& other); // Do not implement - write_lock_guard& operator = (const write_lock_guard& other); // Do not implement - spin_rw_mutex & m_fm; - }; - -private: - OIIO_CACHE_ALIGN - spin_mutex m_locked; // write lock - char pad1_[OIIO_CACHE_LINE_SIZE-sizeof(spin_mutex)]; - OIIO_CACHE_ALIGN - atomic_int m_readers; // number of readers - char pad2_[OIIO_CACHE_LINE_SIZE-sizeof(atomic_int)]; -}; - +using spin_lock = spin_mutex::lock_guard; -#else -// vvv New spin rw lock Oct 2017 /// Spinning reader/writer mutex. This is just like spin_mutex, except /// that there are separate locking mechanisms for "writers" (exclusive @@ -511,11 +391,10 @@ class spin_rw_mutex { std::atomic m_bits { 0 }; }; -#endif -typedef spin_rw_mutex::read_lock_guard spin_rw_read_lock; -typedef spin_rw_mutex::write_lock_guard spin_rw_write_lock; +using spin_rw_read_lock = spin_rw_mutex::read_lock_guard; +using spin_rw_write_lock = spin_rw_mutex::write_lock_guard; @@ -859,4 +738,38 @@ class OIIO_UTIL_API task_set { }; +OIIO_NAMESPACE_3_1_END + + + +// Compatibility -- current version just reuses these old items +// clang-format off +#ifndef OIIO_DOXYGEN +OIIO_NAMESPACE_BEGIN +using v3_1::atomic_backoff; +using v3_1::default_thread_pool; +using v3_1::default_thread_pool_shutdown; +using v3_1::mutex_pool; +using v3_1::null_mutex; +using v3_1::null_lock; +using v3_1::pause; +using v3_1::spin_mutex; +using v3_1::spin_rw_mutex; +using v3_1::task_set; +using v3_1::thread_group; +using v3_1::thread_pool; +using v3_1::yield; + +using std::mutex; +using std::recursive_mutex; +using std::thread; + +using lock_guard = std::lock_guard; +using recursive_lock_guard = std::lock_guard; +using recursive_timed_lock_guard = std::lock_guard; +using spin_lock = spin_mutex::lock_guard; +using spin_rw_read_lock = spin_rw_mutex::read_lock_guard; +using spin_rw_write_lock = spin_rw_mutex::write_lock_guard; OIIO_NAMESPACE_END +#endif +// clang-format on diff --git a/src/include/OpenImageIO/tiffutils.h b/src/include/OpenImageIO/tiffutils.h index 0803634271..c631665b5d 100644 --- a/src/include/OpenImageIO/tiffutils.h +++ b/src/include/OpenImageIO/tiffutils.h @@ -130,7 +130,10 @@ enum TIFFTAG { EXIF_GAMMA = 42240, }; +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN /// Given a TIFF data type code (defined in tiff.h) and a count, return the /// equivalent TypeDesc where one exists. Return TypeUnknown if there is no @@ -250,5 +253,25 @@ OIIO_API const TagInfo* tag_lookup (string_view domain, int tag); OIIO_API const TagInfo* tag_lookup (string_view domain, string_view tagname); +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::decode_exif; +using v3_1::decode_icc_profile; +using v3_1::decode_iptc_iim; +using v3_1::decode_xmp; +using v3_1::encode_iptc_iim; +using v3_1::encode_xmp; +using v3_1::exif_tag_lookup; +using v3_1::tag_lookup; +using v3_1::tag_table; +using v3_1::TagInfo; +using v3_1::tiff_data_size; +using v3_1::tiff_datatype_to_typedesc; +using v3_1::tiff_dir_data; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/timer.h b/src/include/OpenImageIO/timer.h index bc5d361256..04929ab14f 100644 --- a/src/include/OpenImageIO/timer.h +++ b/src/include/OpenImageIO/timer.h @@ -30,7 +30,7 @@ #define OIIO_TIMER_LINUX_USE_clock_gettime 1 -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN /// Simple timer class. /// @@ -275,4 +275,4 @@ class ScopedTimer { -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/include/OpenImageIO/type_traits.h b/src/include/OpenImageIO/type_traits.h index a4ce7fd362..149f176544 100644 --- a/src/include/OpenImageIO/type_traits.h +++ b/src/include/OpenImageIO/type_traits.h @@ -15,8 +15,6 @@ #include #include -OIIO_NAMESPACE_BEGIN - // An enable_if helper to be used in template parameters which results in // much shorter symbols: https://godbolt.org/z/sWw4vP @@ -26,6 +24,8 @@ OIIO_NAMESPACE_BEGIN #endif +OIIO_NAMESPACE_3_1_BEGIN + /// has_size_method::value is true if T has a size() method and it returns /// an integral type. template struct has_size_method : std::false_type { }; @@ -45,6 +45,14 @@ template struct has_subscript()[0])>> : std::true_type { }; +OIIO_NAMESPACE_3_1_END + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::has_size_method; +using v3_1::has_subscript; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/typedesc.h b/src/include/OpenImageIO/typedesc.h index 91aa88ccc9..04bf3f9a8c 100644 --- a/src/include/OpenImageIO/typedesc.h +++ b/src/include/OpenImageIO/typedesc.h @@ -34,7 +34,7 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN ///////////////////////////////////////////////////////////////////////////// /// A TypeDesc describes simple data types. @@ -434,7 +434,6 @@ template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETY template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::STRING; }; template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::STRING; }; template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::STRING; }; -class ustring; template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::STRING; }; template<> struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::STRING; }; template struct BaseTypeFromC { static constexpr TypeDesc::BASETYPE value = TypeDesc::STRING; }; @@ -497,8 +496,6 @@ template<> struct TypeDescFromC { static const constexpr TypeDesc template constexpr TypeDesc TypeDescFromC_v = TypeDescFromC>::value(); -class ustringhash; // forward declaration - /// A template mechanism for getting C type of TypeDesc::BASETYPE. @@ -594,7 +591,7 @@ tostring(TypeDesc type, const void* data, const tostring_formatting& fmt = {}); /// * If dsttype is int32 or uint32: other integer types will do their best /// (caveat emptor if you mix signed/unsigned). Also a source string will /// convert to int if and only if its characters form a valid integer. -/// * If dsttype is float: inteegers and other float types will do +/// * If dsttype is float: integers and other float types will do /// their best conversion; strings will convert if and only if their /// characters form a valid float number. OIIO_UTIL_API bool @@ -602,19 +599,68 @@ convert_type(TypeDesc srctype, const void* src, TypeDesc dsttype, void* dst, int n = 1); +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::tostring_formatting; +using v3_1::tostring; +using v3_1::convert_type; +using v3_1::BaseTypeFromC; +using v3_1::BaseTypeFromC_v; +using v3_1::TypeDescFromC; +using v3_1::TypeDescFromC_v; +using v3_1::CType; + +using v3_1::TypeUnknown; +using v3_1::TypeFloat; +using v3_1::TypeColor; +using v3_1::TypePoint; +using v3_1::TypeVector; +using v3_1::TypeNormal; +using v3_1::TypeMatrix33; +using v3_1::TypeMatrix44; +using v3_1::TypeMatrix; +using v3_1::TypeFloat2; +using v3_1::TypeVector2; +using v3_1::TypeFloat4; +using v3_1::TypeVector4; +using v3_1::TypeString; +using v3_1::TypeInt; +using v3_1::TypeUInt; +using v3_1::TypeInt32; +using v3_1::TypeUInt32; +using v3_1::TypeInt16; +using v3_1::TypeUInt16; +using v3_1::TypeInt8; +using v3_1::TypeUInt8; +using v3_1::TypeInt64; +using v3_1::TypeUInt64; +using v3_1::TypeVector2i; +using v3_1::TypeVector3i; +using v3_1::TypeBox2; +using v3_1::TypeBox3; +using v3_1::TypeBox2i; +using v3_1::TypeBox3i; +using v3_1::TypeHalf; +using v3_1::TypeTimeCode; +using v3_1::TypeKeyCode; +using v3_1::TypeRational; +using v3_1::TypePointer; +using v3_1::TypeUstringhash; +#endif OIIO_NAMESPACE_END // Supply a fmtlib compatible custom formatter for TypeDesc. #if FMT_VERSION >= 100000 -FMT_BEGIN_NAMESPACE -template<> struct formatter : ostream_formatter {}; -FMT_END_NAMESPACE +template<> struct fmt::formatter : ostream_formatter {}; #else -FMT_BEGIN_NAMESPACE template <> -struct formatter { +struct fmt::formatter { // Parses format specification // C++14: constexpr auto parse(format_parse_context& ctx) const { auto parse(format_parse_context &ctx) -> decltype(ctx.begin()) // c++11 @@ -640,5 +686,4 @@ struct formatter { return format_to(ctx.out(), "{}", t.c_str()); } }; -FMT_END_NAMESPACE #endif diff --git a/src/include/OpenImageIO/unordered_map_concurrent.h b/src/include/OpenImageIO/unordered_map_concurrent.h index 95eb6c6d65..2c82981185 100644 --- a/src/include/OpenImageIO/unordered_map_concurrent.h +++ b/src/include/OpenImageIO/unordered_map_concurrent.h @@ -9,7 +9,7 @@ #include #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pvt { @@ -599,4 +599,12 @@ class unordered_map_concurrent { }; +OIIO_NAMESPACE_3_1_END + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::unordered_map_concurrent; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/ustring.h b/src/include/OpenImageIO/ustring.h index 2d82d6bd10..aba90ffdf5 100644 --- a/src/include/OpenImageIO/ustring.h +++ b/src/include/OpenImageIO/ustring.h @@ -25,8 +25,6 @@ #include -OIIO_NAMESPACE_BEGIN - // Feature tests #define OIIO_USTRING_HAS_USTRINGHASH 1 #define OIIO_USTRING_HAS_CTR_FROM_USTRINGHASH 1 @@ -34,8 +32,7 @@ OIIO_NAMESPACE_BEGIN #define OIIO_HAS_USTRINGHASH_FORMATTER 1 -class ustringhash; // forward declaration - +OIIO_NAMESPACE_3_1_BEGIN /// A ustring is an alternative to char* or std::string for storing @@ -1008,8 +1005,12 @@ inline ustring::ustring(ustringhash hash) } #endif +OIIO_NAMESPACE_3_1_END + +OIIO_NAMESPACE_BEGIN + /// ustring string literal operator inline ustring operator""_us(const char* str, std::size_t len) @@ -1025,8 +1026,11 @@ operator""_ush(const char* str, std::size_t len) return ustringhash(str, len); } +OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_BEGIN + /// Functor class to use for comparisons when sorting ustrings, if you /// want the strings sorted lexicographically. class ustringLess { @@ -1101,6 +1105,17 @@ to_string(const ustringhash& value) } // end namespace Strutil +OIIO_NAMESPACE_3_1_END + + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::iequals; +using v3_1::ustringLess; +using v3_1::ustringPtrIsLess; +#endif OIIO_NAMESPACE_END diff --git a/src/include/OpenImageIO/vecparam.h b/src/include/OpenImageIO/vecparam.h index b2bf70c6cc..bd47d78851 100644 --- a/src/include/OpenImageIO/vecparam.h +++ b/src/include/OpenImageIO/vecparam.h @@ -11,7 +11,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN // NOTE: These interoperable type templates were copied from the // [Imath project](http://github.com/AcademySoftwareFoundation/imath), @@ -388,4 +388,22 @@ using M33fParam = MatrixParam; using M44fParam = MatrixParam; +OIIO_NAMESPACE_3_1_END + + + +// Compatibility +OIIO_NAMESPACE_BEGIN +#ifndef OIIO_DOXYGEN +using v3_1::has_double_subscript_RC; +using v3_1::has_subscript_N; +using v3_1::has_xy; +using v3_1::has_xyz; +using v3_1::has_xyzw; +using v3_1::M33fParam; +using v3_1::M44fParam; +using v3_1::MatrixParam; +using v3_1::V3fParam; +using v3_1::Vec3Param; +#endif OIIO_NAMESPACE_END diff --git a/src/include/imageio_pvt.h b/src/include/imageio_pvt.h index ae28898fa3..273375cd77 100644 --- a/src/include/imageio_pvt.h +++ b/src/include/imageio_pvt.h @@ -4,7 +4,7 @@ /// \file -/// Declarations for things that are used privately by ImageIO. +/// Declarations for things that are used privately by OpenImageIO. #ifndef OPENIMAGEIO_IMAGEIO_PVT_H @@ -17,11 +17,10 @@ OIIO_NAMESPACE_BEGIN - -namespace ImageBufAlgo { -struct PixelStats; -} - +// Note: Everything in pvt namespace is expected to be local to the library +// and does not appear in exported headers that client software will see. +// Therefore, it should all stay in the current namespace except where +// specifically noted. namespace pvt { diff --git a/src/libOpenImageIO/color_ocio.cpp b/src/libOpenImageIO/color_ocio.cpp index 03623221de..26f45c8d2b 100644 --- a/src/libOpenImageIO/color_ocio.cpp +++ b/src/libOpenImageIO/color_ocio.cpp @@ -29,7 +29,7 @@ namespace OCIO = OCIO_NAMESPACE; -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace { // Some test colors we use to interrogate transformations @@ -806,7 +806,7 @@ ColorConfig::Impl::init(string_view filename) filename = Sysutil::getenv("OCIO"); if (filename.empty() && !disable_builtin_configs) filename = "ocio://default"; - if (filename.size() && !Filesystem::exists(filename) + if (filename.size() && !OIIO::Filesystem::exists(filename) && !Strutil::istarts_with(filename, "ocio://")) { error("Requested non-existent OCIO config \"{}\"", filename); } else { @@ -867,7 +867,7 @@ ColorConfig::Impl::init(string_view filename) bool ColorConfig::reset(string_view filename) { - pvt::LoggedTimer logtime("ColorConfig::reset"); + OIIO::pvt::LoggedTimer logtime("ColorConfig::reset"); if (m_impl && (filename == getImpl()->configname() || (filename == "" @@ -2010,7 +2010,7 @@ ImageBufAlgo::colorconvert(ImageBuf& dst, const ImageBuf& src, string_view from, const ColorConfig* colorconfig, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::colorconvert"); + OIIO::pvt::LoggedTimer logtime("IBA::colorconvert"); if (from.empty() || from == "current") { from = src.spec().get_string_attribute("oiio:Colorspace", "scene_linear"); @@ -2071,7 +2071,7 @@ ImageBufAlgo::colormatrixtransform(ImageBuf& dst, const ImageBuf& src, M44fParam M, bool unpremult, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::colormatrixtransform"); + OIIO::pvt::LoggedTimer logtime("IBA::colormatrixtransform"); ColorProcessorHandle processor = ColorConfig::default_colorconfig().createMatrixTransform(M); logtime.stop(); // transition to other colorconvert @@ -2253,7 +2253,7 @@ ImageBufAlgo::colorconvert(ImageBuf& dst, const ImageBuf& src, const ColorProcessor* processor, bool unpremult, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::colorconvert"); + OIIO::pvt::LoggedTimer logtime("IBA::colorconvert"); // If the processor is NULL, return false (error) if (!processor) { dst.errorfmt( @@ -2318,7 +2318,7 @@ ImageBufAlgo::ociolook(ImageBuf& dst, const ImageBuf& src, string_view looks, bool inverse, string_view key, string_view value, const ColorConfig* colorconfig, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::ociolook"); + OIIO::pvt::LoggedTimer logtime("IBA::ociolook"); if (from.empty() || from == "current") { auto linearspace = colorconfig->resolve("scene_linear"); from = src.spec().get_string_attribute("oiio:Colorspace", linearspace); @@ -2381,7 +2381,7 @@ ImageBufAlgo::ociodisplay(ImageBuf& dst, const ImageBuf& src, bool inverse, string_view key, string_view value, const ColorConfig* colorconfig, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::ociodisplay"); + OIIO::pvt::LoggedTimer logtime("IBA::ociodisplay"); ColorProcessorHandle processor; { if (!colorconfig) @@ -2453,7 +2453,7 @@ ImageBufAlgo::ociofiletransform(ImageBuf& dst, const ImageBuf& src, const ColorConfig* colorconfig, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::ociofiletransform"); + OIIO::pvt::LoggedTimer logtime("IBA::ociofiletransform"); if (name.empty()) { dst.errorfmt("Unknown filetransform name"); return false; @@ -2512,7 +2512,7 @@ ImageBufAlgo::ocionamedtransform(ImageBuf& dst, const ImageBuf& src, const ColorConfig* colorconfig, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::ocionamedtransform"); + OIIO::pvt::LoggedTimer logtime("IBA::ocionamedtransform"); ColorProcessorHandle processor; { if (!colorconfig) diff --git a/src/libOpenImageIO/deepdata.cpp b/src/libOpenImageIO/deepdata.cpp index a06661d633..35b9ebc8c0 100644 --- a/src/libOpenImageIO/deepdata.cpp +++ b/src/libOpenImageIO/deepdata.cpp @@ -16,7 +16,7 @@ #include #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN // Each pixel has a capacity (number of samples allocated) and a number of @@ -32,6 +32,9 @@ OIIO_NAMESPACE_BEGIN class DeepData::Impl { // holds all the nontrivial stuff + // NOTE: Because the definition of DeepData::Impl is not exposed + // externally, it can change at will even though it's inside the v3_1 + // namespace. friend class DeepData; public: @@ -1273,4 +1276,4 @@ DeepData::occlusion_cull(int64_t pixel) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/exif.cpp b/src/libOpenImageIO/exif.cpp index 5b3252c88b..ccf63979a5 100644 --- a/src/libOpenImageIO/exif.cpp +++ b/src/libOpenImageIO/exif.cpp @@ -119,7 +119,10 @@ TagMap::mapname() const return m_impl->m_mapname; } +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN const TagInfo* tag_lookup(string_view domain, int tag) @@ -229,8 +232,11 @@ tiff_dir_data(const TIFFDirEntry& td, cspan data) return cspan(data.data() + begin, len); } +OIIO_NAMESPACE_3_1_END +OIIO_NAMESPACE_BEGIN + #if DEBUG_EXIF_READ || DEBUG_EXIF_WRITE static bool print_dir_entry(std::ostream& out, const TagMap& tagmap, @@ -613,7 +619,10 @@ pvt::gps_tagmap_ref() return T; } +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN cspan tag_table(string_view tablename) @@ -626,6 +635,10 @@ tag_table(string_view tablename) return cspan(tiff_tag_table); } +OIIO_NAMESPACE_3_1_END + + +OIIO_NAMESPACE_BEGIN /// Add one EXIF directory entry's data to spec under the given 'name'. @@ -1152,6 +1165,10 @@ pvt::append_tiff_dir_entry(std::vector& dirs, } +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN bool decode_exif(string_view exif, ImageSpec& spec) @@ -1236,8 +1253,8 @@ decode_exif(cspan exif, ImageSpec& spec) if (makernote_offset > 0) { if (Strutil::iequals(spec.get_string_attribute("Make"), "Canon")) { if (!decode_ifd(exif, makernote_offset, spec, - pvt::canon_maker_tagmap_ref(), ifd_offsets_seen, - swab)) + OIIO::pvt::canon_maker_tagmap_ref(), + ifd_offsets_seen, swab)) return false; } // Now we can erase the attrib we used to pass the message about @@ -1360,7 +1377,7 @@ encode_exif(const ImageSpec& spec, std::vector& blob, // If we're a canon camera, construct the dirs for the Makernote, // with the data adding to the main blob. if (Strutil::iequals(spec.get_string_attribute("Make"), "Canon")) - pvt::encode_canon_makernote(blob, makerdirs, spec, tiffstart); + OIIO::pvt::encode_canon_makernote(blob, makerdirs, spec, tiffstart); #if DEBUG_EXIF_WRITE std::cerr << "Blob header size " << blob.size() << "\n"; @@ -1526,5 +1543,4 @@ exif_tag_lookup(string_view name, int& tag, int& tifftype, int& count) return true; } - -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/formatspec.cpp b/src/libOpenImageIO/formatspec.cpp index ec317e0f14..81374b9624 100644 --- a/src/libOpenImageIO/formatspec.cpp +++ b/src/libOpenImageIO/formatspec.cpp @@ -97,6 +97,10 @@ pvt::get_default_quantize(TypeDesc format, long long& quant_min, } } +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN ImageSpec::ImageSpec(TypeDesc format) noexcept @@ -659,8 +663,11 @@ ImageSpec::channelindex(string_view name) const return -1; } +OIIO_NAMESPACE_3_1_END +OIIO_NAMESPACE_BEGIN + std::string pvt::explain_justprint(const ParamValue& p, const void* extradata) { @@ -910,7 +917,10 @@ static ExplanationTableEntry explanation[] = { } // namespace +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN std::string ImageSpec::metadata_val(const ParamValue& p, bool human) @@ -1263,6 +1273,76 @@ ImageSpec::decode_compression_metadata(string_view defaultcomp, +void +ImageSpec::set_colorspace(string_view colorspace) +{ + ColorConfig::default_colorconfig().set_colorspace(*this, colorspace); + // Invalidate potentially contradictory metadata + erase_attribute("CICP"); +} + + + +ROI +get_roi(const ImageSpec& spec) +{ + return ROI(spec.x, spec.x + spec.width, spec.y, spec.y + spec.height, + spec.z, spec.z + spec.depth, 0, spec.nchannels); +} + + + +ROI +get_roi_full(const ImageSpec& spec) +{ + return ROI(spec.full_x, spec.full_x + spec.full_width, spec.full_y, + spec.full_y + spec.full_height, spec.full_z, + spec.full_z + spec.full_depth, 0, spec.nchannels); +} + + + +void +set_roi(ImageSpec& spec, const ROI& newroi) +{ + spec.x = newroi.xbegin; + spec.y = newroi.ybegin; + spec.z = newroi.zbegin; + spec.width = newroi.width(); + spec.height = newroi.height(); + spec.depth = newroi.depth(); +} + + + +void +set_roi_full(ImageSpec& spec, const ROI& newroi) +{ + spec.full_x = newroi.xbegin; + spec.full_y = newroi.ybegin; + spec.full_z = newroi.zbegin; + spec.full_width = newroi.width(); + spec.full_height = newroi.height(); + spec.full_depth = newroi.depth(); +} + + + +template<> +size_t +pvt::heapsize(const ImageSpec& is) +{ + size_t size = pvt::heapsize(is.channelformats); + size += pvt::heapsize(is.channelnames); + size += pvt::heapsize(is.extra_attribs); + return size; +} + +OIIO_NAMESPACE_3_1_END + + +OIIO_NAMESPACE_BEGIN + bool pvt::check_texture_metadata_sanity(ImageSpec& spec) { @@ -1290,27 +1370,4 @@ pvt::check_texture_metadata_sanity(ImageSpec& spec) } - -void -ImageSpec::set_colorspace(string_view colorspace) -{ - ColorConfig::default_colorconfig().set_colorspace(*this, colorspace); - // Invalidate potentially contradictory metadata - erase_attribute("CICP"); -} - - - -template<> -size_t -pvt::heapsize(const ImageSpec& is) -{ - size_t size = pvt::heapsize(is.channelformats); - size += pvt::heapsize(is.channelnames); - size += pvt::heapsize(is.extra_attribs); - return size; -} - - - OIIO_NAMESPACE_END diff --git a/src/libOpenImageIO/icc.cpp b/src/libOpenImageIO/icc.cpp index a27ae35bbe..13d22478bc 100644 --- a/src/libOpenImageIO/icc.cpp +++ b/src/libOpenImageIO/icc.cpp @@ -232,7 +232,10 @@ extract(cspan iccdata, size_t& offset, ICCTag& result, } // namespace +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN bool decode_icc_profile(cspan iccdata, ImageSpec& spec, std::string& error) @@ -397,4 +400,4 @@ decode_icc_profile(cspan iccdata, ImageSpec& spec, std::string& error) return true; } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebuf.cpp b/src/libOpenImageIO/imagebuf.cpp index eab61a75cc..e25c1f1fc2 100644 --- a/src/libOpenImageIO/imagebuf.cpp +++ b/src/libOpenImageIO/imagebuf.cpp @@ -38,52 +38,10 @@ std::atomic IB_total_open_time(0.0f); std::atomic IB_total_image_read_time(0.0f); } // namespace pvt +OIIO_NAMESPACE_END -ROI -get_roi(const ImageSpec& spec) -{ - return ROI(spec.x, spec.x + spec.width, spec.y, spec.y + spec.height, - spec.z, spec.z + spec.depth, 0, spec.nchannels); -} - - - -ROI -get_roi_full(const ImageSpec& spec) -{ - return ROI(spec.full_x, spec.full_x + spec.full_width, spec.full_y, - spec.full_y + spec.full_height, spec.full_z, - spec.full_z + spec.full_depth, 0, spec.nchannels); -} - - - -void -set_roi(ImageSpec& spec, const ROI& newroi) -{ - spec.x = newroi.xbegin; - spec.y = newroi.ybegin; - spec.z = newroi.zbegin; - spec.width = newroi.width(); - spec.height = newroi.height(); - spec.depth = newroi.depth(); -} - - - -void -set_roi_full(ImageSpec& spec, const ROI& newroi) -{ - spec.full_x = newroi.xbegin; - spec.full_y = newroi.ybegin; - spec.full_z = newroi.zbegin; - spec.full_width = newroi.width(); - spec.full_height = newroi.height(); - spec.full_depth = newroi.depth(); -} - - +OIIO_NAMESPACE_3_1_BEGIN span span_from_buffer(void* data, TypeDesc format, int nchannels, int width, @@ -615,7 +573,7 @@ ImageBufImpl::~ImageBufImpl() // Upon destruction, print uncaught errors to help users who don't know // how to properly check for errors. if (!m_err.empty() /* Note: safe becausethis is the dtr */ - && pvt::imagebuf_print_uncaught_errors) { + && OIIO::pvt::imagebuf_print_uncaught_errors) { OIIO::print( "An ImageBuf was destroyed with a pending error message that was never\n" "retrieved via ImageBuf::geterror(). This was the error message:\n{}\n", @@ -782,16 +740,16 @@ ImageBufImpl::new_pixels(ImageBuf::IBStorage storage, size_t size, m_bufspan = {}; } m_allocated_size = size; - pvt::IB_local_mem_current += m_allocated_size; - atomic_max(pvt::IB_local_mem_peak, - static_cast(pvt::IB_local_mem_current)); + OIIO::pvt::IB_local_mem_current += m_allocated_size; + atomic_max(OIIO::pvt::IB_local_mem_peak, + static_cast(OIIO::pvt::IB_local_mem_current)); } if (data && size) memcpy(m_pixels.get(), data, size); - if (pvt::oiio_print_debug > 1) + if (OIIO::pvt::oiio_print_debug > 1) OIIO::debugfmt("IB allocated {} MB, global IB memory now {} MB\n", - size >> 20, pvt::IB_local_mem_current >> 20); + size >> 20, OIIO::pvt::IB_local_mem_current >> 20); eval_contiguous(); return m_pixels.get(); } @@ -801,11 +759,11 @@ void ImageBufImpl::free_pixels() { if (m_allocated_size) { - if (pvt::oiio_print_debug > 1) + if (OIIO::pvt::oiio_print_debug > 1) OIIO::debugfmt("IB freed {} MB, global IB memory now {} MB\n", m_allocated_size >> 20, - pvt::IB_local_mem_current >> 20); - pvt::IB_local_mem_current -= m_allocated_size; + OIIO::pvt::IB_local_mem_current >> 20); + OIIO::pvt::IB_local_mem_current -= m_allocated_size; m_allocated_size = 0; } m_pixels.reset(); @@ -934,7 +892,7 @@ ImageBufImpl::reset(string_view filename, int subimage, int miplevel, { clear(); m_name = ustring(filename); - if (m_imagecache || pvt::imagebuf_use_imagecache) { + if (m_imagecache || OIIO::pvt::imagebuf_use_imagecache) { // Invalidate the image in cache. Do so unconditionally if there's a // chance that configuration hints may have changed. invalidate(m_name, config || m_configspec); @@ -1146,13 +1104,13 @@ ImageBufImpl::init_spec(string_view filename, int subimage, int miplevel, && m_current_subimage == subimage && m_current_miplevel == miplevel) return true; // Already done - pvt::LoggedTimer logtime("IB::init_spec"); + OIIO::pvt::LoggedTimer logtime("IB::init_spec"); m_name = filename; // If we weren't given an imagecache but "imagebuf:use_imagecache" // attribute was set, use a shared IC. - if (!m_imagecache && pvt::imagebuf_use_imagecache) + if (!m_imagecache && OIIO::pvt::imagebuf_use_imagecache) m_imagecache = ImageCache::create(true); if (m_imagecache) { @@ -1279,20 +1237,20 @@ ImageBufImpl::init_spec(string_view filename, int subimage, int miplevel, auto input = ImageInput::open(filename, m_configspec.get(), m_rioproxy); if (!input) { error("Could not open file: {}", OIIO::geterror()); - atomic_fetch_add(pvt::IB_total_open_time, float(timer())); + atomic_fetch_add(OIIO::pvt::IB_total_open_time, float(timer())); return false; } m_spec = input->spec(subimage, miplevel); m_nativespec = m_spec; if (input->has_error()) { errorfmt("Error reading: {}", input->geterror()); - atomic_fetch_add(pvt::IB_total_open_time, float(timer())); + atomic_fetch_add(OIIO::pvt::IB_total_open_time, float(timer())); return false; } if (m_spec.format == TypeUnknown) { errorfmt("Could not seek to subimage={} miplevel={}", subimage, miplevel); - atomic_fetch_add(pvt::IB_total_open_time, float(timer())); + atomic_fetch_add(OIIO::pvt::IB_total_open_time, float(timer())); return false; } m_badfile = false; @@ -1320,7 +1278,7 @@ ImageBufImpl::init_spec(string_view filename, int subimage, int miplevel, m_current_subimage = subimage; m_current_miplevel = miplevel; m_pixelaspect = m_spec.get_float_attribute("pixelaspectratio", 1.0f); - atomic_fetch_add(pvt::IB_total_open_time, float(timer())); + atomic_fetch_add(OIIO::pvt::IB_total_open_time, float(timer())); } return !m_badfile; } @@ -1374,7 +1332,7 @@ ImageBufImpl::read(int subimage, int miplevel, int chbegin, int chend, return false; } - pvt::LoggedTimer logtime("IB::read"); + OIIO::pvt::LoggedTimer logtime("IB::read"); m_current_subimage = subimage; m_current_miplevel = miplevel; if (chend < 0 || chend > nativespec().nchannels) @@ -1399,7 +1357,7 @@ ImageBufImpl::read(int subimage, int miplevel, int chbegin, int chend, } else { error(input->geterror()); } - atomic_fetch_add(pvt::IB_total_image_read_time, float(timer())); + atomic_fetch_add(OIIO::pvt::IB_total_image_read_time, float(timer())); return ok; } @@ -1511,7 +1469,7 @@ ImageBufImpl::read(int subimage, int miplevel, int chbegin, int chend, m_pixels_valid = false; error(OIIO::geterror()); } - atomic_fetch_add(pvt::IB_total_image_read_time, float(timer())); + atomic_fetch_add(OIIO::pvt::IB_total_image_read_time, float(timer())); // Since we have read in the entire image now, if we are using an // IOProxy, we invalidate any cache entry to avoid lifetime issues // related to the IOProxy. This helps to eliminate trouble emerging @@ -1623,7 +1581,7 @@ ImageBuf::write(ImageOutput* out, ProgressCallback progress_callback, } bool ok = true; ok &= m_impl->validate_pixels(); - pvt::LoggedTimer logtime("IB::write inner"); + OIIO::pvt::LoggedTimer logtime("IB::write inner"); if (out->supports("thumbnail") && has_thumbnail()) { auto thumb = get_thumbnail(); // Strutil::print("IB::write: has thumbnail ROI {}\n", thumb->roi()); @@ -1749,7 +1707,7 @@ ImageBuf::write(string_view _filename, TypeDesc dtype, string_view _fileformat, ProgressCallback progress_callback, void* progress_callback_data) const { - pvt::LoggedTimer logtime("IB::write"); + OIIO::pvt::LoggedTimer logtime("IB::write"); string_view filename = _filename.size() ? _filename : string_view(name()); string_view fileformat = _fileformat.size() ? _fileformat : filename; if (filename.size() == 0) { @@ -3700,4 +3658,4 @@ ImageBuf::unlock() const } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo.cpp b/src/libOpenImageIO/imagebufalgo.cpp index 483327093d..2b346737b7 100644 --- a/src/libOpenImageIO/imagebufalgo.cpp +++ b/src/libOpenImageIO/imagebufalgo.cpp @@ -57,7 +57,7 @@ /////////////////////////////////////////////////////////////////////////// -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN bool @@ -819,7 +819,7 @@ ImageBufAlgo::convolve(ImageBuf& dst, const ImageBuf& src, const ImageBuf& kernel, bool normalize, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::convolve"); + OIIO::pvt::LoggedTimer logtime("IBA::convolve"); if (!IBAprep(roi, &dst, &src, IBAprep_REQUIRE_SAME_NCHANNELS)) return false; bool ok; @@ -1130,7 +1130,7 @@ bool ImageBufAlgo::median_filter(ImageBuf& dst, const ImageBuf& src, int width, int height, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::median_filter"); + OIIO::pvt::LoggedTimer logtime("IBA::median_filter"); if (!IBAprep(roi, &dst, &src, IBAprep_REQUIRE_SAME_NCHANNELS | IBAprep_NO_SUPPORT_VOLUME)) return false; @@ -1212,7 +1212,7 @@ bool ImageBufAlgo::dilate(ImageBuf& dst, const ImageBuf& src, int width, int height, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::dilate"); + OIIO::pvt::LoggedTimer logtime("IBA::dilate"); if (!IBAprep(roi, &dst, &src, IBAprep_REQUIRE_SAME_NCHANNELS | IBAprep_NO_SUPPORT_VOLUME)) return false; @@ -1243,7 +1243,7 @@ bool ImageBufAlgo::erode(ImageBuf& dst, const ImageBuf& src, int width, int height, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::erode"); + OIIO::pvt::LoggedTimer logtime("IBA::erode"); if (!IBAprep(roi, &dst, &src, IBAprep_REQUIRE_SAME_NCHANNELS | IBAprep_NO_SUPPORT_VOLUME)) return false; @@ -1308,7 +1308,7 @@ hfft_(ImageBuf& dst, const ImageBuf& src, bool inverse, bool unitary, ROI roi, bool ImageBufAlgo::fft(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::fft"); + OIIO::pvt::LoggedTimer logtime("IBA::fft"); if (src.spec().depth > 1) { dst.errorfmt("ImageBufAlgo::fft does not support volume images"); return false; @@ -1379,7 +1379,7 @@ ImageBufAlgo::fft(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) bool ImageBufAlgo::ifft(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::ifft"); + OIIO::pvt::LoggedTimer logtime("IBA::ifft"); if (src.nchannels() != 2 || src.spec().format != TypeDesc::FLOAT) { dst.errorfmt("ifft can only be done on 2-channel float images"); return false; @@ -1505,7 +1505,7 @@ bool ImageBufAlgo::polar_to_complex(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::polar_to_complex"); + OIIO::pvt::LoggedTimer logtime("IBA::polar_to_complex"); if (src.nchannels() != 2) { dst.errorfmt("polar_to_complex can only be done on 2-channel"); return false; @@ -1542,7 +1542,7 @@ bool ImageBufAlgo::complex_to_polar(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::complex_to_polar"); + OIIO::pvt::LoggedTimer logtime("IBA::complex_to_polar"); if (src.nchannels() != 2) { dst.errorfmt("complex_to_polar can only be done on 2-channel"); return false; @@ -1670,4 +1670,4 @@ ImageBufAlgo::fillholes_pushpull(const ImageBuf& src, ROI roi, int nthreads) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_addsub.cpp b/src/libOpenImageIO/imagebufalgo_addsub.cpp index 7f85acc039..c7a4d83e9c 100644 --- a/src/libOpenImageIO/imagebufalgo_addsub.cpp +++ b/src/libOpenImageIO/imagebufalgo_addsub.cpp @@ -21,7 +21,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN template @@ -88,7 +88,7 @@ bool ImageBufAlgo::add(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::add"); + OIIO::pvt::LoggedTimer logtime("IBA::add"); if (A_.is_img() && B_.is_img()) { const ImageBuf &A(A_.img()), &B(B_.img()); if (!IBAprep(roi, &dst, &A, &B)) @@ -175,7 +175,7 @@ bool ImageBufAlgo::sub(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::sub"); + OIIO::pvt::LoggedTimer logtime("IBA::sub"); if (A_.is_img() && B_.is_img()) { const ImageBuf &A(A_.img()), &B(B_.img()); if (!IBAprep(roi, &dst, &A, &B)) @@ -245,4 +245,4 @@ ImageBufAlgo::sub(Image_or_Const A, Image_or_Const B, ROI roi, int nthreads) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_channels.cpp b/src/libOpenImageIO/imagebufalgo_channels.cpp index 0946af3f4a..f8416ecb55 100644 --- a/src/libOpenImageIO/imagebufalgo_channels.cpp +++ b/src/libOpenImageIO/imagebufalgo_channels.cpp @@ -21,7 +21,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN template @@ -63,7 +63,7 @@ ImageBufAlgo::channels(ImageBuf& dst, const ImageBuf& src, int nchannels, return ok; } - pvt::LoggedTimer logtime("IBA::channels"); + OIIO::pvt::LoggedTimer logtime("IBA::channels"); // Not intended to create 0-channel images. if (nchannels <= 0) { dst.errorfmt("{}-channel images not supported", nchannels); @@ -228,7 +228,7 @@ bool ImageBufAlgo::channel_append(ImageBuf& dst, const ImageBuf& A, const ImageBuf& B, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::channel_append"); + OIIO::pvt::LoggedTimer logtime("IBA::channel_append"); // If the region is not defined, set it to the union of the valid // regions of the two source images. if (!roi.defined()) @@ -294,4 +294,4 @@ ImageBufAlgo::channel_append(const ImageBuf& A, const ImageBuf& B, ROI roi, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_compare.cpp b/src/libOpenImageIO/imagebufalgo_compare.cpp index f8cc4f58fc..9d96280fb6 100644 --- a/src/libOpenImageIO/imagebufalgo_compare.cpp +++ b/src/libOpenImageIO/imagebufalgo_compare.cpp @@ -21,7 +21,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN void @@ -187,7 +187,7 @@ computePixelStats_(const ImageBuf& src, ImageBufAlgo::PixelStats& stats, ImageBufAlgo::PixelStats ImageBufAlgo::computePixelStats(const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::computePixelStats"); + OIIO::pvt::LoggedTimer logtimer("IBA::computePixelStats"); ImageBufAlgo::PixelStats stats; if (!roi.defined()) roi = get_roi(src.spec()); @@ -347,7 +347,7 @@ ImageBufAlgo::compare(const ImageBuf& A, const ImageBuf& B, float failthresh, float warnthresh, float failrelative, float warnrelative, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::compare"); + OIIO::pvt::LoggedTimer logtimer("IBA::compare"); ImageBufAlgo::CompareResults result; result.error = true; @@ -463,7 +463,7 @@ bool ImageBufAlgo::isConstantColor(const ImageBuf& src, float threshold, span color, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::isConstantColor"); + OIIO::pvt::LoggedTimer logtimer("IBA::isConstantColor"); // If no ROI is defined, use the data window of src. if (!roi.defined()) roi = get_roi(src.spec()); @@ -519,7 +519,7 @@ bool ImageBufAlgo::isConstantChannel(const ImageBuf& src, int channel, float val, float threshold, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::isConstantChannel"); + OIIO::pvt::LoggedTimer logtimer("IBA::isConstantChannel"); // If no ROI is defined, use the data window of src. if (!roi.defined()) roi = get_roi(src.spec()); @@ -580,7 +580,7 @@ bool ImageBufAlgo::isMonochrome(const ImageBuf& src, float threshold, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::isMonochrome"); + OIIO::pvt::LoggedTimer logtimer("IBA::isMonochrome"); // If no ROI is defined, use the data window of src. if (!roi.defined()) roi = get_roi(src.spec()); @@ -632,7 +632,7 @@ ImageBufAlgo::color_count(const ImageBuf& src, imagesize_t* count, int ncolors, cspan color, cspan eps, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::color_count"); + OIIO::pvt::LoggedTimer logtimer("IBA::color_count"); // If no ROI is defined, use the data window of src. if (!roi.defined()) roi = get_roi(src.spec()); @@ -698,7 +698,7 @@ ImageBufAlgo::color_range_check(const ImageBuf& src, imagesize_t* lowcount, imagesize_t* inrangecount, cspan low, cspan high, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::color_range_check"); + OIIO::pvt::LoggedTimer logtimer("IBA::color_range_check"); // If no ROI is defined, use the data window of src. if (!roi.defined()) roi = get_roi(src.spec()); @@ -753,7 +753,7 @@ deep_nonempty_region(const ImageBuf& src, ROI roi) ROI ImageBufAlgo::nonzero_region(const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::nonzero_region"); + OIIO::pvt::LoggedTimer logtimer("IBA::nonzero_region"); roi = roi_intersection(roi, src.roi()); if (src.deep()) { @@ -860,7 +860,7 @@ std::string ImageBufAlgo::computePixelHashSHA1(const ImageBuf& src, string_view extrainfo, ROI roi, int blocksize, int nthreads) { - pvt::LoggedTimer logtimer("IBA::computePixelHashSHA1"); + OIIO::pvt::LoggedTimer logtimer("IBA::computePixelHashSHA1"); if (!roi.defined()) roi = get_roi(src.spec()); @@ -941,7 +941,7 @@ std::vector ImageBufAlgo::histogram(const ImageBuf& src, int channel, int bins, float min, float max, bool ignore_empty, ROI roi, int nthreads) { - pvt::LoggedTimer logtimer("IBA::histogram"); + OIIO::pvt::LoggedTimer logtimer("IBA::histogram"); std::vector h; // Sanity checks @@ -979,4 +979,4 @@ ImageBufAlgo::histogram(const ImageBuf& src, int channel, int bins, float min, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_copy.cpp b/src/libOpenImageIO/imagebufalgo_copy.cpp index 0a98cf8905..51a138596f 100644 --- a/src/libOpenImageIO/imagebufalgo_copy.cpp +++ b/src/libOpenImageIO/imagebufalgo_copy.cpp @@ -16,7 +16,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN template @@ -105,7 +105,7 @@ bool ImageBufAlgo::paste(ImageBuf& dst, int xbegin, int ybegin, int zbegin, int chbegin, const ImageBuf& src, ROI srcroi, int nthreads) { - pvt::LoggedTimer logtime("IBA::paste"); + OIIO::pvt::LoggedTimer logtime("IBA::paste"); if (!srcroi.defined()) srcroi = get_roi(src.spec()); @@ -189,7 +189,7 @@ bool ImageBufAlgo::copy(ImageBuf& dst, const ImageBuf& src, TypeDesc convert, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::copy"); + OIIO::pvt::LoggedTimer logtime("IBA::copy"); if (&dst == &src) // trivial copy to self return true; @@ -253,7 +253,7 @@ ImageBufAlgo::copy(const ImageBuf& src, TypeDesc convert, ROI roi, int nthreads) bool ImageBufAlgo::crop(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::crop"); + OIIO::pvt::LoggedTimer logtime("IBA::crop"); dst.clear(); roi.chend = std::min(roi.chend, src.nchannels()); if (!IBAprep(roi, &dst, &src, IBAprep_SUPPORT_DEEP)) @@ -307,7 +307,7 @@ ImageBufAlgo::crop(const ImageBuf& src, ROI roi, int nthreads) bool ImageBufAlgo::cut(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - // pvt::LoggedTimer logtime("IBA::cut"); + // OIIO::pvt::LoggedTimer logtime("IBA::cut"); // Don't log, because all the work is inside crop, which already logs bool ok = crop(dst, src, roi, nthreads); if (!ok) @@ -369,7 +369,7 @@ bool ImageBufAlgo::circular_shift(ImageBuf& dst, const ImageBuf& src, int xshift, int yshift, int zshift, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::circular_shift"); + OIIO::pvt::LoggedTimer logtime("IBA::circular_shift"); if (!IBAprep(roi, &dst, &src)) return false; bool ok; @@ -395,4 +395,4 @@ ImageBufAlgo::circular_shift(const ImageBuf& src, int xshift, int yshift, -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_deep.cpp b/src/libOpenImageIO/imagebufalgo_deep.cpp index b2195583a3..ee8cacb342 100644 --- a/src/libOpenImageIO/imagebufalgo_deep.cpp +++ b/src/libOpenImageIO/imagebufalgo_deep.cpp @@ -20,7 +20,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN // FIXME -- NOT CORRECT! This code assumes sorted, non-overlapping samples. @@ -88,7 +88,7 @@ flatten_(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) bool ImageBufAlgo::flatten(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::flatten"); + OIIO::pvt::LoggedTimer logtime("IBA::flatten"); if (!src.deep()) { // For some reason, we were asked to flatten an already-flat image. // So just copy it. @@ -138,7 +138,7 @@ bool ImageBufAlgo::deepen(ImageBuf& dst, const ImageBuf& src, float zvalue, ROI roi, int /*nthreads*/) { - pvt::LoggedTimer logtime("IBA::deepen"); + OIIO::pvt::LoggedTimer logtime("IBA::deepen"); if (src.deep()) { // For some reason, we were asked to deepen an already-deep image. // So just copy it. @@ -242,7 +242,7 @@ bool ImageBufAlgo::deep_merge(ImageBuf& dst, const ImageBuf& A, const ImageBuf& B, bool occlusion_cull, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::deep_merge"); + OIIO::pvt::LoggedTimer logtime("IBA::deep_merge"); if (!A.deep() || !B.deep()) { // For some reason, we were asked to merge a flat image. dst.errorfmt("deep_merge can only be performed on deep images"); @@ -366,7 +366,7 @@ bool ImageBufAlgo::deep_holdout(ImageBuf& dst, const ImageBuf& src, const ImageBuf& thresh, ROI roi, int /*nthreads*/) { - pvt::LoggedTimer logtime("IBA::deep_holdout"); + OIIO::pvt::LoggedTimer logtime("IBA::deep_holdout"); if (!src.deep() || !thresh.deep()) { dst.errorfmt("deep_holdout can only be performed on deep images"); return false; @@ -444,4 +444,4 @@ ImageBufAlgo::deep_holdout(const ImageBuf& src, const ImageBuf& thresh, ROI roi, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_demosaic.cpp b/src/libOpenImageIO/imagebufalgo_demosaic.cpp index f63ba3e148..9a34554b8d 100644 --- a/src/libOpenImageIO/imagebufalgo_demosaic.cpp +++ b/src/libOpenImageIO/imagebufalgo_demosaic.cpp @@ -12,7 +12,7 @@ #include "imagebufalgo_demosaic_prv.h" #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace { @@ -966,7 +966,7 @@ demosaic(ImageBuf& dst, const ImageBuf& src, KWArgs options, ROI roi, int nthreads) { bool ok = false; - pvt::LoggedTimer logtime("IBA::demosaic"); + OIIO::pvt::LoggedTimer logtime("IBA::demosaic"); std::string pattern; std::string algorithm; @@ -1234,4 +1234,4 @@ mosaic_uint8(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, } // namespace ImageBufAlgo -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_demosaic_prv.h b/src/libOpenImageIO/imagebufalgo_demosaic_prv.h index 204a5f7bb2..9f6678cb3b 100644 --- a/src/libOpenImageIO/imagebufalgo_demosaic_prv.h +++ b/src/libOpenImageIO/imagebufalgo_demosaic_prv.h @@ -7,7 +7,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace ImageBufAlgo { @@ -33,4 +33,4 @@ mosaic_uint8(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, } // namespace ImageBufAlgo -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_draw.cpp b/src/libOpenImageIO/imagebufalgo_draw.cpp index 39460bd04f..d3236eba7f 100644 --- a/src/libOpenImageIO/imagebufalgo_draw.cpp +++ b/src/libOpenImageIO/imagebufalgo_draw.cpp @@ -94,11 +94,16 @@ fill_corners_(ImageBuf& dst, const float* topleft, const float* topright, return true; } +OIIO_NAMESPACE_END + + + +OIIO_NAMESPACE_3_1_BEGIN bool ImageBufAlgo::fill(ImageBuf& dst, cspan pixel, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::fill"); + OIIO::pvt::LoggedTimer logtime("IBA::fill"); if (!IBAprep(roi, &dst)) return false; bool ok; @@ -113,7 +118,7 @@ bool ImageBufAlgo::fill(ImageBuf& dst, cspan top, cspan bottom, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::fill"); + OIIO::pvt::LoggedTimer logtime("IBA::fill"); if (!IBAprep(roi, &dst)) return false; bool ok; @@ -130,7 +135,7 @@ ImageBufAlgo::fill(ImageBuf& dst, cspan topleft, cspan topright, cspan bottomleft, cspan bottomright, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::fill"); + OIIO::pvt::LoggedTimer logtime("IBA::fill"); if (!IBAprep(roi, &dst)) return false; bool ok; @@ -185,7 +190,7 @@ ImageBufAlgo::fill(cspan topleft, cspan topright, bool ImageBufAlgo::zero(ImageBuf& dst, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::zero"); + OIIO::pvt::LoggedTimer logtime("IBA::zero"); if (!IBAprep(roi, &dst)) return false; OIIO_ASSERT(dst.localpixels()); @@ -243,7 +248,7 @@ bool ImageBufAlgo::render_point(ImageBuf& dst, int x, int y, cspan color, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::render_point"); + OIIO::pvt::LoggedTimer logtime("IBA::render_point"); if (!IBAprep(roi, &dst)) return false; IBA_FIX_PERCHAN_LEN_DEF(color, dst.nchannels()); @@ -368,7 +373,7 @@ ImageBufAlgo::render_line(ImageBuf& dst, int x1, int y1, int x2, int y2, cspan color, bool skip_first_point, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::render_line"); + OIIO::pvt::LoggedTimer logtime("IBA::render_line"); if (!IBAprep(roi, &dst)) return false; IBA_FIX_PERCHAN_LEN_DEF(color, dst.nchannels()); @@ -426,7 +431,7 @@ bool ImageBufAlgo::render_box(ImageBuf& dst, int x1, int y1, int x2, int y2, cspan color, bool fill, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::render_box"); + OIIO::pvt::LoggedTimer logtime("IBA::render_box"); if (!IBAprep(roi, &dst)) return false; IBA_FIX_PERCHAN_LEN_DEF(color, dst.nchannels()); @@ -505,7 +510,7 @@ ImageBufAlgo::checker(ImageBuf& dst, int width, int height, int depth, cspan color1, cspan color2, int xoffset, int yoffset, int zoffset, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::checker"); + OIIO::pvt::LoggedTimer logtime("IBA::checker"); if (!IBAprep(roi, &dst)) return false; IBA_FIX_PERCHAN_LEN_DEF(color1, dst.nchannels()); @@ -636,6 +641,7 @@ static bool noise_blue_(ImageBuf& dst, float min, float max, bool mono, int seed, ROI roi, int nthreads) { + using OIIO::pvt::bluenoise_4chan_ptr; ImageBufAlgo::parallel_image(roi, nthreads, [&](ROI roi) { for (ImageBuf::Iterator p(dst, roi); !p.done(); ++p) { float n = 0.0; @@ -643,8 +649,8 @@ noise_blue_(ImageBuf& dst, float min, float max, bool mono, int seed, ROI roi, for (int c = roi.chbegin; c < roi.chend; ++c) { if (c == roi.chbegin || !mono) { if (!bn || !(c & 3)) - bn = pvt::bluenoise_4chan_ptr(p.x(), p.y(), p.z(), - roi.chbegin & ~3, seed); + bn = bluenoise_4chan_ptr(p.x(), p.y(), p.z(), + roi.chbegin & ~3, seed); n = lerp(min, max, bn[c & 3]); } p[c] = p[c] + n; @@ -660,7 +666,7 @@ bool ImageBufAlgo::noise(ImageBuf& dst, string_view noisetype, float A, float B, bool mono, int seed, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::noise"); + OIIO::pvt::LoggedTimer logtime("IBA::noise"); if (!IBAprep(roi, &dst)) return false; bool ok; @@ -709,7 +715,8 @@ namespace { inline ImageSpec bnspec() { - ImageSpec spec(pvt::bntable_res, pvt::bntable_res, 4, TypeFloat); + using OIIO::pvt::bntable_res; + ImageSpec spec(bntable_res, bntable_res, 4, TypeFloat); spec.channelnames = { "X", "Y", "Z", "W" }; spec.alpha_channel = -1; return spec; @@ -720,13 +727,16 @@ const ImageBuf& ImageBufAlgo::bluenoise_image() { // This ImageBuf "wraps" the table. - using namespace pvt; + using namespace OIIO::pvt; static ImageBuf img(bnspec(), make_cspan(&bluenoise_table[0][0][0], bntable_res * bntable_res * 4)); return img; } +OIIO_NAMESPACE_3_1_END + +OIIO_NAMESPACE_BEGIN static std::vector font_search_dirs; static std::vector all_font_files; @@ -1114,11 +1124,15 @@ resolve_font(string_view font_, std::string& result) #endif +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN ROI ImageBufAlgo::text_size(string_view text, int fontsize, string_view font_) { - pvt::LoggedTimer logtime("IBA::text_size"); + OIIO::pvt::LoggedTimer logtime("IBA::text_size"); ROI size; #ifdef USE_FREETYPE // Thread safety @@ -1164,7 +1178,7 @@ ImageBufAlgo::render_text(ImageBuf& R, int x, int y, string_view text, TextAlignY aligny, int shadow, ROI roi, int /*nthreads*/) { - pvt::LoggedTimer logtime("IBA::render_text"); + OIIO::pvt::LoggedTimer logtime("IBA::render_text"); if (R.spec().depth > 1) { R.errorfmt("ImageBufAlgo::render_text does not support volume images"); return false; @@ -1316,8 +1330,11 @@ ImageBufAlgo::render_text(ImageBuf& R, int x, int y, string_view text, #endif } +OIIO_NAMESPACE_3_1_END +OIIO_NAMESPACE_BEGIN + const std::vector& pvt::font_family_list() { diff --git a/src/libOpenImageIO/imagebufalgo_mad.cpp b/src/libOpenImageIO/imagebufalgo_mad.cpp index 8c484826e2..5707fcd6ac 100644 --- a/src/libOpenImageIO/imagebufalgo_mad.cpp +++ b/src/libOpenImageIO/imagebufalgo_mad.cpp @@ -15,7 +15,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN @@ -142,7 +142,7 @@ bool ImageBufAlgo::mad(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, Image_or_Const C_, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::mad"); + OIIO::pvt::LoggedTimer logtime("IBA::mad"); // Canonicalize so that if one of A,B is a constant, A is an image. if (A_.is_val() && B_.is_img()) // canonicalize to A_img, B_val @@ -251,4 +251,4 @@ ImageBufAlgo::invert(const ImageBuf& A, ROI roi, int nthreads) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_minmaxchan.cpp b/src/libOpenImageIO/imagebufalgo_minmaxchan.cpp index 1025220a98..6af4281eae 100644 --- a/src/libOpenImageIO/imagebufalgo_minmaxchan.cpp +++ b/src/libOpenImageIO/imagebufalgo_minmaxchan.cpp @@ -18,7 +18,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN template @@ -43,7 +43,7 @@ minchan_impl(ImageBuf& R, const ImageBuf& A, ROI roi, int nthreads) bool ImageBufAlgo::minchan(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::minchan"); + OIIO::pvt::LoggedTimer logtime("IBA::minchan"); if (!roi.defined()) roi = get_roi(src.spec()); roi.chend = std::min(roi.chend, src.nchannels()); @@ -95,7 +95,7 @@ maxchan_impl(ImageBuf& R, const ImageBuf& A, ROI roi, int nthreads) bool ImageBufAlgo::maxchan(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::maxchan"); + OIIO::pvt::LoggedTimer logtime("IBA::maxchan"); if (!roi.defined()) roi = get_roi(src.spec()); roi.chend = std::min(roi.chend, src.nchannels()); @@ -124,4 +124,4 @@ ImageBufAlgo::maxchan(const ImageBuf& src, ROI roi, int nthreads) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_muldiv.cpp b/src/libOpenImageIO/imagebufalgo_muldiv.cpp index e393c8a22a..4fa1a6cba0 100644 --- a/src/libOpenImageIO/imagebufalgo_muldiv.cpp +++ b/src/libOpenImageIO/imagebufalgo_muldiv.cpp @@ -22,7 +22,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN template @@ -47,7 +47,7 @@ bool ImageBufAlgo::scale(ImageBuf& dst, const ImageBuf& A, const ImageBuf& B, KWArgs options, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::scale"); + OIIO::pvt::LoggedTimer logtime("IBA::scale"); bool ok = false; if (B.nchannels() == 1) { if (IBAprep(roi, &dst, &A, &B)) @@ -147,7 +147,7 @@ bool ImageBufAlgo::mul(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::mul"); + OIIO::pvt::LoggedTimer logtime("IBA::mul"); if (A_.is_img() && B_.is_img()) { const ImageBuf &A(A_.img()), &B(B_.img()); if (!IBAprep(roi, &dst, &A, &B, IBAprep_CLAMP_MUTUAL_NCHANNELS)) @@ -220,7 +220,7 @@ bool ImageBufAlgo::div(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::div"); + OIIO::pvt::LoggedTimer logtime("IBA::div"); if (A_.is_img() && B_.is_img()) { const ImageBuf &A(A_.img()), &B(B_.img()); if (!IBAprep(roi, &dst, &A, &B, IBAprep_CLAMP_MUTUAL_NCHANNELS)) @@ -276,4 +276,4 @@ ImageBufAlgo::div(Image_or_Const A, Image_or_Const B, ROI roi, int nthreads) -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_orient.cpp b/src/libOpenImageIO/imagebufalgo_orient.cpp index 9a758d2d86..fb1e656ce8 100644 --- a/src/libOpenImageIO/imagebufalgo_orient.cpp +++ b/src/libOpenImageIO/imagebufalgo_orient.cpp @@ -16,7 +16,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN template @@ -45,7 +45,7 @@ ImageBufAlgo::flip(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) tmp.swap(const_cast(src)); return flip(dst, tmp, roi, nthreads); } - pvt::LoggedTimer logtime("IBA::flip"); + OIIO::pvt::LoggedTimer logtime("IBA::flip"); ROI src_roi = roi.defined() ? roi : src.roi(); ROI src_roi_full = src.roi_full(); @@ -95,7 +95,7 @@ ImageBufAlgo::flop(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) return flop(dst, tmp, roi, nthreads); } - pvt::LoggedTimer logtime("IBA::flop"); + OIIO::pvt::LoggedTimer logtime("IBA::flop"); ROI src_roi = roi.defined() ? roi : src.roi(); ROI src_roi_full = src.roi_full(); int offset = src_roi.xbegin - src_roi_full.xbegin; @@ -167,7 +167,7 @@ ImageBufAlgo::rotate90(ImageBuf& dst, const ImageBuf& src, ROI roi, return rotate90(dst, tmp, roi, nthreads); } - pvt::LoggedTimer logtime("IBA::rotate90"); + OIIO::pvt::LoggedTimer logtime("IBA::rotate90"); ROI src_roi = roi.defined() ? roi : src.roi(); ROI src_roi_full = src.roi_full(); @@ -230,7 +230,7 @@ ImageBufAlgo::rotate180(ImageBuf& dst, const ImageBuf& src, ROI roi, return rotate180(dst, tmp, roi, nthreads); } - pvt::LoggedTimer logtime("IBA::rotate180"); + OIIO::pvt::LoggedTimer logtime("IBA::rotate180"); ROI src_roi = roi.defined() ? roi : src.roi(); ROI src_roi_full = src.roi_full(); int xoffset = src_roi.xbegin - src_roi_full.xbegin; @@ -281,7 +281,7 @@ ImageBufAlgo::rotate270(ImageBuf& dst, const ImageBuf& src, ROI roi, return rotate270(dst, tmp, roi, nthreads); } - pvt::LoggedTimer logtime("IBA::rotate270"); + OIIO::pvt::LoggedTimer logtime("IBA::rotate270"); ROI src_roi = roi.defined() ? roi : src.roi(); ROI src_roi_full = src.roi_full(); @@ -420,7 +420,7 @@ bool ImageBufAlgo::transpose(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::transpose"); + OIIO::pvt::LoggedTimer logtime("IBA::transpose"); if (!roi.defined()) roi = get_roi(src.spec()); roi.chend = std::min(roi.chend, src.nchannels()); @@ -459,4 +459,4 @@ ImageBufAlgo::transpose(const ImageBuf& src, ROI roi, int nthreads) return result; } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_pixelmath.cpp b/src/libOpenImageIO/imagebufalgo_pixelmath.cpp index 33c98a709a..04daeaad27 100644 --- a/src/libOpenImageIO/imagebufalgo_pixelmath.cpp +++ b/src/libOpenImageIO/imagebufalgo_pixelmath.cpp @@ -22,7 +22,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN template @@ -63,7 +63,7 @@ bool ImageBufAlgo::min(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::min"); + OIIO::pvt::LoggedTimer logtime("IBA::min"); if (A_.is_img() && B_.is_img()) { const ImageBuf &A(A_.img()), &B(B_.img()); if (!IBAprep(roi, &dst, &A, &B)) @@ -160,7 +160,7 @@ bool ImageBufAlgo::max(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::max"); + OIIO::pvt::LoggedTimer logtime("IBA::max"); if (A_.is_img() && B_.is_img()) { const ImageBuf &A(A_.img()), &B(B_.img()); if (!IBAprep(roi, &dst, &A, &B)) @@ -245,7 +245,7 @@ bool ImageBufAlgo::clamp(ImageBuf& dst, const ImageBuf& src, cspan min, cspan max, bool clampalpha01, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::clamp"); + OIIO::pvt::LoggedTimer logtime("IBA::clamp"); if (!IBAprep(roi, &dst, &src)) return false; const float big = std::numeric_limits::max(); @@ -313,7 +313,7 @@ bool ImageBufAlgo::absdiff(ImageBuf& dst, Image_or_Const A_, Image_or_Const B_, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::absdiff"); + OIIO::pvt::LoggedTimer logtime("IBA::absdiff"); if (!IBAprep(roi, &dst, A_.imgptr(), B_.imgptr(), nullptr, IBAprep_CLAMP_MUTUAL_NCHANNELS)) return false; @@ -412,7 +412,7 @@ bool ImageBufAlgo::pow(ImageBuf& dst, const ImageBuf& A, cspan b, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::pow"); + OIIO::pvt::LoggedTimer logtime("IBA::pow"); if (!IBAprep(roi, &dst, &A, IBAprep_CLAMP_MUTUAL_NCHANNELS)) return false; IBA_FIX_PERCHAN_LEN_DEF(b, dst.nchannels()); @@ -524,7 +524,7 @@ bool ImageBufAlgo::channel_sum(ImageBuf& dst, const ImageBuf& src, cspan weights, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::channel_sum"); + OIIO::pvt::LoggedTimer logtime("IBA::channel_sum"); if (!roi.defined()) roi = get_roi(src.spec()); roi.chend = std::min(roi.chend, src.nchannels()); @@ -742,7 +742,7 @@ bool ImageBufAlgo::rangecompress(ImageBuf& dst, const ImageBuf& src, bool useluma, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::rangecompress"); + OIIO::pvt::LoggedTimer logtime("IBA::rangecompress"); if (!IBAprep(roi, &dst, &src, IBAprep_CLAMP_MUTUAL_NCHANNELS)) return false; bool ok; @@ -758,7 +758,7 @@ bool ImageBufAlgo::rangeexpand(ImageBuf& dst, const ImageBuf& src, bool useluma, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::rangeexpand"); + OIIO::pvt::LoggedTimer logtime("IBA::rangeexpand"); if (!IBAprep(roi, &dst, &src, IBAprep_CLAMP_MUTUAL_NCHANNELS)) return false; bool ok; @@ -838,7 +838,7 @@ bool ImageBufAlgo::unpremult(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::unpremult"); + OIIO::pvt::LoggedTimer logtime("IBA::unpremult"); if (!IBAprep(roi, &dst, &src, IBAprep_CLAMP_MUTUAL_NCHANNELS)) return false; if (src.spec().alpha_channel < 0 @@ -917,7 +917,7 @@ premult_(ImageBuf& R, const ImageBuf& A, bool preserve_alpha0, ROI roi, bool ImageBufAlgo::premult(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::premult"); + OIIO::pvt::LoggedTimer logtime("IBA::premult"); if (!IBAprep(roi, &dst, &src, IBAprep_CLAMP_MUTUAL_NCHANNELS)) return false; if (src.spec().alpha_channel < 0) { @@ -953,7 +953,7 @@ bool ImageBufAlgo::repremult(ImageBuf& dst, const ImageBuf& src, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::repremult"); + OIIO::pvt::LoggedTimer logtime("IBA::repremult"); if (!IBAprep(roi, &dst, &src, IBAprep_CLAMP_MUTUAL_NCHANNELS)) return false; if (src.spec().alpha_channel < 0) { @@ -1074,7 +1074,7 @@ ImageBufAlgo::contrast_remap(ImageBuf& dst, const ImageBuf& src, cspan scontrast, cspan sthresh, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::contrast_remap"); + OIIO::pvt::LoggedTimer logtime("IBA::contrast_remap"); if (!IBAprep(roi, &dst, &src)) return false; // Force all the input spans to have values for all channels. @@ -1148,7 +1148,7 @@ bool ImageBufAlgo::saturate(ImageBuf& dst, const ImageBuf& src, float scale, int firstchannel, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::saturate"); + OIIO::pvt::LoggedTimer logtime("IBA::saturate"); if (!IBAprep(roi, &dst, &src, IBAprep_CLAMP_MUTUAL_NCHANNELS)) return false; @@ -1230,7 +1230,7 @@ ImageBufAlgo::color_map(ImageBuf& dst, const ImageBuf& src, int srcchannel, int nknots, int channels, cspan knots, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::color_map"); + OIIO::pvt::LoggedTimer logtime("IBA::color_map"); if (srcchannel >= src.nchannels()) { dst.errorfmt("invalid source channel selected"); return false; @@ -1358,7 +1358,7 @@ bool ImageBufAlgo::color_map(ImageBuf& dst, const ImageBuf& src, int srcchannel, string_view mapname, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::color_map"); + OIIO::pvt::LoggedTimer logtime("IBA::color_map"); if (srcchannel >= src.nchannels()) { dst.errorfmt("invalid source channel selected"); return false; @@ -1565,7 +1565,7 @@ ImageBufAlgo::fixNonFinite(ImageBuf& dst, const ImageBuf& src, NonFiniteFixMode mode, int* pixelsFixed, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::fixNonFinite"); + OIIO::pvt::LoggedTimer logtime("IBA::fixNonFinite"); if (mode != ImageBufAlgo::NONFINITE_NONE && mode != ImageBufAlgo::NONFINITE_BLACK && mode != ImageBufAlgo::NONFINITE_BOX3 @@ -1750,7 +1750,7 @@ bool ImageBufAlgo::over(ImageBuf& dst, const ImageBuf& A, const ImageBuf& B, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::over"); + OIIO::pvt::LoggedTimer logtime("IBA::over"); if (!IBAprep(roi, &dst, &A, &B, NULL, IBAprep_REQUIRE_ALPHA | IBAprep_REQUIRE_SAME_NCHANNELS)) return false; @@ -1793,7 +1793,7 @@ bool ImageBufAlgo::zover(ImageBuf& dst, const ImageBuf& A, const ImageBuf& B, bool z_zeroisinf, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::zover"); + OIIO::pvt::LoggedTimer logtime("IBA::zover"); if (!IBAprep(roi, &dst, &A, &B, NULL, IBAprep_REQUIRE_ALPHA | IBAprep_REQUIRE_Z | IBAprep_REQUIRE_SAME_NCHANNELS)) @@ -1819,4 +1819,4 @@ ImageBufAlgo::zover(const ImageBuf& A, const ImageBuf& B, bool z_zeroisinf, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_test.cpp b/src/libOpenImageIO/imagebufalgo_test.cpp index 3ea14c46bc..940e2a8ff5 100644 --- a/src/libOpenImageIO/imagebufalgo_test.cpp +++ b/src/libOpenImageIO/imagebufalgo_test.cpp @@ -1316,15 +1316,15 @@ test_simple_perpixel() template std::string -mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, - const std::string& pattern, const float (&white_balance)[4], - int nthreads); +do_mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, + const std::string& pattern, const float (&white_balance)[4], + int nthreads); template<> std::string -mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, - const std::string& pattern, const float (&white_balance)[4], - int nthreads) +do_mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, + const std::string& pattern, const float (&white_balance)[4], + int nthreads) { return ImageBufAlgo::mosaic_float(dst, src, x_offset, y_offset, pattern, white_balance, nthreads); @@ -1332,9 +1332,9 @@ mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, template<> std::string -mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, - const std::string& pattern, const float (&white_balance)[4], - int nthreads) +do_mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, + const std::string& pattern, const float (&white_balance)[4], + int nthreads) { return ImageBufAlgo::mosaic_half(dst, src, x_offset, y_offset, pattern, white_balance, nthreads); @@ -1342,9 +1342,9 @@ mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, template<> std::string -mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, - const std::string& pattern, const float (&white_balance)[4], - int nthreads) +do_mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, + int y_offset, const std::string& pattern, + const float (&white_balance)[4], int nthreads) { return ImageBufAlgo::mosaic_uint16(dst, src, x_offset, y_offset, pattern, white_balance, nthreads); @@ -1352,9 +1352,9 @@ mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, template<> std::string -mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, int y_offset, - const std::string& pattern, const float (&white_balance)[4], - int nthreads) +do_mosaic(ImageBuf& dst, const ImageBuf& src, int x_offset, + int y_offset, const std::string& pattern, + const float (&white_balance)[4], int nthreads) { return ImageBufAlgo::mosaic_uint8(dst, src, x_offset, y_offset, pattern, white_balance, nthreads); @@ -1421,8 +1421,8 @@ test_demosaic(const DemosaicTestConfig& config, const ImageBuf& src_image, ImageSpec dst_spec(src_spec.width, src_spec.height, 1, type); ImageBuf mosaiced_image(dst_spec); - std::string layout = mosaic(mosaiced_image, src_image, x, y, - config.pattern, wb, 0); + std::string layout = do_mosaic(mosaiced_image, src_image, x, y, + config.pattern, wb, 0); mosaiced_image.specmod().attribute("raw:FilterPattern", layout); mosaiced_image.specmod().attribute("raw:WhiteBalance", diff --git a/src/libOpenImageIO/imagebufalgo_xform.cpp b/src/libOpenImageIO/imagebufalgo_xform.cpp index 5de60fb497..0abbb1ace8 100644 --- a/src/libOpenImageIO/imagebufalgo_xform.cpp +++ b/src/libOpenImageIO/imagebufalgo_xform.cpp @@ -21,7 +21,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace { @@ -378,7 +378,7 @@ warp_impl(ImageBuf& dst, const ImageBuf& src, const Imath::M33f& M, const Filter2D* filter, bool recompute_roi, ImageBuf::WrapMode wrap, bool edgeclamp, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::warp"); + OIIO::pvt::LoggedTimer logtime("IBA::warp"); ROI src_roi_full = src.roi_full(); ROI dst_roi, dst_roi_full; if (dst.initialized()) { @@ -860,7 +860,7 @@ bool ImageBufAlgo::resize(ImageBuf& dst, const ImageBuf& src, KWArgs options, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::resize"); + OIIO::pvt::LoggedTimer logtime("IBA::resize"); static const ustring recognized[] = { filtername_us, @@ -929,7 +929,7 @@ bool ImageBufAlgo::fit(ImageBuf& dst, const ImageBuf& src, KWArgs options, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::fit"); + OIIO::pvt::LoggedTimer logtime("IBA::fit"); static const ustring recognized[] = { filtername_us, @@ -1148,7 +1148,7 @@ bool ImageBufAlgo::resample(ImageBuf& dst, const ImageBuf& src, bool interpolate, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::resample"); + OIIO::pvt::LoggedTimer logtime("IBA::resample"); if (!IBAprep(roi, &dst, &src, IBAprep_NO_SUPPORT_VOLUME | IBAprep_NO_COPY_ROI_FULL | IBAprep_SUPPORT_DEEP)) @@ -1459,7 +1459,7 @@ ImageBufAlgo::st_warp(ImageBuf& dst, const ImageBuf& src, const ImageBuf& stbuf, const Filter2D* filter, int chan_s, int chan_t, bool flip_s, bool flip_t, ROI roi, int nthreads) { - pvt::LoggedTimer logtime("IBA::st_warp"); + OIIO::pvt::LoggedTimer logtime("IBA::st_warp"); if (!check_st_warp_args(dst, src, stbuf, chan_s, chan_t, roi)) { return false; @@ -1534,4 +1534,4 @@ ImageBufAlgo::st_warp(const ImageBuf& src, const ImageBuf& stbuf, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imagebufalgo_yee.cpp b/src/libOpenImageIO/imagebufalgo_yee.cpp index 39daa77248..7ee875ebe5 100644 --- a/src/libOpenImageIO/imagebufalgo_yee.cpp +++ b/src/libOpenImageIO/imagebufalgo_yee.cpp @@ -28,7 +28,7 @@ powf(const Imath::Vec3& x, float y) -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace { @@ -336,4 +336,4 @@ ImageBufAlgo::compare_Yee(const ImageBuf& img0, const ImageBuf& img1, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imageinput.cpp b/src/libOpenImageIO/imageinput.cpp index 4ae22eb7fc..03af1297c5 100644 --- a/src/libOpenImageIO/imageinput.cpp +++ b/src/libOpenImageIO/imageinput.cpp @@ -22,8 +22,9 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using namespace pvt; +using namespace OIIO::pvt; // store an error message per thread, for a specific ImageInput @@ -35,7 +36,7 @@ class ImageInput::Impl { public: Impl() : m_id(++input_next_id) - , m_threads(pvt::oiio_threads) + , m_threads(OIIO::pvt::oiio_threads) { } @@ -322,7 +323,7 @@ ImageInput::read_scanlines(int subimage, int miplevel, int ybegin, int yend, int z, int chbegin, int chend, TypeDesc format, void* data, stride_t xstride, stride_t ystride) { - pvt::LoggedTimer logtime("II::read_scanlines"); + OIIO::pvt::LoggedTimer logtime("II::read_scanlines"); ImageSpec spec; int rps = 0; { @@ -520,7 +521,7 @@ bool ImageInput::read_native_scanlines(int subimage, int miplevel, int ybegin, int yend, span data) { - if (pvt::oiio_print_debug + if (OIIO::pvt::oiio_print_debug #ifndef NDEBUG || true #endif @@ -544,7 +545,7 @@ ImageInput::read_native_scanlines(int subimage, int miplevel, int ybegin, int yend, int chbegin, int chend, span data) { - if (pvt::oiio_print_debug + if (OIIO::pvt::oiio_print_debug #ifndef NDEBUG || true #endif @@ -967,7 +968,7 @@ bool ImageInput::read_native_tiles(int subimage, int miplevel, int xbegin, int xend, int ybegin, int yend, span data) { - if (pvt::oiio_print_debug + if (OIIO::pvt::oiio_print_debug #ifndef NDEBUG || true #endif @@ -991,7 +992,7 @@ ImageInput::read_native_tiles(int subimage, int miplevel, int xbegin, int xend, int ybegin, int yend, int chbegin, int chend, span data) { - if (pvt::oiio_print_debug + if (OIIO::pvt::oiio_print_debug #ifndef NDEBUG || true #endif @@ -1017,7 +1018,7 @@ ImageInput::read_native_volumetric_tiles(int subimage, int miplevel, int xbegin, int zbegin, int zend, span data) { - if (pvt::oiio_print_debug + if (OIIO::pvt::oiio_print_debug #ifndef NDEBUG || true #endif @@ -1043,7 +1044,7 @@ ImageInput::read_native_volumetric_tiles(int subimage, int miplevel, int xbegin, int zbegin, int zend, int chbegin, int chend, span data) { - if (pvt::oiio_print_debug + if (OIIO::pvt::oiio_print_debug #ifndef NDEBUG || true #endif @@ -1070,7 +1071,7 @@ ImageInput::read_image(int subimage, int miplevel, int chbegin, int chend, ProgressCallback progress_callback, void* progress_callback_data) { - pvt::LoggedTimer logtime("II::read_image"); + OIIO::pvt::LoggedTimer logtime("II::read_image"); ImageSpec spec; int rps = 0; { @@ -1181,7 +1182,7 @@ ImageInput::read_image(int subimage, int miplevel, int chbegin, int chend, return read_image(subimage, miplevel, chbegin, chend, format, data.data(), data.xstride(), data.ystride(), data.zstride()); #else - pvt::LoggedTimer logtime("II::read_image"); + OIIO::pvt::LoggedTimer logtime("II::read_image"); ImageSpec spec; int rps = 0; { @@ -1573,21 +1574,22 @@ ImageInput::check_open(const ImageSpec& spec, ROI range, uint64_t /*flags*/) format_name(), spec.nchannels); return false; } - if (pvt::limit_channels && spec.nchannels > pvt::limit_channels) { + if (OIIO::pvt::limit_channels + && spec.nchannels > OIIO::pvt::limit_channels) { errorfmt( "{} channels exceeds \"limits:channels\" = {}. Possible corrupt input?\nIf you're sure this is a valid file, raise the OIIO global attribute \"limits:channels\".", - spec.nchannels, pvt::limit_channels); + spec.nchannels, OIIO::pvt::limit_channels); return false; } - if (pvt::limit_imagesize_MB + if (OIIO::pvt::limit_imagesize_MB && spec.image_bytes(true) - > pvt::limit_imagesize_MB * imagesize_t(1024 * 1024)) { + > OIIO::pvt::limit_imagesize_MB * imagesize_t(1024 * 1024)) { errorfmt( "Uncompressed image size {:.1f} MB exceeds the {} MB limit.\n" "Image claimed to be {}x{}, {}-channel {}. Possible corrupt input?\n" "If this is a valid file, raise the OIIO attribute \"limits:imagesize_MB\".", float(m_spec.image_bytes(true)) / float(1024 * 1024), - pvt::limit_imagesize_MB, m_spec.width, m_spec.height, + OIIO::pvt::limit_imagesize_MB, m_spec.width, m_spec.height, m_spec.nchannels, m_spec.format); return false; } @@ -1618,20 +1620,11 @@ ImageInput::valid_raw_span_size(cspan buf, const ImageSpec& spec, -template<> -inline size_t -pvt::heapsize(const ImageInput::Impl& impl) -{ - return impl.m_io_local ? sizeof(Filesystem::IOProxy) : 0; -} - - - size_t ImageInput::heapsize() const { - size_t size = pvt::heapsize(m_impl); - size += pvt::heapsize(m_spec); + size_t size = OIIO::pvt::heapsize(m_impl); + size += OIIO::pvt::heapsize(m_spec); return size; } @@ -1645,6 +1638,15 @@ ImageInput::footprint() const +template<> +inline size_t +pvt::heapsize(const ImageInput::Impl& impl) +{ + return impl.m_io_local ? sizeof(Filesystem::IOProxy) : 0; +} + + + template<> size_t pvt::heapsize(const ImageInput& input) @@ -1661,6 +1663,4 @@ pvt::footprint(const ImageInput& input) return input.footprint(); } - - -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imageio.cpp b/src/libOpenImageIO/imageio.cpp index 8c28508958..909f8529d4 100644 --- a/src/libOpenImageIO/imageio.cpp +++ b/src/libOpenImageIO/imageio.cpp @@ -269,7 +269,10 @@ oiio_build_platform() return platform; } +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN void shutdown() @@ -358,7 +361,7 @@ attribute(string_view name, TypeDesc type, const void* val) } if (Strutil::starts_with(name, "gpu:") || Strutil::starts_with(name, "cuda:")) { - return pvt::gpu_attribute(name, type, val); + return OIIO::pvt::gpu_attribute(name, type, val); } // Things below here need to buarded by the attrib_mutex @@ -490,7 +493,7 @@ getattribute(string_view name, TypeDesc type, void* val) } if (Strutil::starts_with(name, "gpu:") || Strutil::starts_with(name, "cuda:")) { - return pvt::gpu_getattribute(name, type, val); + return OIIO::pvt::gpu_getattribute(name, type, val); } // Things below here need to buarded by the attrib_mutex @@ -509,31 +512,31 @@ getattribute(string_view name, TypeDesc type, void* val) } if (name == "format_list" && type == TypeString) { if (format_list.empty()) - pvt::catalog_all_plugins(plugin_searchpath.string()); + OIIO::pvt::catalog_all_plugins(plugin_searchpath.string()); *(ustring*)val = ustring(format_list); return true; } if (name == "input_format_list" && type == TypeString) { if (input_format_list.empty()) - pvt::catalog_all_plugins(plugin_searchpath.string()); + OIIO::pvt::catalog_all_plugins(plugin_searchpath.string()); *(ustring*)val = ustring(input_format_list); return true; } if (name == "output_format_list" && type == TypeString) { if (output_format_list.empty()) - pvt::catalog_all_plugins(plugin_searchpath.string()); + OIIO::pvt::catalog_all_plugins(plugin_searchpath.string()); *(ustring*)val = ustring(output_format_list); return true; } if (name == "extension_list" && type == TypeString) { if (extension_list.empty()) - pvt::catalog_all_plugins(plugin_searchpath.string()); + OIIO::pvt::catalog_all_plugins(plugin_searchpath.string()); *(ustring*)val = ustring(extension_list); return true; } if (name == "library_list" && type == TypeString) { if (library_list.empty()) - pvt::catalog_all_plugins(plugin_searchpath.string()); + OIIO::pvt::catalog_all_plugins(plugin_searchpath.string()); *(ustring*)val = ustring(library_list); return true; } @@ -714,8 +717,11 @@ getattribute(string_view name, TypeDesc type, void* val) return false; } +OIIO_NAMESPACE_3_1_END +OIIO_NAMESPACE_BEGIN + namespace { /// Type-independent template for turning potentially @@ -907,6 +913,10 @@ pvt::parallel_convert_from_float(const float* src, void* dst, size_t nvals, return dst; } +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN bool @@ -921,7 +931,7 @@ convert_pixel_values(TypeDesc src_type, const void* src, TypeDesc dst_type, if (dst_type == TypeFloat) { // Special case -- converting non-float to float - pvt::convert_to_float(src, (float*)dst, n, src_type); + OIIO::pvt::convert_to_float(src, (float*)dst, n, src_type); return true; } @@ -937,7 +947,7 @@ convert_pixel_values(TypeDesc src_type, const void* src, TypeDesc dst_type, tmp.reset(new float[n]); // Freed when tmp exists its scope buf = tmp.get(); } - pvt::convert_to_float(src, buf, n, src_type); + OIIO::pvt::convert_to_float(src, buf, n, src_type); } // Convert float to 'dst_type' @@ -1219,10 +1229,9 @@ add_bluenoise(int nchannels, int width, int height, int depth, float* data, int channel = c + chorigin; if (channel == alpha_channel || channel == z_channel) continue; - float dither - = pvt::bluenoise_4chan_ptr(x + xorigin, y + yorigin, - z + zorigin, channel & (~3), - ditherseed)[channel & 3]; + float dither = OIIO::pvt::bluenoise_4chan_ptr( + x + xorigin, y + yorigin, z + zorigin, channel & (~3), + ditherseed)[channel & 3]; *val += ditheramplitude * (dither - 0.5f); } } @@ -1432,4 +1441,4 @@ image_span_within_span(const image_span& ispan, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imageioplugin.cpp b/src/libOpenImageIO/imageioplugin.cpp index 3089427445..68462cebf1 100644 --- a/src/libOpenImageIO/imageioplugin.cpp +++ b/src/libOpenImageIO/imageioplugin.cpp @@ -140,7 +140,10 @@ declare_imageio_format_locked(const std::string& format_name, } } +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN /// Register the input and output 'create' routine and list of file /// extensions for a particular format. @@ -151,7 +154,7 @@ declare_imageio_format(const std::string& format_name, ImageOutput::Creator output_creator, const char** output_extensions, const char* lib_version) { - std::lock_guard lock(pvt::imageio_mutex); + std::lock_guard lock(OIIO::pvt::imageio_mutex); declare_imageio_format_locked(format_name, input_creator, input_extensions, output_creator, output_extensions, lib_version); @@ -169,7 +172,7 @@ is_imageio_format_name(string_view name) if (!format_list_vector.size()) { lock.unlock(); // catalog_all_plugins() will lock imageio_mutex. - pvt::catalog_all_plugins(pvt::plugin_searchpath.string()); + OIIO::pvt::catalog_all_plugins(OIIO::pvt::plugin_searchpath.string()); lock.lock(); } for (const auto& n : format_list_vector) @@ -178,7 +181,11 @@ is_imageio_format_name(string_view name) return false; } +OIIO_NAMESPACE_3_1_END + + +OIIO_NAMESPACE_BEGIN static void catalog_plugin(const std::string& format_name, @@ -518,6 +525,10 @@ pvt::is_procedural_plugin(const std::string& name) return procedural_plugins.find(name) != procedural_plugins.end(); } +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN std::unique_ptr @@ -548,9 +559,10 @@ ImageOutput::create(string_view filename, Filesystem::IOProxy* ioproxy, if (found == output_formats.end()) { lock.unlock(); // catalog_all_plugins() will lock imageio_mutex - catalog_all_plugins(plugin_searchpath.size() - ? plugin_searchpath - : string_view(pvt::plugin_searchpath)); + catalog_all_plugins( + plugin_searchpath.size() + ? plugin_searchpath + : string_view(OIIO::pvt::plugin_searchpath)); lock.lock(); found = output_formats.find(format); } @@ -647,7 +659,7 @@ ImageInput::create(string_view filename, bool do_open, const ImageSpec* config, InputPluginMap::const_iterator found = input_formats.find(format); if (found == input_formats.end()) { if (plugin_searchpath.empty()) - plugin_searchpath = pvt::plugin_searchpath; + plugin_searchpath = OIIO::pvt::plugin_searchpath; lock.unlock(); // catalog_all_plugins() will lock imageio_mutex. catalog_all_plugins(plugin_searchpath); @@ -700,7 +712,7 @@ ImageInput::create(string_view filename, bool do_open, const ImageSpec* config, create_function = nullptr; if (in) { specific_error = in->geterror(); - if (pvt::oiio_print_debug > 1) + if (OIIO::pvt::oiio_print_debug > 1) OIIO::debugfmt( "ImageInput::create: \"{}\" did not open using format \"{}\".\n", filename, in->format_name()); @@ -709,7 +721,7 @@ ImageInput::create(string_view filename, bool do_open, const ImageSpec* config, } } - if (!create_function && pvt::oiio_try_all_readers) { + if (!create_function && OIIO::pvt::oiio_try_all_readers) { // If a plugin can't be found that was explicitly designated for // this extension, then just try every one we find and see if // any will open the file. Add a configuration request that @@ -748,7 +760,7 @@ ImageInput::create(string_view filename, bool do_open, const ImageSpec* config, && !in->valid_file(filename))) { // Since we didn't need to open it, we just checked whether // it was a valid file, and it's not. Try the next one. - if (pvt::oiio_print_debug > 1) + if (OIIO::pvt::oiio_print_debug > 1) OIIO::debugfmt( "ImageInput::create: \"{}\" did not open using format \"{}\" {} [valid_file was false].\n", filename, plugin->first, in->format_name()); @@ -764,13 +776,13 @@ ImageInput::create(string_view filename, bool do_open, const ImageSpec* config, if (ok) { if (!do_open) in->close(); - if (pvt::oiio_print_debug > 1) + if (OIIO::pvt::oiio_print_debug > 1) OIIO::debugfmt( "ImageInput::create: \"{}\" succeeded using format \"{}\".\n", filename, plugin->first); return in; } - if (pvt::oiio_print_debug > 1) + if (OIIO::pvt::oiio_print_debug > 1) OIIO::debugfmt( "ImageInput::create: \"{}\" did not open using format \"{}\" {}.\n", filename, plugin->first, in->format_name()); @@ -809,4 +821,4 @@ ImageInput::create(string_view filename, bool do_open, const ImageSpec* config, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/imageoutput.cpp b/src/libOpenImageIO/imageoutput.cpp index 41e815aabf..1b9edaede5 100644 --- a/src/libOpenImageIO/imageoutput.cpp +++ b/src/libOpenImageIO/imageoutput.cpp @@ -25,8 +25,9 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using namespace pvt; +using namespace OIIO::pvt; // store an error message per thread, for a specific ImageInput @@ -38,7 +39,7 @@ class ImageOutput::Impl { public: Impl() : m_id(++output_next_id) - , m_threads(pvt::oiio_threads) + , m_threads(OIIO::pvt::oiio_threads) { } @@ -600,7 +601,7 @@ ImageOutput::write_image(TypeDesc format, const void* data, stride_t xstride, ProgressCallback progress_callback, void* progress_callback_data) { - pvt::LoggedTimer logtime("ImageOutput::write image"); + OIIO::pvt::LoggedTimer logtime("ImageOutput::write image"); bool native = (format == TypeDesc::UNKNOWN); stride_t pixel_bytes = native ? (stride_t)m_spec.pixel_bytes(native) : format.size() * m_spec.nchannels; @@ -1140,20 +1141,11 @@ ImageOutput::check_open(OpenMode mode, const ImageSpec& userspec, ROI range, -template<> -inline size_t -pvt::heapsize(const ImageOutput::Impl& impl) -{ - return impl.m_io_local ? sizeof(Filesystem::IOProxy) : 0; -} - - - size_t ImageOutput::heapsize() const { - size_t size = pvt::heapsize(m_impl); - size += pvt::heapsize(m_spec); + size_t size = OIIO::pvt::heapsize(m_impl); + size += OIIO::pvt::heapsize(m_spec); return size; } @@ -1167,6 +1159,15 @@ ImageOutput::footprint() const +template<> +inline size_t +pvt::heapsize(const ImageOutput::Impl& impl) +{ + return impl.m_io_local ? sizeof(Filesystem::IOProxy) : 0; +} + + + template<> size_t pvt::heapsize(const ImageOutput& output) @@ -1183,6 +1184,4 @@ pvt::footprint(const ImageOutput& output) return output.footprint(); } - - -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/iptc.cpp b/src/libOpenImageIO/iptc.cpp index aa739eb950..b8ee573059 100644 --- a/src/libOpenImageIO/iptc.cpp +++ b/src/libOpenImageIO/iptc.cpp @@ -95,7 +95,10 @@ static IIMtag iimtag[] = { } // anonymous namespace +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN bool decode_iptc_iim(const void* iptc, int length, ImageSpec& spec) @@ -234,4 +237,4 @@ encode_iptc_iim(const ImageSpec& spec, std::vector& iptc) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/maketexture.cpp b/src/libOpenImageIO/maketexture.cpp index 934d17b56e..ca38206523 100644 --- a/src/libOpenImageIO/maketexture.cpp +++ b/src/libOpenImageIO/maketexture.cpp @@ -29,8 +29,7 @@ #include "imageio_pvt.h" -using namespace OIIO; - +OIIO_NAMESPACE_BEGIN static spin_mutex maketx_mutex; // for anything that needs locking @@ -2042,14 +2041,18 @@ make_texture_impl(ImageBufAlgo::MakeTextureMode mode, const ImageBuf* input, return ok; } +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN + bool ImageBufAlgo::make_texture(ImageBufAlgo::MakeTextureMode mode, string_view filename, string_view outputfilename, const ImageSpec& configspec, std::ostream* outstream) { - pvt::LoggedTimer logtime("IBA::make_texture"); + OIIO::pvt::LoggedTimer logtime("IBA::make_texture"); bool ok = make_texture_impl(mode, NULL, filename, outputfilename, configspec, outstream); if (!ok && outstream && OIIO::has_error()) { @@ -2067,7 +2070,7 @@ ImageBufAlgo::make_texture(ImageBufAlgo::MakeTextureMode mode, string_view outputfilename, const ImageSpec& configspec, std::ostream* outstream) { - pvt::LoggedTimer logtime("IBA::make_texture"); + OIIO::pvt::LoggedTimer logtime("IBA::make_texture"); bool ok = make_texture_impl(mode, NULL, filenames[0], outputfilename, configspec, outstream); if (!ok && outstream && OIIO::has_error()) { @@ -2084,7 +2087,7 @@ ImageBufAlgo::make_texture(ImageBufAlgo::MakeTextureMode mode, const ImageBuf& input, string_view outputfilename, const ImageSpec& configspec, std::ostream* outstream) { - pvt::LoggedTimer logtime("IBA::make_texture"); + OIIO::pvt::LoggedTimer logtime("IBA::make_texture"); bool ok = make_texture_impl(mode, &input, "", outputfilename, configspec, outstream); if (!ok && outstream && OIIO::has_error()) { @@ -2093,3 +2096,5 @@ ImageBufAlgo::make_texture(ImageBufAlgo::MakeTextureMode mode, } return ok; } + +OIIO_NAMESPACE_3_1_END diff --git a/src/libOpenImageIO/xmp.cpp b/src/libOpenImageIO/xmp.cpp index 2301e8abc5..88e9f3fe42 100644 --- a/src/libOpenImageIO/xmp.cpp +++ b/src/libOpenImageIO/xmp.cpp @@ -513,7 +513,10 @@ decode_xmp_node(pugi::xml_node node, ImageSpec& spec, int level = 1, } // anonymous namespace +OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_BEGIN bool decode_xmp(cspan xml, ImageSpec& spec) @@ -857,4 +860,4 @@ encode_xmp(const ImageSpec& spec, bool minimal) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libtexture/environment.cpp b/src/libtexture/environment.cpp index a103bfcbd1..e1fc9cf87d 100644 --- a/src/libtexture/environment.cpp +++ b/src/libtexture/environment.cpp @@ -199,7 +199,7 @@ convention is dictated by OpenEXR. */ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using namespace pvt; using namespace simd; using SubimageInfo = ImageCacheFile::SubimageInfo; @@ -643,4 +643,4 @@ TextureSystemImpl::environment(ustring filename, TextureOptBatch& options, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libtexture/imagecache.cpp b/src/libtexture/imagecache.cpp index e28d8a0e5e..deaf583ed5 100644 --- a/src/libtexture/imagecache.cpp +++ b/src/libtexture/imagecache.cpp @@ -36,7 +36,7 @@ #include "imageio_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using namespace pvt; using ImageDims = ImageCacheFile::ImageDims; using LevelInfo = ImageCacheFile::LevelInfo; @@ -1048,7 +1048,7 @@ ImageCacheFile::init_from_spec() } // Squash some problematic texture metadata if we suspect it's wrong - pvt::check_texture_metadata_sanity(this->spec(0)); + OIIO::pvt::check_texture_metadata_sanity(this->spec(0)); // See if there's a SHA-1 hash in the image description string_view fing = spec.get_string_attribute("oiio:SHA-1"); @@ -2991,8 +2991,9 @@ ImageCacheImpl::resolve_filename(const std::string& filename) const { // Ask if the format can generate imagery procedurally. If so, don't // go looking for a file. - if (pvt::is_procedural_plugin(filename) - || pvt::is_procedural_plugin(Filesystem::extension(filename, false))) + if (OIIO::pvt::is_procedural_plugin(filename) + || OIIO::pvt::is_procedural_plugin( + Filesystem::extension(filename, false))) return filename; if (m_searchdirs.empty() || Filesystem::path_is_absolute(filename, true)) { // Don't bother with the searchpath_find call since it will do an @@ -4390,8 +4391,8 @@ ImageCacheImpl::append_error(string_view message) const size_t ImageCacheImpl::heapsize() const { - using OIIO::pvt::footprint; - using OIIO::pvt::heapsize; + using pvt::footprint; + using pvt::heapsize; size_t size = 0; // strings @@ -4419,8 +4420,8 @@ ImageCacheImpl::heapsize() const size_t ImageCacheImpl::footprint(ImageCacheFootprint& output) const { - using OIIO::pvt::footprint; - using OIIO::pvt::heapsize; + using pvt::footprint; + using pvt::heapsize; // strings output.ic_str_count = m_searchdirs.size() + 2; @@ -4950,4 +4951,4 @@ ImageCache::reset_stats() } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libtexture/imagecache_memory_pvt.h b/src/libtexture/imagecache_memory_pvt.h index a1e2a75310..2d078b6d2c 100644 --- a/src/libtexture/imagecache_memory_pvt.h +++ b/src/libtexture/imagecache_memory_pvt.h @@ -14,7 +14,7 @@ #include "imagecache_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pvt { @@ -78,4 +78,4 @@ heapsize(const ImageCacheImpl& ic) } // namespace pvt -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libtexture/imagecache_pvt.h b/src/libtexture/imagecache_pvt.h index f81d78ec98..a147ce8a52 100644 --- a/src/libtexture/imagecache_pvt.h +++ b/src/libtexture/imagecache_pvt.h @@ -22,9 +22,6 @@ #include #include -OIIO_NAMESPACE_BEGIN - - #ifndef NDEBUG # define IMAGECACHE_TIME_STATS 1 #else @@ -39,22 +36,25 @@ OIIO_NAMESPACE_BEGIN #define TILE_CACHE_SHARDS 128 - -struct TileID; -class ImageCacheImpl; +OIIO_NAMESPACE_BEGIN struct ImageCacheFootprint; +OIIO_NAMESPACE_END -namespace pvt { +OIIO_NAMESPACE_3_1_BEGIN +namespace pvt { const char* texture_format_name(TexFormat f); const char* texture_type_name(TexFormat f); - } // namespace pvt +struct TileID; + + + /// Structure to hold IC and TS statistics. We combine into a single /// structure to minimize the number of costly ImageCachePerThreadInfo /// retrievals. If somebody is using the ImageCache without a @@ -158,8 +158,8 @@ struct UdimInfo { /// thread-specific IC data including microcache and statistics. /// class OIIO_API ImageCacheFile final : public RefCnt { - using TexFormat = pvt::TexFormat; - using EnvLayout = pvt::EnvLayout; + using TexFormat = v3_1::pvt::TexFormat; + using EnvLayout = v3_1::pvt::EnvLayout; using UdimInfo = pvt::UdimInfo; public: @@ -1397,7 +1397,7 @@ class ImageCacheImpl { }; -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END #endif // OPENIMAGEIO_IMAGECACHE_PVT_H diff --git a/src/libtexture/texoptions.cpp b/src/libtexture/texoptions.cpp index 3b3a72d91a..a634cef2eb 100644 --- a/src/libtexture/texoptions.cpp +++ b/src/libtexture/texoptions.cpp @@ -11,7 +11,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace { // anonymous @@ -94,4 +94,4 @@ Tex::parse_wrapmodes(const char* wrapmodes, Tex::Wrap& swrapcode, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libtexture/texture3d.cpp b/src/libtexture/texture3d.cpp index 19b2dfc2e0..7d492c9da3 100644 --- a/src/libtexture/texture3d.cpp +++ b/src/libtexture/texture3d.cpp @@ -22,7 +22,7 @@ #include "imagecache_pvt.h" #include "texture_pvt.h" -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using namespace pvt; using LevelInfo = ImageCacheFile::LevelInfo; using SubimageInfo = ImageCacheFile::SubimageInfo; @@ -766,4 +766,4 @@ TextureSystemImpl::texture3d(ustring filename, TextureOptBatch& options, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libtexture/texture_pvt.h b/src/libtexture/texture_pvt.h index d5e5ce67a6..c1de13890a 100644 --- a/src/libtexture/texture_pvt.h +++ b/src/libtexture/texture_pvt.h @@ -14,11 +14,6 @@ #include OIIO_NAMESPACE_BEGIN - -class ImageCache; -class TextureSystemImpl; -class Filter1D; - #ifndef OPENIMAGEIO_IMAGECACHE_PVT_H class ImageCacheFile; class ImageCacheTile; @@ -26,8 +21,11 @@ class ImageCacheTileRef; class ImageCacheTileID; class ImageCacheImpl; #endif +OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_BEGIN + /// Working implementation of the abstract TextureSystem class. class TextureSystemImpl { @@ -554,6 +552,6 @@ TextureSystemImpl::st_to_texel(float s, float t, TextureFile& texturefile, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END #endif // OPENIMAGEIO_TEXTURE_PVT_H diff --git a/src/libtexture/texturesys.cpp b/src/libtexture/texturesys.cpp index 6b6bae186c..249c47b7aa 100644 --- a/src/libtexture/texturesys.cpp +++ b/src/libtexture/texturesys.cpp @@ -34,14 +34,16 @@ #define TEX_FAST_MATH 1 +using namespace OIIO::simd; -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using namespace pvt; -using namespace simd; +using namespace OIIO::pvt; using LevelInfo = ImageCacheFile::LevelInfo; using SubimageInfo = ImageCacheFile::SubimageInfo; using ImageDims = ImageCacheFile::ImageDims; + namespace { // anonymous // We would like shared_texturesys to be a shared_ptr so that it is @@ -3642,4 +3644,4 @@ TextureSystem::unit_test_hash() } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/SHA1.cpp b/src/libutil/SHA1.cpp index 0ac8959bec..08d246871e 100644 --- a/src/libutil/SHA1.cpp +++ b/src/libutil/SHA1.cpp @@ -49,7 +49,7 @@ #pragma warning(disable: 4127) #endif -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN SHA1::SHA1 (const void *data, size_t size) { @@ -317,4 +317,4 @@ bool CSHA1::GetHash(UINT_8* pbDest20) const #pragma warning(pop) #endif -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/SHA1.h b/src/libutil/SHA1.h index 80970214ee..fca69aee68 100644 --- a/src/libutil/SHA1.h +++ b/src/libutil/SHA1.h @@ -219,7 +219,7 @@ /////////////////////////////////////////////////////////////////////////// // Declare SHA-1 workspace -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN typedef union { @@ -288,7 +288,7 @@ class CSHA1 SHA1_WORKSPACE_BLOCK* m_block; // SHA1 pointer to the byte array above }; -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END #ifndef DO_NOT_UNDEFINE_SHA1 #undef TCHAR diff --git a/src/libutil/argparse.cpp b/src/libutil/argparse.cpp index 6653ee992c..9ad566fac1 100644 --- a/src/libutil/argparse.cpp +++ b/src/libutil/argparse.cpp @@ -21,7 +21,9 @@ #include #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN +// All of ArgParse is still in the v3_1 namespace until it needs to break ABI +// compatibility. class ArgOption final : public ArgParse::Arg { public: @@ -151,7 +153,7 @@ class ArgParse::Impl { : m_argparse(parent) , m_argc(argc) , m_argv(argv) - , m_prog(Filesystem::filename(Sysutil::this_program_path())) + , m_prog(OIIO::Filesystem::filename(Sysutil::this_program_path())) { } @@ -1195,4 +1197,4 @@ ArgParse::set_next_arg(int nextarg) m_impl->m_next_arg = nextarg; } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/benchmark.cpp b/src/libutil/benchmark.cpp index 5642358035..f8e0d2a833 100644 --- a/src/libutil/benchmark.cpp +++ b/src/libutil/benchmark.cpp @@ -10,11 +10,11 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace pvt { -void OIIO_API +void OIIO_UTIL_API #if __has_attribute(__optnone__) __attribute__((__optnone__)) #endif @@ -27,7 +27,7 @@ void OIIO_API // Implementation of clobber_ptr is trivial, but the code in other modules // doesn't know that. -void OIIO_API +void OIIO_UTIL_API #if __has_attribute(__optnone__) __attribute__((__optnone__)) #endif @@ -110,7 +110,7 @@ Benchmarker::compute_stats(std::vector& times, size_t iterations) -OIIO_API +OIIO_UTIL_API std::ostream& operator<<(std::ostream& out, const Benchmarker& bench) { @@ -144,7 +144,7 @@ operator<<(std::ostream& out, const Benchmarker& bench) if (bench.indent()) OIIO::print(out, "{}", std::string(bench.indent(), ' ')); if (unit == int(Benchmarker::Unit::s)) - OIIO::print(out, "{:16}: {}", bench.m_name, + OIIO::print(out, "{:16}: {}", bench.name(), Strutil::timeintervalformat(avg, 2)); else OIIO::print(out, "{:16}: {:6.1f} {} (+/- {:.1f}{}), ", bench.name(), @@ -175,9 +175,14 @@ operator<<(std::ostream& out, const Benchmarker& bench) return out; } +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN -OIIO_API std::vector + +OIIO_UTIL_API std::vector timed_thread_wedge(function_view task, function_view pretask, function_view posttask, std::ostream* out, int maxthreads, int total_iterations, int ntrials, @@ -220,7 +225,7 @@ timed_thread_wedge(function_view task, function_view pretask, -OIIO_API void +OIIO_UTIL_API void timed_thread_wedge(function_view task, int maxthreads, int total_iterations, int ntrials, cspan threadcounts) { @@ -229,4 +234,4 @@ timed_thread_wedge(function_view task, int maxthreads, ntrials, threadcounts); } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/errorhandler.cpp b/src/libutil/errorhandler.cpp index a9baeb79d7..d0d1a2c385 100644 --- a/src/libutil/errorhandler.cpp +++ b/src/libutil/errorhandler.cpp @@ -12,7 +12,7 @@ -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN @@ -58,4 +58,4 @@ ErrorHandler::operator()(int errcode, const std::string& msg) fflush(stderr); } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/farmhash.cpp b/src/libutil/farmhash.cpp index 128c63e1c7..98773d8dba 100644 --- a/src/libutil/farmhash.cpp +++ b/src/libutil/farmhash.cpp @@ -33,9 +33,9 @@ // namespace NAMESPACE_FOR_HASH_FUNCTIONS { - OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN - namespace farmhash { +namespace farmhash { // BASIC STRING HASHING @@ -43,7 +43,7 @@ // May change from time to time, may differ on different platforms, may differ // depending on NDEBUG. uint32_t Hash32(const char* s, size_t len) { - return farmhash::inlined::Hash32(s, len); + return OIIO::farmhash::inlined::Hash32(s, len); } // Hash function for a byte array. For convenience, a 32-bit seed is also @@ -51,7 +51,7 @@ uint32_t Hash32(const char* s, size_t len) { // May change from time to time, may differ on different platforms, may differ // depending on NDEBUG. uint32_t Hash32WithSeed(const char* s, size_t len, uint32_t seed) { - return farmhash::inlined::Hash32WithSeed(s, len, seed); + return OIIO::farmhash::inlined::Hash32WithSeed(s, len, seed); } // Hash function for a byte array. For convenience, a 64-bit seed is also @@ -59,14 +59,14 @@ uint32_t Hash32WithSeed(const char* s, size_t len, uint32_t seed) { // May change from time to time, may differ on different platforms, may differ // depending on NDEBUG. uint64_t Hash64(const char* s, size_t len) { - return farmhash::inlined::Hash64(s, len); + return OIIO::farmhash::inlined::Hash64(s, len); } // Hash function for a byte array. // May change from time to time, may differ on different platforms, may differ // depending on NDEBUG. size_t Hash(const char* s, size_t len) { - return farmhash::inlined::Hash(s, len); + return OIIO::farmhash::inlined::Hash(s, len); } // Hash function for a byte array. For convenience, a 64-bit seed is also @@ -74,7 +74,7 @@ size_t Hash(const char* s, size_t len) { // May change from time to time, may differ on different platforms, may differ // depending on NDEBUG. uint64_t Hash64WithSeed(const char* s, size_t len, uint64_t seed) { - return farmhash::inlined::Hash64WithSeed(s, len, seed); + return OIIO::farmhash::inlined::Hash64WithSeed(s, len, seed); } // Hash function for a byte array. For convenience, two seeds are also @@ -82,14 +82,14 @@ uint64_t Hash64WithSeed(const char* s, size_t len, uint64_t seed) { // May change from time to time, may differ on different platforms, may differ // depending on NDEBUG. uint64_t Hash64WithSeeds(const char* s, size_t len, uint64_t seed0, uint64_t seed1) { - return farmhash::inlined::Hash64WithSeeds(s, len, seed0, seed1); + return OIIO::farmhash::inlined::Hash64WithSeeds(s, len, seed0, seed1); } // Hash function for a byte array. // May change from time to time, may differ on different platforms, may differ // depending on NDEBUG. uint128_t Hash128(const char* s, size_t len) { - return farmhash::inlined::Hash128(s, len); + return OIIO::farmhash::inlined::Hash128(s, len); } // Hash function for a byte array. For convenience, a 128-bit seed is also @@ -97,7 +97,7 @@ uint128_t Hash128(const char* s, size_t len) { // May change from time to time, may differ on different platforms, may differ // depending on NDEBUG. uint128_t Hash128WithSeed(const char* s, size_t len, uint128_t seed) { - return farmhash::inlined::Hash128WithSeed(s, len, seed); + return OIIO::farmhash::inlined::Hash128WithSeed(s, len, seed); } // BASIC NON-STRING HASHING @@ -106,21 +106,22 @@ uint128_t Hash128WithSeed(const char* s, size_t len, uint128_t seed) { // Fingerprint function for a byte array. Most useful in 32-bit binaries. uint32_t Fingerprint32(const char* s, size_t len) { - return farmhash::inlined::Fingerprint32(s, len); + return OIIO::farmhash::inlined::Fingerprint32(s, len); } // Fingerprint function for a byte array. uint64_t Fingerprint64(const char* s, size_t len) { - return farmhash::inlined::Fingerprint64(s, len); + return OIIO::farmhash::inlined::Fingerprint64(s, len); } // Fingerprint function for a byte array. uint128_t Fingerprint128(const char* s, size_t len) { - return farmhash::inlined::Fingerprint128(s, len); + return OIIO::farmhash::inlined::Fingerprint128(s, len); } // Older and still available but perhaps not as fast as the above: // farmhashns::Hash32{,WithSeed}() // } // namespace NAMESPACE_FOR_HASH_FUNCTIONS -} /*end namespace farmhash*/ OIIO_NAMESPACE_END +} /*end namespace farmhash*/ +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/filesystem.cpp b/src/libutil/filesystem.cpp index 5ede2126c3..e19e35a40f 100644 --- a/src/libutil/filesystem.cpp +++ b/src/libutil/filesystem.cpp @@ -40,7 +40,7 @@ using std::error_code; -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN inline filesystem::path @@ -571,7 +571,7 @@ Filesystem::getline(FILE* file, size_t maxlen) void -Filesystem::open(OIIO::ifstream& stream, string_view path, +Filesystem::open(ifstream& stream, string_view path, std::ios_base::openmode mode) { #ifdef _WIN32 @@ -588,7 +588,7 @@ Filesystem::open(OIIO::ifstream& stream, string_view path, void -Filesystem::open(OIIO::ofstream& stream, string_view path, +Filesystem::open(ofstream& stream, string_view path, std::ios_base::openmode mode) { #ifdef _WIN32 @@ -1195,7 +1195,8 @@ Filesystem::IOFile::IOFile(string_view filename, Mode mode) { // Call Filesystem::fopen since it handles UTF-8 file paths on Windows, // which std fopen does not. - m_file = Filesystem::fopen(m_filename, m_mode == Write ? "w+b" : "rb"); + m_file = OIIO::Filesystem::fopen(m_filename, + m_mode == Write ? "w+b" : "rb"); if (!m_file) { m_mode = Closed; int e = errno; @@ -1204,7 +1205,7 @@ Filesystem::IOFile::IOFile(string_view filename, Mode mode) } m_auto_close = true; if (m_mode == Read) - m_size = Filesystem::file_size(filename); + m_size = OIIO::Filesystem::file_size(filename); } Filesystem::IOFile::IOFile(FILE* file, Mode mode) @@ -1212,10 +1213,12 @@ Filesystem::IOFile::IOFile(FILE* file, Mode mode) , m_file(file) { if (m_mode == Read) { - m_pos = Filesystem::ftell(m_file); // save old position - Filesystem::fseek(m_file, 0, SEEK_END); // seek to end - m_size = size_t(Filesystem::ftell(m_file)); // size is end position - Filesystem::fseek(m_file, m_pos, SEEK_SET); // restore old position + m_pos = OIIO::Filesystem::ftell(m_file); // save old position + OIIO::Filesystem::fseek(m_file, 0, SEEK_END); // seek to end + m_size = size_t( + OIIO::Filesystem::ftell(m_file)); // size is end position + OIIO::Filesystem::fseek(m_file, m_pos, + SEEK_SET); // restore old position } } @@ -1241,7 +1244,7 @@ Filesystem::IOFile::seek(int64_t offset) if (!m_file) return false; m_pos = offset; - return Filesystem::fseek(m_file, offset, SEEK_SET) == 0; + return OIIO::Filesystem::fseek(m_file, offset, SEEK_SET) == 0; } size_t @@ -1404,5 +1407,4 @@ Filesystem::IOMemReader::pread(void* buf, size_t size, int64_t offset) return size; } - -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/filter.cpp b/src/libutil/filter.cpp index a39a0d84a9..eb3a346db2 100644 --- a/src/libutil/filter.cpp +++ b/src/libutil/filter.cpp @@ -30,7 +30,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN // Below are the implementations of several 2D filters. They all // inherit their interface from Filter2D. Each must redefine two @@ -1047,4 +1047,4 @@ Filter2D::destroy(Filter2D* filt) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/hashes.cpp b/src/libutil/hashes.cpp index 52a2e753dd..251269c784 100644 --- a/src/libutil/hashes.cpp +++ b/src/libutil/hashes.cpp @@ -12,7 +12,7 @@ #include #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace bjhash { @@ -782,4 +782,4 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval) } // end namespace bjhash -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/paramlist.cpp b/src/libutil/paramlist.cpp index 2721a3fc0c..026e80520b 100644 --- a/src/libutil/paramlist.cpp +++ b/src/libutil/paramlist.cpp @@ -12,7 +12,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN void @@ -102,25 +102,6 @@ ParamValue::operator=(ParamValue&& p) noexcept -namespace Strutil { -template<> -inline short -from_string(string_view s) -{ - return static_cast(Strutil::stoi(s)); -} - - -template<> -inline unsigned short -from_string(string_view s) -{ - return static_cast(Strutil::stoi(s)); -} -} // namespace Strutil - - - // helper to parse a list from a string template static void @@ -379,17 +360,6 @@ ParamValue::clear_value() noexcept -template<> -size_t -pvt::heapsize(const ParamValue& pv) -{ - return (pv.m_nonlocal && pv.m_copy) - ? pv.m_nvalues * static_cast(pv.m_type.size()) - : 0; -} - - - ParamValueList::const_iterator ParamValueList::find(ustring name, TypeDesc type, bool casesensitive) const { @@ -953,4 +923,13 @@ ParamValueSpan::getattribute_indexed(string_view name, int index, -OIIO_NAMESPACE_END +template<> +size_t +pvt::heapsize(const ParamValue& pv) +{ + return (pv.m_nonlocal && pv.m_copy) + ? pv.m_nvalues * static_cast(pv.m_type.size()) + : 0; +} + +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/plugin.cpp b/src/libutil/plugin.cpp index a8451c9c9a..8ec0a97979 100644 --- a/src/libutil/plugin.cpp +++ b/src/libutil/plugin.cpp @@ -25,7 +25,7 @@ OIIO_PRAGMA_WARNING_POP #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN using namespace Plugin; @@ -147,4 +147,4 @@ Plugin::geterror(bool clear) return e; } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/strutil.cpp b/src/libutil/strutil.cpp index ef0d80e7a7..224bafaf68 100644 --- a/src/libutil/strutil.cpp +++ b/src/libutil/strutil.cpp @@ -59,6 +59,18 @@ OIIO_PRAGMA_WARNING_POP OIIO_NAMESPACE_BEGIN +namespace pvt { +static const char* oiio_debug_env = getenv("OPENIMAGEIO_DEBUG"); +#ifdef NDEBUG +OIIO_UTIL_API int + oiio_print_debug(oiio_debug_env ? Strutil::stoi(oiio_debug_env) : 0); +#else +OIIO_UTIL_API int + oiio_print_debug(oiio_debug_env ? Strutil::stoi(oiio_debug_env) : 1); +#endif +OIIO_UTIL_API int oiio_print_uncaught_errors(1); +} // namespace pvt + namespace { @@ -77,6 +89,18 @@ static _locale_t c_loc = _create_locale(LC_ALL, "C"); +#if OIIO_VERSION_LESS(3, 1, 2) /* remove at next ABI compatibility boundary */ +void +pvt::log_fmt_error(const char* message) +{ + print("fmt exception: {}\n", message); + Strutil::pvt::append_error(std::string("fmt exception: ") + message); +} +#endif + +OIIO_NAMESPACE_END + + // Locale-independent quickie ASCII digit and alphanum tests, good enough // for our parsing. inline int @@ -101,6 +125,7 @@ isdigit(char c) } +OIIO_NAMESPACE_3_1_BEGIN OIIO_NO_SANITIZE_ADDRESS const char* c_str(string_view str) @@ -166,20 +191,6 @@ Strutil::sync_output(std::ostream& file, string_view str, bool flush) -namespace pvt { -static const char* oiio_debug_env = getenv("OPENIMAGEIO_DEBUG"); -#ifdef NDEBUG -OIIO_UTIL_API int - oiio_print_debug(oiio_debug_env ? Strutil::stoi(oiio_debug_env) : 0); -#else -OIIO_UTIL_API int - oiio_print_debug(oiio_debug_env ? Strutil::stoi(oiio_debug_env) : 1); -#endif -OIIO_UTIL_API int oiio_print_uncaught_errors(1); -} // namespace pvt - - - // ErrorHolder houses a string, with the addition that when it is destroyed, // it will disgorge any un-retrieved error messages, in an effort to help // beginning users diagnose their problems if they have forgotten to call @@ -189,7 +200,7 @@ struct ErrorHolder { ~ErrorHolder() { - if (!error_msg.empty() && pvt::oiio_print_uncaught_errors) { + if (!error_msg.empty() && OIIO::pvt::oiio_print_uncaught_errors) { OIIO::print( "OpenImageIO exited with a pending error message that was never\n" "retrieved via OIIO::geterror(). This was the error message:\n{}\n", @@ -246,17 +257,6 @@ Strutil::pvt::geterror(bool clear) } -#if OIIO_VERSION_LESS(3, 1, 2) /* remove at next ABI compatibility boundary */ -void -pvt::log_fmt_error(const char* message) -{ - print("fmt exception: {}\n", message); - Strutil::pvt::append_error(std::string("fmt exception: ") + message); -} -#endif - - - void Strutil::pvt::debug(string_view message) { @@ -2008,4 +2008,5 @@ Strutil::eval_as_bool(string_view value) } } -OIIO_NAMESPACE_END + +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/strutil_test.cpp b/src/libutil/strutil_test.cpp index fba21ee41f..a9b8bed758 100644 --- a/src/libutil/strutil_test.cpp +++ b/src/libutil/strutil_test.cpp @@ -1315,7 +1315,7 @@ test_string_view() OIIO_CHECK_EQUAL(OIIO::c_str(string_view(sr.data(), 2)), std::string("01")); Strutil::print("addr cstr={:p}, s={:p}, ustring={:p}, sr={:p}, c_str(sr)={:p}\n", (void*)cstr, (void*)s.c_str(), (void*)ustring(cstr).c_str(), (void*)sr.data(), - (void*)c_str(sr)); + (void*)OIIO::c_str(sr)); } diff --git a/src/libutil/sysutil.cpp b/src/libutil/sysutil.cpp index e89af9cfaa..03e9127473 100644 --- a/src/libutil/sysutil.cpp +++ b/src/libutil/sysutil.cpp @@ -76,9 +76,7 @@ OIIO_INTEL_PRAGMA(warning disable 2196) -OIIO_NAMESPACE_BEGIN - -using namespace Sysutil; +OIIO_NAMESPACE_3_1_BEGIN size_t @@ -369,9 +367,6 @@ isatty(int fd) #endif -Term::Term(FILE* file) { m_is_console = isatty(fileno((file))); } - - #ifdef _WIN32 // from https://msdn.microsoft.com/fr-fr/library/windows/desktop/mt638032%28v=vs.85%29.aspx @@ -404,6 +399,11 @@ enableVTMode() +namespace Sysutil { + +Term::Term(FILE* file) { m_is_console = isatty(fileno((file))); } + + Term::Term(const std::ostream& stream) { m_is_console = (&stream == &std::cout && isatty(fileno(stdout))) @@ -525,6 +525,8 @@ Term::ansi_bgcolor(int r, int g, int b) return ret; } +} // end namespace Sysutil + bool @@ -598,7 +600,8 @@ Sysutil::max_open_files() -void* +// Backward link compatibility +OIIO_UTIL_API void* aligned_malloc(std::size_t size, std::size_t align) { #if defined(_WIN32) @@ -609,9 +612,8 @@ aligned_malloc(std::size_t size, std::size_t align) #endif } - - -void +// Backward link compatibility +OIIO_UTIL_API void aligned_free(void* ptr) { #if defined(_WIN32) @@ -685,4 +687,4 @@ Sysutil::setup_crash_stacktrace(string_view filename) } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/thread.cpp b/src/libutil/thread.cpp index 87dd488b1c..d6e605841f 100644 --- a/src/libutil/thread.cpp +++ b/src/libutil/thread.cpp @@ -87,10 +87,15 @@ OIIO_NAMESPACE_END OIIO_NAMESPACE_BEGIN - namespace pvt { OIIO_UTIL_API int oiio_use_tbb(0); // Use TBB if available } +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN +// Thread utils still in the v3_1 namespace until it needs to break ABI +// compatibility. static int @@ -345,7 +350,7 @@ class thread_pool::Impl { std::vector> threads; std::vector>> flags; - mutable pvt::ThreadsafeQueue*> q; + mutable OIIO::pvt::ThreadsafeQueue*> q; std::atomic isDone; std::atomic isStop; std::atomic nWaiting; // how many threads are waiting @@ -576,20 +581,6 @@ task_set::wait(bool block) -// Helper function to keep track of the recursve depth of our use of the -// thread pool. Call with the adjustment (i.e., parallel_recursive_depth(1) -// to enter, parallel_recursive_depth(-1) to exit), and it will return the -// new value. Call with default args (0) to just return the current depth. -static int -parallel_recursive_depth(int change = 0) -{ - thread_local int depth = 0; // let's only allow one level of parallel work - depth += change; - return depth; -} - - - void paropt::resolve() { @@ -603,6 +594,20 @@ paropt::resolve() +// Helper function to keep track of the recursive depth of our use of the +// thread pool. Call with the adjustment (i.e., parallel_recursive_depth(1) +// to enter, parallel_recursive_depth(-1) to exit), and it will return the +// new value. Call with default args (0) to just return the current depth. +static int +parallel_recursive_depth(int change = 0) +{ + thread_local int depth = 0; // let's only allow one level of parallel work + depth += change; + return depth; +} + + + void parallel_for_chunked_id(int64_t begin, int64_t end, int64_t chunksize, std::function&& task, @@ -652,7 +657,7 @@ parallel_for_chunked(int64_t begin, int64_t end, int64_t chunksize, template inline void -parallel_for_impl(Index begin, Index end, function_view task, +parallel_for_impl(Index begin, Index end, function_view&& task, paropt opt) { if (opt.maxthreads() == 1) { @@ -664,7 +669,7 @@ parallel_for_impl(Index begin, Index end, function_view task, #if OIIO_TBB if (opt.strategy() == paropt::ParStrategy::TryTBB || (opt.strategy() == paropt::ParStrategy::Default - && pvt::oiio_use_tbb)) { + && OIIO::pvt::oiio_use_tbb)) { if (opt.maxthreads()) { tbb::task_arena arena(opt.maxthreads()); arena.execute([=] { tbb::parallel_for(begin, end, task); }); @@ -685,37 +690,79 @@ parallel_for_impl(Index begin, Index end, function_view task, +// DEPRECATED void parallel_for(int begin, int end, function_view task, paropt opt) { - parallel_for_impl(begin, end, task, opt); + parallel_for_impl(begin, end, std::move(task), opt); } +// DEPRECATED void parallel_for(uint32_t begin, uint32_t end, function_view task, paropt opt) { - parallel_for_impl(begin, end, task, opt); + parallel_for_impl(begin, end, std::move(task), opt); } +// DEPRECATED void parallel_for(int64_t begin, int64_t end, function_view task, paropt opt) { - parallel_for_impl(begin, end, task, opt); + parallel_for_impl(begin, end, std::move(task), opt); } +// DEPRECATED void parallel_for(uint64_t begin, uint64_t end, function_view task, paropt opt) { - parallel_for_impl(begin, end, task, opt); + parallel_for_impl(begin, end, std::move(task), opt); +} + +OIIO_NAMESPACE_3_1_END + + +OIIO_NAMESPACE_BEGIN + +void +parallel_for(int begin, int end, function_view&& task, paropt opt) +{ + parallel_for_impl(begin, end, std::move(task), opt); +} + + +void +parallel_for(uint32_t begin, uint32_t end, function_view&& task, + paropt opt) +{ + parallel_for_impl(begin, end, std::move(task), opt); } +void +parallel_for(int64_t begin, int64_t end, function_view&& task, + paropt opt) +{ + parallel_for_impl(begin, end, std::move(task), opt); +} + + +void +parallel_for(uint64_t begin, uint64_t end, function_view&& task, + paropt opt) +{ + parallel_for_impl(begin, end, std::move(task), opt); +} + +OIIO_NAMESPACE_END + + +OIIO_NAMESPACE_3_1_BEGIN template inline void @@ -854,4 +901,4 @@ parallel_for_2D(int64_t xbegin, int64_t xend, int64_t ybegin, int64_t yend, } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/timer.cpp b/src/libutil/timer.cpp index 9dbec63f3c..7692c10e95 100644 --- a/src/libutil/timer.cpp +++ b/src/libutil/timer.cpp @@ -12,7 +12,7 @@ #endif -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN double Timer::seconds_per_tick; Timer::ticks_t Timer::ticks_per_second; @@ -68,4 +68,4 @@ Timer::now(void) const } #endif -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/typedesc.cpp b/src/libutil/typedesc.cpp index 53e2bf07bd..1c58346a7e 100644 --- a/src/libutil/typedesc.cpp +++ b/src/libutil/typedesc.cpp @@ -16,7 +16,7 @@ #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN TypeDesc::TypeDesc(string_view typestring) : basetype(UNKNOWN) @@ -360,6 +360,57 @@ TypeDesc::fromstring(string_view typestring) +bool +TypeDesc::operator<(const TypeDesc& x) const noexcept +{ + if (basetype != x.basetype) + return basetype < x.basetype; + if (aggregate != x.aggregate) + return aggregate < x.aggregate; + if (arraylen != x.arraylen) + return arraylen < x.arraylen; + if (vecsemantics != x.vecsemantics) + return vecsemantics < x.vecsemantics; + return false; // they are equal +} + + + +TypeDesc::BASETYPE +TypeDesc::basetype_merge(TypeDesc at, TypeDesc bt) +{ + BASETYPE a = (BASETYPE)at.basetype; + BASETYPE b = (BASETYPE)bt.basetype; + + // Same type already? done. + if (a == b) + return a; + if (a == UNKNOWN) + return b; + if (b == UNKNOWN) + return a; + // Canonicalize so a's size (in bytes) is >= b's size in bytes. This + // unclutters remaining cases. + if (TypeDesc(a).size() < TypeDesc(b).size()) + std::swap(a, b); + // Double or float trump anything else + if (a == DOUBLE || a == FLOAT) + return a; + if (a == UINT32 && (b == UINT16 || b == UINT8)) + return a; + if (a == INT32 && (b == INT16 || b == UINT16 || b == INT8 || b == UINT8)) + return a; + if ((a == UINT16 || a == HALF) && b == UINT8) + return a; + if ((a == INT16 || a == HALF) && (b == INT8 || b == UINT8)) + return a; + // Out of common cases. For all remaining edge cases, punt and say that + // we prefer float. + return FLOAT; +} + + + tostring_formatting::tostring_formatting( const char* int_fmt, const char* float_fmt, const char* string_fmt, const char* ptr_fmt, const char* aggregate_begin, const char* aggregate_end, @@ -801,7 +852,7 @@ convert_type(TypeDesc srctype, const void* src, TypeDesc dsttype, void* dst, if (srctype == TypeUstringhash) (*(ustring*)dst) = ustring::from_hash(*(const ustring::hash_t*)src); else - (*(ustring*)dst) = ustring(tostring(srctype, src)); + (*(ustring*)dst) = ustring(OIIO::tostring(srctype, src)); return true; } @@ -858,55 +909,4 @@ convert_type(TypeDesc srctype, const void* src, TypeDesc dsttype, void* dst, return false; } - - -bool -TypeDesc::operator<(const TypeDesc& x) const noexcept -{ - if (basetype != x.basetype) - return basetype < x.basetype; - if (aggregate != x.aggregate) - return aggregate < x.aggregate; - if (arraylen != x.arraylen) - return arraylen < x.arraylen; - if (vecsemantics != x.vecsemantics) - return vecsemantics < x.vecsemantics; - return false; // they are equal -} - - - -TypeDesc::BASETYPE -TypeDesc::basetype_merge(TypeDesc at, TypeDesc bt) -{ - BASETYPE a = (BASETYPE)at.basetype; - BASETYPE b = (BASETYPE)bt.basetype; - - // Same type already? done. - if (a == b) - return a; - if (a == UNKNOWN) - return b; - if (b == UNKNOWN) - return a; - // Canonicalize so a's size (in bytes) is >= b's size in bytes. This - // unclutters remaining cases. - if (TypeDesc(a).size() < TypeDesc(b).size()) - std::swap(a, b); - // Double or float trump anything else - if (a == DOUBLE || a == FLOAT) - return a; - if (a == UINT32 && (b == UINT16 || b == UINT8)) - return a; - if (a == INT32 && (b == INT16 || b == UINT16 || b == INT8 || b == UINT8)) - return a; - if ((a == UINT16 || a == HALF) && b == UINT8) - return a; - if ((a == INT16 || a == HALF) && (b == INT8 || b == UINT8)) - return a; - // Out of common cases. For all remaining edge cases, punt and say that - // we prefer float. - return FLOAT; -} - -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/ustring.cpp b/src/libutil/ustring.cpp index 211c944e67..3da39ccf65 100644 --- a/src/libutil/ustring.cpp +++ b/src/libutil/ustring.cpp @@ -12,7 +12,7 @@ #include #include -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN // Use rw spin locks typedef spin_rw_mutex ustring_mutex_t; @@ -662,4 +662,4 @@ ustring::memory() return table.get_memory_usage(); } -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/libutil/xxhash.cpp b/src/libutil/xxhash.cpp index c0afcfefbb..e988bab4c5 100644 --- a/src/libutil/xxhash.cpp +++ b/src/libutil/xxhash.cpp @@ -140,7 +140,7 @@ typedef unsigned long long U64; #endif -OIIO_NAMESPACE_BEGIN +OIIO_NAMESPACE_3_1_BEGIN namespace xxhash { @@ -952,4 +952,4 @@ unsigned long long XXH64_digest (const XXH64_state_t* state_in) } // namespace xxhash -OIIO_NAMESPACE_END +OIIO_NAMESPACE_3_1_END diff --git a/src/oiiotool/oiiotool.cpp b/src/oiiotool/oiiotool.cpp index bf75e18870..c0ae72f9a2 100644 --- a/src/oiiotool/oiiotool.cpp +++ b/src/oiiotool/oiiotool.cpp @@ -3424,7 +3424,7 @@ ImageBufAlgox::cryptomatte_colors(ImageBuf& dst, const ImageBuf& src, span channelset, ROI roi, int nthreads) { - // pvt::LoggedTimer logtime("IBA::cryptomatte_colors"); + // OIIO::pvt::LoggedTimer logtime("IBA::cryptomatte_colors"); if (!roi.defined()) roi = get_roi(src.spec()); roi.chend = std::min(roi.chend, src.nchannels()); @@ -7535,7 +7535,7 @@ handle_sequence(Oiiotool& ot, int argc, const char** argv) OIIO::print("Running {} frames in parallel with {} threads\n", nfilenames, parallel_frame_threads); ot.begin_parallel_frame_loop(parallel_frame_threads); - parallel_for( + OIIO::parallel_for( uint64_t(0), uint64_t(nfilenames), [&](uint64_t i) { one_sequence_iteration(ot, i, frame_numbers[0][i], From 3497fa1a5717b2c61fe708c49a9a208fc0fd8791 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Sep 2025 06:54:02 +0200 Subject: [PATCH 48/71] feat(heif): Read and write of CICP and bit depth 10 and 12 (#4880) * Read and write 10 and 12 bit images * Read and write CICP This makes it possible to write HDR images that are much smaller than PNGs, in a file format that is supported in all modern web browsers. By setting the matrix coefficients, the library will perform RGB to YUV conversion on write. The YUV to RBG conversion was already happening on read automatically. A future improvement would be a better default choice of matrix coefficients for writing. When no CICP is specified or when CICP is read from PNG, then no conversion to YUV will be performed and compression will not work as well. This is the same behavior as before. When there is support for conversion between CICP and display interop ID, a good default choice for matrix coefficients could be made as part of that. Tests for CICP and 10 bit were added. --------- Signed-off-by: Brecht Van Lommel Signed-off-by: Zach Lewis --- src/doc/builtinplugins.rst | 6 ++ src/heif.imageio/heifinput.cpp | 88 ++++++++++++++++-- src/heif.imageio/heifoutput.cpp | 72 ++++++++++++-- testsuite/heif/ref/out-libheif1.12-orient.txt | 28 ++++++ testsuite/heif/ref/out-libheif1.4.txt | 23 +++++ testsuite/heif/ref/out-libheif1.5.txt | 23 +++++ testsuite/heif/ref/out-libheif1.9-alt2.txt | 28 ++++++ .../heif/ref/out-libheif1.9-with-av1-alt2.txt | 23 +++++ .../heif/ref/out-libheif1.9-with-av1.txt | 23 +++++ testsuite/heif/ref/out-libheif1.9.txt | 28 ++++++ testsuite/heif/ref/test-10bit.avif | Bin 0 -> 820 bytes testsuite/heif/run.py | 6 +- 12 files changed, 330 insertions(+), 18 deletions(-) create mode 100644 testsuite/heif/ref/test-10bit.avif diff --git a/src/doc/builtinplugins.rst b/src/doc/builtinplugins.rst index 81d72c911a..1e419e5696 100644 --- a/src/doc/builtinplugins.rst +++ b/src/doc/builtinplugins.rst @@ -688,6 +688,12 @@ preferred except when legacy file access is required. - string - Color space (see Section :ref:`sec-metadata-color`). We currently assume that any RGBE files encountered are linear with sRGB primaries. + * - ``CICP`` + - int[4] + - Coding-independent code points to describe the color profile. + * - ``oiio:BitsPerSample`` + - int + - Bits per sample in the file: 8, 10 or 12. * - ``heif:Orientation`` - int - If the configuration option ``heif:reorient`` is nonzero and diff --git a/src/heif.imageio/heifinput.cpp b/src/heif.imageio/heifinput.cpp index be92acf9f4..4ba8e2fb61 100644 --- a/src/heif.imageio/heifinput.cpp +++ b/src/heif.imageio/heifinput.cpp @@ -3,7 +3,9 @@ // https://github.com/AcademySoftwareFoundation/OpenImageIO #include +#include #include +#include #include #include @@ -36,7 +38,11 @@ class HeifInput final : public ImageInput { const char* format_name(void) const override { return "heif"; } int supports(string_view feature) const override { - return feature == "exif"; + return feature == "exif" +#if LIBHEIF_HAVE_VERSION(1, 9, 0) + || feature == "cicp" +#endif + ; } bool valid_file(const std::string& filename) const override; bool open(const std::string& name, ImageSpec& newspec) override; @@ -53,6 +59,7 @@ class HeifInput final : public ImageInput { std::string m_filename; int m_subimage = -1; int m_num_subimages = 0; + int m_bitdepth = 0; int m_has_alpha = false; bool m_associated_alpha = true; bool m_keep_unassociated_alpha = false; @@ -203,11 +210,30 @@ HeifInput::seek_subimage(int subimage, int miplevel) return false; } - auto id = (subimage == 0) ? m_primary_id : m_item_ids[subimage - 1]; - m_ihandle = m_ctx->get_image_handle(id); + auto id = (subimage == 0) ? m_primary_id : m_item_ids[subimage - 1]; + m_ihandle = m_ctx->get_image_handle(id); + + m_bitdepth = m_ihandle.get_luma_bits_per_pixel(); + if (m_bitdepth < 0) { + errorfmt("Image has undefined bit depth"); + m_ctx.reset(); + return false; + } else if (!(m_bitdepth == 8 || m_bitdepth == 10 || m_bitdepth == 12)) { + errorfmt("Image has unsupported bit depth {}", m_bitdepth); + m_ctx.reset(); + return false; + } + m_has_alpha = m_ihandle.has_alpha_channel(); - auto chroma = m_has_alpha ? heif_chroma_interleaved_RGBA - : heif_chroma_interleaved_RGB; + auto chroma = m_has_alpha ? (m_bitdepth > 8) + ? littleendian() + ? heif_chroma_interleaved_RRGGBBAA_LE + : heif_chroma_interleaved_RRGGBBAA_BE + : heif_chroma_interleaved_RGBA + : (m_bitdepth > 8) ? littleendian() + ? heif_chroma_interleaved_RRGGBB_LE + : heif_chroma_interleaved_RRGGBB_BE + : heif_chroma_interleaved_RGB; #if 0 try { m_himage = m_ihandle.decode_image(heif_colorspace_RGB, chroma); @@ -238,13 +264,40 @@ HeifInput::seek_subimage(int subimage, int miplevel) } #endif - int bits = m_himage.get_bits_per_pixel(heif_channel_interleaved); - m_spec = ImageSpec(m_himage.get_width(heif_channel_interleaved), - m_himage.get_height(heif_channel_interleaved), bits / 8, - TypeUInt8); + m_spec = ImageSpec(m_himage.get_width(heif_channel_interleaved), + m_himage.get_height(heif_channel_interleaved), + m_has_alpha ? 4 : 3, + (m_bitdepth > 8) ? TypeUInt16 : TypeUInt8); + if (m_bitdepth > 8) { + m_spec.attribute("oiio:BitsPerSample", m_bitdepth); + } m_spec.set_colorspace("srgb_rec709_scene"); +#if LIBHEIF_HAVE_VERSION(1, 9, 0) + // Read CICP. Have to use the C API to get it from the image handle, + // the one on the decoded image is not what was written in the file. + enum heif_color_profile_type profile_type + = heif_image_handle_get_color_profile_type( + m_ihandle.get_raw_image_handle()); + if (profile_type == heif_color_profile_type_nclx) { + heif_color_profile_nclx* nclx = nullptr; + const heif_error err = heif_image_handle_get_nclx_color_profile( + m_ihandle.get_raw_image_handle(), &nclx); + + if (nclx) { + if (err.code == heif_error_Ok) { + const int cicp[4] = { int(nclx->color_primaries), + int(nclx->transfer_characteristics), + int(nclx->matrix_coefficients), + int(nclx->full_range_flag ? 1 : 0) }; + m_spec.attribute("CICP", TypeDesc(TypeDesc::INT, 4), cicp); + } + heif_nclx_color_profile_free(nclx); + } + } +#endif + #if LIBHEIF_HAVE_VERSION(1, 12, 0) // Libheif >= 1.12 added API call to find out if the image is associated // alpha (i.e. colors are premultiplied). @@ -402,7 +455,22 @@ HeifInput::read_native_scanline(int subimage, int miplevel, int y, int /*z*/, return false; } hdata += (y - m_spec.y) * ystride; - memcpy(data, hdata, m_spec.width * m_spec.pixel_bytes()); + if (m_bitdepth == 10 || m_bitdepth == 12) { + const size_t num_values = m_spec.width * m_spec.nchannels; + const uint16_t* hdata16 = reinterpret_cast(hdata); + uint16_t* data16 = static_cast(data); + if (m_bitdepth == 10) { + for (size_t i = 0; i < num_values; ++i) { + data16[i] = bit_range_convert<10, 16>(hdata16[i]); + } + } else { + for (size_t i = 0; i < num_values; ++i) { + data16[i] = bit_range_convert<12, 16>(hdata16[i]); + } + } + } else { + memcpy(data, hdata, m_spec.width * m_spec.pixel_bytes()); + } return true; } diff --git a/src/heif.imageio/heifoutput.cpp b/src/heif.imageio/heifoutput.cpp index 2d45f50920..6ed1dbb439 100644 --- a/src/heif.imageio/heifoutput.cpp +++ b/src/heif.imageio/heifoutput.cpp @@ -4,7 +4,9 @@ #include +#include #include +#include #include #include @@ -26,7 +28,11 @@ class HeifOutput final : public ImageOutput { const char* format_name(void) const override { return "heif"; } int supports(string_view feature) const override { - return feature == "alpha" || feature == "exif" || feature == "tiles"; + return feature == "alpha" || feature == "exif" || feature == "tiles" +#if LIBHEIF_HAVE_VERSION(1, 9, 0) + || feature == "cicp" +#endif + ; } bool open(const std::string& name, const ImageSpec& spec, OpenMode mode) override; @@ -45,6 +51,7 @@ class HeifOutput final : public ImageOutput { heif::Encoder m_encoder { heif_compression_HEVC }; std::vector scratch; std::vector m_tilebuffer; + int m_bitdepth = 0; }; @@ -104,19 +111,33 @@ HeifOutput::open(const std::string& name, const ImageSpec& newspec, m_filename = name; - m_spec.set_format(TypeUInt8); // Only uint8 for now + m_bitdepth = m_spec.format.size() > TypeUInt8.size() ? 10 : 8; + m_bitdepth = m_spec.get_int_attribute("oiio:BitsPerSample", m_bitdepth); + if (m_bitdepth == 10 || m_bitdepth == 12) { + m_spec.set_format(TypeUInt16); + } else if (m_bitdepth == 8) { + m_spec.set_format(TypeUInt8); + } else { + errorfmt("Unsupported bit depth {}", m_bitdepth); + return false; + } try { m_ctx.reset(new heif::Context); m_himage = heif::Image(); static heif_chroma chromas[/*nchannels*/] = { heif_chroma_undefined, heif_chroma_monochrome, - heif_chroma_undefined, heif_chroma_interleaved_RGB, - heif_chroma_interleaved_RGBA }; + heif_chroma_undefined, + (m_bitdepth == 8) ? heif_chroma_interleaved_RGB + : littleendian() ? heif_chroma_interleaved_RRGGBB_LE + : heif_chroma_interleaved_RRGGBB_BE, + (m_bitdepth == 8) ? heif_chroma_interleaved_RGBA + : littleendian() ? heif_chroma_interleaved_RRGGBBAA_LE + : heif_chroma_interleaved_RRGGBBAA_BE }; m_himage.create(newspec.width, newspec.height, heif_colorspace_RGB, chromas[m_spec.nchannels]); m_himage.add_plane(heif_channel_interleaved, newspec.width, - newspec.height, 8 * m_spec.nchannels /*bit depth*/); + newspec.height, m_bitdepth); m_encoder = heif::Encoder(heif_compression_HEVC); auto compqual = m_spec.decode_compression_metadata("", 75); @@ -161,7 +182,22 @@ HeifOutput::write_scanline(int y, int /*z*/, TypeDesc format, const void* data, uint8_t* hdata = m_himage.get_plane(heif_channel_interleaved, &hystride); #endif hdata += hystride * (y - m_spec.y); - memcpy(hdata, data, hystride); + if (m_bitdepth == 10 || m_bitdepth == 12) { + const uint16_t* data16 = static_cast(data); + uint16_t* hdata16 = reinterpret_cast(hdata); + const size_t num_values = m_spec.width * m_spec.nchannels; + if (m_bitdepth == 10) { + for (size_t i = 0; i < num_values; ++i) { + hdata16[i] = bit_range_convert<16, 10>(data16[i]); + } + } else { + for (size_t i = 0; i < num_values; ++i) { + hdata16[i] = bit_range_convert<16, 12>(data16[i]); + } + } + } else { + memcpy(hdata, data, hystride); + } return true; } @@ -207,8 +243,30 @@ HeifOutput::close() } else if (compqual.first == "none") { m_encoder.set_lossless(true); } + heif::Context::EncodingOptions options; +#if LIBHEIF_HAVE_VERSION(1, 9, 0) + // Write CICP. we can only set output_nclx_profile with the C API. + std::unique_ptr + nclx(heif_nclx_color_profile_alloc(), heif_nclx_color_profile_free); + const ParamValue* p = m_spec.find_attribute("CICP", + TypeDesc(TypeDesc::INT, 4)); + if (p) { + const int* cicp = static_cast(p->data()); + nclx->color_primaries = heif_color_primaries(cicp[0]); + nclx->transfer_characteristics = heif_transfer_characteristics( + cicp[1]); + nclx->matrix_coefficients = heif_matrix_coefficients(cicp[2]); + nclx->full_range_flag = cicp[3]; + options.output_nclx_profile = nclx.get(); + // Chroma subsampling is incompatible with RGB. + if (nclx->matrix_coefficients == heif_matrix_coefficients_RGB_GBR) { + m_encoder.set_string_parameter("chroma", "444"); + } + } +#endif encode_exif(m_spec, exifblob, endian::big); - m_ihandle = m_ctx->encode_image(m_himage, m_encoder); + m_ihandle = m_ctx->encode_image(m_himage, m_encoder, options); std::vector head { 'E', 'x', 'i', 'f', 0, 0 }; exifblob.insert(exifblob.begin(), head.begin(), head.end()); try { diff --git a/testsuite/heif/ref/out-libheif1.12-orient.txt b/testsuite/heif/ref/out-libheif1.12-orient.txt index a3102659c6..e9ef2777bb 100644 --- a/testsuite/heif/ref/out-libheif1.12-orient.txt +++ b/testsuite/heif/ref/out-libheif1.12-orient.txt @@ -39,6 +39,34 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/Chimera-AV1-8bit-162.avif +ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif + SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 + channel list: R, G, B + oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/test-10bit.avif +ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA + channel list: R, G, B, A + Software: "OpenImageIO 3.2.0.0dev : B4BD496D92983E84F1FD621682CAB821C1E2126C" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" +Reading cicp_pq.avif +cicp_pq.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 + channel list: R, G, B, A + CICP: 9, 16, 9, 1 + Software: "OpenImageIO 3.2.0.0dev : A50DC799B2B4CA667217608C0F82302455E5D32A" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E diff --git a/testsuite/heif/ref/out-libheif1.4.txt b/testsuite/heif/ref/out-libheif1.4.txt index ba85f95394..48384b5e0d 100644 --- a/testsuite/heif/ref/out-libheif1.4.txt +++ b/testsuite/heif/ref/out-libheif1.4.txt @@ -44,6 +44,29 @@ ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/test-10bit.avif +ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA + channel list: R, G, B, A + Software: "OpenImageIO 3.2.0.0dev : B4BD496D92983E84F1FD621682CAB821C1E2126C" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" +Reading cicp_pq.avif +cicp_pq.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 + channel list: R, G, B, A + CICP: 9, 16, 9, 1 + Software: "OpenImageIO 3.2.0.0dev : A50DC799B2B4CA667217608C0F82302455E5D32A" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E diff --git a/testsuite/heif/ref/out-libheif1.5.txt b/testsuite/heif/ref/out-libheif1.5.txt index 8fb8e93fdf..8a371fca47 100644 --- a/testsuite/heif/ref/out-libheif1.5.txt +++ b/testsuite/heif/ref/out-libheif1.5.txt @@ -44,6 +44,29 @@ ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/test-10bit.avif +ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA + channel list: R, G, B, A + Software: "OpenImageIO 3.2.0.0dev : B4BD496D92983E84F1FD621682CAB821C1E2126C" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" +Reading cicp_pq.avif +cicp_pq.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 + channel list: R, G, B, A + CICP: 9, 16, 9, 1 + Software: "OpenImageIO 3.2.0.0dev : A50DC799B2B4CA667217608C0F82302455E5D32A" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E diff --git a/testsuite/heif/ref/out-libheif1.9-alt2.txt b/testsuite/heif/ref/out-libheif1.9-alt2.txt index e24120d453..9d92f3b2ed 100644 --- a/testsuite/heif/ref/out-libheif1.9-alt2.txt +++ b/testsuite/heif/ref/out-libheif1.9-alt2.txt @@ -39,6 +39,34 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/Chimera-AV1-8bit-162.avif +ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif + SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 + channel list: R, G, B + oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/test-10bit.avif +ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA + channel list: R, G, B, A + Software: "OpenImageIO 3.2.0.0dev : B4BD496D92983E84F1FD621682CAB821C1E2126C" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" +Reading cicp_pq.avif +cicp_pq.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 + channel list: R, G, B, A + CICP: 9, 16, 9, 1 + Software: "OpenImageIO 3.2.0.0dev : A50DC799B2B4CA667217608C0F82302455E5D32A" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8064B23A1A995B0D6525AFB5248EEC6C730BBB6C diff --git a/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt b/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt index 2433705c6b..9d92f3b2ed 100644 --- a/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt +++ b/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt @@ -44,6 +44,29 @@ ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/test-10bit.avif +ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA + channel list: R, G, B, A + Software: "OpenImageIO 3.2.0.0dev : B4BD496D92983E84F1FD621682CAB821C1E2126C" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" +Reading cicp_pq.avif +cicp_pq.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 + channel list: R, G, B, A + CICP: 9, 16, 9, 1 + Software: "OpenImageIO 3.2.0.0dev : A50DC799B2B4CA667217608C0F82302455E5D32A" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8064B23A1A995B0D6525AFB5248EEC6C730BBB6C diff --git a/testsuite/heif/ref/out-libheif1.9-with-av1.txt b/testsuite/heif/ref/out-libheif1.9-with-av1.txt index 40d4b662df..5253081cdc 100644 --- a/testsuite/heif/ref/out-libheif1.9-with-av1.txt +++ b/testsuite/heif/ref/out-libheif1.9-with-av1.txt @@ -44,6 +44,29 @@ ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/test-10bit.avif +ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA + channel list: R, G, B, A + Software: "OpenImageIO 3.2.0.0dev : B4BD496D92983E84F1FD621682CAB821C1E2126C" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" +Reading cicp_pq.avif +cicp_pq.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 + channel list: R, G, B, A + CICP: 9, 16, 9, 1 + Software: "OpenImageIO 3.2.0.0dev : A50DC799B2B4CA667217608C0F82302455E5D32A" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E diff --git a/testsuite/heif/ref/out-libheif1.9.txt b/testsuite/heif/ref/out-libheif1.9.txt index 2ddc23c253..5253081cdc 100644 --- a/testsuite/heif/ref/out-libheif1.9.txt +++ b/testsuite/heif/ref/out-libheif1.9.txt @@ -39,6 +39,34 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/Chimera-AV1-8bit-162.avif +ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif + SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 + channel list: R, G, B + oiio:ColorSpace: "srgb_rec709_scene" +Reading ref/test-10bit.avif +ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA + channel list: R, G, B, A + Software: "OpenImageIO 3.2.0.0dev : B4BD496D92983E84F1FD621682CAB821C1E2126C" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" +Reading cicp_pq.avif +cicp_pq.avif : 16 x 16, 4 channel, uint10 heif + SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 + channel list: R, G, B, A + CICP: 9, 16, 9, 1 + Software: "OpenImageIO 3.2.0.0dev : A50DC799B2B4CA667217608C0F82302455E5D32A" + Exif:ExifVersion: "0230" + Exif:FlashPixVersion: "0100" + Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" + heif:UnassociatedAlpha: 1 + oiio:BitsPerSample: 10 + oiio:ColorSpace: "srgb_rec709_scene" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E diff --git a/testsuite/heif/ref/test-10bit.avif b/testsuite/heif/ref/test-10bit.avif new file mode 100644 index 0000000000000000000000000000000000000000..9dab1f234699aa6fe1f676107597d5bec4509d92 GIT binary patch literal 820 zcmZ8fJ%|%Q6n?YGsTaZ_o(B<>+v^T7VP_MU&BDQ%KRhs8B{nweW|9o-&$v4YNh5b~ zs92pgwrRB0+QMEd5kXtI=1MyoMc>RC1!vfK@B7~OX7;@q0JuDqbKy_<5O73%NR=OP zA2E3mG3hHF$JTfdrnw6scp#Vl(yj?EBMk_yJsu{3LY-YGfMS5W%PqP!Ff{Z1FSCIv z97cJ`kZpv0&SU*!I=X>?<%t0P)S@cmABmCwNuu()v%I)hT%-aso^TN)Xv_YTwh!T! z+T|k81XB)<^UF{08COK1R4SqQqra;tEH;l36>lH4dWq%DIg+rqNM)Am4d5C*$^OWVa<8hcAV$X=~&RQ_Y0^L>Y zE6JjPFE2o8wNn1|WwEvRaA0p%V9h-_0{Z&?Y4h{o((20x;q#ks?)=!ieSH1n+g((z zDD@}1Q~~!Zke}@28ykU>36CZE)x?x6L$4;{5$p>V??wKI z?d_ZOnq9MM)__e-&uleXokr8?H0`Ea@4Ag1?R6ZRI Date: Sun, 14 Sep 2025 14:45:20 -0700 Subject: [PATCH 49/71] ci: better spread of libpng versions we test against (#4883) * The "oldest" didn't really test against the oldest we claim to support. * The "latest versions" didn't really test against the latest versions. * The "bleeding edge" didn't really test against libpng master. * The auto-build was unnecessarily a few releases behind. * Documentation touch-ups --------- Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- .github/workflows/ci.yml | 10 ++++++++++ src/build-scripts/build_libpng.bash | 2 +- src/build-scripts/gh-installdeps.bash | 4 ++++ src/cmake/build_PNG.cmake | 2 +- src/doc/builtinplugins.rst | 5 +++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdeebf4cb1..87a02695e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,7 @@ jobs: opencolorio_ver: v2.3.0 pybind11_ver: v2.9.0 setenvs: export FREETYPE_VERSION=VER-2-12-0 + BUILD_PNG_VERSION=1.6.30 - desc: VP2022 clang13/C++17 py39 avx2 exr3.1 ocio2.3 nametag: linux-vfx2022.clang13 runner: ubuntu-latest @@ -75,6 +76,7 @@ jobs: simd: "avx2,f16c" fmt_ver: 9.1.0 setenvs: export FREETYPE_VERSION=VER-2-12-0 + BUILD_PNG_VERSION=1.6.30 - desc: oldest gcc9.3/C++17 py3.9 exr3.1 ocio2.3 # Oldest gcc and versions of the dependencies that we support. nametag: linux-oldest @@ -92,6 +94,7 @@ jobs: PTEX_VERSION=v2.3.2 WEBP_VERSION=v1.1.0 PUGIXML_VERSION=v1.8 + BUILD_PNG_VERSION=1.6.0 depcmds: sudo rm -rf /usr/local/include/OpenEXR - desc: oldest clang10/C++17 py3.9 exr3.1 ocio2.3 # Oldest clang and versions of the dependencies that we support. @@ -112,6 +115,7 @@ jobs: PTEX_VERSION=v2.3.2 WEBP_VERSION=v1.1.0 PUGIXML_VERSION=v1.8 + BUILD_PNG_VERSION=1.6.0 depcmds: sudo rm -rf /usr/local/include/OpenEXR - desc: hobbled gcc9.3/C++17 py3.9 exr-3.1 no-sse # Use the oldest supported versions of required dependencies, and @@ -137,6 +141,7 @@ jobs: USE_OPENCV=0 FREETYPE_VERSION=VER-2-10-0 PUGIXML_VERSION=v1.8 + BUILD_PNG_VERSION=1.6.0 depcmds: sudo rm -rf /usr/local/include/OpenEXR runs-on: ${{ matrix.runner }} @@ -372,6 +377,7 @@ jobs: setenvs: export SANITIZE=address,undefined OIIO_CMAKE_FLAGS="-DSANITIZE=address,undefined -DOIIO_HARDENING=3 -DUSE_PYTHON=0" CTEST_EXCLUSIONS="broken|png-damaged" + OpenImageIO_BUILD_LOCAL_DEPS=PNG # Test ABI stability. `abi_check` is the version or commit that we # believe is the current standard against which we don't want to @@ -425,6 +431,7 @@ jobs: python_ver: "3.12" simd: avx2,f16c setenvs: export LIBJPEGTURBO_VERSION=3.1.1 + LIBPNG_VERSION=v1.6.50 LIBRAW_VERSION=0.21.4 LIBTIFF_VERSION=v4.7.0 OPENJPEG_VERSION=v2.5.3 @@ -447,6 +454,7 @@ jobs: simd: avx2,f16c benchmark: 1 setenvs: export LIBJPEGTURBO_VERSION=main + LIBPNG_VERSION=master LIBRAW_VERSION=master LIBTIFF_VERSION=master OPENJPEG_VERSION=master @@ -523,6 +531,7 @@ jobs: pybind11_ver: v3.0.0 python_ver: "3.12" setenvs: export LIBJPEGTURBO_VERSION=3.1.1 + LIBPNG_VERSION=v1.6.50 LIBRAW_VERSION=0.21.4 LIBTIFF_VERSION=v4.7.0 OPENJPEG_VERSION=v2.5.3 @@ -543,6 +552,7 @@ jobs: pybind11_ver: v3.0.0 python_ver: "3.12" setenvs: export LIBJPEGTURBO_VERSION=3.1.0 + LIBPNG_VERSION=v1.6.50 LIBRAW_VERSION=0.21.4 LIBTIFF_VERSION=v4.7.0 OPENJPEG_VERSION=v2.5.3 diff --git a/src/build-scripts/build_libpng.bash b/src/build-scripts/build_libpng.bash index ea2f5da647..e947dd55bd 100755 --- a/src/build-scripts/build_libpng.bash +++ b/src/build-scripts/build_libpng.bash @@ -11,7 +11,7 @@ set -ex # Repo and branch/tag/commit of libpng to download if we don't have it yet LIBPNG_REPO=${LIBPNG_REPO:=https://github.com/pnggroup/libpng.git} -LIBPNG_VERSION=${LIBPNG_VERSION:=v1.6.47} +LIBPNG_VERSION=${LIBPNG_VERSION:=v1.6.50} # Where to put libpng repo source (default to the ext area) LIBPNG_SRC_DIR=${LIBPNG_SRC_DIR:=${PWD}/ext/libpng} diff --git a/src/build-scripts/gh-installdeps.bash b/src/build-scripts/gh-installdeps.bash index bc0ad63018..0416c0c276 100755 --- a/src/build-scripts/gh-installdeps.bash +++ b/src/build-scripts/gh-installdeps.bash @@ -208,6 +208,10 @@ if [[ "$FREETYPE_VERSION" != "" ]] ; then source src/build-scripts/build_Freetype.bash fi +if [[ "$LIBPNG_VERSION" != "" ]] ; then + source src/build-scripts/build_libpng.bash +fi + if [[ "$USE_ICC" != "" ]] ; then # We used gcc for the prior dependency builds, but use icc for OIIO itself echo "which icpc:" $(which icpc) diff --git a/src/cmake/build_PNG.cmake b/src/cmake/build_PNG.cmake index c0a1657d2d..338b60c5e5 100644 --- a/src/cmake/build_PNG.cmake +++ b/src/cmake/build_PNG.cmake @@ -6,7 +6,7 @@ # PNG by hand! ###################################################################### -set_cache (PNG_BUILD_VERSION 1.6.47 "PNG version for local builds") +set_cache (PNG_BUILD_VERSION 1.6.50 "PNG version for local builds") super_set (PNG_BUILD_GIT_REPOSITORY "https://github.com/pnggroup/libpng") super_set (PNG_BUILD_GIT_TAG "v${PNG_BUILD_VERSION}") super_set (PNG_BUILD_EXTRA_CMAKE_ARGS "") diff --git a/src/doc/builtinplugins.rst b/src/doc/builtinplugins.rst index 1e419e5696..3d600591be 100644 --- a/src/doc/builtinplugins.rst +++ b/src/doc/builtinplugins.rst @@ -1777,6 +1777,11 @@ files use the file extension :file:`.png`. * - ``oiio:ColorSpace`` - string - Color space (see Section :ref:`sec-metadata-color`). + * - ``CICP`` + - int[4] + - CICP color space information (see Section :ref:`sec-metadata-color`). + Note that this attribute is only supported if OIIO was built against + libPNG 1.6.45 or newer. * - ``ICCProfile`` - uint8[] - The ICC color profile. A variety of other ``ICCProfile:*`` attributes From bc2bde019a88ce64108942e19ef5730477d8c791 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Mon, 15 Sep 2025 13:43:17 -0400 Subject: [PATCH 50/71] ci: disable macos-x86 wheels. (#4886) Temporary workaround to unblock publishing of other wheels for 3.1 release Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 6d95da40c4..b8bd13f798 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -299,6 +299,7 @@ jobs: name: cibw-wheels-${{ matrix.python }} path: ./wheelhouse/*.whl + # --------------------------------------------------------------------------- # macOS ARM Wheels # --------------------------------------------------------------------------- @@ -408,7 +409,7 @@ jobs: upload_pypi: - needs: [sdist, linux, linux-arm, macos, macos-arm, windows] + needs: [sdist, linux, linux-arm, macos-arm, windows] runs-on: ubuntu-latest permissions: id-token: write From 1554c3aa82b71507bb0918360848a83cf8711e9a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Sep 2025 19:47:05 +0200 Subject: [PATCH 51/71] fix(ffmpeg): FFmpeg sets zero oiio:BitsPerSample (#4885) Many codecs don't provide `bits_per_raw_sample`. The bit depth of the luma channel is the closest equivalent to a single bit depth then, while the chroma channels may be subsampled. Tested on basically all the video files on my computer, they all give a non-zero bit depth that looks correct now. Signed-off-by: Brecht Van Lommel Signed-off-by: Zach Lewis --- src/ffmpeg.imageio/ffmpeginput.cpp | 16 ++++++++++++++-- .../{out-ffmpeg-6.1.txt => out-ffmpeg6.1.txt} | 14 +++++++------- testsuite/ffmpeg/ref/out-ffmpeg8.0.txt | 14 +++++++------- 3 files changed, 28 insertions(+), 16 deletions(-) rename testsuite/ffmpeg/ref/{out-ffmpeg-6.1.txt => out-ffmpeg6.1.txt} (93%) diff --git a/src/ffmpeg.imageio/ffmpeginput.cpp b/src/ffmpeg.imageio/ffmpeginput.cpp index ae1be13b7d..257dace628 100644 --- a/src/ffmpeg.imageio/ffmpeginput.cpp +++ b/src/ffmpeg.imageio/ffmpeginput.cpp @@ -30,6 +30,7 @@ extern "C" { // ffmpeg is a C api #endif #include +#include } @@ -528,8 +529,19 @@ FFmpegInput::open(const std::string& name, ImageSpec& spec) m_spec.attribute("FramesPerSecond", TypeRational, &rat); m_spec.attribute("oiio:Movie", true); m_spec.attribute("oiio:subimages", int(m_frames)); - m_spec.attribute("oiio:BitsPerSample", - m_codec_context->bits_per_raw_sample); + if (m_codec_context->bits_per_raw_sample) { + m_spec.attribute("oiio:BitsPerSample", + m_codec_context->bits_per_raw_sample); + } else { + // If bits_per_raw_sample is not provided, the bit depth of the + // luma channel is the closest equivalent to a single bit depth. + const AVPixFmtDescriptor* pix_format_desc = av_pix_fmt_desc_get( + src_pix_format); + if (pix_format_desc && pix_format_desc->nb_components > 0) { + m_spec.attribute("oiio:BitsPerSample", + pix_format_desc->comp[0].depth); + } + } m_spec.attribute("ffmpeg:codec_name", m_codec_context->codec->long_name); /* The ffmpeg enums are documented to match CICP values, except the color range. */ const int cicp[4] diff --git a/testsuite/ffmpeg/ref/out-ffmpeg-6.1.txt b/testsuite/ffmpeg/ref/out-ffmpeg6.1.txt similarity index 93% rename from testsuite/ffmpeg/ref/out-ffmpeg-6.1.txt rename to testsuite/ffmpeg/ref/out-ffmpeg6.1.txt index 82b00b1a10..1553a20790 100644 --- a/testsuite/ffmpeg/ref/out-ffmpeg-6.1.txt +++ b/testsuite/ffmpeg/ref/out-ffmpeg6.1.txt @@ -10,7 +10,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 1: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -22,7 +22,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 2: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -34,7 +34,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 3: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -46,7 +46,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 4: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -58,7 +58,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 5: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -70,7 +70,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 6: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -82,6 +82,6 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 diff --git a/testsuite/ffmpeg/ref/out-ffmpeg8.0.txt b/testsuite/ffmpeg/ref/out-ffmpeg8.0.txt index 988ef28210..082a0797f2 100644 --- a/testsuite/ffmpeg/ref/out-ffmpeg8.0.txt +++ b/testsuite/ffmpeg/ref/out-ffmpeg8.0.txt @@ -10,7 +10,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 1: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -22,7 +22,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 2: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -34,7 +34,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 3: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -46,7 +46,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 4: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -58,7 +58,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 5: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -70,7 +70,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 subimage 6: 192 x 108, 3 channel, uint8 FFmpeg movie @@ -82,6 +82,6 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie FramesPerSecond: 24/1 (24) SCENE: "Scene" ffmpeg:codec_name: "Google VP9" - oiio:BitsPerSample: 0 + oiio:BitsPerSample: 8 oiio:Movie: 1 oiio:subimages: 7 From 308059515af0e50a4f71ab6bd9ace3409efc344d Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Mon, 15 Sep 2025 10:50:01 -0700 Subject: [PATCH 52/71] admin: Adjust license notices of A2-only source (#4884) There are still a few historical authors who never signed on to the relicensing of OpenImageIO from BSD-3-Clause to Apache-2.0 two years ago, usually because we could find no current way to contact them. The few (< 25) files that still had their extant code were therefore marked as using both licenses. They they almost always are down to just a few lines in the whole file that are still original to those authors (and therefore BSD), so every once in a while, natural code churn and rewrites of what they touched remove the very last of these lines from a file, leaving that file entirely Apache-2.0. I noticed that this was the case for these three files, and so removed the reference to BSD license, which no longer applies. Signed-off-by: Larry Gritz Signed-off-by: Zach Lewis --- src/include/OpenImageIO/imagebuf.h | 2 +- src/libOpenImageIO/imagebuf.cpp | 2 +- src/webp.imageio/webpoutput.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/OpenImageIO/imagebuf.h b/src/include/OpenImageIO/imagebuf.h index ad55228101..1b9238419b 100644 --- a/src/include/OpenImageIO/imagebuf.h +++ b/src/include/OpenImageIO/imagebuf.h @@ -1,5 +1,5 @@ // Copyright Contributors to the OpenImageIO project. -// SPDX-License-Identifier: BSD-3-Clause and Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 // https://github.com/AcademySoftwareFoundation/OpenImageIO diff --git a/src/libOpenImageIO/imagebuf.cpp b/src/libOpenImageIO/imagebuf.cpp index e25c1f1fc2..8206ff3a8d 100644 --- a/src/libOpenImageIO/imagebuf.cpp +++ b/src/libOpenImageIO/imagebuf.cpp @@ -1,5 +1,5 @@ // Copyright Contributors to the OpenImageIO project. -// SPDX-License-Identifier: BSD-3-Clause and Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 // https://github.com/AcademySoftwareFoundation/OpenImageIO diff --git a/src/webp.imageio/webpoutput.cpp b/src/webp.imageio/webpoutput.cpp index 3e65ed30e8..5b743e2653 100644 --- a/src/webp.imageio/webpoutput.cpp +++ b/src/webp.imageio/webpoutput.cpp @@ -1,5 +1,5 @@ // Copyright Contributors to the OpenImageIO project. -// SPDX-License-Identifier: BSD-3-Clause and Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 // https://github.com/AcademySoftwareFoundation/OpenImageIO #include From 25ab34e33ff5fd877a921fc19f193ea3ded624f1 Mon Sep 17 00:00:00 2001 From: vvalderrv Date: Mon, 15 Sep 2025 14:23:39 -0500 Subject: [PATCH 53/71] fix: Switch to compile-commands (#4879) Fix SonarCloud analysis failures by switching the C/C++ configuration from the deprecated `sonar.cfamily.build-wrapper-output` property to the current `sonar.cfamily.compile-commands` property. **Changes** - Remove `sonar.cfamily.build-wrapper-output` from `sonar-project.properties`. - In `.github/workflows/build-steps.yml`, pass `--define sonar.cfamily.compile-commands="$BUILD_WRAPPER_OUT_DIR/compile_commands.json"`. **Root cause** The SonarCloud config still used the deprecated `sonar.cfamily.build-wrapper-output` property. The current CFamily analyzer expects a `compile_commands.json` (produced by build-wrapper). Using the old property caused scanner failures and blocked analysis. **Validation** Regenerated `bw_output/compile_commands.json`, ran `sonar-scanner`, and confirmed the scan completed and uploaded successfully. **Tests** CI-only change. Verified locally by running the scanner against a fresh build-wrapper capture. --------- Signed-off-by: Vanessa Valderrama Signed-off-by: Zach Lewis --- .github/workflows/build-steps.yml | 4 ++-- sonar-project.properties | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-steps.yml b/.github/workflows/build-steps.yml index cbc2133223..a35687a563 100644 --- a/.github/workflows/build-steps.yml +++ b/.github/workflows/build-steps.yml @@ -186,8 +186,8 @@ jobs: ls -l /__w/OpenImageIO/OpenImageIO/bw_output echo "BUILD_OUTPUT_DIR is " "${{ env.BUILD_WRAPPER_OUT_DIR }}" find . -name "*.gcov" -print - # sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" - time sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="$BUILD_WRAPPER_OUT_DIR" --define sonar.cfamily.gcov.reportsPath="_coverage" --define sonar.cfamily.threads="$PARALLEL" + # sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" + time sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.compile-commands="$BUILD_WRAPPER_OUT_DIR/compile_commands.json" --define sonar.cfamily.gcov.reportsPath="_coverage" --define sonar.cfamily.threads="$PARALLEL" # Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options - name: Check ABI if: inputs.abi_check != '' diff --git a/sonar-project.properties b/sonar-project.properties index d988b8e397..e3a05e7aad 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -21,7 +21,6 @@ sonar.exclusions=src/doc/**,src/build-scripts/**,src/include/OpenImageIO/detail/ sonar.sourceEncoding=UTF-8 # C/C++ analyzer properties -sonar.cfamily.build-wrapper-output=/__w/OpenImageIO/OpenImageIO/bw_output sonar.cfamily.gcov.reportsPath=_coverage sonar.coverage.exclusions=src/iv/**,src/include/OpenImageIO/detail/pugixml/**,src/include/OpenImageIO/detail/fmt/**,src/libOpenImageIO/kissfft.hh From 82ab2a1e1862b65982ed1e6b5ef363e95bad8062 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 07:31:16 -0400 Subject: [PATCH 54/71] ci(wheels-macos-x86): re-enable CMAKE_GENERATOR="Unix Makefiles" bit Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index b8bd13f798..c24a323caa 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -277,7 +277,7 @@ jobs: uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: '3.9' - + - name: List possible OpenEXR installs run: | brew list --versions | grep -E 'openexr|imath' || echo "No brew OpenEXR/Imath" @@ -289,7 +289,7 @@ jobs: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} MACOSX_DEPLOYMENT_TARGET: 10.15 - #CMAKE_GENERATOR: "Unix Makefiles" + CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. USE_Libheif: 'OFF' From 94893854a3f8eec4c721693a4a2b7a135f706a6a Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 07:34:20 -0400 Subject: [PATCH 55/71] ci(wheels): solo macos-x86 builds Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index c24a323caa..244a553556 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -80,8 +80,8 @@ jobs: name: Build wheels on Linux runs-on: ubuntu-latest if: | - github.event_name != 'schedule' || - github.repository == 'AcademySoftwareFoundation/OpenImageIO' + 0 && github.event_name != 'schedule' || + 0 && github.repository == 'AcademySoftwareFoundation/OpenImageIO' strategy: matrix: include: @@ -176,8 +176,8 @@ jobs: name: Build wheels on Linux ARM runs-on: ubuntu-24.04-arm if: | - github.event_name != 'schedule' || - github.repository == 'AcademySoftwareFoundation/OpenImageIO' + 0 && github.event_name != 'schedule' || + 0 && github.repository == 'AcademySoftwareFoundation/OpenImageIO' strategy: matrix: include: @@ -308,8 +308,8 @@ jobs: name: Build wheels on macOS ARM runs-on: macos-14 if: | - github.event_name != 'schedule' || - github.repository == 'AcademySoftwareFoundation/OpenImageIO' + 0 && github.event_name != 'schedule' || + 0 && github.repository == 'AcademySoftwareFoundation/OpenImageIO' strategy: matrix: include: @@ -362,8 +362,8 @@ jobs: name: Build wheels on Windows runs-on: windows-2022 if: | - github.event_name != 'schedule' || - github.repository == 'AcademySoftwareFoundation/OpenImageIO' + 0 && github.event_name != 'schedule' || + 0 && github.repository == 'AcademySoftwareFoundation/OpenImageIO' strategy: matrix: include: From a705f7c2eade6b4306fed039105788f3d9e74a46 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 07:49:13 -0400 Subject: [PATCH 56/71] ci(wheels-macos-x86): try turning macos deployment target up to 11 this one goes to eleven Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 244a553556..28d97e9c4d 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -288,7 +288,7 @@ jobs: env: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} - MACOSX_DEPLOYMENT_TARGET: 10.15 + MACOSX_DEPLOYMENT_TARGET: 11 CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. diff --git a/pyproject.toml b/pyproject.toml index cd12ae1722..ea019e4fee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,8 +95,8 @@ if.platform-system = "darwin" if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" -cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "10.15" -cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" +cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "11" +#cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" #cmake.define.CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH = "OFF" [tool.cibuildwheel] From e320367eb2301a77f1cb1d676084d2b8db8f8418 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 08:00:32 -0400 Subject: [PATCH 57/71] ci(wheels-macos-x86): use CIBW_ENVIRONMENT to force xcrun to find clang Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 28d97e9c4d..1cd9231b7f 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -288,6 +288,21 @@ jobs: env: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} + CIBW_ENVIRONMENT: > + CMAKE_C_COMPILER=$(xcrun -find clang) + CMAKE_CXX_COMPILER=$(xcrun -find clang++) + CMAKE_GENERATOR='Unix Makefiles' + MACOSX_DEPLOYMENT_TARGET=11 + USE_Libheif='OFF' + CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER + -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + -DLINKSTATIC=1 + -DIGNORE_HOMEBREWED_DEPS=1 + -DCMAKE_FIND_FRAMEWORK=NEVER + -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR + -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" + MACOSX_DEPLOYMENT_TARGET: 11 CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does From f246135763e9ceb8359fbdf3f142212569f9cdd1 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 08:37:26 -0400 Subject: [PATCH 58/71] build: set CMAKE_FIND_FRAMEWORK = NEVER in compiler.cmake instead of LAST Signed-off-by: Zach Lewis --- src/cmake/compiler.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake index 6dfad31395..cf95ef4b7c 100644 --- a/src/cmake/compiler.cmake +++ b/src/cmake/compiler.cmake @@ -682,7 +682,7 @@ if (DEFINED ENV{${PROJECT_NAME}_CI}) if (APPLE) # Keep Mono framework from being incorrectly searched for include # files on GitHub Actions CI. - set(CMAKE_FIND_FRAMEWORK LAST) + set(CMAKE_FIND_FRAMEWORK NEVER) endif () endif () From a6e9fff5ba19f2abc8471886724a0bae95e9464d Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 09:10:05 -0400 Subject: [PATCH 59/71] build(openexr): uptick default autobuild ver to 3.4.0 Signed-off-by: Zach Lewis --- src/cmake/build_OpenEXR.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/build_OpenEXR.cmake b/src/cmake/build_OpenEXR.cmake index 190e48ddf1..67ebd8a50b 100644 --- a/src/cmake/build_OpenEXR.cmake +++ b/src/cmake/build_OpenEXR.cmake @@ -3,7 +3,7 @@ # https://github.com/AcademySoftwareFoundation/OpenImageIO -set_cache (OpenEXR_BUILD_VERSION 3.3.5 "OpenEXR version for local builds") +set_cache (OpenEXR_BUILD_VERSION 3.4.0 "OpenEXR version for local builds") set (OpenEXR_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenEXR") set (OpenEXR_GIT_TAG "v${OpenEXR_BUILD_VERSION}") set_cache (OpenEXR_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} From c5ddd1590ac4f6ae6db868ea4afed6c0f90567c7 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 10:03:53 -0400 Subject: [PATCH 60/71] ci(wheels-macos_x86): brew uninstall openexr 3.4 Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 1cd9231b7f..be96d9bc90 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -282,6 +282,15 @@ jobs: run: | brew list --versions | grep -E 'openexr|imath' || echo "No brew OpenEXR/Imath" pkg-config --list-all | grep -E 'OpenEXR|Imath' || true + + - name: Remove brew OpenEXR/Imath + run: | + brew uninstall --ignore-dependencies openexr imath || true + + - name: List possible OpenEXR installs after brew uninstall + run: | + brew list --versions | grep -E 'openexr|imath' || echo "No brew OpenEXR/Imath" + pkg-config --list-all | grep -E 'OpenEXR|Imath' || true - name: Build wheels uses: pypa/cibuildwheel@d4a2945fcc8d13f20a1b99d461b8e844d5fc6e23 # v2.21.1 From 79d1e3c871d3fef5d22eb3dd4c3e8dd0e42f2b9c Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 10:35:56 -0400 Subject: [PATCH 61/71] build: add `$HOMEBREW_PREFIX/Cellar` to IGNORE_HOMEBREWED_DEPS excludes Signed-off-by: Zach Lewis --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee4b9d413f..2ed1589cfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,7 +191,9 @@ if (IGNORE_HOMEBREWED_DEPS) # Define the list of prefixes to ignore set (HOMEBREW_PREFIXES /opt/homebrew + /opt/homebrew/Cellar /usr/local + /usr/local/Cellar /usr/X11 /usr/X11R6 /opt/X11 From 93d158df9197e51ff230416d45e5efdd17e22baf Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 10:36:20 -0400 Subject: [PATCH 62/71] Revert "build(openexr): uptick default autobuild ver to 3.4.0" This reverts commit bf6d1a5ba49082e2699e08f6835ffee041d3ee42. Signed-off-by: Zach Lewis --- src/cmake/build_OpenEXR.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/build_OpenEXR.cmake b/src/cmake/build_OpenEXR.cmake index 67ebd8a50b..190e48ddf1 100644 --- a/src/cmake/build_OpenEXR.cmake +++ b/src/cmake/build_OpenEXR.cmake @@ -3,7 +3,7 @@ # https://github.com/AcademySoftwareFoundation/OpenImageIO -set_cache (OpenEXR_BUILD_VERSION 3.4.0 "OpenEXR version for local builds") +set_cache (OpenEXR_BUILD_VERSION 3.3.5 "OpenEXR version for local builds") set (OpenEXR_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenEXR") set (OpenEXR_GIT_TAG "v${OpenEXR_BUILD_VERSION}") set_cache (OpenEXR_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} From a8ff8bfad2a96d0ceb446152c6a71c76a5ac7e3e Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 10:40:32 -0400 Subject: [PATCH 63/71] Revert "build: set CMAKE_FIND_FRAMEWORK = NEVER in compiler.cmake" This reverts commit 211d61c00b90099f6dfad8288c680f0173f74080. Signed-off-by: Zach Lewis --- src/cmake/compiler.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake index cf95ef4b7c..6dfad31395 100644 --- a/src/cmake/compiler.cmake +++ b/src/cmake/compiler.cmake @@ -682,7 +682,7 @@ if (DEFINED ENV{${PROJECT_NAME}_CI}) if (APPLE) # Keep Mono framework from being incorrectly searched for include # files on GitHub Actions CI. - set(CMAKE_FIND_FRAMEWORK NEVER) + set(CMAKE_FIND_FRAMEWORK LAST) endif () endif () From aa92f6b0e1e1ef059ea8c9a163e5dacf9fa91de1 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 10:46:03 -0400 Subject: [PATCH 64/71] ci(wheels-macos-intel): get rid of unnecessary changes - revert to deployment target 10.15 - don't use CIBW_ENVIRONMENT to find the C / CXX compiler - unset CMAKE_FIND_FRAMEWORK=NEVER - unset NO_SYSTEM_FROM_IMPORTED=ON Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 17 +---------------- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index be96d9bc90..3eab9e15b5 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -297,22 +297,7 @@ jobs: env: CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} - CIBW_ENVIRONMENT: > - CMAKE_C_COMPILER=$(xcrun -find clang) - CMAKE_CXX_COMPILER=$(xcrun -find clang++) - CMAKE_GENERATOR='Unix Makefiles' - MACOSX_DEPLOYMENT_TARGET=11 - USE_Libheif='OFF' - CMAKE_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER - -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - -DLINKSTATIC=1 - -DIGNORE_HOMEBREWED_DEPS=1 - -DCMAKE_FIND_FRAMEWORK=NEVER - -DOpenEXR_DIR=$PWD/deps/dist/lib/cmake/OpenEXR - -DImath_DIR=$PWD/deps/dist/lib/cmake/Imath" - - MACOSX_DEPLOYMENT_TARGET: 11 + MACOSX_DEPLOYMENT_TARGET: 10.15 CMAKE_GENERATOR: "Unix Makefiles" # TODO: Re-enable HEIF when we provide a build recipe that does # not include GPL-licensed dynamic libraries. diff --git a/pyproject.toml b/pyproject.toml index ea019e4fee..e0a82a3910 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,7 @@ if.platform-system = "darwin" if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" -cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "11" +cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "10.15" #cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" #cmake.define.CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH = "OFF" @@ -112,7 +112,7 @@ skip = [ test-command = "oiiotool --buildinfo" [tool.cibuildwheel.macos.environment] -SKBUILD_CMAKE_ARGS = "-DLINKSTATIC=1; -DIGNORE_HOMEBREWED_DEPS=1; -DCMAKE_FIND_FRAMEWORK=NEVER" +SKBUILD_CMAKE_ARGS = "-DLINKSTATIC=1; -DIGNORE_HOMEBREWED_DEPS=1" # Optimize for size (not speed). SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel" From 46e6daacdd3d52af7835b0d18f0b1b7ec9fd2e4c Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 10:46:43 -0400 Subject: [PATCH 65/71] Revert "ci(wheels): solo macos-x86 builds" This reverts commit 557c3d3a9d24c28b331a8e3e44019e010be80bd7. Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 3eab9e15b5..d74e0c8fe0 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -80,8 +80,8 @@ jobs: name: Build wheels on Linux runs-on: ubuntu-latest if: | - 0 && github.event_name != 'schedule' || - 0 && github.repository == 'AcademySoftwareFoundation/OpenImageIO' + github.event_name != 'schedule' || + github.repository == 'AcademySoftwareFoundation/OpenImageIO' strategy: matrix: include: @@ -176,8 +176,8 @@ jobs: name: Build wheels on Linux ARM runs-on: ubuntu-24.04-arm if: | - 0 && github.event_name != 'schedule' || - 0 && github.repository == 'AcademySoftwareFoundation/OpenImageIO' + github.event_name != 'schedule' || + github.repository == 'AcademySoftwareFoundation/OpenImageIO' strategy: matrix: include: @@ -317,8 +317,8 @@ jobs: name: Build wheels on macOS ARM runs-on: macos-14 if: | - 0 && github.event_name != 'schedule' || - 0 && github.repository == 'AcademySoftwareFoundation/OpenImageIO' + github.event_name != 'schedule' || + github.repository == 'AcademySoftwareFoundation/OpenImageIO' strategy: matrix: include: @@ -371,8 +371,8 @@ jobs: name: Build wheels on Windows runs-on: windows-2022 if: | - 0 && github.event_name != 'schedule' || - 0 && github.repository == 'AcademySoftwareFoundation/OpenImageIO' + github.event_name != 'schedule' || + github.repository == 'AcademySoftwareFoundation/OpenImageIO' strategy: matrix: include: From 50064a420801f4c7b540df2280099bcb00d8e165 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 10:50:05 -0400 Subject: [PATCH 66/71] ci(wheels-macos-x86): remove brew uninstall openexr step hopefully, the improved IGNORE_HOMEBREWED_DEPS business will take care of needing to manually uninstall homebrewed stuff in a CI step, but it's not the end of the world if we have to revert this commit to get stuff to work. Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index d74e0c8fe0..6901b0c9be 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -277,20 +277,6 @@ jobs: uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: '3.9' - - - name: List possible OpenEXR installs - run: | - brew list --versions | grep -E 'openexr|imath' || echo "No brew OpenEXR/Imath" - pkg-config --list-all | grep -E 'OpenEXR|Imath' || true - - - name: Remove brew OpenEXR/Imath - run: | - brew uninstall --ignore-dependencies openexr imath || true - - - name: List possible OpenEXR installs after brew uninstall - run: | - brew list --versions | grep -E 'openexr|imath' || echo "No brew OpenEXR/Imath" - pkg-config --list-all | grep -E 'OpenEXR|Imath' || true - name: Build wheels uses: pypa/cibuildwheel@d4a2945fcc8d13f20a1b99d461b8e844d5fc6e23 # v2.21.1 From 346c6c67e4a1bb545161203d80daf8581aeffed0 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 10:57:08 -0400 Subject: [PATCH 67/71] Update pybind11 version in pyproject.toml Signed-off-by: Zach Lewis --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e0a82a3910..014d9d1ddb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ oiiotool = "OpenImageIO:_command_line" build-backend = "scikit_build_core.build" requires = [ "scikit-build-core>=0.10.6,<1", - "pybind11>=2.9,<3" + "pybind11>=2.13,<3" ] [tool.scikit-build] From a7427dd5c4016e30c09775c5007a669d215d27ac Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 11:22:27 -0400 Subject: [PATCH 68/71] ci(wheels-macos-x86): brew-uninstall openexr/imath Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index bb5f7c4b5c..db31dd9f7e 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -277,6 +277,10 @@ jobs: uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: '3.9' + + - name: Remove brew OpenEXR/Imath + run: | + brew uninstall --ignore-dependencies openexr imath || true - name: Build wheels uses: pypa/cibuildwheel@d4a2945fcc8d13f20a1b99d461b8e844d5fc6e23 # v2.21.1 @@ -294,6 +298,7 @@ jobs: name: cibw-wheels-${{ matrix.python }} path: ./wheelhouse/*.whl + # --------------------------------------------------------------------------- # macOS ARM Wheels # --------------------------------------------------------------------------- From 2f0480055da7bf00d29f74274e308c7805324d2c Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 11:25:42 -0400 Subject: [PATCH 69/71] cleanup: revert CMAKE_FIND_FRAMEWORK behavior from NEVER to LAST Signed-off-by: Zach Lewis --- src/cmake/dependency_utils.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/dependency_utils.cmake b/src/cmake/dependency_utils.cmake index 7e2177a7aa..02c764fd03 100644 --- a/src/cmake/dependency_utils.cmake +++ b/src/cmake/dependency_utils.cmake @@ -40,7 +40,7 @@ endif () # Search for regular libraries before searching for macOS frameworks. if (APPLE) - set_cache (CMAKE_FIND_FRAMEWORK NEVER + set_cache (CMAKE_FIND_FRAMEWORK LAST DOC "Set relative priority of finding frameworks vs. regular libraries" ADVANCED) endif () From 1957a9d38594a6fb1a6a80dfc3867b2ff507c0f7 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 11:52:59 -0400 Subject: [PATCH 70/71] ci(wheels-macos-x86): re-require macos wheel for pypi-upload step Signed-off-by: Zach Lewis --- .github/workflows/wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index db31dd9f7e..377f74d363 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -408,7 +408,7 @@ jobs: upload_pypi: - needs: [sdist, linux, linux-arm, macos-arm, windows] + needs: [sdist, linux, linux-arm, macos, macos-arm, windows] runs-on: ubuntu-latest permissions: id-token: write From 52f73730e5b9bd614935adcb9de5e2b0ca5b4238 Mon Sep 17 00:00:00 2001 From: Zach Lewis Date: Tue, 16 Sep 2025 11:54:03 -0400 Subject: [PATCH 71/71] cleanup: revert unnecessary changes Signed-off-by: Zach Lewis --- pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 014d9d1ddb..b243ba3ddc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ oiiotool = "OpenImageIO:_command_line" build-backend = "scikit_build_core.build" requires = [ "scikit-build-core>=0.10.6,<1", - "pybind11>=2.13,<3" + "pybind11>=2.13,<3", ] [tool.scikit-build] @@ -96,8 +96,6 @@ if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "10.15" -#cmake.define.CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH = "OFF" -#cmake.define.CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH = "OFF" [tool.cibuildwheel] build-verbosity = 1