Contents

applyingFilter(_:parameters:)

Returns a new image created by applying a filter to the original image with the specified name and parameters.

Declaration

func applyingFilter(_ filterName: String, parameters params: [String : Any]) -> CIImage

Parameters

  • filterName:

    The name of the filter to apply, as used when creating a Cifilter Swift.class instance with the Init(name:) method.

  • params:

    A dictionary whose key-value pairs are set as input values to the filter. Each key is a constant that specifies the name of an input parameter for the filter, and the corresponding value is the value for that parameter. See TP40004346 for built-in filters and their allowed parameters.

Return Value

An image object representing the result of applying the filter.

Discussion

Calling this method is equivalent to the following sequence of steps:

  1. Creating a CIFilter instance

  2. Setting the original image as the filter’s inputImage parameter

  3. Setting the remaining filter parameters from the params dictionary

  4. Retrieving the outputImage object from the filter

See Also

Creating an Image by Modifying an Existing Image