Created
July 30, 2014 22:38
-
-
Save gregheo/160c40993be9274390ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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