Skip to content

Commit bc47102

Browse files
garyoclaude
andcommitted
Fix incorrect @propdef enum value names and guard against regressions (#247)
Several enum properties listed @propdef `values:` that did not match the actual string literals their value #defines expand to, so the generated openfx-cpp metadata advertised valid-value strings no host or plugin ever uses. The macro string values are ABI and are left untouched; only the metadata is corrected to match them: - Field props (FieldOrder, PropField, FieldExtraction, FieldToRender): OfxImageField* -> OfxField* (kOfxImageFieldNone == "OfxFieldNone") - PreMultiplication: OfxImage{,Un}PreMultiplied -> OfxImageAlpha{,Un}Premultiplied - HostPropNativeOrigin: add the leading "k" the string literals actually have (kOfxHostNativeOriginBottomLeft == "kOfxImageEffectHostProp...") - ColourManagementStyle: drop the erroneous "Prop" (kOfxImageEffectColourManagementNone == "OfxImageEffectColourManagementNone") Guard: gen-props.py now emits a static_assert for every enum value (value string == its #define), mirroring the existing per-property asserts, and aborts generation if an `Ofx`-prefixed value names no macro. A reintroduced typo therefore fails the generator and, failing that, fails to compile. Verified by reintroducing a bad value. Also removed dead `nonProperties` entries in gen-props.py that excluded misspelled (extra-"Prop") ColourManagement value macros which never existed; the real value macros contain no "Prop" and were never collected as properties. Output is byte-identical. Regenerated openfx-cpp metadata and the property reference docs. The docs regen also picks up kOfxImageEffectPluginPropObsolete, whose generated docs were stale on main. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Gary Oberbrunner <garyo@darkstarsystems.com>
1 parent 9943cdf commit bc47102

6 files changed

Lines changed: 235 additions & 69 deletions

File tree

Documentation/sources/Reference/ofxPropertiesReferenceGenerated.rst

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ Integer (Boolean) Properties
112112
- **Used in Property Sets**: :ref:`EffectDescriptor <propset_EffectDescriptor>` (plugin)
113113
- **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectPluginPropHostFrameThreading`.
114114

115+
.. _prop_OfxImageEffectPluginPropObsolete:
116+
117+
**OfxImageEffectPluginPropObsolete**
118+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119+
120+
- **C #define**: :c:macro:`kOfxImageEffectPluginPropObsolete`
121+
- **Type**: bool
122+
- **Dimension**: 1
123+
- **Used in Property Sets**: :ref:`EffectDescriptor <propset_EffectDescriptor>` (plugin)
124+
- **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectPluginPropObsolete`.
125+
115126
.. _prop_OfxImageEffectPluginPropSingleInstance:
116127

117128
**OfxImageEffectPluginPropSingleInstance**
@@ -957,12 +968,12 @@ Enumeration Properties
957968
- **Dimension**: 1
958969
- **Used in Property Sets**: :ref:`ClipDescriptor <propset_ClipDescriptor>` (plugin), :ref:`ClipInstance <propset_ClipInstance>` (host)
959970
- **Valid Values**:
960-
- ``OfxImageFieldNone``
961-
- ``OfxImageFieldLower``
962-
- ``OfxImageFieldUpper``
963-
- ``OfxImageFieldBoth``
964-
- ``OfxImageFieldSingle``
965-
- ``OfxImageFieldDoubled``
971+
- ``OfxFieldNone``
972+
- ``OfxFieldLower``
973+
- ``OfxFieldUpper``
974+
- ``OfxFieldBoth``
975+
- ``OfxFieldSingle``
976+
- ``OfxFieldDoubled``
966977
- **Doc**: For detailed doc, see :c:macro:`kOfxImageClipPropFieldExtraction`.
967978

968979
.. _prop_OfxImageClipPropFieldOrder:
@@ -975,9 +986,9 @@ Enumeration Properties
975986
- **Dimension**: 1
976987
- **Used in Property Sets**: :ref:`ClipInstance <propset_ClipInstance>` (host)
977988
- **Valid Values**:
978-
- ``OfxImageFieldNone``
979-
- ``OfxImageFieldLower``
980-
- ``OfxImageFieldUpper``
989+
- ``OfxFieldNone``
990+
- ``OfxFieldLower``
991+
- ``OfxFieldUpper``
981992
- **Doc**: For detailed doc, see :c:macro:`kOfxImageClipPropFieldOrder`.
982993

983994
.. _prop_OfxImageClipPropUnmappedComponents:
@@ -1023,9 +1034,9 @@ Enumeration Properties
10231034
- **Dimension**: 1
10241035
- **Used in Property Sets**: :ref:`ImageEffectHost <propset_ImageEffectHost>` (host)
10251036
- **Valid Values**:
1026-
- ``OfxImageEffectHostPropNativeOriginBottomLeft``
1027-
- ``OfxImageEffectHostPropNativeOriginTopLeft``
1028-
- ``OfxImageEffectHostPropNativeOriginCenter``
1037+
- ``kOfxImageEffectHostPropNativeOriginBottomLeft``
1038+
- ``kOfxImageEffectHostPropNativeOriginTopLeft``
1039+
- ``kOfxImageEffectHostPropNativeOriginCenter``
10291040
- **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectHostPropNativeOrigin`.
10301041

10311042
.. _prop_OfxImageEffectPluginRenderThreadSafety:
@@ -1068,11 +1079,11 @@ Enumeration Properties
10681079
- **Dimension**: 1
10691080
- **Used in Property Sets**: :ref:`EffectDescriptor <propset_EffectDescriptor>` (plugin), :ref:`EffectInstance <propset_EffectInstance>` (host), :ref:`ImageEffectHost <propset_ImageEffectHost>` (host)
10701081
- **Valid Values**:
1071-
- ``OfxImageEffectPropColourManagementNone``
1072-
- ``OfxImageEffectPropColourManagementBasic``
1073-
- ``OfxImageEffectPropColourManagementCore``
1074-
- ``OfxImageEffectPropColourManagementFull``
1075-
- ``OfxImageEffectPropColourManagementOCIO``
1082+
- ``OfxImageEffectColourManagementNone``
1083+
- ``OfxImageEffectColourManagementBasic``
1084+
- ``OfxImageEffectColourManagementCore``
1085+
- ``OfxImageEffectColourManagementFull``
1086+
- ``OfxImageEffectColourManagementOCIO``
10761087
- **Introduced in**: version 1.5
10771088
- **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectPropColourManagementStyle`.
10781089

@@ -1147,10 +1158,10 @@ Enumeration Properties
11471158
- **Type**: enum
11481159
- **Dimension**: 1
11491160
- **Valid Values**:
1150-
- ``OfxImageFieldNone``
1151-
- ``OfxImageFieldBoth``
1152-
- ``OfxImageFieldLower``
1153-
- ``OfxImageFieldUpper``
1161+
- ``OfxFieldNone``
1162+
- ``OfxFieldBoth``
1163+
- ``OfxFieldLower``
1164+
- ``OfxFieldUpper``
11541165
- **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectPropFieldToRender`.
11551166

11561167
.. _prop_OfxImageEffectPropMetalRenderSupported:
@@ -1255,8 +1266,8 @@ Enumeration Properties
12551266
- **Used in Property Sets**: :ref:`ClipInstance <propset_ClipInstance>` (host), :ref:`Image <propset_Image>` (host)
12561267
- **Valid Values**:
12571268
- ``OfxImageOpaque``
1258-
- ``OfxImagePreMultiplied``
1259-
- ``OfxImageUnPreMultiplied``
1269+
- ``OfxImageAlphaPremultiplied``
1270+
- ``OfxImageAlphaUnPremultiplied``
12601271
- **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectPropPreMultiplication`.
12611272

12621273
.. _prop_OfxImageEffectPropSupportedComponents:
@@ -1334,10 +1345,10 @@ Enumeration Properties
13341345
- **Dimension**: 1
13351346
- **Used in Property Sets**: :ref:`Image <propset_Image>` (host)
13361347
- **Valid Values**:
1337-
- ``OfxImageFieldNone``
1338-
- ``OfxImageFieldBoth``
1339-
- ``OfxImageFieldLower``
1340-
- ``OfxImageFieldUpper``
1348+
- ``OfxFieldNone``
1349+
- ``OfxFieldBoth``
1350+
- ``OfxFieldLower``
1351+
- ``OfxFieldUpper``
13411352
- **Doc**: For detailed doc, see :c:macro:`kOfxImagePropField`.
13421353

13431354
.. _prop_OfxOpenGLPropPixelDepth:

Documentation/sources/Reference/ofxPropertySetsGenerated.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ These property sets represent collections of properties associated with various
104104
- :ref:`OfxImageEffectPluginPropFieldRenderTwiceAlways <prop_OfxImageEffectPluginPropFieldRenderTwiceAlways>` - Type: bool, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPluginPropFieldRenderTwiceAlways`)
105105
- :ref:`OfxImageEffectPluginPropGrouping <prop_OfxImageEffectPluginPropGrouping>` - Type: string, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPluginPropGrouping`)
106106
- :ref:`OfxImageEffectPluginPropHostFrameThreading <prop_OfxImageEffectPluginPropHostFrameThreading>` - Type: bool, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPluginPropHostFrameThreading`)
107+
- :ref:`OfxImageEffectPluginPropObsolete <prop_OfxImageEffectPluginPropObsolete>` - Type: bool, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPluginPropObsolete`)
107108
- :ref:`OfxImageEffectPluginPropOverlayInteractV1 <prop_OfxImageEffectPluginPropOverlayInteractV1>` - Type: pointer, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPluginPropOverlayInteractV1`)
108109
- :ref:`OfxImageEffectPluginPropOverlayInteractV2 <prop_OfxImageEffectPluginPropOverlayInteractV2>` - Type: pointer, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPluginPropOverlayInteractV2`)
109110
- :ref:`OfxImageEffectPluginPropSingleInstance <prop_OfxImageEffectPluginPropSingleInstance>` - Type: bool, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPluginPropSingleInstance`)

include/ofxColour.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ effect instance.
5555
type: enum
5656
dimension: 1
5757
values:
58-
- OfxImageEffectPropColourManagementNone
59-
- OfxImageEffectPropColourManagementBasic
60-
- OfxImageEffectPropColourManagementCore
61-
- OfxImageEffectPropColourManagementFull
62-
- OfxImageEffectPropColourManagementOCIO
58+
- OfxImageEffectColourManagementNone
59+
- OfxImageEffectColourManagementBasic
60+
- OfxImageEffectColourManagementCore
61+
- OfxImageEffectColourManagementFull
62+
- OfxImageEffectColourManagementOCIO
6363
introduced: "1.5"
6464
*/
6565
#define kOfxImageEffectPropColourManagementStyle "OfxImageEffectPropColourManagementStyle"

include/ofxImageEffect.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -912,9 +912,9 @@ This property is set to kOfxHostNativeOriginBottomLeft pre V1.4 and was to be di
912912
type: enum
913913
dimension: 1
914914
values:
915-
- OfxImageEffectHostPropNativeOriginBottomLeft
916-
- OfxImageEffectHostPropNativeOriginTopLeft
917-
- OfxImageEffectHostPropNativeOriginCenter
915+
- kOfxImageEffectHostPropNativeOriginBottomLeft
916+
- kOfxImageEffectHostPropNativeOriginTopLeft
917+
- kOfxImageEffectHostPropNativeOriginCenter
918918
*/
919919
#define kOfxImageEffectHostPropNativeOrigin "OfxImageEffectHostPropNativeOrigin"
920920

@@ -1178,8 +1178,8 @@ See the documentation on clip preferences for more details on how this is used w
11781178
dimension: 1
11791179
values:
11801180
- OfxImageOpaque
1181-
- OfxImagePreMultiplied
1182-
- OfxImageUnPreMultiplied
1181+
- OfxImageAlphaPremultiplied
1182+
- OfxImageAlphaUnPremultiplied
11831183
*/
11841184
#define kOfxImageEffectPropPreMultiplication "OfxImageEffectPropPreMultiplication"
11851185

@@ -1491,9 +1491,9 @@ This contains the duration of the plug-in effect, in frames.
14911491
type: enum
14921492
dimension: 1
14931493
values:
1494-
- OfxImageFieldNone
1495-
- OfxImageFieldLower
1496-
- OfxImageFieldUpper
1494+
- OfxFieldNone
1495+
- OfxFieldLower
1496+
- OfxFieldUpper
14971497
*/
14981498
#define kOfxImageClipPropFieldOrder "OfxImageClipPropFieldOrder"
14991499

@@ -1575,10 +1575,10 @@ Row bytes is not supported for OpenCL Images.
15751575
type: enum
15761576
dimension: 1
15771577
values:
1578-
- OfxImageFieldNone
1579-
- OfxImageFieldBoth
1580-
- OfxImageFieldLower
1581-
- OfxImageFieldUpper
1578+
- OfxFieldNone
1579+
- OfxFieldBoth
1580+
- OfxFieldLower
1581+
- OfxFieldUpper
15821582
*/
15831583
#define kOfxImagePropField "OfxImagePropField"
15841584

@@ -1607,12 +1607,12 @@ Note that if it fetches kOfxImageFieldSingle and the host stores images natively
16071607
type: enum
16081608
dimension: 1
16091609
values:
1610-
- OfxImageFieldNone
1611-
- OfxImageFieldLower
1612-
- OfxImageFieldUpper
1613-
- OfxImageFieldBoth
1614-
- OfxImageFieldSingle
1615-
- OfxImageFieldDoubled
1610+
- OfxFieldNone
1611+
- OfxFieldLower
1612+
- OfxFieldUpper
1613+
- OfxFieldBoth
1614+
- OfxFieldSingle
1615+
- OfxFieldDoubled
16161616
*/
16171617
#define kOfxImageClipPropFieldExtraction "OfxImageClipPropFieldExtraction"
16181618

@@ -1627,10 +1627,10 @@ Note that if it fetches kOfxImageFieldSingle and the host stores images natively
16271627
type: enum
16281628
dimension: 1
16291629
values:
1630-
- OfxImageFieldNone
1631-
- OfxImageFieldBoth
1632-
- OfxImageFieldLower
1633-
- OfxImageFieldUpper
1630+
- OfxFieldNone
1631+
- OfxFieldBoth
1632+
- OfxFieldLower
1633+
- OfxFieldUpper
16341634
*/
16351635
#define kOfxImageEffectPropFieldToRender "OfxImageEffectPropFieldToRender"
16361636

0 commit comments

Comments
 (0)