File ofxDrawSuite.h
API for host- and GPU API-independent drawing.
- Version
Added in OpenFX 1.5
Defines
-
kOfxDrawSuite
the string that names the DrawSuite, passed to OfxHost::fetchSuite
-
kOfxInteractPropDrawContext
The Draw Context handle.
Typedefs
-
typedef struct OfxDrawContext *OfxDrawContextHandle
Blind declaration of an OFX drawing context.
-
typedef enum OfxStandardColour OfxStandardColour
Defines valid values for OfxDrawSuiteV1::getColour.
-
typedef enum OfxDrawLineStipplePattern OfxDrawLineStipplePattern
Defines valid values for OfxDrawSuiteV1::setLineStipple.
-
typedef enum OfxDrawPrimitive OfxDrawPrimitive
Defines valid values for OfxDrawSuiteV1::draw.
-
typedef enum OfxDrawTextAlignment OfxDrawTextAlignment
Defines text alignment values for OfxDrawSuiteV1::drawText.
-
typedef struct OfxDrawSuiteV1 OfxDrawSuiteV1
OFX suite that allows an effect to draw to a host-defined display context. To use this, the plugin must use kOfxImageEffectPluginPropOverlayInteractV2.
Enums
-
enum OfxStandardColour
Defines valid values for OfxDrawSuiteV1::getColour.
Values:
-
enumerator kOfxStandardColourOverlayBackground
-
enumerator kOfxStandardColourOverlayActive
-
enumerator kOfxStandardColourOverlaySelected
-
enumerator kOfxStandardColourOverlayDeselected
-
enumerator kOfxStandardColourOverlayMarqueeFG
-
enumerator kOfxStandardColourOverlayMarqueeBG
-
enumerator kOfxStandardColourOverlayText
-
enumerator kOfxStandardColourOverlayBackground
-
enum OfxDrawLineStipplePattern
Defines valid values for OfxDrawSuiteV1::setLineStipple.
Values:
-
enumerator kOfxDrawLineStipplePatternSolid
-
enumerator kOfxDrawLineStipplePatternDot
-
enumerator kOfxDrawLineStipplePatternDash
-
enumerator kOfxDrawLineStipplePatternAltDash
-
enumerator kOfxDrawLineStipplePatternDotDash
-
enumerator kOfxDrawLineStipplePatternSolid
-
enum OfxDrawPrimitive
Defines valid values for OfxDrawSuiteV1::draw.
Values:
-
enumerator kOfxDrawPrimitiveLines
-
enumerator kOfxDrawPrimitiveLineStrip
-
enumerator kOfxDrawPrimitiveLineLoop
-
enumerator kOfxDrawPrimitiveRectangle
-
enumerator kOfxDrawPrimitivePolygon
-
enumerator kOfxDrawPrimitiveEllipse
-
enumerator kOfxDrawPrimitiveLines
-
enum OfxDrawTextAlignment
Defines text alignment values for OfxDrawSuiteV1::drawText.
Values:
-
enumerator kOfxDrawTextAlignmentLeft
-
enumerator kOfxDrawTextAlignmentRight
-
enumerator kOfxDrawTextAlignmentTop
-
enumerator kOfxDrawTextAlignmentBottom
-
enumerator kOfxDrawTextAlignmentBaseline
-
enumerator kOfxDrawTextAlignmentCenterH
-
enumerator kOfxDrawTextAlignmentCenterV
-
enumerator kOfxDrawTextAlignmentLeft
-
struct OfxDrawSuiteV1
- #include <ofxDrawSuite.h>
OFX suite that allows an effect to draw to a host-defined display context. To use this, the plugin must use kOfxImageEffectPluginPropOverlayInteractV2.
Public Members
-
OfxStatus (*getColour)(OfxDrawContextHandle context, OfxStandardColour std_colour, OfxRGBAColourF *colour)
Retrieves the host’s desired draw colour for.
contextdraw contextstd_colourdesired colour typecolourreturned RGBA colour
- Return:
kOfxStatOK - the colour was returned
kOfxStatErrValue - std_colour was invalid
kOfxStatFailed - failure, e.g. if function is called outside kOfxInteractActionDraw
-
OfxStatus (*setColour)(OfxDrawContextHandle context, const OfxRGBAColourF *colour)
Sets the colour for future drawing operations (lines, filled shapes and text)
contextdraw contextcolourRGBA colour
- Return:
kOfxStatOK - the colour was changed
kOfxStatFailed - failure, e.g. if function is called outside kOfxInteractActionDraw
-
OfxStatus (*setLineWidth)(OfxDrawContextHandle context, float width)
Sets the line width for future line drawing operations.
contextdraw contextwidthline width
The host should adjust for screen density.
- Return:
kOfxStatOK - the width was changed
kOfxStatFailed - failure, e.g. if function is called outside kOfxInteractActionDraw
-
OfxStatus (*setLineStipple)(OfxDrawContextHandle context, OfxDrawLineStipplePattern pattern)
Sets the stipple pattern for future line drawing operations.
contextdraw contextpatterndesired stipple pattern
- Return:
kOfxStatOK - the pattern was changed
kOfxStatErrValue - pattern was not valid
kOfxStatFailed - failure, e.g. if function is called outside kOfxInteractActionDraw
-
OfxStatus (*draw)(OfxDrawContextHandle context, OfxDrawPrimitive primitive, const OfxPointD *points, int point_count)
Draws a primitive of the desired type.
contextdraw contextprimitivedesired primitivepointsarray of points in the primitivepoint_countnumber of points in the array
- Return:
kOfxStatOK - the draw was completed
kOfxStatErrValue - invalid primitive, or point_count not valid for primitive
kOfxStatFailed - failure, e.g. if function is called outside kOfxInteractActionDraw
-
OfxStatus (*drawText)(OfxDrawContextHandle context, const char *text, const OfxPointD *pos, int alignment)
Draws text at the specified position.
contextdraw contexttexttext to draw (UTF-8 encoded)posposition at which to align the textalignmenttext alignment flags (see kOfxDrawTextAlignment*)
- Return:
kOfxStatOK - the text was drawn
kOfxStatErrValue - text or pos were not defined
kOfxStatFailed - failure, e.g. if function is called outside kOfxInteractActionDraw
-
OfxStatus (*getColour)(OfxDrawContextHandle context, OfxStandardColour std_colour, OfxRGBAColourF *colour)