|
//代码名称: Tga图片文件头
//类别: 图形图象 文件格式
//关健字: TGA 图片 文件头 文件格式
//作者: XXXXXX
//编译器: VC, others
//操作系统: Windows, others
#include <windows.h>
#pragma pack( push )
#pragma pack( 1 )
//**************TGA 文件头描述 ***************/
struct TargaHeader_s {
UCHAR bID_Length; // 附加信息长度
UCHAR bPalType; // 调色板信息
UCHAR bImageType; // 图象类型(0,1,2,3,9,10,11)
USHORT wPalFirstNdx;// 调色板第一个索引值
USHORT wPalLength; // 调色板索引数(以调色板单元为单位)
UCHAR bPalBits; // 一个调色板单位位数(15,16,24,32)
USHORT wLeft; // 图象左端坐标(基本无用)
USHORT wBottom; // 图象底端坐标(基本无用)
USHORT wWidth; // 图象宽度
USHORT wDepth; // 图象长度
UCHAR bBits; // 一个象素位数
UCHAR bDescriptor; // 附加特性描述
};
//**************TGA 文件尾描述 ***************/
struct TargaTail_s{
ULONG eao; // 扩展区偏移
ULONG ddo; // 开发者区偏移
UCHAR info[16]; // TRUEVISION-XFILE 商标字符串
UCHAR period; // 字符"."
UCHAR zero; // 0
};
#pragma pack ( pop )
// Targa图象类型定义
#define TGA_NULL 0
#define TGA_UNCPSPAL 1
#define TGA_UNCPSCOLOR 2
#define TGA_UNCPSGRAY 3
#define TGA_RLEPAL 9
#define TGA_RLECOLOR 10
#define TGA_RLEGRAY 11
// Targa图象数据存储类型
#define TGA_HORZMIRROR 0x10
#define TGA_VERTMIRROR 0x20
|
|