Next Page > Hide TOC

QCCompositionLayer Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/Quartz.framework/Frameworks/QuartzComposer.framework
Availability
Available in Mac OS X v10.5 and later.
Declared in
QCCompositionLayer.h
Companion guides
Related sample code

Overview

The QCCompositionLayer class loads, plays, and controls Quartz Composer compositions in a Core Animation layer hierarchy. The composition tracks the Core Animation layer time and is rendered directly at the current dimensions of the QCCompositionLayer object.

An archived QCCompositionLayer object saves the composition that’s loaded at the time the layer is archived. It detects layer usage and pauses or resumes the composition appropriately. A QCCompositionLayer object starts rendering the composition automatically when the layer is placed in a visible layer hierarchy. The layer stops rendering when it is hidden or removed from the visible layer hierarchy.

You can pass data to the input ports, or retrieve data from the output ports, of the root patch of a composition by accessing the patch attribute of the QCCompositionLayer instance using methods provided by the QCCompositionRenderer protocol.

Note: You must not modify the asynchronous property of the superclass CAOpenGLLayer.

Tasks

Creating the Layer

Getting the Composition

Class Methods

compositionLayerWithComposition:

Creates and returns an instance of a composition layer using the provided Quartz Composer composition.

+ (QCCompositionLayer*)compositionLayerWithComposition:(QCComposition*)composition

Parameters
composition

The Quartz Composer composition to use as content.

Return Value

An autoreleased, initialized QCCompositionLayer object or nil if initialization is not successful.

Availability
See Also
Declared In
QCCompositionLayer.h

compositionLayerWithFile:

Creates and returns an instance of a composition layer using the Quartz Composer composition in the specified file.

+ (QCCompositionLayer*)compositionLayerWithFile:(NSString*)path

Parameters
path

A string that specifies the location of a Quartz Composer composition.

Return Value

An autoreleased, initialized QCCompositionLayer object or nil if initialization is not successful.

Availability
See Also
Related Sample Code
Declared In
QCCompositionLayer.h

Instance Methods

composition

Returns the composition associated with the layer.

- (QCComposition*) composition

Return Value

The composition object associated with the layer or nil if there is none.

Availability
Declared In
QCCompositionLayer.h

initWithComposition:

Initializes and returns a composition layer using the provided Quartz Composer composition.

- (id)initWithComposition:(QCComposition*)composition

Parameters
composition

The Quartz Composer composition to use as content.

Return Value

The initialized QCCompositionLayer object or nil if initialization is not successful.

Availability
See Also
Declared In
QCCompositionLayer.h

initWithFile:

Initializes and returns a composition layer using the Quartz Composer composition in the specified file.

- (id)initWithFile:(NSString*)path

Parameters
path

A string that specifies the location of a Quartz Composer composition.

Return Value

The initialized QCCompositionLayer object or nil if initialization is not successful.

Availability
See Also
Declared In
QCCompositionLayer.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-12-11)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.