From 2cd5b4426d68e62f281ab27c47580fe69b358ecf Mon Sep 17 00:00:00 2001 From: umajho Date: Thu, 24 Sep 2026 01:15:00 +0800 Subject: [PATCH 1/2] feat: add @propset OpenGLTexture Signed-off-by: umajho --- .../ofxPropertiesReferenceGenerated.rst | 24 ++--- .../Reference/ofxPropertySetsGenerated.rst | 24 +++++ include/ofxGPURender.h | 18 ++++ .../include/openfx/ofxPropSetAccessors.h | 59 ++++++++++++ .../include/openfx/ofxPropSetAccessorsHost.h | 90 +++++++++++++++++++ openfx-cpp/include/openfx/ofxPropsBySet.h | 15 ++++ 6 files changed, 219 insertions(+), 11 deletions(-) diff --git a/Documentation/sources/Reference/ofxPropertiesReferenceGenerated.rst b/Documentation/sources/Reference/ofxPropertiesReferenceGenerated.rst index 8ddf19d2..517c351e 100644 --- a/Documentation/sources/Reference/ofxPropertiesReferenceGenerated.rst +++ b/Documentation/sources/Reference/ofxPropertiesReferenceGenerated.rst @@ -703,7 +703,7 @@ Double Properties - **C #define**: :c:macro:`kOfxImageEffectPropRenderScale` - **Type**: double - **Dimension**: 2 -- **Used in Property Sets**: :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectPropRenderScale`. .. _prop_OfxImageEffectPropUnmappedFrameRange: @@ -736,7 +736,7 @@ Double Properties - **C #define**: :c:macro:`kOfxImagePropPixelAspectRatio` - **Type**: double - **Dimension**: 1 -- **Used in Property Sets**: :ref:`ClipInstance ` (host), :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`ClipInstance ` (host), :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Doc**: For detailed doc, see :c:macro:`kOfxImagePropPixelAspectRatio`. .. _prop_OfxInteractPropBackgroundColour: @@ -1097,7 +1097,7 @@ Enumeration Properties - **C #define**: :c:macro:`kOfxImageEffectPropComponents` - **Type**: enum - **Dimension**: 1 -- **Used in Property Sets**: :ref:`ClipInstance ` (host), :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`ClipInstance ` (host), :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Valid Values**: - ``OfxImageComponentNone`` - ``OfxImageComponentRGBA`` @@ -1248,7 +1248,7 @@ Enumeration Properties - **C #define**: :c:macro:`kOfxImageEffectPropPixelDepth` - **Type**: enum - **Dimension**: 1 -- **Used in Property Sets**: :ref:`ClipInstance ` (host), :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`ClipInstance ` (host), :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Valid Values**: - ``OfxBitDepthNone`` - ``OfxBitDepthByte`` @@ -1265,7 +1265,7 @@ Enumeration Properties - **C #define**: :c:macro:`kOfxImageEffectPropPreMultiplication` - **Type**: enum - **Dimension**: 1 -- **Used in Property Sets**: :ref:`ClipInstance ` (host), :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`ClipInstance ` (host), :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Valid Values**: - ``OfxImageOpaque`` - ``OfxImageAlphaPremultiplied`` @@ -1345,7 +1345,7 @@ Enumeration Properties - **C #define**: :c:macro:`kOfxImagePropField` - **Type**: enum - **Dimension**: 1 -- **Used in Property Sets**: :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Valid Values**: - ``OfxFieldNone`` - ``OfxFieldBoth`` @@ -1482,6 +1482,7 @@ Integer Properties - **C #define**: :c:macro:`kOfxImageEffectPropOpenGLTextureIndex` - **Type**: int - **Dimension**: 1 +- **Used in Property Sets**: :ref:`OpenGLTexture ` (host) - **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectPropOpenGLTextureIndex`. .. _prop_OfxImageEffectPropOpenGLTextureTarget: @@ -1492,6 +1493,7 @@ Integer Properties - **C #define**: :c:macro:`kOfxImageEffectPropOpenGLTextureTarget` - **Type**: int - **Dimension**: 1 +- **Used in Property Sets**: :ref:`OpenGLTexture ` (host) - **Doc**: For detailed doc, see :c:macro:`kOfxImageEffectPropOpenGLTextureTarget`. .. _prop_OfxImageEffectPropRenderWindow: @@ -1512,7 +1514,7 @@ Integer Properties - **C #define**: :c:macro:`kOfxImagePropBounds` - **Type**: int - **Dimension**: 4 -- **Used in Property Sets**: :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Doc**: For detailed doc, see :c:macro:`kOfxImagePropBounds`. .. _prop_OfxImagePropRegionOfDefinition: @@ -1523,7 +1525,7 @@ Integer Properties - **C #define**: :c:macro:`kOfxImagePropRegionOfDefinition` - **Type**: int - **Dimension**: 4 -- **Used in Property Sets**: :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Doc**: For detailed doc, see :c:macro:`kOfxImagePropRegionOfDefinition`. .. _prop_OfxImagePropRowBytes: @@ -1534,7 +1536,7 @@ Integer Properties - **C #define**: :c:macro:`kOfxImagePropRowBytes` - **Type**: int - **Dimension**: 1 -- **Used in Property Sets**: :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Doc**: For detailed doc, see :c:macro:`kOfxImagePropRowBytes`. .. _prop_OfxInteractPropBitDepth: @@ -2052,7 +2054,7 @@ String Properties - **C #define**: :c:macro:`kOfxImagePropUniqueIdentifier` - **Type**: string - **Dimension**: 1 -- **Used in Property Sets**: :ref:`Image ` (host) +- **Used in Property Sets**: :ref:`Image ` (host), :ref:`OpenGLTexture ` (host) - **Doc**: For detailed doc, see :c:macro:`kOfxImagePropUniqueIdentifier`. .. _prop_OfxInteractPropSlaveToParam: @@ -2271,7 +2273,7 @@ String Properties - **C #define**: :c:macro:`kOfxPropType` - **Type**: string - **Dimension**: 1 -- **Used in Property Sets**: :ref:`ClipDescriptor ` (plugin), :ref:`ClipInstance ` (host), :ref:`EffectDescriptor ` (plugin), :ref:`EffectInstance ` (host), :ref:`Image ` (host), :ref:`ImageEffectHost ` (host), :ref:`ParamsByte ` (plugin), :ref:`ParamsChoice ` (plugin), :ref:`ParamsCustom ` (plugin), :ref:`ParamsDouble1D ` (plugin), :ref:`ParamsDouble2D3D ` (plugin), :ref:`ParamsGroup ` (plugin), :ref:`ParamsInt2D3D ` (plugin), :ref:`ParamsNormalizedSpatial ` (plugin), :ref:`ParamsPage ` (plugin), :ref:`ParamsParametric ` (plugin), :ref:`ParamsRGB ` (plugin), :ref:`ParamsRGBA ` (plugin), :ref:`ParamsStrChoice ` (plugin), :ref:`ParamsString ` (plugin) +- **Used in Property Sets**: :ref:`ClipDescriptor ` (plugin), :ref:`ClipInstance ` (host), :ref:`EffectDescriptor ` (plugin), :ref:`EffectInstance ` (host), :ref:`Image ` (host), :ref:`ImageEffectHost ` (host), :ref:`OpenGLTexture ` (host), :ref:`ParamsByte ` (plugin), :ref:`ParamsChoice ` (plugin), :ref:`ParamsCustom ` (plugin), :ref:`ParamsDouble1D ` (plugin), :ref:`ParamsDouble2D3D ` (plugin), :ref:`ParamsGroup ` (plugin), :ref:`ParamsInt2D3D ` (plugin), :ref:`ParamsNormalizedSpatial ` (plugin), :ref:`ParamsPage ` (plugin), :ref:`ParamsParametric ` (plugin), :ref:`ParamsRGB ` (plugin), :ref:`ParamsRGBA ` (plugin), :ref:`ParamsStrChoice ` (plugin), :ref:`ParamsString ` (plugin) - **Doc**: For detailed doc, see :c:macro:`kOfxPropType`. .. _prop_OfxPropVersionLabel: diff --git a/Documentation/sources/Reference/ofxPropertySetsGenerated.rst b/Documentation/sources/Reference/ofxPropertySetsGenerated.rst index 1de705ed..786f4b16 100644 --- a/Documentation/sources/Reference/ofxPropertySetsGenerated.rst +++ b/Documentation/sources/Reference/ofxPropertySetsGenerated.rst @@ -21,6 +21,7 @@ These property sets represent collections of properties associated with various * :ref:`ImageEffectHost ` * :ref:`InteractDescriptor ` * :ref:`InteractInstance ` +* :ref:`OpenGLTexture ` * :ref:`ParameterSet ` * :ref:`ParamsByte ` * :ref:`ParamsChoice ` @@ -266,6 +267,29 @@ These property sets represent collections of properties associated with various - :ref:`OfxPropEffectInstance ` - Type: pointer, Dimension: 1 (doc: :c:macro:`kOfxPropEffectInstance`) - :ref:`OfxPropInstanceData ` - Type: pointer, Dimension: 1 (doc: :c:macro:`kOfxPropInstanceData`) +.. _propset_OpenGLTexture: + +**OpenGLTexture** +^^^^^^^^^^^^^ + +- **Write Access**: host + +**Properties** + +- :ref:`OfxImageEffectPropComponents ` - Type: enum, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPropComponents`) +- :ref:`OfxImageEffectPropOpenGLTextureIndex ` - Type: int, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPropOpenGLTextureIndex`) +- :ref:`OfxImageEffectPropOpenGLTextureTarget ` - Type: int, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPropOpenGLTextureTarget`) +- :ref:`OfxImageEffectPropPixelDepth ` - Type: enum, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPropPixelDepth`) +- :ref:`OfxImageEffectPropPreMultiplication ` - Type: enum, Dimension: 1 (doc: :c:macro:`kOfxImageEffectPropPreMultiplication`) +- :ref:`OfxImageEffectPropRenderScale ` - Type: double, Dimension: 2 (doc: :c:macro:`kOfxImageEffectPropRenderScale`) +- :ref:`OfxImagePropBounds ` - Type: int, Dimension: 4 (doc: :c:macro:`kOfxImagePropBounds`) +- :ref:`OfxImagePropField ` - Type: enum, Dimension: 1 (doc: :c:macro:`kOfxImagePropField`) +- :ref:`OfxImagePropPixelAspectRatio ` - Type: double, Dimension: 1 (doc: :c:macro:`kOfxImagePropPixelAspectRatio`) +- :ref:`OfxImagePropRegionOfDefinition ` - Type: int, Dimension: 4 (doc: :c:macro:`kOfxImagePropRegionOfDefinition`) +- :ref:`OfxImagePropRowBytes ` - Type: int, Dimension: 1 (doc: :c:macro:`kOfxImagePropRowBytes`) +- :ref:`OfxImagePropUniqueIdentifier ` - Type: string, Dimension: 1 (doc: :c:macro:`kOfxImagePropUniqueIdentifier`) +- :ref:`OfxPropType ` - Type: string, Dimension: 1 (doc: :c:macro:`kOfxPropType`) + .. _propset_ParameterSet: **ParameterSet** diff --git a/include/ofxGPURender.h b/include/ofxGPURender.h index cda16df2..68e1b824 100644 --- a/include/ofxGPURender.h +++ b/include/ofxGPURender.h @@ -906,4 +906,22 @@ Failure to do this will cause crashes or incorrect results when the host switche } #endif +/** @propset OpenGLTexture + write: host + props: + - OfxPropType + - OfxImageEffectPropOpenGLTextureIndex + - OfxImageEffectPropOpenGLTextureTarget + - OfxImageEffectPropPixelDepth + - OfxImageEffectPropComponents + - OfxImageEffectPropPreMultiplication + - OfxImageEffectPropRenderScale + - OfxImagePropPixelAspectRatio + - OfxImagePropBounds + - OfxImagePropRegionOfDefinition + - OfxImagePropRowBytes + - OfxImagePropField + - OfxImagePropUniqueIdentifier + */ + #endif /*__OFXGPURENDER_H__ */ diff --git a/openfx-cpp/include/openfx/ofxPropSetAccessors.h b/openfx-cpp/include/openfx/ofxPropSetAccessors.h index 6e6b3dbe..5a449e6a 100644 --- a/openfx-cpp/include/openfx/ofxPropSetAccessors.h +++ b/openfx-cpp/include/openfx/ofxPropSetAccessors.h @@ -1718,6 +1718,65 @@ class InteractInstance : public PropertySetAccessor { }; +// Property set accessor for: OpenGLTexture +class OpenGLTexture : public PropertySetAccessor { +public: + using PropertySetAccessor::PropertySetAccessor; + + const char* type(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + int openGLTextureIndex(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + int openGLTextureTarget(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + const char* pixelDepth(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + const char* components(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + const char* preMultiplication(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + std::array renderScale() const { + return props_.getAll(); + } + + double pixelAspectRatio(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + std::array bounds() const { + return props_.getAll(); + } + + std::array regionOfDefinition() const { + return props_.getAll(); + } + + int rowBytes(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + const char* field(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + + const char* uniqueIdentifier(bool error_if_missing = true) const { + return props_.get(0, error_if_missing); + } + +}; + // Property set accessor for: ParameterSet class ParameterSet : public PropertySetAccessor { public: diff --git a/openfx-cpp/include/openfx/ofxPropSetAccessorsHost.h b/openfx-cpp/include/openfx/ofxPropSetAccessorsHost.h index d1d523fb..ddc2de81 100644 --- a/openfx-cpp/include/openfx/ofxPropSetAccessorsHost.h +++ b/openfx-cpp/include/openfx/ofxPropSetAccessorsHost.h @@ -2258,6 +2258,96 @@ class InteractInstance : public PropertySetAccessor { }; +// Property set accessor for: OpenGLTexture +class OpenGLTexture : public PropertySetAccessor { +public: + using PropertySetAccessor::PropertySetAccessor; + + OpenGLTexture& setType(const char* value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setOpenGLTextureIndex(int value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setOpenGLTextureTarget(int value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setPixelDepth(const char* value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setComponents(const char* value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setPreMultiplication(const char* value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setRenderScale(const std::array& values, bool error_if_missing = true) { + props_.setAll(values, error_if_missing); + return *this; + } + + // Set all values from an initializer list (e.g., {1, 2}) + OpenGLTexture& setRenderScale(std::initializer_list values, bool error_if_missing = true) { + props_.setAll(values, error_if_missing); + return *this; + } + + OpenGLTexture& setPixelAspectRatio(double value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setBounds(const std::array& values, bool error_if_missing = true) { + props_.setAll(values, error_if_missing); + return *this; + } + + // Set all values from an initializer list (e.g., {1, 2}) + OpenGLTexture& setBounds(std::initializer_list values, bool error_if_missing = true) { + props_.setAll(values, error_if_missing); + return *this; + } + + OpenGLTexture& setRegionOfDefinition(const std::array& values, bool error_if_missing = true) { + props_.setAll(values, error_if_missing); + return *this; + } + + // Set all values from an initializer list (e.g., {1, 2}) + OpenGLTexture& setRegionOfDefinition(std::initializer_list values, bool error_if_missing = true) { + props_.setAll(values, error_if_missing); + return *this; + } + + OpenGLTexture& setRowBytes(int value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setField(const char* value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + + OpenGLTexture& setUniqueIdentifier(const char* value, bool error_if_missing = true) { + props_.set(value, 0, error_if_missing); + return *this; + } + +}; + // Property set accessor for: ParameterSet class ParameterSet : public PropertySetAccessor { public: diff --git a/openfx-cpp/include/openfx/ofxPropsBySet.h b/openfx-cpp/include/openfx/ofxPropsBySet.h index 44d95179..45bf30fe 100644 --- a/openfx-cpp/include/openfx/ofxPropsBySet.h +++ b/openfx-cpp/include/openfx/ofxPropsBySet.h @@ -198,6 +198,21 @@ static inline const std::map> prop_sets { { "OfxInteractPropBitDepth", prop_defs[PropId::OfxInteractPropBitDepth], true, false, false }, { "OfxInteractPropSlaveToParam", prop_defs[PropId::OfxInteractPropSlaveToParam], true, false, false }, { "OfxInteractPropSuggestedColour", prop_defs[PropId::OfxInteractPropSuggestedColour], true, false, false } } }, +// OpenGLTexture +{ "OpenGLTexture", { + { "OfxPropType", prop_defs[PropId::OfxPropType], true, false, false }, + { "OfxImageEffectPropOpenGLTextureIndex", prop_defs[PropId::OfxImageEffectPropOpenGLTextureIndex], true, false, false }, + { "OfxImageEffectPropOpenGLTextureTarget", prop_defs[PropId::OfxImageEffectPropOpenGLTextureTarget], true, false, false }, + { "OfxImageEffectPropPixelDepth", prop_defs[PropId::OfxImageEffectPropPixelDepth], true, false, false }, + { "OfxImageEffectPropComponents", prop_defs[PropId::OfxImageEffectPropComponents], true, false, false }, + { "OfxImageEffectPropPreMultiplication", prop_defs[PropId::OfxImageEffectPropPreMultiplication], true, false, false }, + { "OfxImageEffectPropRenderScale", prop_defs[PropId::OfxImageEffectPropRenderScale], true, false, false }, + { "OfxImagePropPixelAspectRatio", prop_defs[PropId::OfxImagePropPixelAspectRatio], true, false, false }, + { "OfxImagePropBounds", prop_defs[PropId::OfxImagePropBounds], true, false, false }, + { "OfxImagePropRegionOfDefinition", prop_defs[PropId::OfxImagePropRegionOfDefinition], true, false, false }, + { "OfxImagePropRowBytes", prop_defs[PropId::OfxImagePropRowBytes], true, false, false }, + { "OfxImagePropField", prop_defs[PropId::OfxImagePropField], true, false, false }, + { "OfxImagePropUniqueIdentifier", prop_defs[PropId::OfxImagePropUniqueIdentifier], true, false, false } } }, // ParameterSet { "ParameterSet", { { "OfxPropParamSetNeedsSyncing", prop_defs[PropId::OfxPropParamSetNeedsSyncing], false, true, false }, From 3d0fc61091539f82cff0fb617bafc82c0e8382bf Mon Sep 17 00:00:00 2001 From: umajho Date: Thu, 24 Sep 2026 01:34:17 +0800 Subject: [PATCH 2/2] docs: add notes on the two OpenGL texture properties about the texture handle Signed-off-by: umajho --- include/ofxGPURender.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/ofxGPURender.h b/include/ofxGPURender.h index 68e1b824..dcd24053 100644 --- a/include/ofxGPURender.h +++ b/include/ofxGPURender.h @@ -134,6 +134,10 @@ performing OpenGL texture operations. - ::kOfxImageEffectActionBeginSequenceRender - ::kOfxImageEffectActionEndSequenceRender + This property also lives on the texture handle returned by + \ref OfxImageEffectOpenGLRenderSuiteV1::clipLoadTexture via the + \c textureHandle argument. + @propdef type: int dimension: 1 @@ -152,6 +156,10 @@ when performing OpenGL texture operations. - ::kOfxImageEffectActionBeginSequenceRender - ::kOfxImageEffectActionEndSequenceRender + This property also lives on the texture handle returned by + \ref OfxImageEffectOpenGLRenderSuiteV1::clipLoadTexture via the + \c textureHandle argument. + @propdef type: int dimension: 1