I've a problem. I need to apply a filter like Pixelate or Blur
to an entire UIView
.
Like the eBay iPad
app.
I thought to use GPUImage
but I don't know how to do it.
There is a way to apply a filter to a GPUImageView
directly without pass a UIImage
?
The primary problem is that making a screenshot of a large UIView
on an iPad
3rd is to expensive (2 seconds for the UIWindow
grab). So the perfect solution is to apply filter directly to the views, just like eBay app, but.. how?
Thanks to all!
To pull a view into GPUImage, you can use a GPUImageUIElement source, which takes a UIView or CALayer as input. There's an example of this in the FilterShowcase sample application.
This does rely on the -renderInContext:
method of an underlying CALayer, which can be expensive for redrawing the view. However, if the view is static, you just need to use this update once and the resulting image will be cached on the GPU as a texture. Filter actions applied to it after that point will be very fast.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With