Skip to content

Instantly share code, notes, and snippets.

@atnan
Created November 10, 2010 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atnan/670440 to your computer and use it in GitHub Desktop.
Save atnan/670440 to your computer and use it in GitHub Desktop.
@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
@alanjrogers
Copy link

Would work if CIImage was available on iOS :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment