Android SDK的快速位图模糊 [英] Fast Bitmap Blur For Android SDK

查看:32
本文介绍了Android SDK的快速位图模糊的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前在我正在开发的 Android 应用程序中,我正在遍历图像的像素以对其进行模糊处理.在 640x480 的图像上这大约需要 30 秒.

Currently in an Android application that I'm developing I'm looping through the pixels of an image to blur it. This takes about 30 seconds on a 640x480 image.

在 Android Market 中浏览应用程序时,我遇到了一个包含模糊功能的应用程序,它们的模糊处理速度非常快(如 5 秒),因此它们必须使用不同的模糊处理方法.

While browsing apps in the Android Market I came across one that includes a blur feature and their blur is very fast (like 5 seconds) so they must be using a different method of blurring.

除了遍历像素之外,还有没有人知道更快的方法?

Anyone know a faster way other than looping through the pixels?

推荐答案

这是在黑暗中拍摄的,但您可以尝试缩小图像,然后再次放大.这可以通过 Bitmap.createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter) 来完成.确保并将过滤器参数设置为 true.它将在本机代码中运行,因此速度可能会更快.

This is a shot in the dark, but you might try shrinking the image and then enlarging it again. This can be done with Bitmap.createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter). Make sure and set the filter parameter to true. It'll run in native code so it might be faster.

这篇关于Android SDK的快速位图模糊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