00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CIvfTgaImage_h_
00026 #define _CIvfTgaImage_h_
00027
00028 #include <ivfimage/IvfFileImage.h>
00029
00030 IvfSmartPointer(CIvfTgaImage);
00031
00037 class IVFEXT_API CIvfTgaImage : public CIvfFileImage {
00038 private:
00039 bool m_alphaChannel;
00040
00041 typedef struct
00042 {
00043 GLubyte * imageData;
00044 GLuint bpp;
00045 GLuint width;
00046 GLuint height;
00047 GLuint texID;
00048 GLuint type;
00049 } Texture;
00050
00051
00052 typedef struct
00053 {
00054 GLubyte Header[12];
00055 } TGAHeader;
00056
00057 typedef struct
00058 {
00059 GLubyte header[6];
00060 GLuint bytesPerPixel;
00061 GLuint imageSize;
00062 GLuint temp;
00063 GLuint type;
00064 GLuint Height;
00065 GLuint Width;
00066 GLuint Bpp;
00067 } TGA;
00068
00069 Texture texture;
00070 TGAHeader tgaheader;
00071 TGA tga;
00072
00073 bool LoadTGA(Texture * texture, char * filename);
00074
00075 bool LoadUncompressedTGA(Texture *, char *, FILE *);
00076 bool LoadCompressedTGA(Texture *, char *, FILE *);
00077
00078 public:
00080 CIvfTgaImage();
00081
00083 CIvfTgaImage(const char* name);
00084
00086 virtual ~CIvfTgaImage();
00087
00088 IvfClassInfo("CIvfTgaImage",CIvfFileImage);
00089
00091 virtual bool read();
00092
00099 void setAlphaChannel(bool flag);
00100 };
00101
00102 #endif