Fast Image Construction

A

Aaron Birenboim

I'm looking for a FAST way to create a java.awt.Image from a (2D) array
of unsigned char data from C.
It would be nice if I could supply a 256 element pseudo-color table.

I'm having a heck of a time finding a reasonable way to do this.
Everything seems to want to work from .JPG or .PNG files, etc...
not a raw data buffer derived from a C app.

Is the easiest way to do this to make some sort of DataBuffer in
memory containing a BMP description of the image.
(I think BMP has a indexed image mode)

I will probobally (eventually) want some sort of WritableRaster
sub-class of Image. At first, just displaying the image will be
sufficient. Eventually, I may want to draw some "overlays" on
the image. (Like plot an X over the computed centroid point...)

I would think that looping through, and setting pixels ONE AT A TIME
on a WritableRaster would be innefficient.

Right now, C is quantizing the 2D array into unsigned char.
I could move the interface down a level and let Java
quatize and colorize from the original float 2D array.
(We often have non-linear mappings like histogram equalization)

JAI may be the answer, but I fear that it is a bit high-level for me.
I'm not looking for convolutions, etc. Just display the pixels!

aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top