Android 加速位图缩放

发布于 2024-09-30 16:22:46 字数 171 浏览 1 评论 0原文

我有一些大型 JPG 文件需要在 Android 服务中进行下采样。 BitmapFactory(即skia libray)可以处理这个问题,但可能没有获得任何GPU支持。有没有任何便携式方法来获得硬件加速以进行缩放?

服务是否可以创建隐藏视图,然后使用 OpenGL ES 来执行缩放部分,还是仅在活动中可行?

I have some large JPG files that need to be downsampled in an android service. BitmapFactory (i.e. skia libray) can handle this but probably does not get any GPU support. Is there any portable way to get hardware acceleration for scaling ?

Could a service create a hidden View and then use OpenGL ES to do the scaling part or is that only feasible in activities ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心舞飞扬 2024-10-07 16:22:46

您可以通过这种方式获得硬件加速缩放,但您必须从 GPU 读回结果,这可能会或可能不会比仅在软件中进行缩放更快。您还会遇到 GPU 特定的限制,例如最大纹理尺寸(例如 NexusOne 上的 4096x4096)。

You may get hardware accelerated scaling this way, but you'll have to read the result back from the GPU which may or may not be faster than just scaling in software. You will also run into GPU-specific limitations like maximum texture dimensions (4096x4096 on NexusOne for instance.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文