OfxImageEffectOpenGLRenderSuiteV1::clipLoadTexture
— loads an image from an OFX clip as a texture into OpenGL
#include "ofxOpenGLRender.h"
OfxStatus
(*clipLoadTexture)
(
|
OfxImageClipHandle clip , |
OfxTime time , | |
const char * format , | |
const OfxRectD * region , | |
OfxPropertySetHandle *
textureHandle
)
;
|
kOfxOpenGLPropPixelDepth
setting.
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
m
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
m
at
m
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
m
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
\post
returns
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.
\note
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.