Type Alias

CGFunctionEvaluateCallback

Performs custom operations on the supplied input data to produce output data.

Declaration

typealias CGFunctionEvaluateCallback = (UnsafeMutableRawPointer?, UnsafePointer<CGFloat>, UnsafeMutablePointer<CGFloat>) -> Void

Parameters

info
inData

An array of floats. The size of the array is that specified by the domainDimension parameter 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 rangeDimension parameter passed to the init(info:domainDimension:domain:rangeDimension:range:callbacks:) function.

Discussion

The callback you write is responsible for implementing the calculation of output values from the supplied input values. For example, if you want to implement a simple "squaring" function of one input argument to one output argument, your evaluation function might be:

void evaluateSquare(void *info, const float *inData, float *outData)
{
    outData[0] = inData[0] * inData[0];
}

See Also

Creating Function Objects

struct CGFunctionCallbacks

A structure that contains callbacks needed by a CGFunctionRef object.

typealias CGFunctionReleaseInfoCallback

Performs custom clean-up tasks when Core Graphics deallocates a CGFunctionRef object.