Is it possible to convert a CATransform3D
to a set of CIVectors
to convert a UIImage
with a CATransform3D
?
I believe that it is now possible to replace the ability of UIGetScreenImage()
smooth 3D UIView/CALayer
with an image, going through the hierarchy of representations and rendering of individual images, and then applying CATransform3D
to the image that was created,
I started working with GPUImage
, which takes CATransform3Ds
to apply to UIImage
and, unfortunately, no luck. Attached code that I used and links to created images.
Simulator screenshot
Image produced
- (UIImage*)iterateLayerHierarchy:(CALayer*)layer { UIGraphicsBeginImageContextWithOptions(CGSizeMake(layer.frame.size.width, layer.frame.size.height), NO, 0.0); for (CALayer *sublayer in layer.sublayers) { UIImage* subImage; if (sublayer.sublayers.count > 1) { subImage = [self iterateLayerHierarchy:sublayer]; } else { subImage = [UIView getImageFromLayer:sublayer]; } CGRect imageRect; if (isRetina()) { imageRect = CGRectMake(sublayer.position.x-subImage.size.width/4, sublayer.position.y-subImage.size.height/4, subImage.size.width, subImage.size.height); }else{ imageRect = CGRectMake(sublayer.position.x-subImage.size.width/2, sublayer.position.y-subImage.size.height/2, subImage.size.width, subImage.size.height); } [subImage drawInRect:imageRect];
source share