#include "ofxsSupportPrivate.h"
#include <stdarg.h>
#ifdef OFX_SUPPORTS_OPENGLRENDER
#include "ofxOpenGLRender.h"
#endif
#define NULLPTR ((void *)(0))
#ifndef DEBUG
#define kOfxsDisableValidation
#endif
namespace OFX {
namespace Validation {
#ifndef kOfxsDisableValidation
static void
setVectorFromVarArgs(OFX::PropertyTypeEnum ilk,
int dimension,
va_list &argp,
std::vector<ValueHolder> &vec)
{
char *vS;
int vI;
double vD;
void *vP;
for(int i = 0; i < dimension; i++) {
switch (ilk)
{
case eString :
vS = va_arg(argp, char *);
vec.push_back(vS);
break;
case eInt :
vI = va_arg(argp, int);
vec.push_back(vI);
break;
case ePointer :
vP = va_arg(argp, void *);
vec.push_back(vP);
break;
case eDouble :
vD = va_arg(argp, double);
vec.push_back(vD);
break;
}
}
}
PropertyDescription::PropertyDescription(const char *name, OFX::PropertyTypeEnum ilk, int dimension, ...)
: _name(name)
, _exists(false) , _dimension(dimension)
, _ilk(ilk)
{
va_list argp;
va_start(argp, dimension);
bool going = true;
while(going) {
DescriptionTag tag = DescriptionTag(va_arg(argp, int));
switch (tag)
{
case eDescDefault : setVectorFromVarArgs(ilk, dimension, argp, _defaultValue);
break;
case eDescFinished : default :
going = false;
break;
}
}
va_end(argp);
}
void
PropertyDescription::validate(bool checkDefaults,
PropertySet &propSet)
{
try {
int hostDimension = propSet.propGetDimension(_name.c_str());
_exists = true;
if(_dimension != -1) OFX::Log::error(hostDimension != _dimension, "Host reports property '%s' has dimension %d, it should be %d;", _name.c_str(), hostDimension, _dimension);
if(hostDimension > 0) {
switch(_ilk)
{
case OFX::ePointer : { void *vP = propSet.propGetPointer(_name.c_str()); (void)vP; }break;
case OFX::eInt : { int vI = propSet.propGetInt(_name.c_str()); (void)vI; } break;
case OFX::eString : { std::string vS = propSet.propGetString(_name.c_str()); (void)vS; } break;
case OFX::eDouble : { double vD = propSet.propGetDouble(_name.c_str()); (void)vD; } break;
}
}
int nDefs = (int)_defaultValue.size();
if(checkDefaults && nDefs > 0) {
OFX::Log::error(hostDimension != nDefs, "Host reports default dimension of '%s' as %d, which is different to the default dimension size of %d;",
_name.c_str(), hostDimension, nDefs);
int N = hostDimension < nDefs ? hostDimension : nDefs;
for(int i = 0; i < N; i++) {
switch(_ilk)
{
case OFX::ePointer : {
void *vP = propSet.propGetPointer(_name.c_str(), i);
OFX::Log::error(vP != (void *) _defaultValue[i], "Default value of %s[%d] = %p, it should be %p;",
_name.c_str(), i, vP, (void *) _defaultValue[i]);
}
break;
case OFX::eInt : {
int vI = propSet.propGetInt(_name.c_str(), i);
OFX::Log::error(vI != (int) _defaultValue[i], "Default value of %s[%d] = %d, it should be %d;",
_name.c_str(), i, vI, (int) _defaultValue[i]);
}
break;
case OFX::eString : {
std::string vS = propSet.propGetString(_name.c_str(), i);
OFX::Log::error(vS != _defaultValue[i].vString, "Default value of %s[%d] = '%s', it should be '%s';",
_name.c_str(), i, vS.c_str(), _defaultValue[i].vString.c_str());
}
break;
case OFX::eDouble : {
double vD = propSet.propGetDouble(_name.c_str(), i);
OFX::Log::error(vD != (double) _defaultValue[i], "Default value of %s[%d] = %g, it should be %g;",
_name.c_str(), i, vD, (double) _defaultValue[i]);
}
break;
}
}
}
}
catch (OFX::Exception::Suite &e)
{
_exists = false;
}
catch (OFX::Exception::PropertyUnknownToHost &e)
{
_exists = false;
}
catch (OFX::Exception::PropertyValueIllegalToHost &e)
{
_exists = false;
}
}
#define mPropDescriptionArg(descs) descs, sizeof(descs)/sizeof(PropertyDescription)
PropertySetDescription::PropertySetDescription(const char *setName, ...) : _setName(setName)
{
va_list argp;
va_start(argp, setName);
while(1) {
PropertyDescription *descs = (PropertyDescription *) va_arg(argp, PropertyDescription *);
if(!descs) break;
int nDescs = (int) va_arg(argp, int);
for(int i = 0; i < nDescs; i++) {
_descriptions.push_back(descs + i);
}
}
va_end(argp);
}
PropertySetDescription::~PropertySetDescription()
{
int nToDelete = (int)_deleteThese.size();
for(int i = 0; i < nToDelete; i++) {
delete _deleteThese[i];
}
}
void
PropertySetDescription::addProperty(PropertyDescription *desc,
bool deleteOnDestruction)
{
_descriptions.push_back(desc);
if(deleteOnDestruction)
_deleteThese.push_back(desc);
}
void
PropertySetDescription::validate(PropertySet &propSet,
bool checkDefaults,
bool logOrdinaryMessages)
{
OFX::Log::print("START validating properties of %s.", _setName.c_str());
OFX::Log::indent();
if(!logOrdinaryMessages) PropertySet::propDisableLogging();
int n = (int)_descriptions.size();
for(int i = 0; i < n; i++)
_descriptions[i]->validate(checkDefaults, propSet);
if(!logOrdinaryMessages) PropertySet::propEnableLogging();
OFX::Log::outdent();
OFX::Log::print("STOP property validation of %s.", _setName.c_str());
}
static PropertyDescription gHostProps[ ] =
{
PropertyDescription(kOfxPropType, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropName, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectHostPropIsBackground, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsOverlays, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsMultiResolution, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsTiles, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropTemporalClipAccess, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsMultipleClipDepths, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsMultipleClipPARs, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSetableFrameRate, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSetableFielding, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamHostPropSupportsStringAnimation, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamHostPropSupportsCustomInteract, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamHostPropSupportsChoiceAnimation, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamHostPropSupportsBooleanAnimation, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamHostPropSupportsCustomAnimation, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamHostPropMaxParameters, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamHostPropMaxPages, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportedComponents, OFX::eString, -1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportedContexts, OFX::eString, -1, eDescFinished),
PropertyDescription(kOfxParamHostPropPageRowColumnCount, OFX::eInt, 2, eDescFinished),
};
static PropertySetDescription gHostPropSet("Host Property",
gHostProps, sizeof(gHostProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gPluginDescriptorProps[ ] =
{
PropertyDescription(kOfxPropLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropShortLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropLongLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPluginPropGrouping, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPluginPropFilePath, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropType, OFX::eString, 1, eDescDefault, kOfxTypeImageEffect, eDescFinished),
PropertyDescription(kOfxImageEffectPluginRenderThreadSafety, OFX::eString, 1, eDescDefault, kOfxImageEffectRenderFullySafe, eDescFinished),
PropertyDescription(kOfxImageEffectPluginPropSingleInstance, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageEffectPluginPropHostFrameThreading, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsMultiResolution, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsTiles, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropTemporalClipAccess, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageEffectPluginPropFieldRenderTwiceAlways, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsMultipleClipDepths, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsMultipleClipPARs, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageEffectPluginPropOverlayInteractV1, OFX::ePointer, 1, eDescDefault, (void *)(0), eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportedContexts, OFX::eString, -1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportedPixelDepths, OFX::eString, -1, eDescFinished),
PropertyDescription(kOfxImageEffectPropClipPreferencesSlaveParam, OFX::eString, -1, eDescFinished),
};
static PropertySetDescription gPluginDescriptorPropSet("Plugin Descriptor",
gPluginDescriptorProps, sizeof(gPluginDescriptorProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gPluginInstanceProps[ ] =
{
PropertyDescription(kOfxPropType, OFX::eString, 1, eDescDefault, kOfxTypeImageEffectInstance, eDescFinished),
PropertyDescription(kOfxImageEffectInstancePropSequentialRender, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxPropInstanceData, OFX::ePointer, 1, eDescDefault, (void *)(0), eDescFinished),
PropertyDescription(kOfxImageEffectPropPluginHandle, OFX::ePointer, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropContext, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropIsInteractive, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropProjectSize, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropProjectExtent, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropProjectOffset, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropProjectPixelAspectRatio, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectInstancePropEffectDuration, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropFrameRate, OFX::eDouble, 1, eDescFinished),
};
static PropertySetDescription gPluginInstancePropSet("Plugin Instance",
gPluginInstanceProps, sizeof(gPluginInstanceProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gClipDescriptorProps[ ] =
{
PropertyDescription(kOfxPropType, OFX::eString, 1, eDescDefault, kOfxTypeClip, eDescFinished),
PropertyDescription(kOfxImageClipPropFieldExtraction, OFX::eString, 1, eDescDefault, kOfxImageFieldDoubled, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportedComponents, OFX::eString,-1, eDescFinished),
PropertyDescription(kOfxPropName, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropShortLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropLongLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropTemporalClipAccess, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageClipPropOptional, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageClipPropIsMask, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsTiles, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
};
static PropertySetDescription gClipDescriptorPropSet("Clip Descriptor",
gClipDescriptorProps, sizeof(gClipDescriptorProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gClipInstanceProps[ ] =
{
PropertyDescription(kOfxPropType, OFX::eString, 1, eDescDefault, kOfxTypeClip, eDescFinished),
PropertyDescription(kOfxPropName, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropShortLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropLongLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportedComponents, OFX::eString,-1, eDescFinished),
PropertyDescription(kOfxImageClipPropFieldExtraction, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropPixelDepth, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropComponents, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropUnmappedPixelDepth, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropUnmappedComponents, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropPreMultiplication, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropFieldOrder, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropTemporalClipAccess, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropOptional, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropIsMask, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropSupportsTiles, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropConnected, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropContinuousSamples, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImagePropPixelAspectRatio, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropFrameRate, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropFrameRange, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropUnmappedFrameRate, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropUnmappedFrameRange, OFX::eDouble, 2, eDescFinished),
};
static PropertySetDescription gClipInstancePropSet("Clip Instance", gClipInstanceProps, sizeof(gClipInstanceProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gImageBaseInstanceProps[ ] =
{
PropertyDescription(kOfxPropType, OFX::eString, 1, eDescDefault, kOfxTypeImage, eDescFinished),
PropertyDescription(kOfxImageEffectPropPixelDepth, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropComponents, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropPreMultiplication, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImagePropField, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImagePropUniqueIdentifier, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderScale, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImagePropPixelAspectRatio, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImagePropData, OFX::ePointer, 1, eDescFinished),
PropertyDescription(kOfxImagePropBounds, OFX::eInt, 4, eDescFinished),
PropertyDescription(kOfxImagePropRegionOfDefinition, OFX::eInt, 4, eDescFinished),
PropertyDescription(kOfxImagePropRowBytes, OFX::eInt, 1, eDescFinished),
};
static PropertySetDescription gImageBaseInstancePropSet("Image or Texture Instance",
gImageBaseInstanceProps, sizeof(gImageBaseInstanceProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gImageInstanceProps[ ] =
{
PropertyDescription(kOfxImagePropData, OFX::ePointer, 1, eDescFinished),
};
static PropertySetDescription gImageInstancePropSet("Image Instance",
gImageInstanceProps, sizeof(gImageInstanceProps)/sizeof(PropertyDescription),
NULLPTR);
#ifdef OFX_SUPPORTS_OPENGLRENDER
static PropertyDescription gTextureInstanceProps[ ] =
{
PropertyDescription(kOfxImageEffectPropOpenGLTextureIndex, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropOpenGLTextureTarget, OFX::eInt, 1, eDescFinished),
};
static PropertySetDescription gTextureInstancePropSet("Texture Instance",
gTextureInstanceProps, sizeof(gTextureInstanceProps)/sizeof(PropertyDescription),
NULLPTR);
#endif
static PropertyDescription gDescribeInContextActionInArgProps[ ] =
{
PropertyDescription(kOfxImageEffectPropContext, OFX::eString, 1, eDescFinished),
};
static PropertySetDescription gDescribeInContextActionInArgPropSet(kOfxImageEffectActionDescribeInContext " in argument",
gDescribeInContextActionInArgProps, sizeof(gDescribeInContextActionInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gRenderActionInArgProps[ ] =
{
PropertyDescription(kOfxPropTime, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderScale, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderWindow, OFX::eInt, 4, eDescFinished),
PropertyDescription(kOfxImageEffectPropFieldToRender, OFX::eString, 1, eDescFinished),
};
static PropertySetDescription gRenderActionInArgPropSet(kOfxImageEffectActionRender " in argument",
gRenderActionInArgProps, sizeof(gRenderActionInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gBeginSequenceRenderActionInArgProps[ ] =
{
PropertyDescription(kOfxImageEffectPropFrameRange, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropFrameStep, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderScale, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxPropIsInteractive, OFX::eInt, 1, eDescFinished),
};
static PropertySetDescription gBeginSequenceRenderActionInArgPropSet(kOfxImageEffectActionBeginSequenceRender " in argument",
gBeginSequenceRenderActionInArgProps, sizeof(gBeginSequenceRenderActionInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gEndSequenceRenderActionInArgProps[ ] =
{
PropertyDescription(kOfxImageEffectPropFrameRange, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropFrameStep, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderScale, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxPropIsInteractive, OFX::eInt, 1, eDescFinished),
};
static PropertySetDescription gEndSequenceRenderActionInArgPropSet(kOfxImageEffectActionEndSequenceRender " in argument",
gEndSequenceRenderActionInArgProps, sizeof(gEndSequenceRenderActionInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gIsIdentityActionInArgProps[ ] =
{
PropertyDescription(kOfxPropTime, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderScale, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderWindow, OFX::eInt, 4, eDescFinished),
PropertyDescription(kOfxImageEffectPropFieldToRender, OFX::eString, 1, eDescFinished),
};
static PropertySetDescription gIsIdentityActionInArgPropSet(kOfxImageEffectActionIsIdentity " in argument",
gIsIdentityActionInArgProps, sizeof(gIsIdentityActionInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gIsIdentityActionOutArgProps[ ] =
{
PropertyDescription(kOfxPropTime, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxPropName, OFX::eString, 1, eDescFinished),
};
static PropertySetDescription gIsIdentityActionOutArgPropSet(kOfxImageEffectActionIsIdentity " out argument",
gIsIdentityActionOutArgProps, sizeof(gIsIdentityActionOutArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gGetRegionOfDefinitionInArgProps[ ] =
{
PropertyDescription(kOfxPropTime, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderScale, OFX::eDouble, 2, eDescFinished),
};
static PropertySetDescription gGetRegionOfDefinitionInArgPropSet(kOfxImageEffectActionGetRegionOfDefinition " in argument",
gGetRegionOfDefinitionInArgProps, sizeof(gGetRegionOfDefinitionInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gGetRegionOfDefinitionOutArgProps[ ] =
{
PropertyDescription(kOfxImageEffectPropRegionOfDefinition, OFX::eDouble, 4, eDescFinished),
};
static PropertySetDescription gGetRegionOfDefinitionOutArgPropSet(kOfxImageEffectActionGetRegionOfDefinition " out argument",
gGetRegionOfDefinitionOutArgProps, sizeof(gGetRegionOfDefinitionOutArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gGetRegionOfInterestInArgProps[ ] =
{
PropertyDescription(kOfxPropTime, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderScale, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxImageEffectPropRegionOfInterest, OFX::eDouble, 4, eDescFinished),
};
static PropertySetDescription gGetRegionOfInterestInArgPropSet(kOfxImageEffectActionGetRegionsOfInterest "in argument",
gGetRegionOfInterestInArgProps, sizeof(gGetRegionOfInterestInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gGetTimeDomainOutArgProps[ ] =
{
PropertyDescription(kOfxImageEffectPropFrameRange, OFX::eDouble, 2, eDescFinished),
};
static PropertySetDescription gGetTimeDomainOutArgPropSet(kOfxImageEffectActionGetTimeDomain " out argument",
gGetTimeDomainOutArgProps, sizeof(gGetTimeDomainOutArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gGetFramesNeededInArgProps[ ] =
{
PropertyDescription(kOfxPropTime, OFX::eDouble, 1, eDescFinished),
};
static PropertySetDescription gGetFramesNeededInArgPropSet(kOfxImageEffectActionGetFramesNeeded " in argument",
gGetFramesNeededInArgProps, sizeof(gGetFramesNeededInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gGetClipPreferencesOutArgProps[ ] =
{
PropertyDescription(kOfxImageEffectPropFrameRate, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropFieldOrder, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxImageClipPropContinuousSamples, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageEffectFrameVarying, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxImageEffectPropPreMultiplication, OFX::eString, 1, eDescFinished),
};
static PropertySetDescription gGetClipPreferencesOutArgPropSet(kOfxImageEffectActionGetClipPreferences " out argument",
gGetClipPreferencesOutArgProps, sizeof(gGetClipPreferencesOutArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gInstanceChangedInArgProps[ ] =
{
PropertyDescription(kOfxPropType, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropName, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropChangeReason, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropTime, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxImageEffectPropRenderScale, OFX::eDouble, 2, eDescFinished),
};
static PropertySetDescription gInstanceChangedInArgPropSet(kOfxActionInstanceChanged " in argument",
gInstanceChangedInArgProps, sizeof(gInstanceChangedInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gBeginEndInstanceChangedInArgProps[ ] =
{
PropertyDescription(kOfxPropChangeReason, OFX::eString, 1, eDescFinished),
};
static PropertySetDescription gBeginInstanceChangedInArgPropSet(kOfxActionBeginInstanceChanged " in argument",
gBeginEndInstanceChangedInArgProps, sizeof(gBeginEndInstanceChangedInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertySetDescription gEndInstanceChangedInArgPropSet(kOfxActionEndInstanceChanged " in argument",
gBeginEndInstanceChangedInArgProps, sizeof(gBeginEndInstanceChangedInArgProps)/sizeof(PropertyDescription),
NULLPTR);
static PropertyDescription gBasicParamProps[ ] =
{
PropertyDescription(kOfxPropType, OFX::eString, 1, eDescDefault, kOfxTypeParameter, eDescFinished),
PropertyDescription(kOfxPropName, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropShortLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxPropLongLabel, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxParamPropType, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxParamPropSecret, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxParamPropHint, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxParamPropScriptName, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxParamPropParent, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxParamPropEnabled, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropDataPtr, OFX::ePointer,1, eDescDefault, (void *)(0), eDescFinished),
};
static PropertyDescription gInteractOverideParamProps[ ] =
{
PropertyDescription(kOfxParamPropInteractV1, OFX::ePointer,1, eDescDefault, (void *)(0), eDescFinished),
PropertyDescription(kOfxParamPropInteractSize, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxParamPropInteractSizeAspect, OFX::eDouble, 1, eDescDefault, 1.0, eDescFinished),
PropertyDescription(kOfxParamPropInteractMinimumSize, OFX::eDouble, 2, eDescDefault, 10, 10, eDescFinished),
PropertyDescription(kOfxParamPropInteractPreferedSize, OFX::eInt, 2, eDescDefault, 10, 10, eDescFinished),
};
static PropertyDescription gValueHolderParamProps[ ] =
{
PropertyDescription(kOfxParamPropIsAnimating, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropIsAutoKeying, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropPersistant, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropEvaluateOnChange, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
# ifdef kOfxParamPropPluginMayWrite
PropertyDescription(kOfxParamPropPluginMayWrite, OFX::eInt, 1, eDescDefault, 0, eDescFinished), # endif
PropertyDescription(kOfxParamPropCacheInvalidation, OFX::eString, 1, eDescDefault, kOfxParamInvalidateValueChange, eDescFinished),
PropertyDescription(kOfxParamPropCanUndo, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
};
static PropertyDescription gStringParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxParamPropStringMode, OFX::eString, 1, eDescDefault, kOfxParamStringIsSingleLine, eDescFinished),
PropertyDescription(kOfxParamPropStringFilePathExists, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
};
static PropertyDescription gCustomParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eString, 1, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxParamPropCustomInterpCallbackV1, OFX::ePointer, 1, eDescDefault, NULLPTR, eDescFinished),
};
static PropertyDescription gRGBColourParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eDouble, 3, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropMin, OFX::eDouble, 3, eDescDefault, 0., 0., 0., eDescFinished),
PropertyDescription(kOfxParamPropMax, OFX::eDouble, 3, eDescDefault, 1., 1., 1., eDescFinished),
PropertyDescription(kOfxParamPropDisplayMin, OFX::eDouble, 3, eDescDefault, 0., 0., 0., eDescFinished),
PropertyDescription(kOfxParamPropDisplayMax, OFX::eDouble, 3, eDescDefault, 1., 1., 1., eDescFinished),
PropertyDescription(kOfxParamPropDimensionLabel, OFX::eString, 3, eDescDefault, "r", "g", "b", eDescFinished),
};
static PropertyDescription gRGBAColourParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eDouble, 4, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropMin, OFX::eDouble, 4, eDescDefault, 0., 0., 0., 0., eDescFinished),
PropertyDescription(kOfxParamPropMax, OFX::eDouble, 4, eDescDefault, 1., 1., 1., 1., eDescFinished),
PropertyDescription(kOfxParamPropDisplayMin, OFX::eDouble, 4, eDescDefault, 0., 0., 0., 0., eDescFinished),
PropertyDescription(kOfxParamPropDisplayMax, OFX::eDouble, 4, eDescDefault, 1., 1., 1., 1., eDescFinished),
PropertyDescription(kOfxParamPropDimensionLabel, OFX::eString, 4, eDescDefault, "r", "g", "b", "a", eDescFinished),
};
static PropertyDescription gBooleanParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
};
static PropertyDescription gChoiceParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
PropertyDescription(kOfxParamPropChoiceOption, OFX::eString, -1, eDescFinished),
};
static PropertyDescription gInt1DParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropMin, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropMax, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMin, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMax, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
};
static PropertyDescription gInt2DParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eInt, 2, eDescFinished),
PropertyDescription(kOfxParamPropMin, OFX::eInt, 2, eDescFinished),
PropertyDescription(kOfxParamPropMax, OFX::eInt, 2, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMin, OFX::eInt, 2, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMax, OFX::eInt, 2, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropDimensionLabel, OFX::eString, 2, eDescDefault, "x", "y", eDescFinished),
};
static PropertyDescription gInt3DParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eInt, 3, eDescFinished),
PropertyDescription(kOfxParamPropMin, OFX::eInt, 3, eDescFinished),
PropertyDescription(kOfxParamPropMax, OFX::eInt, 3, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMin, OFX::eInt, 3, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMax, OFX::eInt, 3, eDescFinished),
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropDimensionLabel, OFX::eString, 3, eDescDefault, "x", "y", "z", eDescFinished),
};
static PropertyDescription gDoubleParamProps[ ] =
{
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropIncrement, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxParamPropDigits, OFX::eInt, 1, eDescFinished),
PropertyDescription(kOfxParamPropDoubleType, OFX::eString, 1, eDescDefault, kOfxParamDoubleTypePlain, eDescFinished),
};
static PropertyDescription gDouble1DParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxParamPropMin, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxParamPropMax, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMin, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMax, OFX::eDouble, 1, eDescFinished),
PropertyDescription(kOfxParamPropShowTimeMarker, OFX::eInt, 1, eDescDefault, 0, eDescFinished),
};
static PropertyDescription gDouble2DParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxParamPropMin, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxParamPropMax, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMin, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMax, OFX::eDouble, 2, eDescFinished),
PropertyDescription(kOfxParamPropDimensionLabel, OFX::eString, 2, eDescDefault, "x", "y", eDescFinished),
};
static PropertyDescription gDouble3DParamProps[ ] =
{
PropertyDescription(kOfxParamPropDefault, OFX::eDouble, 3, eDescFinished),
PropertyDescription(kOfxParamPropMin, OFX::eDouble, 3, eDescFinished),
PropertyDescription(kOfxParamPropMax, OFX::eDouble, 3, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMin, OFX::eDouble, 3, eDescFinished),
PropertyDescription(kOfxParamPropDisplayMax, OFX::eDouble, 3, eDescFinished),
PropertyDescription(kOfxParamPropDimensionLabel, OFX::eString, 3, eDescDefault, "x", "y", "z", eDescFinished),
};
static PropertyDescription gGroupParamProps[ ] =
{
PropertyDescription(kOfxParamPropGroupOpen, OFX::eInt, 1, eDescFinished),
};
static PropertyDescription gPageParamProps[ ] =
{
PropertyDescription(kOfxParamPropPageChild, OFX::eString, -1, eDescFinished),
};
static PropertyDescription gParametricParamProps[ ] =
{
PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropCanUndo, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropParametricDimension, OFX::eInt, 1, eDescDefault, 1, eDescFinished),
PropertyDescription(kOfxParamPropParametricUIColour, OFX::eDouble, -1, eDescFinished),
PropertyDescription(kOfxParamPropParametricInteractBackground, OFX::ePointer, 1, eDescDefault, (void*)(0), eDescFinished),
PropertyDescription(kOfxParamPropParametricRange, OFX::eDouble, 2, eDescDefault, 0.0, 1.0, eDescFinished),
};
static PropertySetDescription gInt1DParamPropSet("1D Integer parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gInt1DParamProps),
NULLPTR);
static PropertySetDescription gInt2DParamPropSet("2D Integer parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gInt2DParamProps),
NULLPTR);
static PropertySetDescription gInt3DParamPropSet("3D Integer parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gInt3DParamProps),
NULLPTR);
static PropertySetDescription gDouble1DParamPropSet("1D Double parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gDoubleParamProps),
mPropDescriptionArg(gDouble1DParamProps),
NULLPTR);
static PropertySetDescription gDouble2DParamPropSet("2D Double parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gDoubleParamProps),
mPropDescriptionArg(gDouble2DParamProps),
NULLPTR);
static PropertySetDescription gDouble3DParamPropSet("3D Double parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gDoubleParamProps),
mPropDescriptionArg(gDouble3DParamProps),
NULLPTR);
static PropertySetDescription gRGBParamPropSet("RGB Colour parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gRGBColourParamProps),
NULLPTR);
static PropertySetDescription gRGBAParamPropSet("RGB Colour parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gRGBAColourParamProps),
NULLPTR);
static PropertySetDescription gStringParamPropSet("String parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gStringParamProps),
NULLPTR);
static PropertySetDescription gCustomParamPropSet("Custom parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gCustomParamProps),
NULLPTR);
static PropertySetDescription gBooleanParamPropSet("Boolean parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gBooleanParamProps),
NULLPTR);
static PropertySetDescription gChoiceParamPropSet("Choice parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gChoiceParamProps),
NULLPTR);
static PropertySetDescription gPushButtonParamPropSet("PushButton parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
NULLPTR);
static PropertySetDescription gGroupParamPropSet("Group Parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gGroupParamProps),
NULLPTR);
static PropertySetDescription gPageParamPropSet("Page Parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gPageParamProps),
NULLPTR);
static PropertySetDescription gParametricParamPropSet("Parametric Parameter",
mPropDescriptionArg(gBasicParamProps),
mPropDescriptionArg(gInteractOverideParamProps),
mPropDescriptionArg(gValueHolderParamProps),
mPropDescriptionArg(gParametricParamProps),
NULLPTR);
#endif
void
validateHostProperties(OfxHost *host)
{
#ifdef kOfxsDisableValidation
(void)host;
#else
PropertySet props(host->host);
gHostPropSet.validate(props);
#endif
}
void
validatePluginDescriptorProperties(PropertySet props)
{
#ifdef kOfxsDisableValidation
(void)props;
#else
gPluginDescriptorPropSet.validate(props);
#endif
}
void
validatePluginInstanceProperties(PropertySet props)
{
#ifdef kOfxsDisableValidation
(void)props;
#else
gPluginInstancePropSet.validate(props);
#endif
}
void
validateClipDescriptorProperties(PropertySet props)
{
#ifdef kOfxsDisableValidation
(void)props;
#else
gClipDescriptorPropSet.validate(props);
#endif
}
void
validateClipInstanceProperties(PropertySet props)
{
#ifdef kOfxsDisableValidation
(void)props;
#else
gClipInstancePropSet.validate(props);
#endif
}
void
validateImageBaseProperties(PropertySet props)
{
#ifdef kOfxsDisableValidation
(void)props;
#else
gImageBaseInstancePropSet.validate(props);
#endif
}
void
validateImageProperties(PropertySet props)
{
#ifdef kOfxsDisableValidation
(void)props;
#else
gImageInstancePropSet.validate(props);
#endif
}
#ifdef OFX_SUPPORTS_OPENGLRENDER
void
validateTextureProperties(PropertySet props)
{
#ifdef kOfxsDisableValidation
(void)props;
#else
gTextureInstancePropSet.validate(props);
#endif
}
#endif
void
validateActionArgumentsProperties(const std::string &action, PropertySet inArgs, PropertySet outArgs)
{
#ifdef kOfxsDisableValidation
(void)action;
(void)inArgs;
(void)outArgs;
#else
if(action == kOfxActionInstanceChanged) {
gInstanceChangedInArgPropSet.validate(inArgs);
}
else if(action == kOfxActionBeginInstanceChanged) {
gBeginInstanceChangedInArgPropSet.validate(inArgs);
}
else if(action == kOfxActionEndInstanceChanged) {
gEndInstanceChangedInArgPropSet.validate(inArgs);
}
else if(action == kOfxImageEffectActionGetRegionOfDefinition) {
gGetRegionOfDefinitionInArgPropSet.validate(inArgs);
gGetRegionOfDefinitionOutArgPropSet.validate(outArgs);
}
else if(action == kOfxImageEffectActionGetRegionsOfInterest) {
gGetRegionOfInterestInArgPropSet.validate(inArgs);
}
else if(action == kOfxImageEffectActionGetTimeDomain) {
gGetTimeDomainOutArgPropSet.validate(outArgs);
}
else if(action == kOfxImageEffectActionGetFramesNeeded) {
gGetFramesNeededInArgPropSet.validate(inArgs);
}
else if(action == kOfxImageEffectActionGetClipPreferences) {
gGetClipPreferencesOutArgPropSet.validate(outArgs);
}
else if(action == kOfxImageEffectActionIsIdentity) {
gIsIdentityActionInArgPropSet.validate(inArgs);
gIsIdentityActionOutArgPropSet.validate(outArgs);
}
else if(action == kOfxImageEffectActionRender) {
gRenderActionInArgPropSet.validate(inArgs);
}
else if(action == kOfxImageEffectActionBeginSequenceRender) {
gBeginSequenceRenderActionInArgPropSet.validate(inArgs);
}
else if(action == kOfxImageEffectActionEndSequenceRender) {
gEndSequenceRenderActionInArgPropSet.validate(inArgs);
}
else if(action == kOfxImageEffectActionDescribeInContext) {
gDescribeInContextActionInArgPropSet.validate(inArgs);
}
#endif
}
void
validateParameterProperties(ParamTypeEnum paramType,
OFX::PropertySet paramProps,
bool checkDefaults)
{
#ifdef kOfxsDisableValidation
(void)paramType;
(void)paramProps;
(void)checkDefaults;
#else
switch(paramType)
{
case eStringParam :
gStringParamPropSet.validate(paramProps, checkDefaults);
break;
case eIntParam :
gInt1DParamPropSet.validate(paramProps, checkDefaults);
break;
case eInt2DParam :
gInt2DParamPropSet.validate(paramProps, checkDefaults);
break;
case eInt3DParam :
gInt3DParamPropSet.validate(paramProps, checkDefaults);
break;
case eDoubleParam :
gDouble1DParamPropSet.validate(paramProps, checkDefaults);
break;
case eDouble2DParam :
gDouble2DParamPropSet.validate(paramProps, checkDefaults);
break;
case eDouble3DParam :
gDouble3DParamPropSet.validate(paramProps, checkDefaults);
break;
case eRGBParam :
gRGBParamPropSet.validate(paramProps, checkDefaults);
break;
case eRGBAParam :
gRGBAParamPropSet.validate(paramProps, checkDefaults);
break;
case eBooleanParam :
gBooleanParamPropSet.validate(paramProps, checkDefaults);
break;
case eChoiceParam :
gChoiceParamPropSet.validate(paramProps, checkDefaults);
break;
case eCustomParam :
gCustomParamPropSet.validate(paramProps, checkDefaults);
break;
case eGroupParam :
gGroupParamPropSet.validate(paramProps, checkDefaults);
break;
case ePageParam :
gPageParamPropSet.validate(paramProps, checkDefaults);
break;
case ePushButtonParam :
gPushButtonParamPropSet.validate(paramProps, checkDefaults);
break;
case eParametricParam:
gParametricParamPropSet.validate(paramProps, checkDefaults);
break;
case eDummyParam:
break;
}
#endif
}
void
initialise(void)
{
#ifndef kOfxsDisableValidation
static bool beenInitialised = false;
if(!beenInitialised && getImageEffectHostDescription()) {
beenInitialised = true;
PropertyDescription *desc;
desc = new PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1,
eDescDefault, int(getImageEffectHostDescription()->supportsCustomAnimation),
eDescFinished);
gCustomParamPropSet.addProperty(desc, true);
desc = new PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1,
eDescDefault, int(getImageEffectHostDescription()->supportsStringAnimation),
eDescFinished);
gStringParamPropSet.addProperty(desc, true);
desc = new PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1,
eDescDefault, int(getImageEffectHostDescription()->supportsChoiceAnimation),
eDescFinished);
gChoiceParamPropSet.addProperty(desc, true);
desc = new PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1,
eDescDefault, int(getImageEffectHostDescription()->supportsBooleanAnimation),
eDescFinished);
gBooleanParamPropSet.addProperty(desc, true);
}
#endif
}
};
};