Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CIFilter+Extension.swift
//
// Created by はるふ on 2017/12/11.
// Copyright © 2017年 ha1f. All rights reserved.
//
import Foundation
import CoreImage
import AVFoundation
extension CIFilter {
/// [CIAccordionFoldTransition](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAccordionFoldTransition)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTargetImage: The target image for a transition.
/// - parameter inputBottomHeight: defaultValue = 0.
/// - parameter inputNumberOfFolds: defaultValue = 3.
/// - parameter inputFoldShadowAmount: defaultValue = 0.1.
/// - parameter inputTime: The duration of the effect. defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 8, *)
static func accordionFoldTransition(inputImage: CIImage, inputTargetImage: CIImage, inputBottomHeight: NSNumber = 0, inputNumberOfFolds: NSNumber = 3, inputFoldShadowAmount: NSNumber = 0.1, inputTime: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIAccordionFoldTransition") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTargetImage, forKey: "inputTargetImage")
filter.setValue(inputBottomHeight, forKey: "inputBottomHeight")
filter.setValue(inputNumberOfFolds, forKey: "inputNumberOfFolds")
filter.setValue(inputFoldShadowAmount, forKey: "inputFoldShadowAmount")
filter.setValue(inputTime, forKey: kCIInputTimeKey)
return filter
}
/// [CIAdditionCompositing](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAdditionCompositing)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func additionCompositing(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIAdditionCompositing") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIAffineClamp](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAffineClamp)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTransform: The transform to apply to the image. defaultValue = CGAffineTransform: {{1, 0, 0, 1}, {0, 0}}.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func affineClamp(inputImage: CIImage, inputTransform: NSValue = NSValue(cgAffineTransform: CGAffineTransform(a: 1.0, b: 0.0, c: 0.0, d: 1.0, tx: 0.0, ty: 0.0))) -> CIFilter? {
guard let filter = CIFilter(name: "CIAffineClamp") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTransform, forKey: kCIInputTransformKey)
return filter
}
/// [CIAffineTile](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAffineTile)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTransform: The transform to apply to the image. defaultValue = CGAffineTransform: {{1, 0, 0, 1}, {0, 0}}.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func affineTile(inputImage: CIImage, inputTransform: NSValue = NSValue(cgAffineTransform: CGAffineTransform(a: 1.0, b: 0.0, c: 0.0, d: 1.0, tx: 0.0, ty: 0.0))) -> CIFilter? {
guard let filter = CIFilter(name: "CIAffineTile") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTransform, forKey: kCIInputTransformKey)
return filter
}
/// [CIAffineTransform](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAffineTransform)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTransform: A transform to apply to the image. defaultValue = CGAffineTransform: {{1, 0, 0, 1}, {0, 0}}.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func affineTransform(inputImage: CIImage, inputTransform: NSValue = NSValue(cgAffineTransform: CGAffineTransform(a: 1.0, b: 0.0, c: 0.0, d: 1.0, tx: 0.0, ty: 0.0))) -> CIFilter? {
guard let filter = CIFilter(name: "CIAffineTransform") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTransform, forKey: kCIInputTransformKey)
return filter
}
/// [CIAreaAverage](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAreaAverage)
///
/// - parameter inputImage: The image to process.
/// - parameter inputExtent: A rectangle that specifies the subregion of the image that you want to process. defaultValue = [0 0 640 80].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func areaAverage(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIAreaAverage") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
return filter
}
/// [CIAreaHistogram](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAreaHistogram)
///
/// - parameter inputImage: The image whose histogram you want to calculate.
/// - parameter inputExtent: A rectangle that, after intersection with the image extent, specifies the subregion of the image that you want to process. defaultValue = [0 0 640 80].
/// - parameter inputScale: The scale value to use for the histogram values. If the scale is 1.0, then the bins in the resulting image will add up to 1.0. defaultValue = 1.
/// - parameter inputCount: The number of bins for the histogram. This value will determine the width of the output image. defaultValue = 64.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage", "outputData"])
@available(iOS 8, *)
static func areaHistogram(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0), inputScale: NSNumber = 1, inputCount: NSNumber = 64) -> CIFilter? {
guard let filter = CIFilter(name: "CIAreaHistogram") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
filter.setValue(inputScale, forKey: kCIInputScaleKey)
filter.setValue(inputCount, forKey: "inputCount")
return filter
}
/// [CIAreaMaximum](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAreaMaximum)
///
/// - parameter inputImage: The image to process.
/// - parameter inputExtent: A rectangle that specifies the subregion of the image that you want to process. defaultValue = [0 0 640 80].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func areaMaximum(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIAreaMaximum") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
return filter
}
/// [CIAreaMaximumAlpha](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAreaMaximumAlpha)
///
/// - parameter inputImage: The image to process.
/// - parameter inputExtent: A rectangle that specifies the subregion of the image that you want to process. defaultValue = [0 0 640 80].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func areaMaximumAlpha(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIAreaMaximumAlpha") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
return filter
}
/// [CIAreaMinimum](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAreaMinimum)
///
/// - parameter inputImage: The image to process.
/// - parameter inputExtent: A rectangle that specifies the subregion of the image that you want to process. defaultValue = [0 0 640 80].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func areaMinimum(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIAreaMinimum") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
return filter
}
/// [CIAreaMinimumAlpha](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAreaMinimumAlpha)
///
/// - parameter inputImage: The image to process.
/// - parameter inputExtent: A rectangle that specifies the subregion of the image that you want to process. defaultValue = [0 0 640 80].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func areaMinimumAlpha(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIAreaMinimumAlpha") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
return filter
}
/// [CIAreaMinMaxRed](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAreaMinMaxRed)
///
/// - parameter inputImage: The image to process.
/// - parameter inputExtent: A rectangle that specifies the subregion of the image that you want to process. defaultValue = [0 0 640 80].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func areaMinMaxRed(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIAreaMinMaxRed") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
return filter
}
/// [CIAttributedTextImageGenerator](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAttributedTextImageGenerator)
///
/// - parameter inputText:
/// - parameter inputScaleFactor: defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func attributedTextImageGenerator(inputText: NSAttributedString, inputScaleFactor: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CIAttributedTextImageGenerator") else {
return nil
}
filter.setDefaults()
filter.setValue(inputText, forKey: "inputText")
filter.setValue(inputScaleFactor, forKey: "inputScaleFactor")
return filter
}
/// [CIAztecCodeGenerator](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIAztecCodeGenerator)
///
/// - parameter inputMessage:
/// - parameter inputCorrectionLevel: Aztec error correction value between 5 and 95 defaultValue = 23.
/// - parameter inputLayers: Aztec layers value between 1 and 32. Set to nil for automatic.
/// - parameter inputCompactStyle: Aztec force compact style @YES or @NO. Set to nil for automatic.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage", "outputCGImage"])
@available(iOS 8, *)
static func aztecCodeGenerator(inputMessage: NSData, inputCorrectionLevel: NSNumber = 23, inputLayers: NSNumber, inputCompactStyle: NSNumber) -> CIFilter? {
guard let filter = CIFilter(name: "CIAztecCodeGenerator") else {
return nil
}
filter.setDefaults()
filter.setValue(inputMessage, forKey: "inputMessage")
filter.setValue(inputCorrectionLevel, forKey: "inputCorrectionLevel")
filter.setValue(inputLayers, forKey: "inputLayers")
filter.setValue(inputCompactStyle, forKey: "inputCompactStyle")
return filter
}
/// [CIBarcodeGenerator](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBarcodeGenerator)
///
/// - parameter inputBarcodeDescriptor:
///
/// - returns: Generated CIFilter (you can get result with ["outputImage", "outputCGImageForQRCodeDescriptor", "outputCGImageForAztecCodeDescriptor", "outputCGImageForPDF417CodeDescriptor", "outputCGImageForDataMatrixCodeDescriptor", "outputCGImage"])
@available(iOS 11, *)
static func barcodeGenerator(inputBarcodeDescriptor: CIBarcodeDescriptor) -> CIFilter? {
guard let filter = CIFilter(name: "CIBarcodeGenerator") else {
return nil
}
filter.setDefaults()
filter.setValue(inputBarcodeDescriptor, forKey: "inputBarcodeDescriptor")
return filter
}
/// [CIBarsSwipeTransition](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBarsSwipeTransition)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTargetImage: The target image for a transition.
/// - parameter inputAngle: The angle (in radians) of the bars. defaultValue = 3.141592653589793.
/// - parameter inputWidth: The width of each bar. defaultValue = 30.
/// - parameter inputBarOffset: The offset of one bar with respect to another defaultValue = 10.
/// - parameter inputTime: The parametric time of the transition. This value drives the transition from start (at time 0) to end (at time 1). defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func barsSwipeTransition(inputImage: CIImage, inputTargetImage: CIImage, inputAngle: NSNumber = 3.141592653589793, inputWidth: NSNumber = 30, inputBarOffset: NSNumber = 10, inputTime: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIBarsSwipeTransition") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTargetImage, forKey: "inputTargetImage")
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputBarOffset, forKey: "inputBarOffset")
filter.setValue(inputTime, forKey: kCIInputTimeKey)
return filter
}
/// [CIBicubicScaleTransform](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBicubicScaleTransform)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputScale: The scaling factor to use on the image. Values less than 1.0 scale down the images. Values greater than 1.0 scale up the image. defaultValue = 1.
/// - parameter inputAspectRatio: The additional horizontal scaling factor to use on the image. defaultValue = 1.
/// - parameter inputB: Specifies the value of B to use for the cubic resampling function. defaultValue = 0.
/// - parameter inputC: Specifies the value of C to use for the cubic resampling function. defaultValue = 0.75.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func bicubicScaleTransform(inputImage: CIImage, inputScale: NSNumber = 1, inputAspectRatio: NSNumber = 1, inputB: NSNumber = 0, inputC: NSNumber = 0.75) -> CIFilter? {
guard let filter = CIFilter(name: "CIBicubicScaleTransform") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputScale, forKey: kCIInputScaleKey)
filter.setValue(inputAspectRatio, forKey: "inputAspectRatio")
filter.setValue(inputB, forKey: "inputB")
filter.setValue(inputC, forKey: "inputC")
return filter
}
/// [CIBlendWithAlphaMask](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBlendWithAlphaMask)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
/// - parameter inputMaskImage: A masking image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func blendWithAlphaMask(inputImage: CIImage, inputBackgroundImage: CIImage, inputMaskImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIBlendWithAlphaMask") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
filter.setValue(inputMaskImage, forKey: kCIInputMaskImageKey)
return filter
}
/// [CIBlendWithBlueMask](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBlendWithBlueMask)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
/// - parameter inputMaskImage: A masking image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func blendWithBlueMask(inputImage: CIImage, inputBackgroundImage: CIImage, inputMaskImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIBlendWithBlueMask") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
filter.setValue(inputMaskImage, forKey: kCIInputMaskImageKey)
return filter
}
/// [CIBlendWithMask](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBlendWithMask)
///
/// - parameter inputImage: The image to use as a foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
/// - parameter inputMaskImage: A grayscale mask. When a mask value is 0.0, the result is the background. When the mask value is 1.0, the result is the image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func blendWithMask(inputImage: CIImage, inputBackgroundImage: CIImage, inputMaskImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIBlendWithMask") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
filter.setValue(inputMaskImage, forKey: kCIInputMaskImageKey)
return filter
}
/// [CIBlendWithRedMask](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBlendWithRedMask)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
/// - parameter inputMaskImage: A masking image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func blendWithRedMask(inputImage: CIImage, inputBackgroundImage: CIImage, inputMaskImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIBlendWithRedMask") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
filter.setValue(inputMaskImage, forKey: kCIInputMaskImageKey)
return filter
}
/// [CIBloom](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBloom)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: The radius determines how many pixels are used to create the effect. The larger the radius, the greater the effect. defaultValue = 10.
/// - parameter inputIntensity: The intensity of the effect. A value of 0.0 is no effect. A value of 1.0 is the maximum effect. defaultValue = 0.5.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func bloom(inputImage: CIImage, inputRadius: NSNumber = 10, inputIntensity: NSNumber = 0.5) -> CIFilter? {
guard let filter = CIFilter(name: "CIBloom") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputIntensity, forKey: kCIInputIntensityKey)
return filter
}
/// [CIBokehBlur](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBokehBlur)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: The radius determines how many pixels are used to create the blur. The larger the radius, the blurrier the result. defaultValue = 20.
/// - parameter inputRingAmount: The amount of extra emphasis at the ring of the bokeh. defaultValue = 0.
/// - parameter inputRingSize: The size of extra emphasis at the ring of the bokeh defaultValue = 0.1.
/// - parameter inputSoftness: defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func bokehBlur(inputImage: CIImage, inputRadius: NSNumber = 20, inputRingAmount: NSNumber = 0, inputRingSize: NSNumber = 0.1, inputSoftness: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CIBokehBlur") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputRingAmount, forKey: "inputRingAmount")
filter.setValue(inputRingSize, forKey: "inputRingSize")
filter.setValue(inputSoftness, forKey: "inputSoftness")
return filter
}
/// [CIBoxBlur](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBoxBlur)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: The radius determines how many pixels are used to create the blur. The larger the radius, the blurrier the result. defaultValue = 10.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func boxBlur(inputImage: CIImage, inputRadius: NSNumber = 10) -> CIFilter? {
guard let filter = CIFilter(name: "CIBoxBlur") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CIBumpDistortion](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBumpDistortion)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
/// - parameter inputRadius: The radius determines how many pixels are used to create the distortion. The larger the radius, the wider the extent of the distortion. defaultValue = 300.
/// - parameter inputScale: The scale of the effect determines the curvature of the bump. A value of 0.0 has no effect. Positive values create an outward bump; negative values create an inward bump. defaultValue = 0.5.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func bumpDistortion(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputRadius: NSNumber = 300, inputScale: NSNumber = 0.5) -> CIFilter? {
guard let filter = CIFilter(name: "CIBumpDistortion") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputScale, forKey: kCIInputScaleKey)
return filter
}
/// [CIBumpDistortionLinear](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBumpDistortionLinear)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
/// - parameter inputRadius: The radius determines how many pixels are used to create the distortion. The larger the radius, the wider the extent of the distortion. defaultValue = 300.
/// - parameter inputAngle: The angle (in radians) of the line around which the distortion occurs. defaultValue = 0.
/// - parameter inputScale: The scale of the effect. defaultValue = 0.5.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func bumpDistortionLinear(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputRadius: NSNumber = 300, inputAngle: NSNumber = 0, inputScale: NSNumber = 0.5) -> CIFilter? {
guard let filter = CIFilter(name: "CIBumpDistortionLinear") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputScale, forKey: kCIInputScaleKey)
return filter
}
/// [CICheckerboardGenerator](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICheckerboardGenerator)
///
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
/// - parameter inputColor0: A color to use for the first set of squares. defaultValue = (1 1 1 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputColor1: A color to use for the second set of squares. defaultValue = (0 0 0 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputWidth: The width of the squares in the pattern. defaultValue = 80.
/// - parameter inputSharpness: The sharpness of the edges in pattern. The smaller the value, the more blurry the pattern. Values range from 0.0 to 1.0. defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func checkerboardGenerator(inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputColor0: CIColor, inputColor1: CIColor, inputWidth: NSNumber = 80, inputSharpness: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CICheckerboardGenerator") else {
return nil
}
filter.setDefaults()
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputColor0, forKey: "inputColor0")
filter.setValue(inputColor1, forKey: "inputColor1")
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputSharpness, forKey: kCIInputSharpnessKey)
return filter
}
/// [CICircleSplashDistortion](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICircleSplashDistortion)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
/// - parameter inputRadius: The radius determines how many pixels are used to create the distortion. The larger the radius, the wider the extent of the distortion. defaultValue = 150.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func circleSplashDistortion(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputRadius: NSNumber = 150) -> CIFilter? {
guard let filter = CIFilter(name: "CICircleSplashDistortion") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CICircularScreen](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICircularScreen)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the circular screen pattern defaultValue = [150 150].
/// - parameter inputWidth: The distance between each circle in the pattern. defaultValue = 6.
/// - parameter inputSharpness: The sharpness of the circles. The larger the value, the sharper the circles. defaultValue = 0.7.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func circularScreen(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputWidth: NSNumber = 6, inputSharpness: NSNumber = 0.7) -> CIFilter? {
guard let filter = CIFilter(name: "CICircularScreen") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputSharpness, forKey: kCIInputSharpnessKey)
return filter
}
/// [CICircularWrap](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICircularWrap)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
/// - parameter inputRadius: The radius determines how many pixels are used to create the distortion. The larger the radius, the wider the extent of the distortion. defaultValue = 150.
/// - parameter inputAngle: The angle of the effect. defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func circularWrap(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputRadius: NSNumber = 150, inputAngle: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CICircularWrap") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
return filter
}
/// [CIClamp](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIClamp)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputExtent: A rectangle that defines the extent of the effect. defaultValue = [0 0 640 80].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 10, *)
static func clamp(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIClamp") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
return filter
}
/// [CICMYKHalftone](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICMYKHalftone)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the halftone pattern defaultValue = [150 150].
/// - parameter inputWidth: The distance between dots in the pattern. defaultValue = 6.
/// - parameter inputAngle: The angle of the pattern. defaultValue = 0.
/// - parameter inputSharpness: The sharpness of the pattern. The larger the value, the sharper the pattern. defaultValue = 0.7.
/// - parameter inputGCR: The gray component replacement value. The value can vary from 0.0 (none) to 1.0. defaultValue = 1.
/// - parameter inputUCR: The under color removal value. The value can vary from 0.0 to 1.0. defaultValue = 0.5.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func cMYKHalftone(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputWidth: NSNumber = 6, inputAngle: NSNumber = 0, inputSharpness: NSNumber = 0.7, inputGCR: NSNumber = 1, inputUCR: NSNumber = 0.5) -> CIFilter? {
guard let filter = CIFilter(name: "CICMYKHalftone") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputSharpness, forKey: kCIInputSharpnessKey)
filter.setValue(inputGCR, forKey: "inputGCR")
filter.setValue(inputUCR, forKey: "inputUCR")
return filter
}
/// [CICode128BarcodeGenerator](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICode128BarcodeGenerator)
///
/// - parameter inputMessage:
/// - parameter inputQuietSpace: defaultValue = 7.
/// - parameter inputBarcodeHeight: defaultValue = 32.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage", "outputCGImage"])
@available(iOS 8, *)
static func code128BarcodeGenerator(inputMessage: NSData, inputQuietSpace: NSNumber = 7, inputBarcodeHeight: NSNumber = 32) -> CIFilter? {
guard let filter = CIFilter(name: "CICode128BarcodeGenerator") else {
return nil
}
filter.setDefaults()
filter.setValue(inputMessage, forKey: "inputMessage")
filter.setValue(inputQuietSpace, forKey: "inputQuietSpace")
filter.setValue(inputBarcodeHeight, forKey: "inputBarcodeHeight")
return filter
}
/// [CIColorBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func colorBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIColorBurnBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorBurnBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func colorBurnBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorBurnBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIColorClamp](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorClamp)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputMinComponents: Lower clamping values defaultValue = [0 0 0 0].
/// - parameter inputMaxComponents: Higher clamping values defaultValue = [1 1 1 1].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func colorClamp(inputImage: CIImage, inputMinComponents: CIVector = CIVector(x: 0.0, y: 0.0, z: 0.0, w: 0.0), inputMaxComponents: CIVector = CIVector(x: 1.0, y: 1.0, z: 1.0, w: 1.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorClamp") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputMinComponents, forKey: "inputMinComponents")
filter.setValue(inputMaxComponents, forKey: "inputMaxComponents")
return filter
}
/// [CIColorControls](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorControls)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputSaturation: The amount of saturation to apply. The larger the value, the more saturated the result. defaultValue = 1.
/// - parameter inputBrightness: The amount of brightness to apply. The larger the value, the brighter the result. defaultValue = 0.
/// - parameter inputContrast: The amount of contrast to apply. The larger the value, the more contrast in the resulting image. defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func colorControls(inputImage: CIImage, inputSaturation: NSNumber = 1, inputBrightness: NSNumber = 0, inputContrast: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorControls") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputSaturation, forKey: "inputSaturation")
filter.setValue(inputBrightness, forKey: kCIInputBrightnessKey)
filter.setValue(inputContrast, forKey: kCIInputContrastKey)
return filter
}
/// [CIColorCrossPolynomial](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorCrossPolynomial)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRedCoefficients: Polynomial coefficients for red channel defaultValue = [1 0 0 0 0 0 0 0 0 0].
/// - parameter inputGreenCoefficients: Polynomial coefficients for green channel defaultValue = [0 1 0 0 0 0 0 0 0 0].
/// - parameter inputBlueCoefficients: Polynomial coefficients for blue channel defaultValue = [0 0 1 0 0 0 0 0 0 0].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func colorCrossPolynomial(inputImage: CIImage, inputRedCoefficients: CIVector = CIVector(), inputGreenCoefficients: CIVector = CIVector(), inputBlueCoefficients: CIVector = CIVector()) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorCrossPolynomial") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRedCoefficients, forKey: "inputRedCoefficients")
filter.setValue(inputGreenCoefficients, forKey: "inputGreenCoefficients")
filter.setValue(inputBlueCoefficients, forKey: "inputBlueCoefficients")
return filter
}
/// [CIColorCube](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorCube)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCubeDimension: defaultValue = 2.
/// - parameter inputCubeData: This is a color table of floating-point RGBA cells that use premultiplied alpha. The cells are organized in a standard ordering. The columns and rows of the data are indexed by red and green, respectively. Each data plane is followed by the next higher plane in the data, with planes indexed by blue. defaultValue = <00000000 00000000 00000000 0000803f 0000803f 00000000 00000000 0000803f 00000000 0000803f 00000000 0000803f 0000803f 0000803f 00000000 0000803f 00000000 00000000 0000803f 0000803f 0000803f 00000000 0000803f 0000803f 00000000 0000803f 0000803f 0000803f 0000803f 0000803f 0000803f 0000803f>.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func colorCube(inputImage: CIImage, inputCubeDimension: NSNumber = 2, inputCubeData: NSData) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorCube") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCubeDimension, forKey: "inputCubeDimension")
filter.setValue(inputCubeData, forKey: "inputCubeData")
return filter
}
/// [CIColorCubesMixedWithMask](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorCubesMixedWithMask)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputMaskImage: A masking image.
/// - parameter inputCubeDimension: defaultValue = 2.
/// - parameter inputCube0Data: defaultValue = <00000000 00000000 00000000 0000803f 0000803f 00000000 00000000 0000803f 00000000 0000803f 00000000 0000803f 0000803f 0000803f 00000000 0000803f 00000000 00000000 0000803f 0000803f 0000803f 00000000 0000803f 0000803f 00000000 0000803f 0000803f 0000803f 0000803f 0000803f 0000803f 0000803f>.
/// - parameter inputCube1Data: defaultValue = <00000000 00000000 00000000 0000803f 0000803f 00000000 00000000 0000803f 00000000 0000803f 00000000 0000803f 0000803f 0000803f 00000000 0000803f 00000000 00000000 0000803f 0000803f 0000803f 00000000 0000803f 0000803f 00000000 0000803f 0000803f 0000803f 0000803f 0000803f 0000803f 0000803f>.
/// - parameter inputColorSpace:
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func colorCubesMixedWithMask(inputImage: CIImage, inputMaskImage: CIImage, inputCubeDimension: NSNumber = 2, inputCube0Data: NSData, inputCube1Data: NSData, inputColorSpace: NSObject) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorCubesMixedWithMask") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputMaskImage, forKey: kCIInputMaskImageKey)
filter.setValue(inputCubeDimension, forKey: "inputCubeDimension")
filter.setValue(inputCube0Data, forKey: "inputCube0Data")
filter.setValue(inputCube1Data, forKey: "inputCube1Data")
filter.setValue(inputColorSpace, forKey: "inputColorSpace")
return filter
}
/// [CIColorCubeWithColorSpace](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorCubeWithColorSpace)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCubeDimension: defaultValue = 2.
/// - parameter inputCubeData: defaultValue = <00000000 00000000 00000000 0000803f 0000803f 00000000 00000000 0000803f 00000000 0000803f 00000000 0000803f 0000803f 0000803f 00000000 0000803f 00000000 00000000 0000803f 0000803f 0000803f 00000000 0000803f 0000803f 00000000 0000803f 0000803f 0000803f 0000803f 0000803f 0000803f 0000803f>.
/// - parameter inputColorSpace:
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func colorCubeWithColorSpace(inputImage: CIImage, inputCubeDimension: NSNumber = 2, inputCubeData: NSData, inputColorSpace: NSObject) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorCubeWithColorSpace") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCubeDimension, forKey: "inputCubeDimension")
filter.setValue(inputCubeData, forKey: "inputCubeData")
filter.setValue(inputColorSpace, forKey: "inputColorSpace")
return filter
}
/// [CIColorCurves](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorCurves)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCurvesData: defaultValue = <00000000 00000000 00000000 0000003f 0000003f 0000003f 0000803f 0000803f 0000803f>.
/// - parameter inputCurvesDomain: defaultValue = [0 1].
/// - parameter inputColorSpace:
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func colorCurves(inputImage: CIImage, inputCurvesData: NSData, inputCurvesDomain: CIVector = CIVector(x: 0.0, y: 1.0), inputColorSpace: NSObject) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorCurves") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCurvesData, forKey: "inputCurvesData")
filter.setValue(inputCurvesDomain, forKey: "inputCurvesDomain")
filter.setValue(inputColorSpace, forKey: "inputColorSpace")
return filter
}
/// [CIColorDodgeBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorDodgeBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func colorDodgeBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorDodgeBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIColorInvert](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorInvert)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func colorInvert(inputImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorInvert") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
return filter
}
/// [CIColorMap](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorMap)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputGradientImage: The image data from this image transforms the source image values.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func colorMap(inputImage: CIImage, inputGradientImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorMap") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputGradientImage, forKey: "inputGradientImage")
return filter
}
/// [CIColorMatrix](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorMatrix)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRVector: The amount of red to multiply the source color values by. defaultValue = [1 0 0 0].
/// - parameter inputGVector: The amount of green to multiply the source color values by. defaultValue = [0 1 0 0].
/// - parameter inputBVector: The amount of blue to multiply the source color values by. defaultValue = [0 0 1 0].
/// - parameter inputAVector: The amount of alpha to multiply the source color values by. defaultValue = [0 0 0 1].
/// - parameter inputBiasVector: A vector that’s added to each color component. defaultValue = [0 0 0 0].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func colorMatrix(inputImage: CIImage, inputRVector: CIVector = CIVector(x: 1.0, y: 0.0, z: 0.0, w: 0.0), inputGVector: CIVector = CIVector(x: 0.0, y: 1.0, z: 0.0, w: 0.0), inputBVector: CIVector = CIVector(x: 0.0, y: 0.0, z: 1.0, w: 0.0), inputAVector: CIVector = CIVector(x: 0.0, y: 0.0, z: 0.0, w: 1.0), inputBiasVector: CIVector = CIVector(x: 0.0, y: 0.0, z: 0.0, w: 0.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorMatrix") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRVector, forKey: "inputRVector")
filter.setValue(inputGVector, forKey: "inputGVector")
filter.setValue(inputBVector, forKey: "inputBVector")
filter.setValue(inputAVector, forKey: "inputAVector")
filter.setValue(inputBiasVector, forKey: "inputBiasVector")
return filter
}
/// [CIColorMonochrome](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorMonochrome)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputColor: The monochrome color to apply to the image. defaultValue = (0.6 0.45 0.3 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputIntensity: The intensity of the monochrome effect. A value of 1.0 creates a monochrome image using the supplied color. A value of 0.0 has no effect on the image. defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func colorMonochrome(inputImage: CIImage, inputColor: CIColor, inputIntensity: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorMonochrome") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputColor, forKey: kCIInputColorKey)
filter.setValue(inputIntensity, forKey: kCIInputIntensityKey)
return filter
}
/// [CIColorPolynomial](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorPolynomial)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRedCoefficients: Polynomial coefficients for red channel defaultValue = [0 1 0 0].
/// - parameter inputGreenCoefficients: Polynomial coefficients for green channel defaultValue = [0 1 0 0].
/// - parameter inputBlueCoefficients: Polynomial coefficients for blue channel defaultValue = [0 1 0 0].
/// - parameter inputAlphaCoefficients: Polynomial coefficients for alpha channel defaultValue = [0 1 0 0].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func colorPolynomial(inputImage: CIImage, inputRedCoefficients: CIVector = CIVector(x: 0.0, y: 1.0, z: 0.0, w: 0.0), inputGreenCoefficients: CIVector = CIVector(x: 0.0, y: 1.0, z: 0.0, w: 0.0), inputBlueCoefficients: CIVector = CIVector(x: 0.0, y: 1.0, z: 0.0, w: 0.0), inputAlphaCoefficients: CIVector = CIVector(x: 0.0, y: 1.0, z: 0.0, w: 0.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorPolynomial") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRedCoefficients, forKey: "inputRedCoefficients")
filter.setValue(inputGreenCoefficients, forKey: "inputGreenCoefficients")
filter.setValue(inputBlueCoefficients, forKey: "inputBlueCoefficients")
filter.setValue(inputAlphaCoefficients, forKey: "inputAlphaCoefficients")
return filter
}
/// [CIColorPosterize](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorPosterize)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputLevels: The number of brightness levels to use for each color component. Lower values result in a more extreme poster effect. defaultValue = 6.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func colorPosterize(inputImage: CIImage, inputLevels: NSNumber = 6) -> CIFilter? {
guard let filter = CIFilter(name: "CIColorPosterize") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputLevels, forKey: "inputLevels")
return filter
}
/// [CIColumnAverage](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColumnAverage)
///
/// - parameter inputImage: The image to process.
/// - parameter inputExtent: A rectangle that specifies the subregion of the image that you want to process. defaultValue = [0 0 640 80].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func columnAverage(inputImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 640.0, w: 80.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIColumnAverage") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
return filter
}
/// [CIComicEffect](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIComicEffect)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func comicEffect(inputImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIComicEffect") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
return filter
}
/// [CIConstantColorGenerator](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIConstantColorGenerator)
///
/// - parameter inputColor: The color to generate. defaultValue = (1 0 0 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func constantColorGenerator(inputColor: CIColor) -> CIFilter? {
guard let filter = CIFilter(name: "CIConstantColorGenerator") else {
return nil
}
filter.setDefaults()
filter.setValue(inputColor, forKey: kCIInputColorKey)
return filter
}
/// [CIConvolution3X3](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIConvolution3X3)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputWeights: defaultValue = [0 0 0 0 1 0 0 0 0].
/// - parameter inputBias: defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func convolution3X3(inputImage: CIImage, inputWeights: CIVector = CIVector(), inputBias: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIConvolution3X3") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputWeights, forKey: kCIInputWeightsKey)
filter.setValue(inputBias, forKey: kCIInputBiasKey)
return filter
}
/// [CIConvolution5X5](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIConvolution5X5)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputWeights: defaultValue = [0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0].
/// - parameter inputBias: defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func convolution5X5(inputImage: CIImage, inputWeights: CIVector = CIVector(), inputBias: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIConvolution5X5") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputWeights, forKey: kCIInputWeightsKey)
filter.setValue(inputBias, forKey: kCIInputBiasKey)
return filter
}
/// [CIConvolution7X7](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIConvolution7X7)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputWeights: defaultValue = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0].
/// - parameter inputBias: defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func convolution7X7(inputImage: CIImage, inputWeights: CIVector = CIVector(), inputBias: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIConvolution7X7") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputWeights, forKey: kCIInputWeightsKey)
filter.setValue(inputBias, forKey: kCIInputBiasKey)
return filter
}
/// [CIConvolution9Horizontal](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIConvolution9Horizontal)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputWeights: defaultValue = [0 0 0 0 1 0 0 0 0].
/// - parameter inputBias: defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func convolution9Horizontal(inputImage: CIImage, inputWeights: CIVector = CIVector(), inputBias: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIConvolution9Horizontal") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputWeights, forKey: kCIInputWeightsKey)
filter.setValue(inputBias, forKey: kCIInputBiasKey)
return filter
}
/// [CIConvolution9Vertical](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIConvolution9Vertical)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputWeights: defaultValue = [0 0 0 0 1 0 0 0 0].
/// - parameter inputBias: defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func convolution9Vertical(inputImage: CIImage, inputWeights: CIVector = CIVector(), inputBias: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIConvolution9Vertical") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputWeights, forKey: kCIInputWeightsKey)
filter.setValue(inputBias, forKey: kCIInputBiasKey)
return filter
}
/// [CICopyMachineTransition](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICopyMachineTransition)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTargetImage: The target image for a transition.
/// - parameter inputExtent: A rectangle that defines the extent of the effect. defaultValue = [0 0 300 300].
/// - parameter inputColor: The color of the copier light. defaultValue = (0.6 1 0.8 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputTime: The parametric time of the transition. This value drives the transition from start (at time 0) to end (at time 1). defaultValue = 0.
/// - parameter inputAngle: The angle of the copier light. defaultValue = 0.
/// - parameter inputWidth: The width of the copier light. defaultValue = 200.
/// - parameter inputOpacity: The opacity of the copier light. A value of 0.0 is transparent. A value of 1.0 is opaque. defaultValue = 1.3.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func copyMachineTransition(inputImage: CIImage, inputTargetImage: CIImage, inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 300.0, w: 300.0), inputColor: CIColor, inputTime: NSNumber = 0, inputAngle: NSNumber = 0, inputWidth: NSNumber = 200, inputOpacity: NSNumber = 1.3) -> CIFilter? {
guard let filter = CIFilter(name: "CICopyMachineTransition") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTargetImage, forKey: "inputTargetImage")
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
filter.setValue(inputColor, forKey: kCIInputColorKey)
filter.setValue(inputTime, forKey: kCIInputTimeKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputOpacity, forKey: "inputOpacity")
return filter
}
/// [CICrop](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICrop)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRectangle: The rectangle that specifies the crop to apply to the image. defaultValue = [-8.98847e+307 -8.98847e+307 1.79769e+308 1.79769e+308].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func crop(inputImage: CIImage, inputRectangle: CIVector = CIVector(x: -8.98846567431158e+307, y: -8.98846567431158e+307, z: 1.79769313486232e+308, w: 1.79769313486232e+308)) -> CIFilter? {
guard let filter = CIFilter(name: "CICrop") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRectangle, forKey: "inputRectangle")
return filter
}
/// [CICrystallize](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CICrystallize)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: The radius determines how many pixels are used to create the effect. The larger the radius, the larger the resulting crystals. defaultValue = 20.
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func crystallize(inputImage: CIImage, inputRadius: NSNumber = 20, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CICrystallize") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
return filter
}
/// [CIDarkenBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDarkenBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func darkenBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIDarkenBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIDepthBlurEffect](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDepthBlurEffect)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputDisparityImage:
/// - parameter inputAperture: defaultValue = 0.
/// - parameter inputLeftEyePositions:
/// - parameter inputRightEyePositions:
/// - parameter inputChinPositions:
/// - parameter inputNosePositions:
/// - parameter inputFocusRect:
/// - parameter inputLumaNoiseScale: defaultValue = 0.
/// - parameter inputScaleFactor: defaultValue = 1.
/// - parameter inputCalibrationData:
/// - parameter inputAuxDataMetadata:
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func depthBlurEffect(inputImage: CIImage, inputDisparityImage: CIImage, inputAperture: NSNumber = 0, inputLeftEyePositions: CIVector, inputRightEyePositions: CIVector, inputChinPositions: CIVector, inputNosePositions: CIVector, inputFocusRect: CIVector, inputLumaNoiseScale: NSNumber = 0, inputScaleFactor: NSNumber = 1, inputCalibrationData: AVCameraCalibrationData, inputAuxDataMetadata: NSDictionary) -> CIFilter? {
guard let filter = CIFilter(name: "CIDepthBlurEffect") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputDisparityImage, forKey: "inputDisparityImage")
filter.setValue(inputAperture, forKey: "inputAperture")
filter.setValue(inputLeftEyePositions, forKey: "inputLeftEyePositions")
filter.setValue(inputRightEyePositions, forKey: "inputRightEyePositions")
filter.setValue(inputChinPositions, forKey: "inputChinPositions")
filter.setValue(inputNosePositions, forKey: "inputNosePositions")
filter.setValue(inputFocusRect, forKey: "inputFocusRect")
filter.setValue(inputLumaNoiseScale, forKey: "inputLumaNoiseScale")
filter.setValue(inputScaleFactor, forKey: "inputScaleFactor")
filter.setValue(inputCalibrationData, forKey: "inputCalibrationData")
filter.setValue(inputAuxDataMetadata, forKey: "inputAuxDataMetadata")
return filter
}
/// [CIDepthOfField](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDepthOfField)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputPoint0: defaultValue = [0 300].
/// - parameter inputPoint1: defaultValue = [300 300].
/// - parameter inputSaturation: The amount to adjust the saturation. defaultValue = 1.5.
/// - parameter inputUnsharpMaskRadius: defaultValue = 2.5.
/// - parameter inputUnsharpMaskIntensity: defaultValue = 0.5.
/// - parameter inputRadius: The distance from the center of the effect. defaultValue = 6.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func depthOfField(inputImage: CIImage, inputPoint0: CIVector = CIVector(x: 0.0, y: 300.0), inputPoint1: CIVector = CIVector(x: 300.0, y: 300.0), inputSaturation: NSNumber = 1.5, inputUnsharpMaskRadius: NSNumber = 2.5, inputUnsharpMaskIntensity: NSNumber = 0.5, inputRadius: NSNumber = 6) -> CIFilter? {
guard let filter = CIFilter(name: "CIDepthOfField") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputPoint0, forKey: "inputPoint0")
filter.setValue(inputPoint1, forKey: "inputPoint1")
filter.setValue(inputSaturation, forKey: "inputSaturation")
filter.setValue(inputUnsharpMaskRadius, forKey: "inputUnsharpMaskRadius")
filter.setValue(inputUnsharpMaskIntensity, forKey: "inputUnsharpMaskIntensity")
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CIDepthToDisparity](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDepthToDisparity)
///
/// - parameter inputImage: The input depth data image to convert to disparity data.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func depthToDisparity(inputImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIDepthToDisparity") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
return filter
}
/// [CIDifferenceBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDifferenceBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func differenceBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIDifferenceBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIDiscBlur](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDiscBlur)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: The radius determines how many pixels are used to create the blur. The larger the radius, the blurrier the result. defaultValue = 8.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func discBlur(inputImage: CIImage, inputRadius: NSNumber = 8) -> CIFilter? {
guard let filter = CIFilter(name: "CIDiscBlur") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CIDisintegrateWithMaskTransition](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDisintegrateWithMaskTransition)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTargetImage: The target image for a transition.
/// - parameter inputMaskImage: An image that defines the shape to use when disintegrating from the source to the target image.
/// - parameter inputTime: The parametric time of the transition. This value drives the transition from start (at time 0) to end (at time 1). defaultValue = 0.
/// - parameter inputShadowRadius: The radius of the shadow created by the mask. defaultValue = 8.
/// - parameter inputShadowDensity: The density of the shadow created by the mask. defaultValue = 0.65.
/// - parameter inputShadowOffset: The offset of the shadow created by the mask. defaultValue = [0 -10].
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func disintegrateWithMaskTransition(inputImage: CIImage, inputTargetImage: CIImage, inputMaskImage: CIImage, inputTime: NSNumber = 0, inputShadowRadius: NSNumber = 8, inputShadowDensity: NSNumber = 0.65, inputShadowOffset: CIVector = CIVector(x: 0.0, y: -10.0)) -> CIFilter? {
guard let filter = CIFilter(name: "CIDisintegrateWithMaskTransition") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTargetImage, forKey: "inputTargetImage")
filter.setValue(inputMaskImage, forKey: kCIInputMaskImageKey)
filter.setValue(inputTime, forKey: kCIInputTimeKey)
filter.setValue(inputShadowRadius, forKey: "inputShadowRadius")
filter.setValue(inputShadowDensity, forKey: "inputShadowDensity")
filter.setValue(inputShadowOffset, forKey: "inputShadowOffset")
return filter
}
/// [CIDisparityToDepth](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDisparityToDepth)
///
/// - parameter inputImage: The input disparity data image to convert to depth data.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func disparityToDepth(inputImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIDisparityToDepth") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
return filter
}
/// [CIDisplacementDistortion](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDisplacementDistortion)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputDisplacementImage: An image whose grayscale values will be applied to the source image.
/// - parameter inputScale: The amount of texturing of the resulting image. The larger the value, the greater the texturing. defaultValue = 50.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func displacementDistortion(inputImage: CIImage, inputDisplacementImage: CIImage, inputScale: NSNumber = 50) -> CIFilter? {
guard let filter = CIFilter(name: "CIDisplacementDistortion") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputDisplacementImage, forKey: "inputDisplacementImage")
filter.setValue(inputScale, forKey: kCIInputScaleKey)
return filter
}
/// [CIDissolveTransition](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDissolveTransition)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTargetImage: The target image for a transition.
/// - parameter inputTime: The parametric time of the transition. This value drives the transition from start (at time 0) to end (at time 1). defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func dissolveTransition(inputImage: CIImage, inputTargetImage: CIImage, inputTime: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIDissolveTransition") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTargetImage, forKey: "inputTargetImage")
filter.setValue(inputTime, forKey: kCIInputTimeKey)
return filter
}
/// [CIDivideBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDivideBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 8, *)
static func divideBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIDivideBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIDotScreen](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDotScreen)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the dot screen pattern defaultValue = [150 150].
/// - parameter inputAngle: The angle of the pattern. defaultValue = 0.
/// - parameter inputWidth: The distance between dots in the pattern. defaultValue = 6.
/// - parameter inputSharpness: The sharpness of the pattern. The larger the value, the sharper the pattern. defaultValue = 0.7.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func dotScreen(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputAngle: NSNumber = 0, inputWidth: NSNumber = 6, inputSharpness: NSNumber = 0.7) -> CIFilter? {
guard let filter = CIFilter(name: "CIDotScreen") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputSharpness, forKey: kCIInputSharpnessKey)
return filter
}
/// [CIDroste](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIDroste)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputInsetPoint0: defaultValue = [200 200].
/// - parameter inputInsetPoint1: defaultValue = [400 400].
/// - parameter inputStrands: defaultValue = 1.
/// - parameter inputPeriodicity: defaultValue = 1.
/// - parameter inputRotation: defaultValue = 0.
/// - parameter inputZoom: defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func droste(inputImage: CIImage, inputInsetPoint0: CIVector = CIVector(x: 200.0, y: 200.0), inputInsetPoint1: CIVector = CIVector(x: 400.0, y: 400.0), inputStrands: NSNumber = 1, inputPeriodicity: NSNumber = 1, inputRotation: NSNumber = 0, inputZoom: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CIDroste") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputInsetPoint0, forKey: "inputInsetPoint0")
filter.setValue(inputInsetPoint1, forKey: "inputInsetPoint1")
filter.setValue(inputStrands, forKey: "inputStrands")
filter.setValue(inputPeriodicity, forKey: "inputPeriodicity")
filter.setValue(inputRotation, forKey: "inputRotation")
filter.setValue(inputZoom, forKey: "inputZoom")
return filter
}
/// [CIEdgePreserveUpsampleFilter](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIEdgePreserveUpsampleFilter)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputSmallImage:
/// - parameter inputSpatialSigma: defaultValue = 3.
/// - parameter inputLumaSigma: defaultValue = 0.15.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 10, *)
static func edgePreserveUpsampleFilter(inputImage: CIImage, inputSmallImage: CIImage, inputSpatialSigma: NSNumber = 3, inputLumaSigma: NSNumber = 0.15) -> CIFilter? {
guard let filter = CIFilter(name: "CIEdgePreserveUpsampleFilter") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputSmallImage, forKey: "inputSmallImage")
filter.setValue(inputSpatialSigma, forKey: "inputSpatialSigma")
filter.setValue(inputLumaSigma, forKey: "inputLumaSigma")
return filter
}
/// [CIEdges](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIEdges)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputIntensity: The intensity of the edges. The larger the value, the higher the intensity. defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func edges(inputImage: CIImage, inputIntensity: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CIEdges") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputIntensity, forKey: kCIInputIntensityKey)
return filter
}
/// [CIEdgeWork](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIEdgeWork)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: The thickness of the edges. The larger the value, the thicker the edges. defaultValue = 3.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func edgeWork(inputImage: CIImage, inputRadius: NSNumber = 3) -> CIFilter? {
guard let filter = CIFilter(name: "CIEdgeWork") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CIEightfoldReflectedTile](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIEightfoldReflectedTile)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the effect defaultValue = [150 150].
/// - parameter inputAngle: The angle (in radians) of the tiled pattern. defaultValue = 0.
/// - parameter inputWidth: The width of a tile. defaultValue = 100.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func eightfoldReflectedTile(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputAngle: NSNumber = 0, inputWidth: NSNumber = 100) -> CIFilter? {
guard let filter = CIFilter(name: "CIEightfoldReflectedTile") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
return filter
}
/// [CIExclusionBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIExclusionBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func exclusionBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIExclusionBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIExposureAdjust](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIExposureAdjust)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputEV: The amount to adjust the exposure of the image by. The larger the value, the brighter the exposure. defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func exposureAdjust(inputImage: CIImage, inputEV: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIExposureAdjust") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputEV, forKey: kCIInputEVKey)
return filter
}
/// [CIFalseColor](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIFalseColor)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputColor0: The first color to use for the color ramp. defaultValue = (0.3 0 0 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputColor1: The second color to use for the color ramp. defaultValue = (1 0.9 0.8 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func falseColor(inputImage: CIImage, inputColor0: CIColor, inputColor1: CIColor) -> CIFilter? {
guard let filter = CIFilter(name: "CIFalseColor") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputColor0, forKey: "inputColor0")
filter.setValue(inputColor1, forKey: "inputColor1")
return filter
}
/// [CIFlashTransition](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIFlashTransition)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTargetImage: The target image for a transition.
/// - parameter inputCenter: The x and y position to use as the center of the effect defaultValue = [150 150].
/// - parameter inputExtent: The extent of the flash. defaultValue = [0 0 300 300].
/// - parameter inputColor: The color of the light rays emanating from the flash. defaultValue = (1 0.8 0.6 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputTime: The parametric time of the transition. This value drives the transition from start (at time 0) to end (at time 1). defaultValue = 0.
/// - parameter inputMaxStriationRadius: The radius of the light rays emanating from the flash. defaultValue = 2.58.
/// - parameter inputStriationStrength: The strength of the light rays emanating from the flash. defaultValue = 0.5.
/// - parameter inputStriationContrast: The contrast of the light rays emanating from the flash. defaultValue = 1.375.
/// - parameter inputFadeThreshold: The amount of fade between the flash and the target image. The higher the value, the more flash time and the less fade time. defaultValue = 0.85.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func flashTransition(inputImage: CIImage, inputTargetImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputExtent: CIVector = CIVector(x: 0.0, y: 0.0, z: 300.0, w: 300.0), inputColor: CIColor, inputTime: NSNumber = 0, inputMaxStriationRadius: NSNumber = 2.58, inputStriationStrength: NSNumber = 0.5, inputStriationContrast: NSNumber = 1.375, inputFadeThreshold: NSNumber = 0.85) -> CIFilter? {
guard let filter = CIFilter(name: "CIFlashTransition") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTargetImage, forKey: "inputTargetImage")
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputExtent, forKey: kCIInputExtentKey)
filter.setValue(inputColor, forKey: kCIInputColorKey)
filter.setValue(inputTime, forKey: kCIInputTimeKey)
filter.setValue(inputMaxStriationRadius, forKey: "inputMaxStriationRadius")
filter.setValue(inputStriationStrength, forKey: "inputStriationStrength")
filter.setValue(inputStriationContrast, forKey: "inputStriationContrast")
filter.setValue(inputFadeThreshold, forKey: "inputFadeThreshold")
return filter
}
/// [CIFourfoldReflectedTile](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIFourfoldReflectedTile)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the effect defaultValue = [150 150].
/// - parameter inputAngle: The angle (in radians) of the tiled pattern. defaultValue = 0.
/// - parameter inputWidth: The width of a tile. defaultValue = 100.
/// - parameter inputAcuteAngle: The primary angle for the repeating reflected tile. Small values create thin diamond tiles, and higher values create fatter reflected tiles. defaultValue = 1.570796326794897.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func fourfoldReflectedTile(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputAngle: NSNumber = 0, inputWidth: NSNumber = 100, inputAcuteAngle: NSNumber = 1.570796326794897) -> CIFilter? {
guard let filter = CIFilter(name: "CIFourfoldReflectedTile") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputAcuteAngle, forKey: "inputAcuteAngle")
return filter
}
/// [CIFourfoldRotatedTile](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIFourfoldRotatedTile)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the effect defaultValue = [150 150].
/// - parameter inputAngle: The angle (in radians) of the tiled pattern. defaultValue = 0.
/// - parameter inputWidth: The width of a tile. defaultValue = 100.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func fourfoldRotatedTile(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputAngle: NSNumber = 0, inputWidth: NSNumber = 100) -> CIFilter? {
guard let filter = CIFilter(name: "CIFourfoldRotatedTile") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
return filter
}
/// [CIFourfoldTranslatedTile](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIFourfoldTranslatedTile)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the effect defaultValue = [150 150].
/// - parameter inputAngle: The angle (in radians) of the tiled pattern. defaultValue = 0.
/// - parameter inputWidth: The width of a tile. defaultValue = 100.
/// - parameter inputAcuteAngle: The primary angle for the repeating translated tile. Small values create thin diamond tiles, and higher values create fatter translated tiles. defaultValue = 1.570796326794897.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func fourfoldTranslatedTile(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputAngle: NSNumber = 0, inputWidth: NSNumber = 100, inputAcuteAngle: NSNumber = 1.570796326794897) -> CIFilter? {
guard let filter = CIFilter(name: "CIFourfoldTranslatedTile") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputAcuteAngle, forKey: "inputAcuteAngle")
return filter
}
/// [CIGammaAdjust](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIGammaAdjust)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputPower: A gamma value to use to correct image brightness. The larger the value, the darker the result. defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func gammaAdjust(inputImage: CIImage, inputPower: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CIGammaAdjust") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputPower, forKey: "inputPower")
return filter
}
/// [CIGaussianBlur](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIGaussianBlur)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: The radius determines how many pixels are used to create the blur. The larger the radius, the blurrier the result. defaultValue = 10.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func gaussianBlur(inputImage: CIImage, inputRadius: NSNumber = 10) -> CIFilter? {
guard let filter = CIFilter(name: "CIGaussianBlur") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CIGaussianGradient](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIGaussianGradient)
///
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
/// - parameter inputColor0: The first color to use in the gradient. defaultValue = (1 1 1 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputColor1: The second color to use in the gradient. defaultValue = (0 0 0 0) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputRadius: The radius of the Gaussian distribution. defaultValue = 300.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func gaussianGradient(inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputColor0: CIColor, inputColor1: CIColor, inputRadius: NSNumber = 300) -> CIFilter? {
guard let filter = CIFilter(name: "CIGaussianGradient") else {
return nil
}
filter.setDefaults()
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputColor0, forKey: "inputColor0")
filter.setValue(inputColor1, forKey: "inputColor1")
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CIGlassDistortion](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIGlassDistortion)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputTexture: A texture to apply to the source image.
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
/// - parameter inputScale: The amount of texturing of the resulting image. The larger the value, the greater the texturing. defaultValue = 200.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 8, *)
static func glassDistortion(inputImage: CIImage, inputTexture: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputScale: NSNumber = 200) -> CIFilter? {
guard let filter = CIFilter(name: "CIGlassDistortion") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputTexture, forKey: "inputTexture")
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputScale, forKey: kCIInputScaleKey)
return filter
}
/// [CIGlassLozenge](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIGlassLozenge)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputPoint0: The x and y position that defines the center of the circle at one end of the lozenge. defaultValue = [150 150].
/// - parameter inputPoint1: The x and y position that defines the center of the circle at the other end of the lozenge. defaultValue = [350 150].
/// - parameter inputRadius: The radius of the lozenge. The larger the radius, the wider the extent of the distortion. defaultValue = 100.
/// - parameter inputRefraction: The refraction of the glass. defaultValue = 1.7.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func glassLozenge(inputImage: CIImage, inputPoint0: CIVector = CIVector(x: 150.0, y: 150.0), inputPoint1: CIVector = CIVector(x: 350.0, y: 150.0), inputRadius: NSNumber = 100, inputRefraction: NSNumber = 1.7) -> CIFilter? {
guard let filter = CIFilter(name: "CIGlassLozenge") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputPoint0, forKey: "inputPoint0")
filter.setValue(inputPoint1, forKey: "inputPoint1")
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputRefraction, forKey: "inputRefraction")
return filter
}
/// [CIGlideReflectedTile](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIGlideReflectedTile)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the effect defaultValue = [150 150].
/// - parameter inputAngle: The angle (in radians) of the tiled pattern. defaultValue = 0.
/// - parameter inputWidth: The width of a tile. defaultValue = 100.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func glideReflectedTile(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputAngle: NSNumber = 0, inputWidth: NSNumber = 100) -> CIFilter? {
guard let filter = CIFilter(name: "CIGlideReflectedTile") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
return filter
}
/// [CIGloom](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIGloom)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: The radius determines how many pixels are used to create the effect. The larger the radius, the greater the effect. defaultValue = 10.
/// - parameter inputIntensity: The intensity of the effect. A value of 0.0 is no effect. A value of 1.0 is the maximum effect. defaultValue = 0.5.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func gloom(inputImage: CIImage, inputRadius: NSNumber = 10, inputIntensity: NSNumber = 0.5) -> CIFilter? {
guard let filter = CIFilter(name: "CIGloom") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputIntensity, forKey: kCIInputIntensityKey)
return filter
}
/// [CIHardLightBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHardLightBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func hardLightBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIHardLightBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIHatchedScreen](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHatchedScreen)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the hatched screen pattern defaultValue = [150 150].
/// - parameter inputAngle: The angle of the pattern. defaultValue = 0.
/// - parameter inputWidth: The distance between lines in the pattern. defaultValue = 6.
/// - parameter inputSharpness: The amount of sharpening to apply. defaultValue = 0.7.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func hatchedScreen(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputAngle: NSNumber = 0, inputWidth: NSNumber = 6, inputSharpness: NSNumber = 0.7) -> CIFilter? {
guard let filter = CIFilter(name: "CIHatchedScreen") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
filter.setValue(inputWidth, forKey: kCIInputWidthKey)
filter.setValue(inputSharpness, forKey: kCIInputSharpnessKey)
return filter
}
/// [CIHeightFieldFromMask](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHeightFieldFromMask)
///
/// - parameter inputImage: The white values of the mask define those pixels that are inside the height field while the black values define those pixels that are outside. The field varies smoothly and continuously inside the mask, reaching the value 0 at the edge of the mask.
/// - parameter inputRadius: The distance from the edge of the mask for the smooth transition is proportional to the input radius. Larger values make the transition smoother and more pronounced. Smaller values make the transition approximate a fillet radius. defaultValue = 10.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func heightFieldFromMask(inputImage: CIImage, inputRadius: NSNumber = 10) -> CIFilter? {
guard let filter = CIFilter(name: "CIHeightFieldFromMask") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CIHexagonalPixellate](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHexagonalPixellate)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The x and y position to use as the center of the effect defaultValue = [150 150].
/// - parameter inputScale: The scale determines the size of the hexagons. Larger values result in larger hexagons. defaultValue = 8.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func hexagonalPixellate(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputScale: NSNumber = 8) -> CIFilter? {
guard let filter = CIFilter(name: "CIHexagonalPixellate") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputScale, forKey: kCIInputScaleKey)
return filter
}
/// [CIHighlightShadowAdjust](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHighlightShadowAdjust)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputRadius: Shadow Highlight Radius defaultValue = 0.
/// - parameter inputShadowAmount: The amount of adjustment to the shadows of the image. defaultValue = 0.
/// - parameter inputHighlightAmount: The amount of adjustment to the highlights of the image. defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func highlightShadowAdjust(inputImage: CIImage, inputRadius: NSNumber = 0, inputShadowAmount: NSNumber = 0, inputHighlightAmount: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CIHighlightShadowAdjust") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputShadowAmount, forKey: "inputShadowAmount")
filter.setValue(inputHighlightAmount, forKey: "inputHighlightAmount")
return filter
}
/// [CIHistogramDisplayFilter](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHistogramDisplayFilter)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputHeight: The height of the displayable histogram image. defaultValue = 100.
/// - parameter inputHighLimit: The fraction of the right portion of the histogram image to make lighter. defaultValue = 1.
/// - parameter inputLowLimit: The fraction of the left portion of the histogram image to make darker defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 8, *)
static func histogramDisplayFilter(inputImage: CIImage, inputHeight: NSNumber = 100, inputHighLimit: NSNumber = 1, inputLowLimit: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIHistogramDisplayFilter") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputHeight, forKey: "inputHeight")
filter.setValue(inputHighLimit, forKey: "inputHighLimit")
filter.setValue(inputLowLimit, forKey: "inputLowLimit")
return filter
}
/// [CIHoleDistortion](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHoleDistortion)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCenter: The center of the effect as x and y coordinates. defaultValue = [150 150].
/// - parameter inputRadius: The radius determines how many pixels are used to create the distortion. The larger the radius, the wider the extent of the distortion. defaultValue = 150.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func holeDistortion(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputRadius: NSNumber = 150) -> CIFilter? {
guard let filter = CIFilter(name: "CIHoleDistortion") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CIHueAdjust](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHueAdjust)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputAngle: An angle (in radians) to use to correct the hue of an image. defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func hueAdjust(inputImage: CIImage, inputAngle: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIHueAdjust") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
return filter
}
/// [CIHueBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHueBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func hueBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CIHueBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CIHueSaturationValueGradient](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIHueSaturationValueGradient)
///
/// - parameter inputValue: defaultValue = 1.
/// - parameter inputRadius: The distance from the center of the effect. defaultValue = 300.
/// - parameter inputSoftness: defaultValue = 1.
/// - parameter inputDither: defaultValue = 1.
/// - parameter inputColorSpace: The CGColorSpaceRef that the color wheel should be generated in. defaultValue = <CGColorSpace 0x6040000afa80> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1).
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 10, *)
static func hueSaturationValueGradient(inputValue: NSNumber = 1, inputRadius: NSNumber = 300, inputSoftness: NSNumber = 1, inputDither: NSNumber = 1, inputColorSpace: NSObject) -> CIFilter? {
guard let filter = CIFilter(name: "CIHueSaturationValueGradient") else {
return nil
}
filter.setDefaults()
filter.setValue(inputValue, forKey: "inputValue")
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
filter.setValue(inputSoftness, forKey: "inputSoftness")
filter.setValue(inputDither, forKey: "inputDither")
filter.setValue(inputColorSpace, forKey: "inputColorSpace")
return filter
}
/// [CIKaleidoscope](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIKaleidoscope)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputCount: The number of reflections in the pattern. defaultValue = 6.
/// - parameter inputCenter: The x and y position to use as the center of the effect defaultValue = [150 150].
/// - parameter inputAngle: The angle of reflection. defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func kaleidoscope(inputImage: CIImage, inputCount: NSNumber = 6, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputAngle: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CIKaleidoscope") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCount, forKey: "inputCount")
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputAngle, forKey: kCIInputAngleKey)
return filter
}
/// [CILabDeltaE](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILabDeltaE)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputImage2:
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 11, *)
static func labDeltaE(inputImage: CIImage, inputImage2: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CILabDeltaE") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputImage2, forKey: "inputImage2")
return filter
}
/// [CILanczosScaleTransform](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILanczosScaleTransform)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputScale: The scaling factor to use on the image. Values less than 1.0 scale down the images. Values greater than 1.0 scale up the image. defaultValue = 1.
/// - parameter inputAspectRatio: The additional horizontal scaling factor to use on the image. defaultValue = 1.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func lanczosScaleTransform(inputImage: CIImage, inputScale: NSNumber = 1, inputAspectRatio: NSNumber = 1) -> CIFilter? {
guard let filter = CIFilter(name: "CILanczosScaleTransform") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputScale, forKey: kCIInputScaleKey)
filter.setValue(inputAspectRatio, forKey: "inputAspectRatio")
return filter
}
/// [CILenticularHaloGenerator](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILenticularHaloGenerator)
///
/// - parameter inputCenter: The x and y position to use as the center of the halo. defaultValue = [150 150].
/// - parameter inputColor: A color. defaultValue = (1 0.9 0.8 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputHaloRadius: The radius of the halo. defaultValue = 70.
/// - parameter inputHaloWidth: The width of the halo, from its inner radius to its outer radius. defaultValue = 87.
/// - parameter inputHaloOverlap: defaultValue = 0.77.
/// - parameter inputStriationStrength: The intensity of the halo colors. Larger values are more intense. defaultValue = 0.5.
/// - parameter inputStriationContrast: The contrast of the halo colors. Larger values are higher contrast. defaultValue = 1.
/// - parameter inputTime: The duration of the effect. defaultValue = 0.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func lenticularHaloGenerator(inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputColor: CIColor, inputHaloRadius: NSNumber = 70, inputHaloWidth: NSNumber = 87, inputHaloOverlap: NSNumber = 0.77, inputStriationStrength: NSNumber = 0.5, inputStriationContrast: NSNumber = 1, inputTime: NSNumber = 0) -> CIFilter? {
guard let filter = CIFilter(name: "CILenticularHaloGenerator") else {
return nil
}
filter.setDefaults()
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputColor, forKey: kCIInputColorKey)
filter.setValue(inputHaloRadius, forKey: "inputHaloRadius")
filter.setValue(inputHaloWidth, forKey: "inputHaloWidth")
filter.setValue(inputHaloOverlap, forKey: "inputHaloOverlap")
filter.setValue(inputStriationStrength, forKey: "inputStriationStrength")
filter.setValue(inputStriationContrast, forKey: "inputStriationContrast")
filter.setValue(inputTime, forKey: kCIInputTimeKey)
return filter
}
/// [CILightenBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILightenBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func lightenBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CILightenBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CILightTunnel](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILightTunnel)
///
/// - parameter inputImage: The image to process.
/// - parameter inputCenter: Center of the light tunnel. defaultValue = [150 150].
/// - parameter inputRotation: Rotation angle of the light tunnel. defaultValue = 0.
/// - parameter inputRadius: Center radius of the light tunnel. defaultValue = 100.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 6, *)
static func lightTunnel(inputImage: CIImage, inputCenter: CIVector = CIVector(x: 150.0, y: 150.0), inputRotation: NSNumber = 0, inputRadius: NSNumber = 100) -> CIFilter? {
guard let filter = CIFilter(name: "CILightTunnel") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputCenter, forKey: kCIInputCenterKey)
filter.setValue(inputRotation, forKey: "inputRotation")
filter.setValue(inputRadius, forKey: kCIInputRadiusKey)
return filter
}
/// [CILinearBurnBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILinearBurnBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 8, *)
static func linearBurnBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CILinearBurnBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CILinearDodgeBlendMode](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILinearDodgeBlendMode)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputBackgroundImage: The image to use as a background image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 8, *)
static func linearDodgeBlendMode(inputImage: CIImage, inputBackgroundImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CILinearDodgeBlendMode") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputBackgroundImage, forKey: kCIInputBackgroundImageKey)
return filter
}
/// [CILinearGradient](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILinearGradient)
///
/// - parameter inputPoint0: The starting position of the gradient -- where the first color begins. defaultValue = [0 0].
/// - parameter inputPoint1: The ending position of the gradient -- where the second color begins. defaultValue = [200 200].
/// - parameter inputColor0: The first color to use in the gradient. defaultValue = (1 1 1 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
/// - parameter inputColor1: The second color to use in the gradient. defaultValue = (0 0 0 1) <CGColorSpace 0x6040000af9c0> (kCGColorSpaceDeviceRGB).
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 5, *)
static func linearGradient(inputPoint0: CIVector = CIVector(x: 0.0, y: 0.0), inputPoint1: CIVector = CIVector(x: 200.0, y: 200.0), inputColor0: CIColor, inputColor1: CIColor) -> CIFilter? {
guard let filter = CIFilter(name: "CILinearGradient") else {
return nil
}
filter.setDefaults()
filter.setValue(inputPoint0, forKey: "inputPoint0")
filter.setValue(inputPoint1, forKey: "inputPoint1")
filter.setValue(inputColor0, forKey: "inputColor0")
filter.setValue(inputColor1, forKey: "inputColor1")
return filter
}
/// [CILinearToSRGBToneCurve](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILinearToSRGBToneCurve)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 7, *)
static func linearToSRGBToneCurve(inputImage: CIImage) -> CIFilter? {
guard let filter = CIFilter(name: "CILinearToSRGBToneCurve") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
return filter
}
/// [CILineOverlay](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILineOverlay)
///
/// - parameter inputImage: The image to use as an input image. For filters that also use a background image, this is the foreground image.
/// - parameter inputNRNoiseLevel: The noise level of the image (used with camera data) that gets removed before tracing the edges of the image. Increasing the noise level helps to clean up the traced edges of the image. defaultValue = 0.07000000000000001.
/// - parameter inputNRSharpness: The amount of sharpening done when removing noise in the image before tracing the edges of the image. This improves the edge acquisition. defaultValue = 0.71.
/// - parameter inputEdgeIntensity: The accentuation factor of the Sobel gradient information when tracing the edges of the image. Higher values find more edges, although typically a low value (such as 1.0) is used. defaultValue = 1.
/// - parameter inputThreshold: This value determines edge visibility. Larger values thin out the edges. defaultValue = 0.1.
/// - parameter inputContrast: The amount of anti-aliasing to use on the edges produced by this filter. Higher values produce higher contrast edges (they are less anti-aliased). defaultValue = 50.
///
/// - returns: Generated CIFilter (you can get result with ["outputImage"])
@available(iOS 9, *)
static func lineOverlay(inputImage: CIImage, inputNRNoiseLevel: NSNumber = 0.07000000000000001, inputNRSharpness: NSNumber = 0.71, inputEdgeIntensity: NSNumber = 1, inputThreshold: NSNumber = 0.1, inputContrast: NSNumber = 50) -> CIFilter? {
guard let filter = CIFilter(name: "CILineOverlay") else {
return nil
}
filter.setDefaults()
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputNRNoiseLevel, forKey: "inputNRNoiseLevel")
filter.setValue(inputNRSharpness, forKey: "inputNRSharpness")
filter.setValue(inputEdgeIntensity, forKey: "inputEdgeIntensity")
filter.setValue(inputThreshold, forKey: "inputThreshold")
filter.setValue(inputContrast, forKey: kCIInputContrastKey)
return filter
}
/// [CILineScreen](http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CILineScreen)
///