Type Method

contextWithCGContext:options:

Creates a Core Image context from a Quartz context, using the specified options.

Declaration

+ (CIContext *)contextWithCGContext:(CGContextRef)cgctx options:(NSDictionary<CIContextOption, id> *)options;

Parameters

ctx

A Quartz graphics context (CGContextRef object) either obtained from the system or created using a Quartz function such as CGBitmapContextCreate. See Quartz 2D Programming Guide for information on creating Quartz graphics contexts.

dict

A dictionary that contains color space information. You can pass any of the keys defined in Context Options along with the appropriate value.

Discussion

After calling this method, Core Image draws content to the specified Quartz graphics context.

When you create a CIContext object using a Quartz graphics context, any transformations that are already set on the Quartz graphics context affect drawing to that context.