Fast Image Construction

Discussion in 'Java' started by Aaron Birenboim, Jan 27, 2006.

  1. 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
    Aaron Birenboim, Jan 27, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darrel Riekhof

    fast image compare?

    Darrel Riekhof, Jan 4, 2005, in forum: Java
    Replies:
    9
    Views:
    6,035
    Andrey Kuznetsov
    Jan 8, 2005
  2. Replies:
    0
    Views:
    659
  3. Michele Simionato

    Python is darn fast (was: How fast is Python)

    Michele Simionato, Aug 23, 2003, in forum: Python
    Replies:
    13
    Views:
    558
  4. Ook
    Replies:
    10
    Views:
    550
  5. Juha Nieminen
    Replies:
    22
    Views:
    1,020
    Kai-Uwe Bux
    Oct 12, 2007
Loading...

Share This Page