Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

CIFilter Class Reference

Inherits from
Conforms to
Framework
Library/Frameworks/QuartzCore.framework
Availability
Mac OS X v10.4 and later
Declared in
CIFilter.h
CIRAWFilter.h
Companion guides

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.

You use the CIFilter object in conjunction with other Core Image classes, such as CIImage, CIContext, CIImageAccumulator, and CIColor, to take advantage of the built-in Core Image filters when processing images, creating filter generators, or writing custom filters.

Tasks

Creating a Filter

Creating a Filter from a RAW Image

Accessing Registered Filters

Registering a Filter

Getting Filter Parameters and Attributes

Setting Default Values

Applying a Filter

Getting Localized Information for Registered Filters

Class Methods

filterNamesInCategories:

Returns an array of all published filter names that match all the specified categories.

+ (NSArray *)filterNamesInCategories:(NSArray *)categories

Parameters
categories

One or more filter categories. Pass nil to get all filters in all categories.

Return Value

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

Discussion

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 kCICategoryFilterGenerator, you obtain all the filters that are members of both the built-in and generator 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.

Availability
See Also
Declared In
CIFilter.h

filterNamesInCategory:

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

+ (NSArray *)filterNamesInCategory:(NSString *)category

Parameters
category

A string object that specifies a filter category.

Return Value

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

Availability
See Also
Declared In
CIFilter.h

filterWithImageData:options:

Returns a CIFilter object initialized with RAW image data supplied to the method.

+ (CIFilter *)filterWithImageData:(NSData *)data options:(NSDictionary *)options;

Parameters
data

The RAW image data to initialize the object with.

options

A options dictionary. You can pass any of the keys defined in “RAW Image Options” along with the appropriate value. You should provide a source type identifier hint key (kCGImageSourceTypeIdentifierHint) and the appropriate source type value to help the decoder determine the file type. Otherwise it’s possible to obtain incorrect results. See the Discussion for an example

Return Value

A CIFilter object.

Discussion

After calling this method, the CIFilter object returns a CIImage object that is properly processed similar to images retrieved using the outputImage key.

Here is an example of adding a source type identifier key-value pair to the options dictionary:

[opts setObject:(id)CGImageSourceGetTypeWithExtension ((CFStringRef)[[url path] pathExtension])
         forKey:(id)kCGImageSourceTypeIdentifierHint];
Availability
See Also
Declared In
CIRAWFilter.h

filterWithImageURL:options:

Returns a CIFilter object initialized with data from a RAW image file.

+ (CIFilter *)filterWithImageURL:(NSURL *)url options:(NSDictionary *)options;

Parameters
url

The location of a RAW image file.

options

An options dictionary. You can pass any of the keys defined in “RAW Image Options”.

Return Value

A CIFilter object.

Discussion

After calling this method, the CIFilter object returns a CIImage object that is properly processed similar to images retrieved using the outputImage key.

Availability
See Also
Declared In
CIRAWFilter.h

filterWithName:

Creates a CIFilter object for a specific kind of filter.

+ (CIFilter *)filterWithName:(NSString *)name

Parameters
name

The name of the filter.

Return Value

A CIFilter object whose input values are undefined.

Discussion

You should call setDefaults after you call this method or set values individually by calling setValue:forKey.

Availability
See Also
Declared In
CIFilter.h

filterWithName:keysAndValues:

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

+ (CIFilter *)filterWithName:(NSString *)namekeysAndValues:key0, ...

Parameters
name

The name of the filter.

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.

Return Value

A CIFilter object whose input values are initialized.

Availability
See Also
Declared In
CIFilter.h

localizedDescriptionForFilterName:

Returns the localized description of a filter for display in the user interface.

+ (NSString *)localizedDescriptionForFilterName:(NSString *)filterName

Parameters
filterName

The filter name.

Return Value

The localized description of the filter.

Availability
Declared In
CIFilter.h

localizedNameForCategory:

Returns the localized name for the specified filter category.

+ (NSString *)localizedNameForCategory:(NSString *)category

Parameters
category

A filter category.

Return Value

The localized name for the filter category.

Availability
Declared In
CIFilter.h

localizedNameForFilterName:

Returns the localized name for the specified filter name.

+ (NSString *)localizedNameForFilterName:(NSString *)filterName

Parameters
filterName

A filter name.

Return Value

The localized name for the filter.

Availability
Declared In
CIFilter.h

localizedReferenceDocumentationForFilterName:

Returns the location of the localized reference documentation that describes the filter.

+ (NSURL *)localizedReferenceDocumentationForFilterName:(NSString *)filterName

Parameters
filterName

The filter name.

Return Value

A URL that specifies the location of the localized documentation, or nil if the filter does not provide localized reference documentation.

Discussion

The URL can be a local file or a remote document on a web server. Because filters created prior to Mac OS X v10.5 could return nil, you should be make sure that your code handles this case gracefully.

Availability
Declared In
CIFilter.h

registerFilterName:constructor:classAttributes:

Publishes a custom filter that is not packaged as an image unit.

+ (void)registerFilterName:(NSString *)name constructor:(id)anObject classAttributes:(NSDictionary *)attributes

Parameters
name

A string object that specifies the name of the filter you want to publish.

anObject

A constructor object that implements the filterWithName method.

attributes

A dictionary that contains the class display name and filter categories attributes along with the appropriate value for each attributes. That is, the kCIAttributeFilterDisplayName attribute and a string that specifies the display name, and the kCIAttributeFilterCategories and an array that specifies the categories to which the filter belongs (such as kCICategoryStillImage and kCICategoryDistortionEffect). All other attributes for the filter should be returned by the custom attributes method implement by the filter.

Discussion

In most cases you don’t need to use this method because the preferred way to register a custom filter that you write is to package it as an image unit. You do not need to use this method for a filter packaged as an image unit because you register your filter using the CIPlugInRegistration protocol. (See Core Image Programming Guide for additional details.)

Availability
Declared In
CIFilter.h

Instance Methods

apply:

Produces a CIImage object by applying a kernel function.

- (CIImage *)apply:(CIKernel *)k, ...

Parameters
k

A CIKernel object that contains a kernel function.

A list of arguments to supply to the kernel function. The supplied arguments must be type-compatible with the function signature of the kernel function. The list of arguments must be terminated by the nil object.

Discussion

For example, if the kernel function has this signature:

kernel vec4 brightenEffect (sampler src, float k)

You would supply two arguments after the k argument to the apply:k, .. method. In this case, the first argument must be a sampler and the second a floating-point value. For more information on kernels, see Core Image Kernel Language Reference.

Availability
See Also
Declared In
CIFilter.h

apply:arguments:options:

Produces a CIImage object by applying arguments to a kernel function and using options to control how the kernel function is evaluated.

- (CIImage *)apply:(CIKernel *)k arguments:(NSArray *)args options:(NSDictionary *)dict

Parameters
k

A CIKernel object that contains a kernel function.

args

The arguments that are type compatible with the function signature of the kernel function.

dict

A dictionary that contains options (key-value pairs) to control how the kernel function is evaluated.

Return Value

The CIImage object produced by a filter.

Discussion

You can pass any of the following keys in the dictionary:

Availability
See Also
Declared In
CIFilter.h

attributes

Returns a dictionary of key-value pairs that describe the filter.

- (NSDictionary *)attributes

Return Value

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.

Discussion

For example, the attributes dictionary for the CIColorControls filter contains the following information:

CIColorControls:
{
    CIAttributeFilterCategories = (
        CICategoryColorAdjustment,
        CICategoryVideo,
        CICategoryStillImage,
        CICategoryInterlaced,
        CICategoryNonSquarePixels,
        CICategoryBuiltIn
    );
    CIAttributeFilterDisplayName = "Color Controls";
    CIAttributeFilterName = CIColorControls;
    inputBrightness = {
        CIAttributeClass = NSNumber;
        CIAttributeDefault = 0;
        CIAttributeIdentity = 0;
        CIAttributeMin = -1;
        CIAttributeSliderMax = 1;
        CIAttributeSliderMin = -1;
        CIAttributeType = CIAttributeTypeScalar;
    };
    inputContrast = {
        CIAttributeClass = NSNumber;
        CIAttributeDefault = 1;
        CIAttributeIdentity = 1;
        CIAttributeMin = 0.25;
        CIAttributeSliderMax = 4;
        CIAttributeSliderMin = 0.25;
        CIAttributeType = CIAttributeTypeScalar;
    };
    inputImage = {CIAttributeClass = CIImage; };
    inputSaturation = {
        CIAttributeClass = NSNumber;
        CIAttributeDefault = 1;
        CIAttributeIdentity = 1;
        CIAttributeMin = 0;
        CIAttributeSliderMax = 3;
        CIAttributeSliderMin = 0;
        CIAttributeType = CIAttributeTypeScalar;
    };
    outputImage = {CIAttributeClass = CIImage; };
}
Availability
Declared In
CIFilter.h

inputKeys

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

- (NSArray *)inputKeys

Return Value

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

Availability
Declared In
CIFilter.h

outputKeys

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

- (NSArray *)outputKeys

Return Value

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

Availability
Declared In
CIFilter.h

setDefaults

Sets all input values for a filter to default values.

- (void)setDefaults

Discussion

Input values whose default values are not defined are left unchanged.

Availability
Declared In
CIFilter.h

Constants

Filter Attribute Keys

Attributes for a filter and its parameters.

extern NSString *kCIAttributeFilterName;
extern NSString *kCIAttributeFilterDisplayName;
extern NSString *kCIAttributeDescription;
extern NSString *kCIAttributeReferenceDocumentation;
extern NSString *kCIAttributeFilterCategories;
extern NSString *kCIAttributeClass;
extern NSString *kCIAttributeType;
extern NSString *kCIAttributeMin;
extern NSString *kCIAttributeMax;
extern NSString *kCIAttributeSliderMin;
extern NSString *kCIAttributeSliderMax;
extern NSString *kCIAttributeDefault;
extern NSString *kCIAttributeIdentity;
extern NSString *kCIAttributeName;
extern NSString *kCIAttributeDisplayName;

Constants
kCIAttributeFilterName

The filter name, specified as an NSString object.

kCIAttributeFilterDisplayName

The localized version of the filter name that is displayed in the user interface.

kCIAttributeDescription

The localized description of the filter. This description should inform the end user what the filter does and be short enough to display in the user interface for the filter. It is not intended to be technically detailed.

Available in Mac OS X v10.5 and later.

kCIAttributeReferenceDocumentation

The localized reference documentation for the filter. The reference should provide developers with technical details.

Available in Mac OS X v10.5 and later.

kCIAttributeFilterCategories

An array of filter category keys that specifies all the categories in which the filter is a member.

kCIAttributeClass

The class of the input parameter for a filter. If you are writing an image unit (see Image Unit Tutorial), Core Image supports only these classes for nonexecutable image units: CIColor, CIVector, CIImage, and NSNumber only. Executable image units may have input parameters of any class, but Core Image does not generate an automatic user interface for custom classes (see CIFilter(IKFilterUIAddition)).

kCIAttributeType

The attribute type.

kCIAttributeMin

The minimum value for a filter parameter, specified as a floating-point value.

kCIAttributeMax

The maximum value for a filter parameter, specified as a floating-point value.

kCIAttributeSliderMin

The minimum value, specified as a floating-point value, to use for a slider that controls input values for a filter parameter.

kCIAttributeSliderMax

The maximum value, specified as a floating-point value, to use for a slider that controls input values for a filter parameter.

kCIAttributeDefault

The default value, specified as a floating-point value, for a filter parameter.

kCIAttributeIdentity

If supplied as a value for a parameter, the parameter has no effect on the input image.

kCIAttributeName

The name of the attribute.

kCIAttributeDisplayName

The localized display name of the attribute.

Discussion

Attribute keys are used for the attribute dictionary of a filter. Most entries in the attribute dictionary are optional. The attribute CIAttributeFilterName is mandatory. For a parameter, the attribute kCIAttributeClass is mandatory.

