An object that creates and configures chains of individual image filters.


@interface CIFilterGenerator : NSObject


The CIFilterGenerator class provides methods for creating a CIFilter object by chaining together existing CIFilter objects to create complex effects. (A filter chain refers to the CIFilter objects that are connected in the CIFilterGenerator object.) The complex effect can be encapsulated as a CIFilterGenerator object and saved as a file so that it can be used again. The filter generator file contains an archived instance of all the CIFilter objects that are chained together.

Any filter generator files that you copy to /Library/Graphics/Image Units/ are loaded when any of the loading methods provided by the CIPlugIn class are invoked. A CIFilterGenerator object is registered by its filename or, if present, by a class attribute that you supply in its description.

You can create a CIFilterGenerator object programmatically, using the methods provided by the CIFilterGenerator class, or by using the editor view provided by Core Image.


Creating Filter Generator Objects

+ filterGenerator

Creates and returns an empty filter generator object.

+ filterGeneratorWithContentsOfURL:

Creates and returns a filter generator object and initializes it with the contents of a filter generator file.

Initializing a Filter Generator Object

- initWithContentsOfURL:

Initializes a filter generator object with the contents of a filter generator file.

Connecting and Disconnecting Objects

- connectObject:withKey:toObject:withKey:

Adds an object to the filter chain.

- disconnectObject:withKey:toObject:withKey:

Removes the connection between two objects in the filter chain.

Managing Exported Keys


Returns an array of the exported keys.

- exportKey:fromObject:withName:

Exports an input or output key of an object in the filter chain.

- removeExportedKey:

Removes a key that was previously exported.

- setAttributes:forExportedKey:

Sets a dictionary of attributes for an exported key.

Setting and Getting Class Attributes


The class attributes associated with the filter.

Archiving a Filter Generator Object

- writeToURL:atomically:

Archives a filter generator object to a filter generator file.

Registering a Filter Chain

- registerFilterName:

Registers the name associated with a filter chain.

Creating a Filter from a Filter Chain

- filter

Creates a filter object based on the filter chain.


Exported Keys

Keys for the exported parameters of a filter generator object.


Inherits From

See Also

Image Units


The mechanism for loading image units in macOS.


The interface for loading Core Image image units.


A general interface for objects that produce CIFilter instances.