[][src]Struct ofx_sys::OfxImageEffectOpenGLRenderSuiteV1

#[repr(C)]
pub struct OfxImageEffectOpenGLRenderSuiteV1 { pub clipLoadTexture: Option<unsafe extern "C" fn(clip: OfxImageClipHandle, time: OfxTime, format: *const c_char, region: *const OfxRectD, textureHandle: *mut OfxPropertySetHandle) -> OfxStatus>, pub clipFreeTexture: Option<unsafe extern "C" fn(textureHandle: OfxPropertySetHandle) -> OfxStatus>, pub flushResources: Option<unsafe extern "C" fn() -> OfxStatus>, }

@brief OFX suite that provides image to texture conversion for OpenGL processing

Fields

clipLoadTexture: Option<unsafe extern "C" fn(clip: OfxImageClipHandle, time: OfxTime, format: *const c_char, region: *const OfxRectD, textureHandle: *mut OfxPropertySetHandle) -> OfxStatus>

@brief loads an image from an OFX clip as a texture into OpenGL

\arg clip - the clip to load the image from \arg time - effect time to load the image from \arg format - the requested texture format (As in none,byte,word,half,float, etc..) When set to NULL, the host decides the format based on the plug-in's ::kOfxOpenGLPropPixelDepth setting. \arg region - region of the image to load (optional, set to NULL to get a 'default' region) this is in the \ref CanonicalCoordinates. \arg textureHandle - a property set containing information about the texture

An image is fetched from a clip at the indicated time for the given region and loaded into an OpenGL texture. When a specific format is requested, the host ensures it gives the requested format. When the clip specified is the "Output" clip, the format is ignored and the host must bind the resulting texture as the current color buffer (render target). This may also be done prior to calling the ::kOfxImageEffectActionRender action. If the \em region parameter is set to non-NULL, then it will be clipped to the clip's Region of Definition for the given time. The returned image will be \em at \em least as big as this region. If the region parameter is not set or is NULL, then the region fetched will be at least the Region of Interest the effect has previously specified, clipped to the clip's Region of Definition. Information about the texture, including the texture index, is returned in the \em textureHandle argument. The properties on this handle will be...

  • ::kOfxImageEffectPropOpenGLTextureIndex
  • ::kOfxImageEffectPropOpenGLTextureTarget
  • ::kOfxImageEffectPropPixelDepth
  • ::kOfxImageEffectPropComponents
  • ::kOfxImageEffectPropPreMultiplication
  • ::kOfxImageEffectPropRenderScale
  • ::kOfxImagePropPixelAspectRatio
  • ::kOfxImagePropBounds
  • ::kOfxImagePropRegionOfDefinition
  • ::kOfxImagePropRowBytes
  • ::kOfxImagePropField
  • ::kOfxImagePropUniqueIdentifier

With the exception of the OpenGL specifics, these properties are the same as the properties in an image handle returned by clipGetImage in the image effect suite. \pre

  • clip was returned by clipGetHandle
  • Format property in the texture handle

\post

  • texture handle to be disposed of by clipFreeTexture before the action returns
  • when the clip specified is the "Output" clip, the format is ignored and the host must bind the resulting texture as the current color buffer (render target). This may also be done prior to calling the render action.

@returns

  • ::kOfxStatOK - the image was successfully fetched and returned in the handle,
  • ::kOfxStatFailed - the image could not be fetched because it does not exist in the clip at the indicated time and/or region, the plugin should continue operation, but assume the image was black and transparent.
  • ::kOfxStatErrBadHandle - the clip handle was invalid,
  • ::kOfxStatErrMemory - not enough OpenGL memory was available for the effect to load the texture. The plugin should abort the GL render and return ::kOfxStatErrMemory, after which the host can decide to retry the operation with CPU based processing.

\note

  • this is the OpenGL equivalent of clipGetImage from OfxImageEffectSuiteV1
clipFreeTexture: Option<unsafe extern "C" fn(textureHandle: OfxPropertySetHandle) -> OfxStatus>

@brief Releases the texture handle previously returned by clipLoadTexture

For input clips, this also deletes the texture from OpenGL. This should also be called on the output clip; for the Output clip, it just releases the handle but does not delete the texture (since the host will need to read it).

\pre

  • textureHandle was returned by clipGetImage

\post

  • all operations on textureHandle will be invalid, and the OpenGL texture it referred to has been deleted (for source clips)

@returns

  • ::kOfxStatOK - the image was successfully fetched and returned in the handle,
  • ::kOfxStatFailed - general failure for some reason,
  • ::kOfxStatErrBadHandle - the image handle was invalid,
flushResources: Option<unsafe extern "C" fn() -> OfxStatus>

@brief Request the host to minimize its GPU resource load

When a plugin fails to allocate GPU resources, it can call this function to request the host to flush it's GPU resources if it holds any. After the function the plugin can try again to allocate resources which then might succeed if the host actually has released anything.

\pre \post

  • No changes to the plugin GL state should have been made.

@returns

  • ::kOfxStatOK - the host has actually released some resources,
  • ::kOfxStatReplyDefault - nothing the host could do..

Trait Implementations

impl Clone for OfxImageEffectOpenGLRenderSuiteV1[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for OfxImageEffectOpenGLRenderSuiteV1[src]

impl Debug for OfxImageEffectOpenGLRenderSuiteV1[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]