Instance Method

startTask(toRender:from:to:at:)

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

Declaration

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

Parameters

image

CIImage to prepare to render.

fromRect

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

destination

The CIRenderDestination to which to render.

atPoint

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

error

Pointer to an error should the render task creation fail.

Return Value

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

Discussion

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.

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