Add contrib/colour header-only colour-conversion library (#158)#244
Open
garyo wants to merge 1 commit into
Open
Add contrib/colour header-only colour-conversion library (#158)#244garyo wants to merge 1 commit into
garyo wants to merge 1 commit into
Conversation
6986898 to
aefcff8
Compare
Add ofxColourConvert.h, a small, dependency-free, header-only C++17 library that converts RGB triplets between the OFX native colourspaces and ACES2065-1, for plug-in and host authors who want exact conversions without a full OpenColorIO dependency. It is not a replacement for OCIO: display rendering and the display-referred/ADX/basic spaces are out of scope. Layout and integration: - contrib/colour/ofxColourConvert.h - the library, with README. - contrib/colour/tests/ - validation suite comparing every supported colourspace against OpenColorIO in both directions, plus round-trip and name-lookup checks. - An INTERFACE target OpenFX::ColourConvert exposes the header to in-tree consumers, plus a ColourConvert Conan component. The header is distributed via the Conan package and the CI release tarball (under openfx/contrib/colour/), matching the other OFX headers; it is not CMake-installed (the install target only installs example plugins). - The tests are built and run by pcons (which fetches OpenColorIO and GoogleTest via Conan). They are gated behind OFX_BUILD_COLOUR_TESTS (default OFF); when on, a CTest fixture delegates to pcons via uvx, so `ctest` runs them with zero install and no impact on the main build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Gary Oberbrunner <garyo@darkstarsystems.com>
aefcff8 to
911a493
Compare
Contributor
Author
|
I should note that most of this code was co-written with Claude Opus 4.8 and reviewed by me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the Colour Managed Color Parameter work (#158). Companion to #245 (the
kOfxParamPropColourManagementspec change).What
Adds
contrib/colour/ofxColourConvert.h: a small, dependency-free, header-only C++17 library that converts RGB triplets between the OFX native colourspaces and ACES2065-1, for plug-in and host authors who want exact conversions without taking on a full OpenColorIO dependency. It is not a replacement for OCIO — display rendering and the display-referred / ADX / "basic" spaces are out of scope.This is the conversion helper referenced by #245: a plug-in that declares a parameter
kOfxParamColourManagementManagedreceives its values in ACES2065-1, and can use this library to convert them to or from whatever working space it needs.Every supported space reduces to
code value --(transfer function)--> linear RGB --(3x3 matrix)--> AP0and back; gamut matrices are derived at compile time (NPM + von Kries adaptation) to match the OCIO ACES config the OFX native colourspaces are based on.Layout & integration
contrib/colour/ofxColourConvert.h— the library, with a README.contrib/colour/tests/— validation suite comparing every supported colourspace against OpenColorIO in both directions, plus round-trip and name-lookup checks.INTERFACEtargetOpenFX::ColourConvertthat installs it, plus aColourConvertConan component. No test dependencies leak into the core package.openfx/contrib/colour/.OFX_BUILD_COLOUR_TESTS(default OFF). When on, a CTest fixture delegates touvx pcons, soctestruns them with zero install and no impact on the main build.Validation
-Wall -Wextra; all 39 colourspaces round-trip to 1e-9.OpenFX::ColourConvertlinks from a consumer;cmake --installand the CI tarball both place the header.🤖 Generated with Claude Code