www.pudn.com > Gimcrack-v0.0051-Source.zip > targa.h
#ifndef _GCTARGA_H_ #define _GCTARGA_H_ #include "loader.h" #includeusing namespace std; class GcTarga : public GcLoader { public: // Constructor/Destructor GcTarga(); ~GcTarga(); // Load the file bool Load(char *fileName); // Write to the file bool Write(char *filename, uint widht, uint height, uint screenBpp); // Take a screenshot /* WARNING! DO NOT USE THIS IF THE BITMAP ARE TO BE USED FURTHER ON */ void Screenshot(char *fileName, uint winWidth, uint winHeight, uint screenBpp); // Draw it to the screen void Draw(uint xPos, uint yPos); // Destroy the TGA (so that the same object can be re-used) void Destroy(); // Return width/height and bit depth uint Width() { return imageWidth; } uint Height() { return imageHeight; } byte Bpp() { return bitCount; } uint Size() { return imageSize; } // Return the image byte *Image() { return imageData; } byte Image(int index) { return imageData[index]; } private: bool LoadRLE(ifstream &file); bool LoadNormal(ifstream &file); byte imageTypeCode; byte bitCount; byte *imageData; uint imageWidth; uint imageHeight; uint imageSize; }; #endif