質問

I have implemented the ability to blur images in my iOS app using the pinch gesture, however I would like to implement a circular white overlay that is commonly used as a reference point with the pinch gesture so that the user can adjust the amount of blur. Just like the image below:

Sample White Pinch Gesture Overlay

The image above was from: https://media.tumblr.com/tumblr_lutwauVUW31qm4rc3.png

How can I implement this feature?

Thanks!

役に立ちましたか?

解決

GaussianSelectiveBlurFilter in GPUImage lib may be help yo a lot. well,here is the github source.

I think it is not hard to use, hope you will enjoy it.

他のヒント

You can use a GPUImageVignetteFilter, and set the vignette color to white.

I'm guessing you're implementing the blur with GPUImageGaussianSelectiveBlurFilter within GPUImage (because I see you tagged GPUImage in your question). If you are, you'll notice that the properties on GPUImageGaussianSelectiveBlurFilter don't exactly translate over to GPUImageVignetteFilter, so you'll have to do a bit of math to translate to a new "coordinate" system, but it's fairly trivial.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top