Java Image Representation

In a java image, each pixel is represented by a series of bands. In RGB there is a band for red, green and blue. In CMYK there are bands for cyan, magenta, yellow and black.

There are a few basic classes used in Java2D:

  • DataBuffer which simply wraps data arrays into bands.
  • Raster stores a DataBuffer and represents it as a rectangular array of pixels and bands which is described by a SampleModel. It is read only.
  • SampleModel describes how to access the individual pixels within a Raster.
  • WriteableRaster inherets from Raster and implements methods for writing data as well.
  • ColorModel is a class that determines what each of the bands are in colormetric space. It is only used by Java2D, not JAI.

Rendered vs. Renderable

Renderable Layer is a layer that has no specific context and can be run through a series of operations that contain parameters. It can be rendered once is it called upon by some specific context like a screen display or printer. The parameters for filters are editable.

Any object that falls in this layer is expected to adapt to a RenderContext.

Rendered Layer is a layer that does have a specific context. It can also be pulled through a chain of operations, but the operations must be context specific. The parameters for filter are not editable.

RenderableImageOps are filters that operate within the Renderable Layer and must implement RenderableImage as its output will conform to that interface.


Personal Tools