CleVR Actionscript libraries now on RIAForge
I’ve put up the CleVR AS3 libraries on RIAForge, where you can download them as a zip file, or use the svn repository.
The library includes a number of classes that we developed as part of the CleVR Stitcher. They include a set of matrix algebra classes, ported from the Java JAMA library. These let you do standard matrix algebra stuff, and includes support for singular value decomposition and QR decomposition.
There’s also some graphics classes. One is a subclass of BitmapData that adds bicubic and bilinear interpolation. Another is a class for calculating the histogram of an image, with methods to do histogram stretching. This gives results similar to “Auto levels” in Photoshop, or “Enhance” in iPhoto.
You will find them here. They’re released under the Creative Commons attribution licence, which basically lets you do anything with them, so long as you give credit somewhere. A link to clevr.com would usually suffice. Let me know if you have any comments, patches, or if you’re using it.


November 11th, 2007 at 1:07 am GMT
Love the AIR app and thanks for providing some great code resources, done so well! I noticed that you auto-orient the image based on the EXIF data and was looking for a class to do this in my own AIR app. I was wondering if you would share that class or if it is pretty much Kevin Hoyt’s code? It seems like that would be a great utility class for AIR for loading client JPGs. Does it require that you do two load calls on the JPG or are you able to load the image and get the EXIF out of the same call?
Todd
November 11th, 2007 at 10:18 am GMT
Hi,
Glad you like it! We do have our own class, but it’s based on Kevin Hoyt’s code. I essentially turned it into a slightly more general class, allowing access to the values rather than just dumping them. The class is a bit of a mess though, and only works on some photos – ones with embedded thumbnails in particular can confuse it. I am planning on cleaning it up and adding it to the library.
July 7th, 2008 at 11:08 am GMT
Hi,
The interpolation bitmap data class looks really cool, but how do you use it? Do you just use it as you would the bitmap data class? But then how would it know which method to use?
I’ve built a Flex/AIR app that resizes images for you, but when you try to resize a large image to something quite small the result doesn’t look very good! I was hoping to use the bicubic interpolation to make the picture look better (much like photoshop does).
Mark
July 7th, 2008 at 11:22 am GMT
Hi Mark,
You use it in the same way as BitmapData, except instead of getPixel you use getPixelBicubic or getPixelBilinear, where you can pass the coordinates as Numbers rather than ints. Anything not on the pixel boundary is then interpolated.
July 9th, 2008 at 9:47 pm GMT
Thanks for getting back to me Matt.
Sorry for asking, but I haven’t delved deep into the realms of BitmapData – could you help point me in the right direction as to how I would use the getPixelBicubic method to resize an image? I’m trying to create an AIR app that resizes my camera photo’s and uploads them to my webspace, so I can just point it at a folder and let it go! I’ve got it working ok, however Flash/Flex gives any jpg’s it makes smaller (e.g. 200 x 200px) a jagged look. I would like to remove this, by using bicubic interpolation, or any other method. Do you have any ideas?
Thanks in advance!
Mark
July 9th, 2008 at 10:18 pm GMT
try something like:
July 10th, 2008 at 6:52 am GMT
That’s brilliant, thanks Matt, will try asap and let you know the results!
July 10th, 2008 at 8:32 am GMT
I’ve added a new post with a more complete description of how to do this (without the typos in this one).
August 22nd, 2008 at 8:28 am GMT
if i try matt’s code, then can keep exif data??(sorry, my english is poor..)