estimateRender(_:from:to:at:)
Returns a task with estimated resource statistics for a render, without executing the render.
Declaration
func estimateRender(_ image: CIImage, from fromRect: CGRect, to destination: CIRenderDestination, at atPoint: CGPoint) throws -> CIRenderTaskParameters
- image:
The Ciimage to estimate the render for.
- fromRect:
The region of Ciimage to render.
- destination:
The Cirenderdestination to estimate the render to.
- atPoint:
The point in the destination where the origin of
fromRectis placed.
Return Value
A CIRenderTask you can query for estimated statistics, or nil if fromRect doesn’t intersect image.extent or if estimation fails.
Discussion
Call this method to analyze the cost of a render before you execute it. Query the returned task’s plannedPixelsProcessed, plannedPixelsOverdrawn, plannedPassCount, and plannedPeakMemory properties to get the estimated statistics.
The method renders as if the image is cropped to fromRect and places the origin of fromRect at atPoint in the destination.