OfxParametricParameterSuiteV1
-
struct OfxParametricParameterSuiteV1
The OFX suite used to define and manipulate ‘parametric’ parameters.
This is an optional suite.
Parametric parameters are in effect ‘functions’ a plug-in can ask a host to arbitrarily evaluate for some value ‘x’. A classic use case would be for constructing look-up tables, a plug-in would ask the host to evaluate one at multiple values from 0 to 1 and use that to fill an array.
A host would probably represent this to a user as a cubic curve in a standard curve editor interface, or possibly through scripting. The user would then use this to define the ‘shape’ of the parameter.
The evaluation of such params is not the same as animation, they are returning values based on some arbitrary argument orthogonal to time, so to evaluate such a param, you need to pass a parametric position and time.
Often, you would want such a parametric parameter to be multi-dimensional, for example, a colour look-up table might want three values, one for red, green and blue. Rather than declare three separate parametric parameters, it would be better to have one such parameter with multiple values in it.
The major complication with these parameters is how to allow a plug-in to set values, and defaults. The default default value of a parametric curve is to be an identity lookup. If a plugin wishes to set a different default value for a curve, it can use the suite to set key/value pairs on the descriptor of the param. When a new instance is made, it will have these curve values as a default.
Public Members
-
OfxStatus (*parametricParamGetValue)(OfxParamHandle param, int curveIndex, OfxTime time, double parametricPosition, double *returnValue)
Evaluates a parametric parameter.
param
handle to the parametric parametercurveIndex
which dimension to evaluatetime
the time to evaluate to the parametric param atparametricPosition
the position to evaluate the parametric param atreturnValue
pointer to a double where a value is returned
- Return:
kOfxStatOK - all was fine
kOfxStatErrBadHandle - if the paramter handle was invalid
kOfxStatErrBadIndex - the curve index was invalid
-
OfxStatus (*parametricParamGetNControlPoints)(OfxParamHandle param, int curveIndex, double time, int *returnValue)
Returns the number of control points in the parametric param.
param
handle to the parametric parametercurveIndex
which dimension to checktime
the time to checkreturnValue
pointer to an integer where the value is returned.
- Return:
kOfxStatOK - all was fine
kOfxStatErrBadHandle - if the paramter handle was invalid
kOfxStatErrBadIndex - the curve index was invalid
-
OfxStatus (*parametricParamGetNthControlPoint)(OfxParamHandle param, int curveIndex, double time, int nthCtl, double *key, double *value)
Returns the key/value pair of the nth control point.
param
handle to the parametric parametercurveIndex
which dimension to checktime
the time to checknthCtl
the nth control point to get the value ofkey
pointer to a double where the key will be returnedvalue
pointer to a double where the value will be returned
- Return:
kOfxStatOK - all was fine
kOfxStatErrBadHandle - if the paramter handle was invalid
kOfxStatErrUnknown - if the type is unknown
-
OfxStatus (*parametricParamSetNthControlPoint)(OfxParamHandle param, int curveIndex, double time, int nthCtl, double key, double value, bool addAnimationKey)
Modifies an existing control point on a curve.
param
handle to the parametric parametercurveIndex
which dimension to settime
the time to set the value atnthCtl
the control point to modifykey
key of the control pointvalue
value of the control pointaddAnimationKey
if the param is an animatable, setting this to true will force an animation keyframe to be set as well as a curve key, otherwise if false, a key will only be added if the curve is already animating.
- Return:
kOfxStatOK - all was fine
kOfxStatErrBadHandle - if the paramter handle was invalid
kOfxStatErrUnknown - if the type is unknown
-
OfxStatus (*parametricParamAddControlPoint)(OfxParamHandle param, int curveIndex, double time, double key, double value, bool addAnimationKey)
Adds a control point to the curve.
param
handle to the parametric parametercurveIndex
which dimension to settime
the time to set the value atkey
key of the control pointvalue
value of the control pointaddAnimationKey
if the param is an animatable, setting this to true will force an animation keyframe to be set as well as a curve key, otherwise if false, a key will only be added if the curve is already animating.
- Return:
kOfxStatOK - all was fine
kOfxStatErrBadHandle - if the paramter handle was invalid
kOfxStatErrUnknown - if the type is unknown
-
OfxStatus (*parametricParamDeleteControlPoint)(OfxParamHandle param, int curveIndex, int nthCtl)
Deletes the nth control point from a parametric param.
param
handle to the parametric parametercurveIndex
which dimension to deletenthCtl
the control point to delete
-
OfxStatus (*parametricParamDeleteAllControlPoints)(OfxParamHandle param, int curveIndex)
Delete all curve control points on the given param.
param
handle to the parametric parametercurveIndex
which dimension to clear
-
OfxStatus (*parametricParamGetValue)(OfxParamHandle param, int curveIndex, OfxTime time, double parametricPosition, double *returnValue)