Type Method


Method to override for determining specific region of input image required to process in rendering a specified region of the output image.


class func roi(forInput input: Int32, arguments: [String : Any]?, outputRect: CGRect) -> CGRect



Index of the input image.


Dictionary of arguments mapping keys such as "thresholdValue" to their values.


Rectangle defining the area of output that must be rendered.

Return Value

Rectangle defining the region of the input image over which the kernel should execute.


Override this method if your image processor needs to work with a larger or smaller region of interest in the input image than each corresponding region of the output image (for example, a blur filter, which samples several input pixels for each output pixel).

This will be called one or more times per render to determine the portion of the input images needed to render a given outputRect of the output. This will not be called if there are 0 input images.

The default implementation simply returns outputRect.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software