00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
#ifndef _TGA_H
00012 
#define _TGA_H
00013 
00014 
#include <stdio.h>
00015 
#include <stdlib.h>
00016 
00034 class  CTgaHeader
00035 {
00036 
public:
00037     
char  idlength;
00038     
char  colourmaptype;
00039     
char  datatypecode;
00040     
short colourmaporigin;
00041     
short colourmaplength;
00042     
char  colourmapdepth;
00043     
short x_origin;
00044     
short y_origin;
00045     
short SizeX;
00046     
short SizeY;
00047     
char  Bpp;
00048     
char  imagedescriptor;
00049 };
00050 
00051 
class CTga
00052 {
00053 
private:
00054     
CTgaHeader TgaHeader;
00055     
int m_SizeX,m_SizeY,m_Bpp;
00056     
unsigned char *m_dest;
00057 
public:
00058 
00059     CTga(); 
00060 
00061     
int GetSizeX()
00062     {
00063         
return m_SizeX;
00064     }
00065     
00066     
int GetSizeY()
00067     {
00068         
return m_SizeY;
00069     }
00070     
00071     
int Bpp()
00072     {
00073         
return m_Bpp;       
00074     }
00075     
00076     
unsigned char * GetPointer()
00077     {
00078         
return m_dest;
00079     }   
00080     
00081     
int ReadFile(
const char *str);
00082     
int Release();
00083 };
00084 
00085 
#endif