---
title: CGFunctionEvaluateCallback
framework: coregraphics
role: symbol
role_heading: Type Alias
path: coregraphics/cgfunctionevaluatecallback
---

# CGFunctionEvaluateCallback

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

## Declaration

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

## Parameters

- `info`: The info parameter passed to doc://com.apple.coregraphics/documentation/CoreGraphics/CGFunction/init(info:domainDimension:domain:rangeDimension:range:callbacks:).
- `inData`: An array of floats. The size of the array is that specified by the domainDimension parameter passed to the doc://com.apple.coregraphics/documentation/CoreGraphics/CGFunction/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 doc://com.apple.coregraphics/documentation/CoreGraphics/CGFunction/init(info:domainDimension:domain:rangeDimension:range:callbacks:) function.

## Discussion

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]; }

## See Also

### Callbacks

- [CGFunctionCallbacks](coregraphics/cgfunctioncallbacks.md)
- [CGFunctionReleaseInfoCallback](coregraphics/cgfunctionreleaseinfocallback.md)
