FIGURE 7a - 24-Bit Raster Image Set Contents
7.2.1 Required 24-Bit Raster Image Data Set Objects
All 24-bit raster images must contain image data and a dimension record. These objects are created by the HDF library using information provided at the time the image is written to file. 7.2.1.1 24-Bit Raster Image Data Representation
The 24-bit raster image object contains a set of 24-bit pixel values, each of which has three 8-bit components; one for the red, one for the green, and one for the blue color component of the image. These values, referred to as RGB values, are arranged in one of three specific ways, as described in Section 7.2.2.2 on page 247. The pixel values are arranged in rows, painted from left-to-right, top-to-bottom. As each pixel in a 24-bit image is represented in the image data by three 8-bit numbers, palettes are unnecessary and are not included in the 24-bit raster data model.
As an example, consider a stream of 24-bit numbers representing a raster image (Fig. 4.1a). To display the image, the color associated with the first number in the data stream appears in the upper left corner of the image. The remainder of the first line is then painted from left-to-right using as many values from the data stream as necessary to complete the line. The remainder of the rows are similarly painted from left-to-right, top-to-bottom until every value in the data stream appears as one pixel in the image.
FIGURE 7b - The Numerical Representation of a 24-Bit Raster Image
7.2.1.2 24-Bit Raster Image Dimension
The dimensions of an image are the height and width of the image in pixels. 7.2.2 Optional 24-Bit Raster Image Data Set Objects
7.2.2.1 Compression Method
The only 24-bit compression method currently available in HDF is the JPEG algorithm . The applicable HDF compression tags are COMP_JPEG
, and COMP_NONE
. (See Table 7A.) The HDF tags COMP_JPEG
and COMP_NONE
are defined as the values 2
, and 0
respectively in the "hdf.h" header file.
TABLE 7A - 24-Bit Raster Image Compression Method List
|
|
|
|
None
|
Lossless
| COMP_NONE |
Image data only (default setting).
|
JPEG
|
Lossy
| COMP_JPEG |
Image data, quality factor and compatibility factor.
|
For more information on the JPEG algorithm, refer to Chapter 6, 8-Bit Raster Images (DFR8 API).
7.2.2.2 Interlace Modes
Because graphics applications and hardware devices vary in the way they access image data, HDF supports three interlace formats. By storing an image using a format that is consistent with the expected application or device, it is possible to achieve substantial improvements in performance.
FIGURE 7c - RGB Interlace Format for 24-Bit Raster Images
TABLE 7B - 24-Bit Raster Image Interlace Format