Struct OfxImageEffectSuiteV1
-
struct OfxImageEffectSuiteV1
The OFX suite for image effects.
This suite provides the functions needed by a plugin to defined and use an image effect plugin.
Public Members
-
OfxStatus (*getPropertySet)(OfxImageEffectHandle imageEffect, OfxPropertySetHandle *propHandle)
Retrieves the property set for the given image effect.
imageEffect
image effect to get the property set forpropHandle
pointer to a the property set pointer, value is returned here
- Return:
kOfxStatOK - the property set was found and returned
kOfxStatErrBadHandle - if the paramter handle was invalid
kOfxStatErrUnknown - if the type is unknown
-
OfxStatus (*getParamSet)(OfxImageEffectHandle imageEffect, OfxParamSetHandle *paramSet)
Retrieves the parameter set for the given image effect.
imageEffect
image effect to get the property set forparamSet
pointer to a the parameter set, value is returned here
- Return:
kOfxStatOK - the property set was found and returned
kOfxStatErrBadHandle - if the paramter handle was invalid
kOfxStatErrUnknown - if the type is unknown
-
OfxStatus (*clipDefine)(OfxImageEffectHandle imageEffect, const char *name, OfxPropertySetHandle *propertySet)
Define a clip to the effect.
pluginHandle
handle passed into ‘describeInContext’ actionname
unique name of the clip to definepropertySet
property handle for the clip descriptor will be returned here
- Pre:
we are inside the describe in context action.
- Return:
-
OfxStatus (*clipGetHandle)(OfxImageEffectHandle imageEffect, const char *name, OfxImageClipHandle *clip, OfxPropertySetHandle *propertySet)
Get the propery handle of the named input clip in the given instance.
imageEffect
an instance handle to the pluginname
name of the clip, previously used in a clip define callclip
where to return the clippropertySet
if not NULL, the descriptor handle for a parameter’s property set will be placed here.
This return a clip handle for the given instance, note that this will \em not be the same as the clip handle returned by clipDefine and will be distanct to clip handles in any other instance of the plugin. Not a valid call in any of the describe actions.
- Pre:
create instance action called,
name passed to clipDefine for this context,
not inside describe or describe in context actions.
- Post:
handle will be valid for the life time of the instance.
-
OfxStatus (*clipGetPropertySet)(OfxImageClipHandle clip, OfxPropertySetHandle *propHandle)
Retrieves the property set for a given clip.
clip
clip effect to get the property set forpropHandle
pointer to a the property set handle, value is returedn her
- Return:
kOfxStatOK - the property set was found and returned
kOfxStatErrBadHandle - if the paramter handle was invalid
kOfxStatErrUnknown - if the type is unknown
-
OfxStatus (*clipGetImage)(OfxImageClipHandle clip, OfxTime time, const OfxRectD *region, OfxPropertySetHandle *imageHandle)
Get a handle for an image in a clip at the indicated time and indicated region.
clip
clip to extract the image fromtime
time to fetch the image atregion
region to fetch the image from (optional, set to NULL to get a ‘default’ region) this is in the CanonicalCoordinates.imageHandle
property set containing the image’s data
If the region parameter is not set to NULL, then it will be clipped to the clip’s Region of Definition for the given time. The returned image will be at least as big as this region. If the region parameter is not set, then the region fetched will be at least the Region of Interest the effect has previously specified, clipped the clip’s Region of Definition.
If clipGetImage is called twice with the same parameters, then two separate image handles will be returned, each of which must be release. The underlying implementation could share image data pointers and use reference counting to maintain them.
- Pre:
clip was returned by clipGetHandle
- Post:
image handle is only valid for the duration of the action clipGetImage is called in
image handle to be disposed of by clipReleaseImage before the action returns
- Return:
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 - the host had not enough memory to complete the operation, plugin should abort whatever it was doing.
-
OfxStatus (*clipReleaseImage)(OfxPropertySetHandle imageHandle)
Releases the image handle previously returned by clipGetImage.
- Pre:
imageHandle was returned by clipGetImage
- Post:
all operations on imageHandle will be invalid
- Return:
kOfxStatOK - the image was successfully fetched and returned in the handle,
kOfxStatErrBadHandle - the image handle was invalid,
-
OfxStatus (*clipGetRegionOfDefinition)(OfxImageClipHandle clip, OfxTime time, OfxRectD *bounds)
Returns the spatial region of definition of the clip at the given time.
clipHandle
clip to extract the image fromtime
time to fetch the image atregion
region to fetch the image from (optional, set to NULL to get a ‘default’ region) this is in the CanonicalCoordinates.imageHandle
handle where the image is returned
If the region parameter is not set to NULL, then it will be clipped to the clip’s Region of Definition for the given time. The returned image will be at least as big as this region. If the region parameter is not set, then the region fetched will be at least the Region of Interest the effect has previously specified, clipped the clip’s Region of Definition.
- Pre:
clipHandle was returned by clipGetHandle
- Post:
bounds will be filled the RoD of the clip at the indicated time
- Return:
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, the plugin should continue operation, but assume the image was black and transparent.
kOfxStatErrBadHandle - the clip handle was invalid,
kOfxStatErrMemory - the host had not enough memory to complete the operation, plugin should abort whatever it was doing.
-
int (*abort)(OfxImageEffectHandle imageEffect)
Returns whether to abort processing or not.
imageEffect
instance of the image effect
This function indicates whether a plugin should stop whatever processing it is doing.
- Return:
0 if the effect should continue whatever processing it is doing
1 if the effect should abort whatever processing it is doing
-
OfxStatus (*imageMemoryAlloc)(OfxImageEffectHandle instanceHandle, size_t nBytes, OfxImageMemoryHandle *memoryHandle)
Allocate memory from the host’s image memory pool.
instanceHandle
effect instance to associate with this memory allocation, may be NULL.nBytes
number of bytes to allocatememoryHandle
pointer to the memory handle where a return value is placed
See ImageEffectsMemoryAllocation.
- Return:
kOfxStatOK if all went well, a valid memory handle is placed in memoryHandle
kOfxStatErrBadHandle if instanceHandle is not valid, memoryHandle is set to NULL
kOfxStatErrMemory if there was not enough memory to satisfy the call, memoryHandle is set to NULL
-
OfxStatus (*imageMemoryFree)(OfxImageMemoryHandle memoryHandle)
Frees a memory handle and associated memory.
memoryHandle
memory handle returned by imageMemoryAlloc
If there are outstanding locks, these are ignored and the handle and memory are freed anyway.
See ImageEffectsMemoryAllocation.
- Return:
kOfxStatOK if the memory was cleanly deleted
kOfxStatErrBadHandle if the value of memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc
-
OfxStatus (*imageMemoryLock)(OfxImageMemoryHandle memoryHandle, void **returnedPtr)
Lock the memory associated with a memory handle and make it available for use.
memoryHandle
memory handle returned by imageMemoryAllocreturnedPtr
where to the pointer to the locked memory
Note that memory locks and unlocks nest.
After the first lock call, the contents of the memory pointer to by returnedPtr is undefined. All subsequent calls to lock will return memory with the same contents as the previous call.
Also, if unlocked, then relocked, the memory associated with a memory handle may be at a different address.
See also OfxImageEffectSuiteV1::imageMemoryUnlock and ImageEffectsMemoryAllocation.
- Return:
kOfxStatOK if the memory was locked, a pointer is placed in returnedPtr
kOfxStatErrBadHandle if the value of memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc, null is placed in *returnedPtr
kOfxStatErrMemory if there was not enough memory to satisfy the call, *returnedPtr is set to NULL
-
OfxStatus (*imageMemoryUnlock)(OfxImageMemoryHandle memoryHandle)
Unlock allocated image data.
allocatedData
pointer to memory previously returned by OfxImageEffectSuiteV1::imageAlloc
Note that locks and unlocks nest, and to fully unlock memory you need to match the count of locks placed upon it.
Also note, if you unlock a completely unlocked handle, it has no effect (ie: the lock count can’t be negative).
If unlocked, then relocked, the memory associated with a memory handle may be at a different address, however the contents will remain the same.
See also OfxImageEffectSuiteV1::imageMemoryLock and ImageEffectsMemoryAllocation.
- Return:
kOfxStatOK if the memory was unlocked cleanly,
kOfxStatErrBadHandle if the value of memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc, null is placed in *returnedPtr
-
OfxStatus (*getPropertySet)(OfxImageEffectHandle imageEffect, OfxPropertySetHandle *propHandle)