A parameter of type NSNumber does not necessarily need the attributes kCIAttributeMin and kCIAttributeMax. These attributes are not present when the parameter has no upper or lower bounds. For example, the Gaussian blur filter has a radius parameter with a minimum of 0 but no maximum value to indicate that all nonnegative values are valid.

Declared In
CIFilter.h

Data Type Attributes

Numeric data types.

extern NSString *kCIAttributeTypeTime;
extern NSString *kCIAttributeTypeScalar;
extern NSString *kCIAttributeTypeDistance;
extern NSString *kCIAttributeTypeAngle;
extern NSString *kCIAttributeTypeBoolean;
extern NSString *kCIAttributeTypeInteger;
extern NSString *kCIAttributeTypeCount;

Constants
kCIAttributeTypeTime

A parametric time for transitions, specified as a floating-point value in the range of 0.0 to 1.0.

kCIAttributeTypeScalar

A scalar value.

kCIAttributeTypeDistance

A distance.

kCIAttributeTypeAngle

An angle.

kCIAttributeTypeBoolean

A Boolean value.

kCIAttributeTypeInteger

An integer value.

kCIAttributeTypeCount

A positive integer value.

Declared In
CIFilter.h

Vector Quantity Attributes

Vector data types.

extern NSString *kCIAttributeTypePosition;
extern NSString *kCIAttributeTypeOffset;
extern NSString *kCIAttributeTypePosition3;
extern NSString *kCIAttributeTypeRectangle

Constants
kCIAttributeTypePosition

A two-dimensional location in the working coordinate space. (A 2-element vector type.)

kCIAttributeTypeOffset

An offset. (A 2-element vector type.)

kCIAttributeTypePosition3

A three-dimensional location in the working coordinate space. (A 3-element vector type.)

kCIAttributeTypeRectangle

A Core Image vector that specifies the x and y values of the rectangle origin, and the width (w) and height (h) of the rectangle. The vector takes the form [x, y, w, h]. (A 4-element vector type.)

Declared In
CIFilter.h

Color Attribute Keys

Color types.

extern NSString *kCIAttributeTypeOpaqueColor;
extern NSString *kCIAttributeTypeGradient;

Constants
kCIAttributeTypeOpaqueColor

A Core Image color (CIColor object) that specifies red, green, and blue component values. Use this key for colors with no alpha component. If the key is not present, Core Image assumes color with alpha.

kCIAttributeTypeGradient

An n-by-1 gradient image used to describe a color ramp.

Declared In
CIFilter.h

Filter Category Keys

Categories of filters.

extern NSString *kCICategoryDistortionEffect;
extern NSString *kCICategoryGeometryAdjustment;
extern NSString *kCICategoryCompositeOperation;
extern NSString *kCICategoryHalftoneEffect;
extern NSString *kCICategoryColorAdjustment;
extern NSString *kCICategoryColorEffect;
extern NSString *kCICategoryTransition;
extern NSString *kCICategoryTileEffect;
extern NSString *kCICategoryGenerator;
extern NSString *kCICategoryReduction;
extern NSString *kCICategoryGradient;
extern NSString *kCICategoryStylize;
extern NSString *kCICategorySharpen;
extern NSString *kCICategoryBlur;
extern NSString *kCICategoryVideo;
extern NSString *kCICategoryStillImage;
extern NSString *kCICategoryInterlaced;
extern NSString *kCICategoryNonSquarePixels;
extern NSString *kCICategoryHighDynamicRange ;
extern NSString *kCICategoryBuiltIn;
extern NSString *kCICategoryFilterGenerator;

Constants
kCICategoryDistortionEffect

A filter that reshapes an image by altering its geometry to create a 3D effect. Using distortion filters, you can displace portions of an image, apply lens effects, make a bulge in an image, and perform other operation to achieve an artistic effect.

kCICategoryGeometryAdjustment

A filter that changes the geometry of an image. Some of these filters are used to warp an image to achieve an artistic effects, but these filters can also be used to correct problems in the source image. For example, you can apply an affine transform to straighten an image that is rotated with respect to the horizon.

kCICategoryCompositeOperation

A filter operates on two image sources, using the color values of one image to operate on the other. Composite filters perform computations such as computing maximum values, minimum values, and multiplying values between input images. You can use compositing filters to add effects to an image, crop an image, and achieve a variety of other effects.

kCICategoryHalftoneEffect

A filter that simulates a variety of halftone screens, to mimic the halftone process used in print media. The output of these filters has the familiar “newspaper” look of the various dot patterns. Filters are typically named after the pattern created by the virtual halftone screen, such as circular screen or hatched screen.

kCICategoryColorAdjustment

A filter that changes color values. Color adjustment filters are used to eliminate color casts, adjust hue, and correct brightness and contrast. Color adjustment filters do not perform color management; ColorSync performs color management. You can use Quartz 2D to specify the color space associated with an image. For more information, see Color Management Overview and Quartz 2D Programming Guide.

kCICategoryColorEffect

A filter that modifies the color of an image to achieve an artistic effect. Examples of color effect filters include filters that change a color image to a sepia image or a monochrome image or that produces such effects as posterizing.

kCICategoryTransition

A filter that provides a bridge between two or more images by applying a motion effect that defines how the pixels of a source image yield to that of the destination image.

kCICategoryTileEffect

A filter that typically applies an effect to an image and then create smaller versions of the image (tiles), which are then laid out to create a pattern that’s infinite in extent.

kCICategoryGenerator

A filter that generates a pattern, such as a solid color, a checkerboard, or a star shine. The generated output is typically used as input to another filter.

kCICategoryReduction

A filter that reduces image data. These filters are used to solve image analysis problems.

kCICategoryGradient

A filter that generates a fill whose color varies smoothly. Exactly how color varies depends on the type of gradient—linear, radial, or Gaussian.

kCICategoryStylize

A filter that makes a photographic image look as if it was painted or sketched. These filters are typically used alone or in combination with other filters to achieve artistic effects.

kCICategorySharpen

A filter that sharpens images, increasing the contrast between the edges in an image. Examples of sharpen filters are unsharp mask and sharpen luminance.

kCICategoryBlur

A filter that softens images, decreasing the contrast between the edges in an image. Examples of blur filters are Gaussian blur and zoom blur.

kCICategoryVideo

A filter that works on video images.

kCICategoryStillImage

A filter that works on still images.

kCICategoryInterlaced

A filter that works on interlaced images.

kCICategoryNonSquarePixels

A filter that works on non-square pixels.

kCICategoryHighDynamicRange

A filter that works on high dynamic range pixels.

kCICategoryBuiltIn

A filter provided by Core Image. This distinguishes built-in filters from plug-in filters.

kCICategoryFilterGenerator

A filter created by chaining several filters together and then packaged as a CIFilterGenerator object.

Available in Mac OS X v10.5 and later.

Declared In
CIFilter.h

Options for Applying a Filter

Options that control the application of a Core Image filter.

extern NSString *kCIApplyOptionExtent;
extern NSString *kCIApplyOptionDefinition;
extern NSString *kCIApplyOptionUserInfo;

Constants
kCIApplyOptionExtent

The size of the produced image. The associated value is a four-element array (NSArray) that specifies the x-value of the rectangle origin, the y-value of the rectangle origin, and the width and height.

kCIApplyOptionDefinition

The domain of definition (DOD) of the produced image. The associated value is either a Core Image filter shape or a four-element array (NSArray) that specifies a rectangle.

kCIApplyOptionUserInfo

Information needed by a callback. The associated value is an object that Core Image will pass to any callbacks invoked for that filter.

Declared In
CIFilter.h

User Interface Control Options

Sets of controls for various user scenarios.

extern NSString *kCIUIParameterSet;
extern NSString *kCIUISetBasic;
extern NSString *kCIUISetIntermediate;
extern NSString *kCIUISetAdvanced;
extern NSString *kCIUISetDevelopment;

Constants
kCIUIParameterSet

The set of input parameters to use. The associated value can be kCIUISetBasic, kCIUISetIntermediate, kCIUISetAdvanced, or kCIUISetDevelopment.

kCIUISetBasic

Controls that are appropriate for a basic user scenario, that is, the minimum of settings to control the filter.

kCIUISetIntermediate

Controls that are appropriate for an intermediate user scenario.

kCIUISetAdvanced

Controls that are appropriate for an advanced user scenario.

kCIUISetDevelopment

Controls that should be visible only for development purposes.

Discussion

You can use these constants to specify the controls that you want associated with each user scenario. For example, for a filter that has many input parameters you can choose a small set of input parameters that the typical consumer can control and set the other input parameters to default values. For the same filter, however, you can choose to allow professional customers to control all the input parameters.

Declared In
CIFIlter.h

Filter Parameter Keys

Keys for input parameters to filters.

extern NSString *kCIOutputImageKey;
extern NSString *kCIInputBackgroundImageKey;
extern NSString *kCIInputImageKey;
extern NSString *kCIInputTimeKey;
extern NSString *kCIInputTransformKey;
extern NSString *kCIInputScaleKey;
extern NSString *kCIInputAspectRatioKey;
extern NSString *kCIInputCenterKey;
extern NSString *kCIInputRadiusKey;
extern NSString *kCIInputAngleKey;
extern NSString *kCIInputRefractionKey;
extern NSString *kCIInputWidthKey;
extern NSString *kCIInputSharpnessKey;
extern NSString *kCIInputIntensityKey;
extern NSString *kCIInputEVKey;
extern NSString *kCIInputSaturationKey;
extern NSString *kCIInputColorKey;
extern NSString *kCIInputBrightnessKey;
extern NSString *kCIInputContrastKey;
extern NSString *kCIInputGradientImageKey;
extern NSString *kCIInputMaskImageKey;
extern NSString *kCIInputShadingImageKey;
extern NSString *kCIInputTargetImageKey;
extern NSString *kCIInputExtentKey;

Constants
kCIOutputImageKey

A key for the CIImage object produced by a filter.

kCIInputBackgroundImageKey

A key for the CIImage object to use as a background image.

kCIInputImageKey

A key for the CIImage object to use as an input image. For filters that also use a background image, this key refers to the foreground image.

kCIInputTimeKey

A key for z scalar value (NSNumber) that specifies a time.

kCIInputTransformKey

A key for an NSAffineTransform object that specifies a transformation to apply.

kCIInputScaleKey

A key for a scalar value (NSNumber) that specifies the amount of the effect.

kCIInputAspectRatioKey

A key for a scalar value (NSNumber) that specifies a ratio.

kCIInputCenterKey

A key for a CIVector object that specifies the center of the area, as x and y- coordinates, to be filtered.

kCIInputRadiusKey

A key for a scalar value (NSNumber) that specifies that specifies the distance from the center of an effect.

kCIInputAngleKey

A key for a scalar value (NSNumber) that specifies an angle.

kCIInputRefractionKey

A key for a scalar value (NSNumber) that specifies the index of refraction of the material (such as glass) used in the effect.

kCIInputWidthKey

A key for a scalar value (NSNumber) that specifies the width of the effect.

kCIInputSharpnessKey

A key for a scalar value (NSNumber) that specifies the amount of sharpening to apply.

kCIInputIntensityKey

A key for a scalar value (NSNumber) that specifies an intensity value.

kCIInputEVKey

A key for a scalar value (NSNumber) that specifies how many F-stops brighter or darker the image should be.

kCIInputSaturationKey

A key for a scalar value (NSNumber) that specifies the amount to adjust the saturation.

kCIInputColorKey

A key for a CIColor object that specifies a color value.

kCIInputBrightnessKey

A key for a scalar value (NSNumber) that specifies a brightness level.

kCIInputContrastKey

A key for a scalar value (NSNumber) that specifies a contrast level.

kCIInputGradientImageKey

A key for a CIImage object that specifies an environment map with alpha. Typically, this image contains highlight and shadow.

kCIInputMaskImageKey

A key for a CIImage object to use as a mask.

kCIInputShadingImageKey

A key for a CIImage object that specifies an environment map with alpha values. Typically this image contains highlight and shadow.

kCIInputTargetImageKey

A key for a CIImage object that is the target image for a transition.

kCIInputExtentKey

A key for a CIVector object that specifies a rectangle that defines the extent of the effect.

Discussion

These keys represent some of the most commonly used input parameters. A filter can use other kinds of input parameters.

Declared In
CIFIlter.h

RAW Image Options

Options for creating a CIFilter object from RAW image data.

extern NSString * const kCIInputDecoderVersionKey;
extern NSString * const kCISupportedDecoderVersionsKey;
extern NSString * const kCIInputBoostKey;
extern NSString * const kCIInputNeutralChromaticityXKey;
extern NSString * const kCIInputNeutralChromaticityYKey;
extern NSString * const kCIInputNeutralTemperatureKey;
extern NSString * const kCIInputNeutralTintKey;
extern NSString * const kCIInputNeutralLocation;
extern NSString * const kCIInputScaleFactorKey;
extern NSString * const kCIInputAllowDraftModeKey;
extern NSString * const kCIInputIgnoreImageOrientationKey;
extern NSString * const kCIInputImageOrientationKey;
extern NSString * const kCIInputEnableSharpeningKey;
extern NSString * const kCIInputEnableChromaticNoiseTrackingKey;
extern NSString * const kCIInputBoostShadowAmountKey;
extern NSString * const kCIInputBiasKey;

Constants
kCIInputDecoderVersionKey

A key for the version number of the method to be used for decoding. A newly initialized object defaults to the newest available decoder version for the given image type. You can request an alternative, older version to maintain compatibility with older releases. Must be one of kCISupportedDecoderVersions, otherwise a nil output image is generated. The associated value must be an NSNumber object that specifies an integer value in range of 0 to the current decoder version. When you request a specific version of the decoder, Core Image produces an image that is visually the same across different versions of the operating system. Core Image, however, does not guarantee that the same bits are produced across different versions of the operating system. That’s because the rounding behavior of floating-point arithmetic can vary due to differences in compilers or hardware. Note that this option has no effect if the image used for initialization is not RAW.

kCISupportedDecoderVersionsKey

A key for the supported decoder versions. The associated value is an NSArray object that contains all supported decoder versions for the given image type, sorted in increasingly newer order. Each entry is an NSDictionary object that contains key-value pairs. All entries represent a valid version identifier that can be passed as the kCIDecoderVersion value for the key kCIDecoderMethodKey. Version values are read-only; attempting to set this value raises an exception. Currently, the only defined key is @"version" which has as its value an NSString that uniquely describing a given decoder version. This string might not be suitable for user interface display..

kCIInputBoostKey

A key for the the amount of boost to apply to an image. The associated value is a floating-point value packaged as an NSNumber object. The value must be in the range of 0...1. A value of 0 indicates no boost, that is, a linear response. The default value is 1, which indicates full boost.

kCIInputNeutralChromaticityXKey

The x value of the chromaticity. The associated value is a floating-point value packaged as an NSNumber object. You can query this value to get the current x value for neutral x, y.

kCIInputNeutralChromaticityYKey

The y value of the chromaticity. The associated value is a floating-point value packaged as an NSNumber object. You can query this value to get the current y value for neutral x, y.

kCIInputNeutralTemperatureKey

A key for neutral temperature. The associated value is a floating-point value packaged as an NSNumber object. You can query this value to get the current temperature value.

kCIInputNeutralTintKey

A key for the neutral tint. The associated value is a floating-point value packaged as an NSNumber object. Use this key to set or fetch the temperature and tint values. You can query this value to get the current tint value.

kCIInputNeutralLocationKey

A key for the neutral position. Use this key to set the location in geometric coordinates of the unrotated output image that should be used as neutral. You cannot query this value; it is undefined for reading. The associated value is a two-element CIVector object that specifies the location (x, y).

kCIInputScaleFactorKey

A key for the scale factor. The associated value is a floating-point value packaged as an NSNumber object that specifies the desired scale factor at which the image will be drawn. Setting this value can greatly improve the drawing performance. A value of 1 is the identity. In some cases, if you change the scale factor and enable draft mode, performance can decrease. See kCIAllowDraftModeKey.