Mac Developer Library

Developer

Quartz Framework Reference QCCompositionRenderer Protocol Reference

Options
Deployment Target:

On This Page
Language:

QCCompositionRenderer

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import Quartz

Objective-C

@import Quartz;

Availability


Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func setValue(_ value: AnyObject!, forInputKey key: String!) -> Bool

    Objective-C

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func valueForInputKey(_ key: String!) -> AnyObject!

    Objective-C

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func valueForOutputKey(_ key: String!) -> AnyObject!

    Objective-C

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

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

    Declaration

    Swift

    func valueForOutputKey(_ key: String!, ofType type: String!) -> AnyObject!

    Objective-C

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

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

    Declaration

    Swift

    func inputKeys() -> [AnyObject]!

    Objective-C

    - (NSArray *)inputKeys

    Return Value

    An array of keys associated with input ports.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

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

    Declaration

    Swift

    func outputKeys() -> [AnyObject]!

    Objective-C

    - (NSArray *)outputKeys

    Return Value

    An array of keys associated with input ports.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.4 and later.

    See Also

    – inputKeys

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

    Declaration

    Swift

    func attributes() -> [NSObject : AnyObject]!

    Objective-C

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func userInfo() -> NSMutableDictionary!

    Objective-C

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func propertyListFromInputValues() -> AnyObject!

    Objective-C

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func setInputValuesWithPropertyList(_ plist: AnyObject!)

    Objective-C

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.