Mac Developer Library


Quartz Composer Reference Collection QCComposition Class Reference

Deployment Target:

On This Page


The QCComposition class represents a Quartz Composer composition that either:

  • comes from the system-wide composition repository (/Library/Compositions and ~/Library/Compositions) where it can be accessed by any application through the methods of the QCCompositionRepository class

  • is created from an arbitrary source (typically a file on disk) using one of its methods

This class cannot be subclassed.

A QCComposition object has the following information associated with it and that you can obtain by using the appropriate method of the QCComposition class:

  • Attributes include the name and description of the composition, copyright information, and whether or not its provided by OS X (built-in).

  • The protocols that the composition conforms to. A composition protocol defines a set of required and optional input parameters and output results.

Many methods of the QCRenderer, QCCompositionLayer, and QCView classes take a QCComposition object as a parameter.

  • Returns a composition object initialized with a Quartz Composer composition file.


    + (QCComposition*) compositionWithFile:(NSString*)path;



    A path to a file created with the Quartz Composer developer tool (.qtz extension).

    Return Value

    A Quartz Composer composition object or nil if there is an error.

  • Returns a composition object initialized with the contents of a Quartz Composer composition file.


    + (QCComposition*) compositionWithData:(NSData*)data;



    The contents of a file created with the Quartz Composer developer tool.

    Return Value

    A Quartz Composer composition object or nil if there is an error.

  • Returns the attributes of the composition.


    - (NSDictionary*) attributes

    Return Value

    A dictionary of composition attributes. See “Attribute Keys” for the attributes that can be returned.

  • Returns the list of protocols to which the composition conforms.


    - (NSArray*) protocols

    Return Value

    A list of protocols. See “Standard Protocols”.

  • Returns the unique and persistent identifier for the composition from the composition repository.


    - (NSString*) identifier

    Return Value

    The unique identifier for the composition if it comes from the composition repository; nil otherwise.

  • Returns an array listing the keys that identify the input ports of the root patch of the composition.


    - (NSArray*) inputKeys

    Return Value

    An array of input keys.

  • Returns an array listing the keys that identify the output ports of the root patch of the composition.


    - (NSArray*) outputKeys

    Return Value

    An array of output keys.

  • Attributes of a composition.


    extern NSString* const QCCompositionAttributeNameKey; extern NSString* const QCCompositionAttributeDescriptionKey; extern NSString* const QCCompositionAttributeCopyrightKey; extern NSString* const QCCompositionAttributeBuiltInKey; extern NSString* const QCCompositionAttributeTimeDependentKey; extern NSString* const QCCompositionAttributeHasConsumersKey; extern NSString* const QCCompositionAttributeCategoryKey;


    • QCCompositionAttributeNameKey

    • QCCompositionAttributeDescriptionKey

    • QCCompositionAttributeCopyrightKey

    • QCCompositionAttributeBuiltInKey

    • QCCompositionAttributeTimeDependentKey

    • QCCompositionAttributeHasConsumersKey

    • QCCompositionAttributeCategoryKey

  • Categories for compositions.


    extern NSString* const QCCompositionCategoryDistortion; extern NSString* const QCCompositionCategoryStylize; extern NSString* const QCCompositionCategoryUtility;


    • QCCompositionCategoryDistortion

    • QCCompositionCategoryStylize

    • QCCompositionCategoryUtility

  • Input ports of a composition.


    extern NSString* const QCCompositionInputImageKey; extern NSString* const QCCompositionInputSourceImageKey; extern NSString* const QCCompositionInputDestinationImageKey; extern NSString* const QCCompositionInputRSSFeedURLKey; extern NSString* const QCCompositionInputRSSArticleDurationKey; extern NSString* const QCCompositionInputPreviewModeKey; extern NSString* const QCCompositionInputXKey; extern NSString* const QCCompositionInputYKey; extern NSString* const QCCompositionInputScreenImageKey; extern NSString* const QCCompositionInputAudioPeakKey; extern NSString* const QCCompositionInputAudioSpectrumKey; extern NSString* const QCCompositionInputTrackPositionKey; extern NSString* const QCCompositionInputTrackInfoKey; extern NSString* const QCCompositionInputTrackSignalKey; extern NSString* const QCCompositionInputPrimaryColorKey; extern NSString* const QCCompositionInputSecondaryColorKey; extern NSString* const QCCompositionInputPaceKey;


    • QCCompositionInputImageKey

    • QCCompositionInputSourceImageKey

    • QCCompositionInputDestinationImageKey

    • QCCompositionInputRSSFeedURLKey

    • QCCompositionInputRSSArticleDurationKey

    • QCCompositionInputPreviewModeKey

    • QCCompositionInputXKey

    • QCCompositionInputYKey

    • QCCompositionInputScreenImageKey

    • QCCompositionInputAudioPeakKey

    • QCCompositionInputAudioSpectrumKey

    • QCCompositionInputTrackPositionKey

    • QCCompositionInputTrackInfoKey

    • QCCompositionInputTrackSignalKey

    • QCCompositionInputPrimaryColorKey

    • QCCompositionInputSecondaryColorKey

    • QCCompositionInputPaceKey

  • Output ports of a composition.


    extern NSString* const QCCompositionOutputImageKey; extern NSString* const QCCompositionOutputWebPageURLKey;


    • QCCompositionOutputImageKey

    • QCCompositionOutputWebPageURLKey

  • Protocols for a composition.


    extern NSString* const QCCompositionProtocolGraphicAnimation; extern NSString* const QCCompositionProtocolGraphicTransition; extern NSString* const QCCompositionProtocolImageFilter; extern NSString* const QCCompositionProtocolImageCompositor; extern NSString* const QCCompositionProtocolImageTransition; extern NSString* const QCCompositionProtocolScreenSaverRSS;


    • QCCompositionProtocolGraphicAnimation

    • QCCompositionProtocolGraphicTransition

    • QCCompositionProtocolImageFilter

    • QCCompositionProtocolScreenSaver

    • QCCompositionProtocolImageTransition

    • QCCompositionProtocolRSSVisualizer

    • QCCompositionProtocolMusicVisualizer