简体   繁体   English

在Android上使用OpenGL 2.0模糊实时摄像机预览

[英]Blurring live camera preview with OpenGL 2.0 on Android

I have properly set up the Camera preview using SurfaceTexture and OpenGL. 我已经使用SurfaceTexture和OpenGL正确设置了Camera预览。
After days of research with trial and error, I'm unable to blur the pixels, there seems to be very little documentation on this. 经过反复试验的研究,我无法模糊像素,关于此的文档似乎很少。

The desired effect is blurring and dimming the camera while opening DrawerLayout. 打开DrawerLayout时,所需的效果是使相机模糊和变暗。 So far all the apps and guides that I've found blur a bitmap. 到目前为止,我发现的所有应用程序和指南都模糊了位图。

Can someone help me out or point me in the right direction? 有人可以帮助我或为我指明正确的方向吗?

You will have to use a fragment shader and apply your blurring filter over there. 您将必须使用fragment shader然后在其中应用模糊滤镜。 So for your use case you will have to keep one flag inside shader which determines whether blur has to be applied or not. 因此,对于您的用例,您将必须在着色器中保留一个标志,该标志确定是否必须应用模糊。 Say when your drawer is about to open or starting to close you can set and unset that flag. 说出您的抽屉即将打开或开始关闭时,您可以设置和取消设置该标志。

a simple google search will point you to many further readings on this topic. 一个简单的谷歌搜索将带您获得有关该主题的更多阅读材料。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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