Instance Method

createCGLayer(with:info:)

Creates a CGLayer object from the provided parameters.

Declaration

func createCGLayer(with size: CGSize, info: CFDictionary?) -> CGLayer?

Parameters

size

The size, in default user space units, of the layer relative to the graphics context.

d

A dictionary, which is passed to CGLayerCreateWithContext as the auxiliaryInfo parameter. Pass NULL because this parameter is reserved for future use.

Return Value

A CGLayer object.

Discussion

After calling this method, Core Image draws content into the CGLayer object. Core Image creates a CGLayer object by calling the Quartz 2D function init(_:size:auxiliaryInfo:), whose prototype is:

CGLayerRef CGLayerCreateWithContext (
   CGContextRef context,
   CGSize size,
   CFDictionaryRef auxiliaryInfo
);

Core Image passes the CIContext object as the context parameter, the size as the size parameter, and the dictionary as the auxiliaryInfo parameter. For more information on CGLayer objects, see Quartz 2D Programming Guide and CGLayer.

See Also