CGFunctionEvaluateCallback
Performs custom operations on the supplied input data to produce output data.
Declaration
typealias CGFunctionEvaluateCallback = (UnsafeMutableRawPointer?, UnsafePointer<CGFloat>, UnsafeMutablePointer<CGFloat>) -> VoidParameters
- info:
The
infoparameter passed to Init(info:domaindimension:domain:rangedimension:range:callbacks:). - inData:
An array of floats. The size of the array is that specified by the
domainDimensionparameter passed to the Init(info:domaindimension:domain:rangedimension:range:callbacks:) function. - outData:
An array of floats. The size of the array is that specified by the
rangeDimensionparameter passed to the Init(info:domaindimension:domain:rangedimension:range:callbacks:) function.
Discussion
The callback you write is responsible for implementing thecalculation of output values from the supplied input values. Forexample, if you want to implement a simple “squaring” functionof one input argument to one output argument, your evaluation functionmight be:
void evaluateSquare(void *info, const float *inData, float *outData)
{
outData[0] = inData[0] * inData[0];
}