OfxDrawSuiteV1: Drawing Overlays

Added for OFX v1.5, Jan 2022.

See the source at ofxDrawSuite.h

struct OfxDrawSuiteV1

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 context

  • std_colour desired colour type

  • colour returned RGBA colour

Return:

OfxStatus (*setColour)(OfxDrawContextHandle context, const OfxRGBAColourF *colour)

Sets the colour for future drawing operations (lines, filled shapes and text)

  • context draw context

  • colour RGBA colour

The host should use “over” compositing when using a non-opaque 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 context

  • width line width

Use width 0 for a single pixel line or non-zero for a smooth line of the desired 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 context

  • pattern desired stipple pattern

Return:

OfxStatus (*draw)(OfxDrawContextHandle context, OfxDrawPrimitive primitive, const OfxPointD *points, int point_count)

Draws a primitive of the desired type.

  • context draw context

  • primitive desired primitive

  • points array of points in the primitive

  • point_count number of points in the array

kOfxDrawPrimitiveLines - like GL_LINES, n points draws n/2 separated lines kOfxDrawPrimitiveLineStrip - like GL_LINE_STRIP, n points draws n-1 connected lines kOfxDrawPrimitiveLineLoop - like GL_LINE_LOOP, n points draws n connected lines kOfxDrawPrimitiveRectangle - draws an axis-aligned filled rectangle defined by 2 opposite corner points kOfxDrawPrimitivePolygon - like GL_POLYGON, draws a filled n-sided polygon kOfxDrawPrimitiveEllipse - draws a axis-aligned elliptical line (not filled) within the rectangle defined by 2 opposite corner points

Return:

OfxStatus (*drawText)(OfxDrawContextHandle context, const char *text, const OfxPointD *pos, int alignment)

Draws text at the specified position.

  • context draw context

  • text text to draw (UTF-8 encoded)

  • pos position at which to align the text

  • alignment text alignment flags (see kOfxDrawTextAlignment*)

The text font face and size are determined by the host.

Return:

#defines

kOfxInteractPropDrawContext

The Draw Context handle.

  • Type - pointer X 1

  • Property Set - read only property on the inArgs of the following actions…

  • kOfxInteractActionDraw

Enums

enum OfxStandardColour

Defines valid values for OfxDrawSuiteV1::getColour.

Values:

enumerator kOfxStandardColourOverlayBackground
enumerator kOfxStandardColourOverlayActive
enumerator kOfxStandardColourOverlaySelected
enumerator kOfxStandardColourOverlayDeselected
enumerator kOfxStandardColourOverlayMarqueeFG
enumerator kOfxStandardColourOverlayMarqueeBG
enumerator kOfxStandardColourOverlayText
enum OfxDrawLineStipplePattern

Defines valid values for OfxDrawSuiteV1::setLineStipple.

Values:

enumerator kOfxDrawLineStipplePatternSolid
enumerator kOfxDrawLineStipplePatternDot
enumerator kOfxDrawLineStipplePatternDash
enumerator kOfxDrawLineStipplePatternAltDash
enumerator kOfxDrawLineStipplePatternDotDash
enum OfxDrawPrimitive

Defines valid values for OfxDrawSuiteV1::draw.

Values:

enumerator kOfxDrawPrimitiveLines
enumerator kOfxDrawPrimitiveLineStrip
enumerator kOfxDrawPrimitiveLineLoop
enumerator kOfxDrawPrimitiveRectangle
enumerator kOfxDrawPrimitivePolygon
enumerator kOfxDrawPrimitiveEllipse

Warning

doxygenenum: Cannot find enum “OfxDrawTextAligment” in doxygen xml output for project “ofx_reference” from directory: ../doxygen_build/xml/