Mac Developer Library

Developer

Quartz Composer Reference Collection QCCompositionRenderer Protocol Reference

Options
Deployment Target:

On This Page
Language:

QCCompositionRenderer

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.

  • Sets the value for an input port of a composition.

    Declaration

    - (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 NOfalse if it cannot set the value.

    Availability

    Available in OS X v10.4 and later.

  • Returns the value for an input port of a composition.

    Declaration

    - (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.

  • Returns the value for an output port of a composition.

    Declaration

    - (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.

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

    Declaration

    - (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, 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.

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

    Declaration

    - (NSArray *)inputKeys

    Return Value

    An array of keys associated with input ports.

    Availability

    Available in OS X v10.4 and later.

    See Also

    – outputKeys

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

    Declaration

    - (NSArray *)outputKeys

    Return Value

    An array of keys associated with input ports.

    Availability

    Available in OS X v10.4 and later.

    See Also

    – inputKeys

  • Returns the attributes of the composition associated with the renderer.

    Declaration

    - (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.

  • Returns a mutable dictionary for storing arbitrary information.

    Declaration

    - (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".

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

    Declaration

    - (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.

  • Sets the values for the input keys of the composition from a previously saved property list.

    Declaration

    - (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.