An evaluation context for rendering image processing results and performing image analysis.
SDKs
- iOS 5.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Core Image
Declaration
class CIContext : NSObject
Overview
The CIContext
class provides an evaluation context for Core Image processing with Quartz 2D, Metal, or OpenGL. You use CIContext
objects in conjunction with other Core Image classes, such as CIFilter
, CIImage
, and CIColor
, to process images using Core Image filters. You also use a Core Image context with the CIDetector
class to analyze images—for example, to detect faces or barcodes.
CIContext
and CIImage
objects are immutable, so multiple threads can use the same CIContext
object to render CIImage
objects. However, CIFilter
objects are mutable and thus cannot be shared safely among threads. Each thread must create its own CIFilter
objects, but you can pass a filter’s immutable input and output CIImage
objects between threads.