Last active
August 29, 2015 14:07
-
-
Save maxmzd/67b3013c75b30afd65ba to your computer and use it in GitHub Desktop.
Example of how to use a GPUImage Blend Filter in Swift
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
let filter = GPUImageOverlayBlendFilter() | |
filter.useNextFrameForImageCapture() | |
var picture_1 = GPUImagePicture(image: UIImage(named: "bun-outline.png")) | |
var picture_2 = GPUImagePicture(image: UIImage(named: "pink.png")) | |
picture_1.addTarget(filter) | |
picture_1.processImage() | |
picture_2.addTarget(filter) | |
picture_2.processImage() | |
// Write it to a UIImageView on the interface | |
bun.image = filter.imageFromCurrentFramebuffer() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment