Reputation: 39376
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.
Upvotes: 2
Views: 1033
Reputation: 41483
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
).
Upvotes: 3