将模糊例程与 UIImage 或 CGImageRef 连接... (iPhone)
我不确定他们的 BImage 文件是什么格式(位图?)以及 Cocoa Touch 中对应的格式是什么。
谢谢。
I found some blurring code at http://incubator.quasimondo.com/processing/stackblur.pde. Any ideas how to feed it, and get back, a UIImage or CGImageRef or something usable on the iPhone?
I'm not sure what format their BImage file is (Bitmap?) and what corresponds to it in Cocoa Touch.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该代码采用基于 JVM 的处理语言。 有一些尝试在 iPhone 上移植处理< /a>,但是,我想,在这个阶段,您要么必须手动移植该代码,深入研究处理实现的内部,要么必须为自己找到其他参考资料。
更新:乍一看,他们似乎正在处理简单的低级 RGB 数据。 所以代码应该很容易移植。 处理与 Java 足够接近,Java 与 C++ 足够接近,您可以将 C++ 代码编译为 Objective C(只需使用 .mm 扩展名)。 只需复制粘贴代码,修复语法错误,然后在 RGB 数据上运行即可。 您很有可能能够逃脱惩罚。
深入了解 CGImage 文档 以获取信息关于如何获取原始 RGB 数据。
更新2:您链接到的代码似乎是堆栈模糊。 作者页面说在 Fog 库(搜索此处用于
Fog::Raster_C - StackBlur
)。That code is in JVM-based Processing language. There are some attempts to port Processing on iPhone, but, I guess, at this stage, you'll either have to port that code by hands, digging in the entrails of the Processing implementation, or have to find yourself some another reference.
Update: On the second glance, they seem to be working with the plain low-level RGB data. So the code should be straightforward to port. Processing is close enough to Java, Java is close enough to C++, and you may compile C++ code as Objective C (just use .mm extension). Just copy-paste the code, fix syntax errors, and run it on your RGB data. Chances are good that you'll be able to get away with just that.
Dig into CGImage docs for information on how to get raw RGB data.
Update 2: The code you've linked to appears to be the stack blur. Author's page says there is a MIT-licensed C++ port of it in the Fog library (search here for
Fog::Raster_C - StackBlur
).