Instance Method


Renders a portion of an image to a point of destination.


func startTask(toRender image: CIImage, from fromRect: CGRect, to destination: CIRenderDestination, at atPoint: CGPoint) throws -> CIRenderTask



CIImage to prepare to render.


The part of the image to render, as if cropped.


The CIRenderDestination to which to render.


The point in the destination where point (0, 0) of the input image is placed.


Pointer to an error should the render task creation fail.

Return Value

The asynchronous CIRenderTask to render the image to the specified destination.


This render task renders as if image is cropped to fromRect, placing the origin of the result at atPoint. If image.extent and fromRect are infinite, then this renders so that point (0, 0) of image is placed at atPoint.

An MTLTexture-backed CIRenderDestination must be supported by an MTLTexture-backed CIContext.

A GLTexture-backed CIRenderDestination must be supported by a GLContext-backed CIContext.

This call will return as soon as all the work for the render is enqueued on the context's device. In many situations, after issuing a render, you may need to wait for the render to complete. In this case, use the returned CIRenderTask as follows:

See Also

Customizing Render Destination

func prepareRender(CIImage, from: CGRect, to: CIRenderDestination, at: CGPoint)

An optional call to warm up a CIContext so that subsequent calls to render with the same arguments run more efficiently.

func startTask(toClear: CIRenderDestination) -> CIRenderTask

Fills the entire destination with black or clear depending on its alphaMode.

func startTask(toRender: CIImage, to: CIRenderDestination) -> CIRenderTask

Renders an image to a destination so that point (0, 0) of the image maps to point (0, 0) of the destination.