1 <H4> Update Time 06/12/13---03:07:17 </H4>
4 <H2>Information from source codes</H2>
21 typedef enum tgaFileColorMap {
22 tgaFileColorMapNoColorMap=0,
23 tgaFileColorMapColorMap=1
26 typedef enum tgaFileImageType {
27 tgaFileImageTypeNoImage = 0,
28 tgaFileImageTypeColorMappedImage = 1,
29 tgaFileImageTypeTrueColorImage = 2,
30 tgaFileImageTypeBlackAndWhite = 3,
31 tgaFileImageTypeRLEColorMappedImage = 9,
32 tgaFileImageTypeRLETrueColorImage = 10,
33 tgaFileImageTypeRLEBlackAndWhite = 11
36 typedef struct tgaFileColorMapSpecification {
37 short FirstEntryIndex;
39 unsigned char ColorMapEntrySize;
40 } tgaFileColorMapSpecification;
42 typedef enum tgaFileImageOrigin {
43 tgaFileImageOriginBottomLeft = 0,
44 tgaFileImageOriginBottomRight = 1,
45 tgaFileImageOriginTopLeft = 2,
46 tgaFileImageOriginTopRight = 3
49 typedef union tgaFileDescriptor {
52 unsigned char AlphaChannelBits:4;
53 unsigned char ImageOrigin:2;
54 unsigned char Unused:2;
58 typedef struct tgaFileImageSpecification {
64 tgaFileDescriptor Descriptor;
65 } tgaFileImageSpecification;
67 typedef struct tgaFileHeader {
68 unsigned char IDLength; /* 1 Byte */
69 unsigned char ColorMapType; /* 1 Byte */
70 unsigned char ImageType; /* 1 Byte */
71 tgaFileColorMapSpecification ColorMapSpec; /* 5 Bytes */
72 tgaFileImageSpecification ImageSpec; /* 10 Bytes */
73 } tgaFileHeader; /* 18 Bytes */
75 typedef unsigned char tgaFileImageID;
76 typedef unsigned char tgaFileColorMapData;
77 typedef unsigned char tgaFileImageData;
78 typedef unsigned char tgaFileDeveloperData;
80 typedef struct tgaFile {
81 tgaFileHeader Header; /* Field 1-5 : fixed: 18 Bytes */
82 tgaFileImageID* ImageID; /* Field 6: variable */
83 tgaFileColorMapData* ColorMapData; /* Field 7: variable */
84 tgaFileImageData* Image; /* Field 8: variable */
85 tgaFileDeveloperData* DeveloperData; /* Field 9: variable */
87 /* Additional Information */
96 extern tgaFile* tgaFileInit(tgaFile* tga, FILE* fpt, int mode);
97 extern tgaFile* tgaFileImageInit(tgaFile* tga, FILE* fpt, int mode);
99 /* in tgaFileRead.c */
100 extern tgaFile* tgaFileHeaderRead(tgaFile* tga, FILE* fpt, int mode);
101 extern tgaFile* tgaFileImageDataRead(tgaFile* tga, FILE* fpt, int mode);
102 extern tgaFile* tgaFileRead(tgaFile* tga, FILE* fpt, int mode);
104 /* in tgaFilePrint */
105 extern void tgaFileHeaderPrint(tgaFile* tga, FILE* out, int mode);
111 #endif /* TGA_FILE_H */