IMG(2)

NAME
IMG File Format - The IMG file format for use in the VolVis system

DESCRIPTION
The IMG file format is the format for image files in the VolVis system. VolVis 1.0 can currently input and output only 24 bit image files (although these images can be displayed on an 8 bit monitor). The format consists of a header, followed by the red component of the image, then the green componenet, then the blue component. Each component may be compressed using a run-length encoding technique, or may be uncompressed. When an image is saved using VolVis 1.0, compression is always attempted. If compressing an image would result in an image size greater than it would be uncompressed, compression is not used. The system can read in compressed and uncompressed images. The exact IMG format is as follows:
 byte size name description
 ----------------------------------------------

 0 int width the width of the image
                        in pixels
 4 int height the height of the image
                        in pixels
 8 int depth the depth of the image
                        in bytes (in version 1.0
                        this will always be a 3)
 12 C_CompressionType ctype the compression type used
                        on this image - it will be
                        either C_RUN_LENGTH_ENCODE
                        or C_NO_COMPRESSION
 16 C_Byte red the red information
                        the size of this depends
                        on the compression type
 XX C_Byte green the green information
                        the size of this depends
                        on the compression type
 YY C_Byte blue the blue information
                        the size of this depends
                        on the compression type If the compression type is C_NO_COMPRESSION, then the size of each of the red, green, and blue components of the image will be width*height bytes. If the compression type is C_RUN_LENGTH_ENCODE, then the size of each color component is dependent on how well the data compresses.

SEE ALSO
FUN, SLC, TXT, C_write_IMG_file, C_read_IMG_file, C_encode_bytes, C_decode_bytes

AUTHOR
    Lisa Sobierajski