TGAHeader

Name

TGAHeader --  holds image header information, such as image width and height

Synopsis

typedef struct _TGAHeader TGAHeader;

struct _TGAHeader {
        tbyte id_len;
	tbyte map_t;
	tbyte img_t;
	tshort map_first;
	tshort map_len;
	tbyte map_entry;
	tshort x;
	tshort y;
	tshort width;
	tshort height;
	tbyte depth;
	tbyte alpha;
	tbyte horz;
	tbyte vert;
};
     

Members

id_len

Length in bytes of the image id field

map_t

Indicates wether this image is color mapped (0 = no color map, 1 = has color map).

img_t,

Indicates the image type. Recognized values are

0 = no image data included
1 = color mapped
2 = grayscale
3 = true-color (RGB or RGBA)
9 = RLE encoded color mapped
10 = RLE encoded grayscale
11 = RLE encoded true-color

For image types 1 and 9 the map_t field must be 1.

map_first

Index of the first color map entry

map_len

Number of entries (colors) in the color map.

map_entry

Color depth in bits of the color map entries (usualy 8, 16 or 24)

x

x-Coordinate of the left corner of the image

y

y-Coordinate of the upper corner of the image

width

Width of the image in pixels

height

Height of the image in pixels

depth

Color depth of the pixels in bits (The TGA file format puts no limitations on this value, so any color depth would be possible. However 8, 24 and 32 are normally used).

alpha

number of alpha channel bits per pixel

horz

horizontal orientation of the image (0 = left, 1 = right)

vert

vertical orientation of the image (0 = bottom, 1 = top)