startTask(toRender:from:to:at:)
Renders a portion of an image to a point in the destination.
Declaration
func startTask(toRender image: CIImage, from fromRect: CGRect, to destination: CIRenderDestination, at atPoint: CGPoint) throws -> CIRenderTaskParameters
- image:
A Ciimage to render.
- fromRect:
The part of the image to render, as if cropped.
- destination:
A Cirenderdestination into which to render the image.
- atPoint:
An origin point in the destination at which to place the image.
Return Value
An asynchronous CIRenderTask to render the image to the specified destination.
Discussion
This method crops the image to the specified rectangle and renders the result at the indicated origin point. If the image’s extent property and fromRect argument values are infinite, this call renders the image’s (0, 0) point starting from the origin atPoint.
You must use an MTLTexture-backed CIContext to support an MTLTexture-backed CIRenderDestination. Similarly, you must use GLContext-backed CIContext to support a GLTexture-backed CIRenderDestination.
This call returns as soon as it enqueues all work required to render the image on the context’s device. In many situations, after issuing a render, you may need to wait for it to complete. In these cases, use the returned CIRenderTask as follows: