Skip to content

Instantly share code, notes, and snippets.

@gregheo
Created July 30, 2014 22:38
Show Gist options
  • Save gregheo/160c40993be9274390ce to your computer and use it in GitHub Desktop.
Save gregheo/160c40993be9274390ce to your computer and use it in GitHub Desktop.
import UIKit
import CoreImage
class CustomFilter : CIFilter {
var privateInputImage: CIImage?
var inputImage: CIImage? {
set {
privateInputImage = newValue
}
get {
return privateInputImage
}
}
func outputImage() -> CIImage {
let colorControls = CIFilter(name: "CIColorControls")
colorControls.setValue(0.0, forKey: "inputSaturation")
colorControls.setValue(privateInputImage, forKey: "inputImage")
return colorControls.outputImage
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment