QCCompositionRenderer Protocol Reference

Adopted by
Framework
/System/Library/Frameworks/Quartz.framework/Frameworks/QuartzComposer.framework
Availability
Available in OS X v10.5 and later.
Declared in
QCRenderer.h

Overview

The QCRenderer protocol defines the methods used to pass data to the input ports or retrieve data from the output ports of the root patch of a Quartz Composer composition. This protocol is adopted by the QCRenderer, QCView, and QCCompositionLayer classes.

Tasks

Passing and Retrieving Values From a Composition

Getting Input and Output Keys

Getting Attributes

Storing Arbitrary Information

Saving and Restoring Input Values

Instance Methods

attributes

Returns the attributes of the composition associated with the renderer. (required)

- (NSDictionary *)attributes
Return Value

A dictionary that contains the attributes that describe the composition, including the input and output ports of the root patch.

Discussion

The dictionary can define any of the attributes that are specified by the composition attribute keys. See QCCompositionAttributeNameKey, QCCompositionAttributeDescriptionKey, and QCCompositionAttributeCopyrightKey.

The dictionary can also contain dictionaries that correspond to the keys that identify the input and output ports of the root patch of the composition. See QCPortAttributeTypeKey, QCPortAttributeNameKey, QCPortAttributeMinimumValueKey, QCPortAttributeMaximumValueKey, and QCPortAttributeMenuItemsKey.

Availability
  • Available in OS X v10.4 and later.
Declared In
QCRenderer.h

inputKeys

Returns an array that contains the keys that identify the input ports of the root patch of the composition. (required)

- (NSArray *)inputKeys
Return Value

An array of keys associated with input ports.

Availability
  • Available in OS X v10.4 and later.
Declared In
QCRenderer.h

outputKeys

Returns an array that contains the keys that identify the output ports of the root patch of the composition. (required)

- (NSArray *)outputKeys
Return Value

An array of keys associated with input ports.

Availability
  • Available in OS X v10.4 and later.
Declared In
QCRenderer.h

propertyListFromInputValues

Returns a property list object that represents the current values for all the input keys of the composition. (required)

- (id) propertyListFromInputValues
Return Value

A property list object.

Discussion

This is a convenience method that allows you to easily save the set of input values on a composition. Typically, you store the set of values in application preferences.

Availability
  • Available in OS X v10.5 and later.
Declared In
QCRenderer.h

setInputValuesWithPropertyList:

Sets the values for the input keys of the composition from a previously saved property list. (required)

- (void) setInputValuesWithPropertyList:(id)plist
Discussion

This is a convenience method that allows you to restore the set of input values that you obtained previously by calling the method propertyListFromInputValues. If the property list object does not define a value for an input key, or if the value is not of the proper type, Quartz Composer does not set a value for the corresponding input port.

Availability
  • Available in OS X v10.5 and later.
Declared In
QCRenderer.h

setValue:forInputKey:

Sets the value for an input port of a composition. (required)

- (BOOL)setValue:(id)value forInputKey:(NSString *)key
Parameters
value

The value to set for the input port. The input port must be at the root patch of the composition. The data type of the value argument must match the input port. See QCPortAttributeTypeKey for the data types accepted by a particular port type.

key

The key associated with the input port of the composition. This method throws an exception if key is invalid.

Return Value

Returns NO if it cannot set the value.

Availability
  • Available in OS X v10.4 and later.
Declared In
QCRenderer.h

userInfo

Returns a mutable dictionary for storing arbitrary information. (required)

- (NSMutableDictionary*) userInfo
Return Value

A mutable dictionary.

Discussion

The userInfo dictionary is shared—there is one per Quartz Composer context. In fact, it is the same dictionary as the one available for the plug-in execution context for instances of the QCPlugIn class.

When you add information to the dictionary, make sure that you use unique keys, such as "com.myCompany.foo".

Availability
  • Available in OS X v10.5 and later.
Declared In
QCRenderer.h

valueForInputKey:

Returns the value for an input port of a composition. (required)

- (id)valueForInputKey:(NSString *)key
Parameters
key

The key associated with an input port for the root patch of a composition. This method throws an exception if key is invalid.

Return Value

The value. The data type of returned value depends on the type of the input port. See QCPortAttributeTypeKey for more information.

Availability
  • Available in OS X v10.4 and later.
Declared In
QCRenderer.h

valueForOutputKey:

Returns the value for an output port of a composition. (required)

- (id)valueForOutputKey:(NSString *)key
Parameters
key

The key associated with an output port for the root patch of a composition. This method throws an exception if key is invalid.

Return Value

The value. The data type of returned value depends on the type of the output port. See QCPortAttributeTypeKey for more information.

Availability
  • Available in OS X v10.4 and later.
Declared In
QCRenderer.h

valueForOutputKey:ofType:

Returns the current value on an output port (identified by its key) of the root patch of the composition. (required)

- (id) valueForOutputKey:(NSString*)key ofType:(NSString*)type
Parameters
key

The key associated with an output port for the root patch of a composition. This method throws an exception if key is invalid.

type

A string that specifies the class.

Return Value

The value.

Discussion

The value type depends on the type of the port type, as shown in the following table

Port type

Value type

Boolean, Index, or Number

NSNumber or any object that responds to the methods integerValue, floatValue, or doubleValue

String

NSString or any object that responds to the methodsstringValue or description

Color

NSColor, CIColor, or CGColor object

Image

NSImage, NSBitmapImageRep, CGImage object, CIImage, CVPixelBuffer object, CVOpenGLBuffer object, CVOpenGLTexture object, or an opaque QCImage (that is, an optimized abstract image object only to be used with setValue:forInputKey: of another <QCCompositionRenderer>)

Structure

NSArray or NSDictionary

Availability
  • Available in OS X v10.5 and later.
Related Sample Code
Declared In
QCRenderer.h