[Top] [Prev] [Next] [Bottom]

8.2 The General Raster Data Model

HDF users familiar with the SD interface will find the general raster data model a simplified version of the SD scientific data set model, customized to accommodate image data storage and manipulation. The raster image data is stored in a two-dimensional array and attributes can be created for the image, the file or both. Palettes can be created and attached to the image as well as compression method information. A fundamental difference between the SD scientific data model and the GR raster data model is the absence of customizable dimensional information in the GR data set. Refer to Figure 8a.

FIGURE 8a General Raster Image Data Set Contents

8.2.1 Required General Raster Objects

Every general raster data set must contain three objects. These objects are the image array , the image array name and pixel type . Required objects are automatically created from the information provided at the time the data set is defined.

8.2.1.1 Image Array

An image array is the two-dimensional structure used to store the image's pixel data.

8.2.1.2 Image Array Name

Each image array has an image name consisting of a string of case-sensitive alphanumeric characters. The name must be provided by the calling program; the GR interface does not provide one by default if one isn't specified. Names are assigned when the data set is created and cannot be changed afterwards. Image array names do not have to be unique within a file, but if they are not it can be difficult to distinguish between the general raster data sets in the file.

8.2.1.3 Pixel Type

Another fundamental difference between the SD SDS model and the GR data model is that a GR image data array is defined by data type of its elements and the number of components in each element rather than only the data type. This is because each element in an image array corresponds to one pixel and each element of pixel data can consist of a variable number of color component values. (Red-Blue-Green or RGB, Cyan-Magenta-Yellow-Black or CMYK, etc.) These color component values can be represented by different methods and data lengths (8-bit lookup table or 24-bit direct representation, graphically depicted in Figure 6a in Chapter 6 and Figure 7b in Chapter 7 respectively). The data type of array elements and the number of components in each element are collectively referred to as the pixel type.

Data Type

As of HDF version 4.1r1, the general raster data model supports any data type.

Number of Components

Pixel elements can be comprised of any number of components.

8.2.1.4 Dimensions

Image array dimensions specify the size of an image array. There are no routines in the GR library that allow the HDF user to add attributes to a dimension or change the scale, as is possible in the SD interface.

8.2.2 Optional General Raster Objects

There are two types of optional objects available for inclusion in a general raster data set: palettes and attributes. These objects are only created when specifically requested by the calling program; the GR interface doesn't provide predefined palettes or attributes.

Palettes

Palettes are lookup tables attached to images for the purpose of the determining a set of color values for each pixel value in the image array. The GR interface provides similar capabilities for storing and manipulation palettes as the DFP interface described in Chapter 9, titled Palettes (DFP API). However, the DFP interface is restricted to single-file operations while the GR interface allows multifile palette operations. Eventually, all palette manipulation functionality will reside only within the GR interface, but for the time being the single-file DFP routines are fully compatible with palettes created with the GR palette routines. The GR palette routines are described in Section 8.9 on page 233.

Attributes

Attributes are defined by the calling program to contain auxiliary information about a file, image or both. They are described in Chapter 3, titled Scientific Data Sets (SD API). The GR implementation of attributes is covered in Section 8.8 on page 227.



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Guide - 06/04/97, NCSA HDF Development Group.