简体   繁体   中英

Hue effect for Image - iOS

I just wonder, if there is any possibility to make an hue effect for Image, but not using OpenGl ES, preferably using CALayer. I have spent some time looking for an answer, but still nothing.

tnx

Are you talking about tinting an image? A quick way (although probably not the best—for that you'll need a custom solution) would be to check out Quartz's blending options:

https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_paths/dq_paths.html#//apple_ref/doc/uid/TP30001066-CH211-TPXREF101

You could try copying the visible portion of the original image to an RGB bitmap, and writing Neon ASM to recalculate each pixel's RGB given some linear color space transform. Something in the Accelerate DSP framework might also be suitable. Then update the CALayer's contents with the modified bitmap image. Might be fast enough for a decent frame rate for a reasonable sized portion of the image. If the slider doesn't move for a bit, update the rest of the image as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM