Created
November 10, 2010 06:17
-
-
Save atnan/670440 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@implementation UIView (CIImageAdditions) | |
- (CIImage *)CIImage { | |
UIImage* image = nil; | |
UIGraphicsBeginImageContext(self.frame.size); { | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
[self.layer renderInContext:context]; | |
image = UIGraphicsGetImageFromCurrentImageContext(); | |
}; UIGraphicsEndImageContext(); | |
return [CIImage imageWithCGImage:[image CGImage]]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would work if CIImage was available on iOS :D