OFX suite that provides image to texture conversion for OpenGL processing.
clipLoadTexture)(OfxImageClipHandle clip, OfxTime time, const char *format, const OfxRectD *region, OfxPropertySetHandle *textureHandle)¶
loads an image from an OFX clip as a texture into OpenGL
- clip - the clip to load the image from
- time - effect time to load the image from
- 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.
- region - region of the image to load (optional, set to NULL to get a ‘default’ region) this is in the CanonicalCoordinates.
- textureHandle - a property set containing information about the texture
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.
- clip was returned by clipGetHandle
- Format property in the texture handle
- 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.
- 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.
- this is the OpenGL equivalent of clipGetImage from OfxImageEffectSuiteV1
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).
- textureHandle was returned by clipGetImage
- all operations on textureHandle will be invalid, and the OpenGL texture it referred to has been deleted (for source clips)
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.
- OfxStatus (*