QCComposition Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Quartz.framework/Frameworks/QuartzComposer.framework |
| Availability | Available in OS X v10.5 and later. |
| Companion guide | Quartz Composer Programming Guide |
| Declared in | QCComposition.h QCCompositionRepository.h |
Overview
The QCComposition class represents a Quartz Composer composition that either:
comes from the system-wide composition repository (
/Library/Compositionsand~/Library/Compositions) where it can be accessed by any application through the methods of theQCCompositionRepositoryclassis 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.
Class Methods
compositionWithData:
Returns a composition object initialized with the contents of a Quartz Composer composition file.
Parameters
- 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.
Availability
- Available in OS X v10.5 and later.
Declared In
QCComposition.hcompositionWithFile:
Returns a composition object initialized with a Quartz Composer composition file.
Parameters
- path
A path to a file created with the Quartz Composer developer tool (
.qtzextension).
Return Value
A Quartz Composer composition object or nil if there is an error.
Availability
- Available in OS X v10.5 and later.
Declared In
QCComposition.hInstance Methods
attributes
Returns the attributes of the composition.
Return Value
A dictionary of composition attributes. See “Attribute Keys” for the attributes that can be returned.
Availability
- Available in OS X v10.5 and later.
Declared In
QCComposition.hidentifier
Returns the unique and persistent identifier for the composition from the composition repository.
Return Value
The unique identifier for the composition if it comes from the composition repository; nil otherwise.
Availability
- Available in OS X v10.5 and later.
Declared In
QCCompositionRepository.hinputKeys
Returns an array listing the keys that identify the input ports of the root patch of the composition.
Return Value
An array of input keys.
Availability
- Available in OS X v10.5 and later.
Declared In
QCComposition.houtputKeys
Returns an array listing the keys that identify the output ports of the root patch of the composition.
Return Value
An array of output keys.
Availability
- Available in OS X v10.5 and later.
Declared In
QCComposition.hprotocols
Returns the list of protocols to which the composition conforms.
Return Value
A list of protocols. See “Standard Protocols”.
Availability
- Available in OS X v10.5 and later.
Declared In
QCComposition.hConstants
Attribute 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;
Constants
QCCompositionAttributeNameKeyThe key for the composition name. The associated value is an
NSStringobject.Available in OS X v10.4 and later.
Declared in
QCComposition.h.QCCompositionAttributeDescriptionKeyThe key for the composition description. The associated value is an
NSStringobject.Available in OS X v10.4 and later.
Declared in
QCComposition.h.QCCompositionAttributeCopyrightKeyThe key for composition copyright information. The associated value is an
NSStringobject.Available in OS X v10.4 and later.
Declared in
QCComposition.h.QCCompositionAttributeBuiltInKeyThe key for the composition origin. The associated value is an
NSNumberobject that contains a Boolean value.YESindicates the composition is built-in (provided by OS X).Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionAttributeTimeDependentKeyThe key for the composition time dependency. The associated value is an
NSNumberobject that contains a Boolean value.YESindicates that the composition is time dependent.QCCompositionAttributeHasConsumersKeyThe key for a composition that has consumer patches. The associated value is an
NSNumberobject that contains a Boolean value.YESindicates that the composition has consumers.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionAttributeCategoryKeyThe composition category. The associated value is a category constant. See “Composition Categories.”
Available in OS X v10.5 and later.
Declared in
QCComposition.h.
Declared In
QCComposition.hComposition Categories
Categories for compositions.
extern NSString* const QCCompositionCategoryDistortion; extern NSString* const QCCompositionCategoryStylize; extern NSString* const QCCompositionCategoryUtility;
Constants
QCCompositionCategoryDistortionA composition that produces a distortion effect.
Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionCategoryStylizeA composition that produces a stylize effect.
Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionCategoryUtilityA utility composition.
Available in OS X v10.5 and later.
Declared in
QCComposition.h.
Declared In
QCComposition.hStandard Protocol Input Keys
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;
Constants
QCCompositionInputImageKeyAn image input port whose key is
inputImage.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputSourceImageKeyAn image input port whose key is
inputSourceImage.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputDestinationImageKeyAn image input port whose key is
inputDestinationImage.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputRSSFeedURLKeyA string input port whose key is
inputRSSFeedURL. This port must be passed an http or feed scheme URL.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputRSSArticleDurationKeyA number input port whose key is
inputRSSArticleDuration. The value must be expressed in seconds.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputPreviewModeKeyA Boolean input port whose key is
inputPreviewMode. When the value of this input port is set toTRUE, the composition that provides this port must be able to run in a low-quality mode that produces a preview of the composition.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputXKeyA number input port whose key is
inputX. The value must be normalized to the image width with the origin on the left.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputYKeyA number input port whose key is
inputY. The value must be normalized to the image height with the origin at the bottom.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputScreenImageKeyAn image input port whose key is
inputScreenImage.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputAudioPeakKeyA number input port whose key is
inputAudioPeak. The value must be in the[0,1]range as a mono signal with no decay applied.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputAudioSpectrumKeyA structure input port whose key is
inputAudioSpectrum. The structure must contain 16 values in the[0,1]range representing 16 spectrum bands of the mono signal from low to high frequencies with no decay applied.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputTrackPositionKeyA number input port whose key is
inputTrackPosition. The value must be expressed in seconds.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputTrackInfoKeyA structure input port whose key is
inputTrackInfo. The structure contains optional entries, such as “name”, “artist”, "album", "duration", "artwork", and so on.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputTrackSignalKeyA Boolean input port whose key is
inputTrackSignal.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputPrimaryColorKeyA color input port whose key is
inputPrimaryColor.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputSecondaryColorKeyA color input port whose key is
inputSecondaryColor.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionInputPaceKeyA number input port whose key is
inputPace. The value must be in the[0,1]range.Available in OS X v10.5 and later.
Declared in
QCComposition.h.
Declared In
QCComposition.hStandard Protocol Output Keys
Output ports of a composition.
extern NSString* const QCCompositionOutputImageKey; extern NSString* const QCCompositionOutputWebPageURLKey;
Constants
QCCompositionOutputImageKeyAn image output port whose key is
outputImage.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionOutputWebPageURLKeyA string output port whose key is
outputWebPageURL.Available in OS X v10.5 and later.
Declared in
QCComposition.h.
Declared In
QCComposition.hStandard Protocols
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;
Constants
QCCompositionProtocolGraphicAnimationA composition that renders a generic graphical animation. It has the option to use
QCCompositionInputPrimaryColorKeyfor the primary color of the animation,QCCompositionInputSecondaryColorKeyfor the secondary color of the animation,QCCompositionInputPaceKeyfor the global pace of the animation, andQCCompositionInputPreviewModeKeyto indicate if the animation should run in lower-quality for preview purposes.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionProtocolGraphicTransitionA composition that performs a transition between two images, using a transition time in range of
0to1. A conforming composition must use the input keysQCCompositionInputSourceImageKeyfor the starting image andQCCompositionInputDestinationImageKeyfor the image to transition to. The composition can optionally useQCCompositionInputPreviewModeKeyto indicate if the animation should run in lower-quality for preview purposes.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionProtocolImageFilterA composition that applies an effect to a source image. A conforming composition must use the input key
QCCompositionInputImageKeyfor the source image andQCCompositionOutputImageKeyfor the output image. The composition can optionally useQCCompositionInputXKeyto specify the X position of the center point of the effect,QCCompositionInputYKeyto specify the Y position of the center point of the effect, andQCCompositionInputPreviewModeKeyto indicate if the animation should run in lower-quality for preview purposes.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionProtocolScreenSaverA composition that can be used as a screen saver. The composition has the option to use
QCCompositionInputScreenImageKeyfor a screenshot image of the screen that the screen saver runs on,QCCompositionInputPreviewModeKeyto indicate if the animation should run in lower-quality for preview purposes, andQCCompositionOutputWebPageURLKeyfor a URL to open in the default web browser when screen saver exits (only allowed if screen saver password is disabled).Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionProtocolImageTransitionA composition that performs a transition between two images, using a parametric time value to drives the transition from start (at time
0) to end (at time1). A conforming composition must use the input keysQCCompositionInputImageKeyfor the starting image andQCCompositionInputDestinationImageKeyfor the ending image. The composition can optionally useQCCompositionInputPreviewModeKeyto indicate if the animation should run in lower-quality for preview purposes.QCCompositionProtocolRSSVisualizerA composition that acts as a visualizer for an RSS feed. A conforming composition must use the input key
QCCompositionInputRSSFeedURLKeyfor the URL to use for the RSS feed. It can optionally useQCCompositionInputRSSArticleDurationKeyto specify the duration of each feed article.Available in OS X v10.5 and later.
Declared in
QCComposition.h.QCCompositionProtocolMusicVisualizerA composition that acts as a visualizer for music. A conforming composition must use the input key
QCCompositionInputAudioPeakKeyfor the instantaneous audio peak and theQCCompositionInputAudioSpectrumKeyfor the instantaneous audio spectrum. It can optionally use theQCCompositionInputTrackInfoKeyto indicate it receives information about the current track and theQCCompositionInputTrackSignalKeyto indicate the start of a new track.Available in OS X v10.5 and later.
Declared in
QCComposition.h.
Declared In
QCComposition.h© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-06-26)