Instance Method

applyWithExtent:roiCallback:arguments:

Creates a new image using the kernel and specified arguments.

Declaration

- (CIImage *)applyWithExtent:(CGRect)extent roiCallback:(CIKernelROICallback)callback arguments:(NSArray<id> *)args;

Parameters

extent

The extent of the output image.

callback

A block or closure that computes the region of interest for a given rectangle of destination image pixels. See CIKernelROICallback.

args

An array of arguments to pass to the kernel routine. The type of each object in the array must be compatible with the corresponding parameter declared in the kernel routine source code. For details, see Core Image Kernel Language Reference.

Return Value

A new image object describing the result of applying the kernel.

Discussion

This method is analogous to the CIFilter method apply:arguments:options:, but it does not require construction of a CIFilter object, and it allows you to specify a callback for determining the kernel’s region of interest as a block or closure. As with the similar CIFilter method, calling this method does not execute the kernel code—filters and their kernel code are evaluated only when rendering a final output image.

When applying a filter kernel, the region of interest (ROI) is the area of source image pixels that must be processed to produce a given area of destination image pixels. For a more detailed definition, see The Region of Interest. Core Image calls your callback block or closure to determine the ROI when rendering the filter output. Core Image automatically splits large images into smaller tiles for rendering, so your callback may be called multiple times.

See Also

Applying a Kernel to Filter an Image

CIKernelROICallback

The signature for a block that computes the region of interest (ROI) for a given area of destination image pixels. Core Image calls this block when applying the kernel. You specify this block when using the applyWithExtent:roiCallback:arguments: method.

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