November 2002
Intermediate to advanced
848 pages
19h 59m
English
The previous example is a simple description of what would be referred to as a Raster with a grayscale ColorModel in Java. In other words, the Raster consists of a rectangular array of the pixel values, and the ColorModel contains methods to convert pixel data into colors. Together, they provide the information we need to render the image.
Two pieces make up the Raster: a DataBuffer containing the actual numbers, and a SampleModel, which groups the numbers into pixels. In the Java 2D API, the Sample is the atomic representation of image data. In the case of the grayscale image described previously, one Sample is equivalent to one pixel. However, in the case of color data, there will be multiple Samples
Read now
Unlock full access