Monday, 23 July 2007

Image Load --- 1

The example in JAI program needs WindowContainer, which I downloaded from
http://swjscmail1.java.sun.com/cgi-bin/wa?A2=ind0104&L=jai-interest&D=0&P=28364

JAI supports several image data types, so the DataBuffer class has the following subclasses,
* DataBufferByte - stores data internally as bytes (8-bit values)
* DataBufferShort - stores data internally as shorts (16-bit values)
* DataBufferUShort - stores data internally as unsigned shorts (16-bit values)
* DataBufferInt - stores data internally as integers (32-bit values)
* DataBufferFloat - stores data internally as single-precision floating-point values.
* DataBufferDouble - stores data internally as double-precision floating-point values.

JAI also supports a large number of image data formats, so the SampleModel class provides the following types of sample models:
* ComponentSampleModel - used to extract pixels from images that store sample data in separate data array elements in one bank of a DataBuffer object.
* ComponentSampleModelJAI - used to extract pixels from images that store sample data such that each sample of a pixel occupies one data element of the DataBuffer.
* BandedSampleModel - used to extract pixels from images that store each sample in a separate data element with bands stored in a sequence of data elements.
* PixelInterleavedSampleModel - used to extract pixels from images that store each sample in a separate data element with pixels stored in a sequence of data elements.
* MultiPixelPackedSampleModel - used to extract pixels from single-banded images that store multiple one-sample pixels in one data element.
* SinglePixelPackedSampleModel - used to extract samples from images that store sample data for a single pixel in one data array element in the first bank of a DataBuffer object.
* FloatComponentSampleModel - stores n samples that make up a pixel in n separate data array elements, all of which are in the same bank in a DataBuffer object. This class supports different kinds of interleaving.

The combination of a DataBuffer object, a SampleModel object, and an origin constitute a meaningful multi-pixel image storage unit called a Raster. The Raster class has methods that directly return pixel data for the image data it contains.

There are two basic Raster types:
* Raster - represents a rectangular array of pixels. This is a "read-only" class that only has get methods.
* WritableRaster - extends Raster to provide pixel writing capabilities.

There are separate interfaces for dealing with each raster type:
* The RenderedImage interface assumes the data is read-only and, therefore, does not contain methods for writing a Raster.
* The WriteableRenderedImage interfaces assumes that the image data can be modified.

A ColorModel class provides a color interpretation of pixel data provided by the image's sample model. The combination of a Raster and a ColorModel define a BufferedImage.

No comments: