OfxDrawSuiteV1

Struct OfxDrawSuiteV1 

Source
#[repr(C)]
pub struct OfxDrawSuiteV1 { pub getColour: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, std_colour: OfxStandardColour, colour: *mut OfxRGBAColourF) -> OfxStatus>, pub setColour: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, colour: *const OfxRGBAColourF) -> OfxStatus>, pub setLineWidth: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, width: f32) -> OfxStatus>, pub setLineStipple: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, pattern: OfxDrawLineStipplePattern) -> OfxStatus>, pub draw: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, primitive: OfxDrawPrimitive, points: *const OfxPointD, point_count: c_int) -> OfxStatus>, pub drawText: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, text: *const c_char, pos: *const OfxPointD, alignment: c_int) -> OfxStatus>, }
Expand description

@brief OFX suite that allows an effect to draw to a host-defined display context.

Fields§

§getColour: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, std_colour: OfxStandardColour, colour: *mut OfxRGBAColourF) -> OfxStatus>

@brief Retrieves the host’s desired draw colour for

\arg context - the draw context \arg std_colour - the desired colour type \arg colour - the returned RGBA colour

@returns

  • ::kOfxStatOK - the colour was returned
§setColour: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, colour: *const OfxRGBAColourF) -> OfxStatus>

@brief Sets the current draw colour for future drawing operations

\arg context - the draw context \arg colour - the RGBA colour

@returns

  • ::kOfxStatOK - the colour was changed
§setLineWidth: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, width: f32) -> OfxStatus>

@brief Sets the current draw colour for future drawing operations

\arg context - the draw context \arg width - the line width - use 0 for a single pixel line or non-zero for a smooth line of the desired width

The host should adjust for screen density.

@returns

  • ::kOfxStatOK - the width was changed
§setLineStipple: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, pattern: OfxDrawLineStipplePattern) -> OfxStatus>

@brief Sets the current line stipple pattern

\arg context - the draw context \arg pattern - the desired stipple pattern

@returns

  • ::kOfxStatOK - the pattern was changed
§draw: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, primitive: OfxDrawPrimitive, points: *const OfxPointD, point_count: c_int) -> OfxStatus>

@brief Draws a primitive of the desired type

\arg context - the draw context \arg primitive - the desired primitive \arg points - the array of points in the primitive \arg point_count - the number of points in the array

The number of points required matches the equivalent OpenGL primitives. For an ellipse, point_count should be 2, and points should form the top-left and bottom-right of a rectangle to draw the ellipse inside

@returns

  • ::kOfxStatOK - the pattern was changed
  • ::kOfxStatErrValue - point_count was not valid
§drawText: Option<unsafe extern "C" fn(context: OfxDrawContextHandle, text: *const c_char, pos: *const OfxPointD, alignment: c_int) -> OfxStatus>

@brief Draws text at the specified position in the current font size

\arg context - the draw context \arg text - the text to draw (UTF-8 encoded) \arg pos - the position of the lower-left corner of the text baseline \arg alignment - the text alignment flags (see kOfxDrawTextAlignment*)

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

@returns

  • ::kOfxStatOK - the text was drawn
  • ::kOfxStatErrValue - text or pos were not defined

Trait Implementations§

Source§

impl Clone for OfxDrawSuiteV1

Source§

fn clone(&self) -> OfxDrawSuiteV1

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OfxDrawSuiteV1

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for OfxDrawSuiteV1

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.