Class: CIFilter

Inherits:
NSObject show all

Overview

The CIFilter class produces a CIImage object as output. Typically, a filter takes one or more images as input. Some filters, however, generate an image based on other types of input parameters. The parameters of a CIFilter object are set and retrieved through the use of key-value pairs.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (CIImage) outputImage (readonly)

Returns a CIImage object that encapsulates the operations configured in the filter. (read-only)

Returns:

Class Method Details

+ (Array) filterArrayFromSerializedXMP(xmpData, inputImageExtent:extent, error:outError)

Returns an array of filter objects de-serialized from XMP data.

Parameters:

  • xmpData (NSData)

    The XMP data created previously by calling serializedXMPFromFilters:inputImageExtent:.

  • extent (CGRect)

    The extent of the image from which the XMP data was extracted.

  • outError (Pointer)

    The address of an NSError object for receiving errors, otherwise nil.

Returns:

+ (Array) filterNamesInCategories(categories)

Returns an array of all published filter names that match all the specified categories. When you pass more than one filter category, this method returns the intersection of the filters in the categories. For example, if you pass the categories kCICategoryBuiltIn and kCICategoryColorAdjustment, you obtain all the filters that are members of both the built-in and color adjustment categories. But if you pass in kCICategoryGenerator and kCICategoryStylize, you will not get any filters returned to you because there are no filters that are members of both the generator and stylize categories. If you want to obtain all stylize and generator filters, you must call the filterNamesInCategories: method for each category separately and then merge the results.

Parameters:

  • categories (Array)

    One or more of the filter category keys defined in “Filter Category Keys.” Pass nil to get all filters in all categories.

Returns:

  • (Array)

    An array that contains all published filter names that match all the categories specified by the categories argument.

+ (Array) filterNamesInCategory(category)

Returns an array of all published filter names in the specified category.

Parameters:

  • category (String)

    A string object that specifies one of the filter categories defined in “Filter Category Keys.”

Returns:

  • (Array)

    An array that contains all published names of the filter in a category.

+ (CIFilter) filterWithName(name)

Creates a CIFilter object for a specific kind of filter. You should call setDefaults after you call this method or set values individually by calling setValue:forKey.

Parameters:

  • name (String)

    The name of the filter. You must make sure the name is spelled correctly, otherwise your app will run but not produce any output images. For that reason, you should check for the existence of the filter after calling this method.

Returns:

+ (CIFilter) filterWithName(name, keysAndValues:key0, ...)

Creates a CIFilter object for a specific kind of filter and initializes the input values.

Parameters:

  • name

    The name of the filter. You must make sure the name is spelled correctly, otherwise your app will run but not produce any output images. For that reason, you should check for the existence of the filter after calling this method.

  • key0,

    A list of key-value pairs to set as input values to the filter. Each key is a constant that specifies the name of the input value to set, and must be followed by a value. You signal the end of the list by passing a nil value.

Returns:

+ (NSData) serializedXMPFromFilters(filters, inputImageExtent:extent)

Serializes filter parameters into XMP form that is suitable for embedding in an image. At this time the only filters classes that can be serialized using this method are, CIAffineTransform, CICrop, and the filters returned by the CIImage methods autoAdjustmentFilters and autoAdjustmentFiltersWithOptions:. The parameters of other filter classes will not be serialized.

Parameters:

  • filters (Array)

    The array of filters to serialize. See Discussion for the filters that can be serialized.

  • extent (CGRect)

    The extent of the input image to the filter.

Returns:

Instance Method Details

- (Hash) attributes

Returns a dictionary of key-value pairs that describe the filter. For example, the attributes dictionary for the CIColorControls filter contains the following information:

Returns:

  • (Hash)

    A dictionary that contains a key for each input and output parameter for the filter. Each key is a dictionary that contains all the attributes of an input or output parameter.

- (Array) inputKeys

Returns an array that contains the names of the input parameters to the filter.

Returns:

  • (Array)

    An array that contains the names of all input parameters to the filter.

- (String) name

The name of the filter.

Returns:

  • (String)

    A string that holds the name of the filter.

- (Array) outputKeys

Returns an array that contains the names of the output parameters for the filter.

Returns:

  • (Array)

    An array that contains the names of all output parameters from the filter.

- (Object) setDefaults

Sets all input values for a filter to default values. Input values whose default values are not defined are left unchanged.

Returns: