Skip to content

Commit e34971a

Browse files
committed
Add kOfxParamPropColourManaged for colour-managed RGB/RGBA params (#158)
Add kOfxParamPropColourManaged, a boolean parameter property a plug-in can set on an RGB or RGBA parameter to declare that the parameter's values — including its default — are in the ACES2065-1 (AP0) reference colourspace rather than an unmanaged, display-referred encoding. The values are scene-linear and not constrained to [0..1], so a colour-managed host (or any host that supports wide-gamut colours) can interpret and convert them correctly. Plug-ins must check the set status: if the host does not implement the property, they should fall back to old-style colour values. It defaults to 0, so existing plug-ins are unaffected. - include/ofxParam.h: the property with its @propdef metadata (bool, dim 1), plus new ParamsRGB and ParamsRGBA property sets (the colour param types were not previously modelled in the property metadata). - Documentation/sources/Reference/ofxParameter.rst: describe the property in the Colour Parameters section. - release-notes.md: note the addition under 1.5.1. - openfx-cpp/include/openfx/*: regenerated metadata, property sets, and typed accessors (scripts/gen-props.py). Signed-off-by: Gary Oberbrunner <garyo@darkstarsystems.com>
1 parent 9943cdf commit e34971a

7 files changed

Lines changed: 1131 additions & 65 deletions

File tree

Documentation/sources/Reference/ofxParameter.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,25 @@ These are typed by :c:macro:`kOfxParamTypeRGB` and :c:macro:`kOfxParamTypeRGBA`.
150150

151151
Colour parameters are 3 or 4 dimensional double precision floating point
152152
parameters. They are displayed using the host's appropriate interface
153-
for a colour. Values are always normalised in the range [0 .. 1], with 0
153+
for a colour. By default values are normalised in the range [0 .. 1], with 0
154154
being the nominal black point and 1 being the white point.
155155

156+
A plug-in may set :c:macro:`kOfxParamPropColourManaged` on an RGB or RGBA
157+
parameter to declare that its values — including its default — are in the
158+
ACES2065-1 (AP0) reference colourspace rather than an unmanaged,
159+
display-referred encoding. These values are scene-linear and are not
160+
constrained to the [0 .. 1] range. This lets a host interpret and convert the parameter's colour correctly — for
161+
example to draw an accurate swatch, or to transform the value into its own
162+
working colourspace, or to give wide-gamut colours to the plugin. Hosts or
163+
plug-ins that do not support this property should treat the values as before.
164+
165+
Plugins should check the return status when setting
166+
:c:macro:`kOfxParamPropColourManaged`; if the host returns an error,
167+
the plugin should continue to use and expect unmanaged colour values.
168+
169+
See :c:macro:`kOfxImageEffectPropColourManagementStyle` and the
170+
related colour management properties for the native colour management
171+
config and its reference colourspaces.
156172

157173
Boolean Parameters
158174
------------------

include/ofxParam.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,36 @@ The exact type and dimension is dependent on the type of the parameter. These ar
421421
*/
422422
#define kOfxParamPropDefault "OfxParamPropDefault"
423423

424+
/** @brief Flags that an RGB or RGBA parameter's colour values are
425+
colour-managed.
426+
427+
When set to a non-zero value on a parameter of type ::kOfxParamTypeRGB or
428+
::kOfxParamTypeRGBA, the parameter's colour values — including its default
429+
(::kOfxParamPropDefault) and its current value — are expressed in the
430+
ACES2065-1 (AP0) reference colourspace, rather than an unmanaged,
431+
display-referred encoding. ACES2065-1 is the reference colourspace of the OFX
432+
native colour management config (see @ref ofxColour.h); values are scene-linear
433+
and not constrained to the [0..1] range.
434+
435+
This lets a host interpret and convert the parameter's colour correctly — for
436+
example to draw an accurate swatch, or to transform the value into its own
437+
working colourspace, or to give wide-gamut colours to the plugin. Hosts or
438+
plug-ins that do not support this property should treat the values as before.
439+
440+
Plugins must check the status when setting this property; if it's unimplemented
441+
by the host, the plugin should use and expect old-style colour values.
442+
443+
This property is only meaningful on RGB and RGBA parameters and is ignored on
444+
other parameter types. It defaults to 0 (not colour-managed) so that existing
445+
plug-ins are unaffected.
446+
447+
@propdef
448+
type: bool
449+
dimension: 1
450+
introduced: "1.5.1"
451+
*/
452+
#define kOfxParamPropColourManaged "OfxParamPropColourManaged"
453+
424454
/** @brief Describes how the double parameter should be interpreted by a host.
425455
426456
- Valid Values -This must be one of
@@ -1453,6 +1483,26 @@ changes a keyframe. The keyframe indices will not change within a single action
14531483
- ParamsNumeric_REF
14541484
*/
14551485

1486+
/** @propset ParamsRGB
1487+
write: plugin
1488+
props:
1489+
- OfxParamPropColourManaged
1490+
- ParamsCommon_REF
1491+
- ParamsAllButGroupPage_REF
1492+
- ParamsValue_REF
1493+
- ParamsNumeric_REF
1494+
*/
1495+
1496+
/** @propset ParamsRGBA
1497+
write: plugin
1498+
props:
1499+
- OfxParamPropColourManaged
1500+
- ParamsCommon_REF
1501+
- ParamsAllButGroupPage_REF
1502+
- ParamsValue_REF
1503+
- ParamsNumeric_REF
1504+
*/
1505+
14561506
/** @propset ParamsChoice
14571507
write: plugin
14581508
props:

0 commit comments

Comments
 (0)