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.
Type - pointer X 1
Property Set - read only property on the inArgs of the following actions…
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.
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.
Public Members
-
OfxStatus (*getColour)(OfxDrawContextHandle context, OfxStandardColour std_colour, OfxRGBAColourF *colour)
Retrieves the host’s desired draw colour for.
context
draw contextstd_colour
desired colour typecolour
returned 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)
context
draw contextcolour
RGBA 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.
context
draw contextwidth
line 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.
context
draw contextpattern
desired 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.
context
draw contextprimitive
desired primitivepoints
array of points in the primitivepoint_count
number 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.
context
draw contexttext
text to draw (UTF-8 encoded)pos
position at which to align the textalignment
text 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)