-/*\r
- * File: ximatga.h\r
- * Purpose: TARGA Image Class Loader and Writer\r
- */\r
-/* ==========================================================\r
- * CxImageTGA (c) 05/Jan/2002 Davide Pizzolato - www.xdp.it\r
- * For conditions of distribution and use, see copyright notice in ximage.h\r
- *\r
- * Parts of the code come from Paintlib : Copyright (c) 1996-1998 Ulrich von Zadow\r
- * ==========================================================\r
- */\r
-#if !defined(__ximaTGA_h)\r
-#define __ximaTGA_h\r
-\r
-#include "ximage.h"\r
-\r
-#if CXIMAGE_SUPPORT_TGA\r
-\r
-class CxImageTGA: public CxImage\r
-{\r
-#pragma pack(1)\r
-typedef struct tagTgaHeader\r
-{\r
- BYTE IdLength; // Image ID Field Length\r
- BYTE CmapType; // Color Map Type\r
- BYTE ImageType; // Image Type\r
-\r
- WORD CmapIndex; // First Entry Index\r
- WORD CmapLength; // Color Map Length\r
- BYTE CmapEntrySize; // Color Map Entry Size\r
-\r
- WORD X_Origin; // X-origin of Image\r
- WORD Y_Origin; // Y-origin of Image\r
- WORD ImageWidth; // Image Width\r
- WORD ImageHeight; // Image Height\r
- BYTE PixelDepth; // Pixel Depth\r
- BYTE ImagDesc; // Image Descriptor\r
-} TGAHEADER;\r
-#pragma pack()\r
-\r
-public:\r
- CxImageTGA(): CxImage(CXIMAGE_FORMAT_TGA) {}\r
-\r
-// bool Load(const TCHAR * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_TGA);}\r
-// bool Save(const TCHAR * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_TGA);}\r
- bool Decode(CxFile * hFile);\r
- bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); }\r
-\r
-#if CXIMAGE_SUPPORT_ENCODE\r
- bool Encode(CxFile * hFile);\r
- bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); }\r
-#endif // CXIMAGE_SUPPORT_ENCODE\r
-protected:\r
- BYTE ExpandCompressedLine(BYTE* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int width, int y, BYTE rleLeftover);\r
- void ExpandUncompressedLine(BYTE* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int width, int y, int xoffset);\r
- void tga_toh(TGAHEADER* p);\r
-};\r
-\r
-#endif\r
-\r
-#endif\r
+/*
+ * File: ximatga.h
+ * Purpose: TARGA Image Class Loader and Writer
+ */
+/* ==========================================================
+ * CxImageTGA (c) 05/Jan/2002 Davide Pizzolato - www.xdp.it
+ * For conditions of distribution and use, see copyright notice in ximage.h
+ *
+ * Parts of the code come from Paintlib : Copyright (c) 1996-1998 Ulrich von Zadow
+ * ==========================================================
+ */
+#if !defined(__ximaTGA_h)
+#define __ximaTGA_h
+
+#include "ximage.h"
+
+#if CXIMAGE_SUPPORT_TGA
+
+class CxImageTGA: public CxImage
+{
+#pragma pack(1)
+typedef struct tagTgaHeader
+{
+ BYTE IdLength; // Image ID Field Length
+ BYTE CmapType; // Color Map Type
+ BYTE ImageType; // Image Type
+
+ WORD CmapIndex; // First Entry Index
+ WORD CmapLength; // Color Map Length
+ BYTE CmapEntrySize; // Color Map Entry Size
+
+ WORD X_Origin; // X-origin of Image
+ WORD Y_Origin; // Y-origin of Image
+ WORD ImageWidth; // Image Width
+ WORD ImageHeight; // Image Height
+ BYTE PixelDepth; // Pixel Depth
+ BYTE ImagDesc; // Image Descriptor
+} TGAHEADER;
+#pragma pack()
+
+public:
+ CxImageTGA(): CxImage(CXIMAGE_FORMAT_TGA) {}
+
+// bool Load(const TCHAR * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_TGA);}
+// bool Save(const TCHAR * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_TGA);}
+ bool Decode(CxFile * hFile);
+ bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); }
+
+#if CXIMAGE_SUPPORT_ENCODE
+ bool Encode(CxFile * hFile);
+ bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); }
+#endif // CXIMAGE_SUPPORT_ENCODE
+protected:
+ BYTE ExpandCompressedLine(BYTE* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int width, int y, BYTE rleLeftover);
+ void ExpandUncompressedLine(BYTE* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int width, int y, int xoffset);
+ void tga_toh(TGAHEADER* p);
+};
+
+#endif
+
+#endif