aboutsummaryrefslogtreecommitdiff
path: root/archive/hge/CxImage/ximatga.h
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-26 22:52:36 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-26 22:52:36 +0800
commit3bd383baf6a17e734329e1fc677c7e86283db772 (patch)
tree69a9148087577f797624ceb9c71323a2563d6bb4 /archive/hge/CxImage/ximatga.h
parent543e4f570be9b279ba558ca61cc02cda251af384 (diff)
downloadbullet-lab-remix-3bd383baf6a17e734329e1fc677c7e86283db772.tar.xz
Added support for relative line numbers.
Added instructions for, brk and cont. (They are still untested...) Parser code cleanup. Removed garbage output to stderr. Reorganize the repository structure. Updated BLR2 code move it into archive. Added BLR1 files.
Diffstat (limited to 'archive/hge/CxImage/ximatga.h')
-rw-r--r--archive/hge/CxImage/ximatga.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/archive/hge/CxImage/ximatga.h b/archive/hge/CxImage/ximatga.h
new file mode 100644
index 0000000..3cbc36a
--- /dev/null
+++ b/archive/hge/CxImage/ximatga.h
@@ -0,0 +1,61 @@
+/*
+ * 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
+{
+ uint8_t IdLength; // Image ID Field Length
+ uint8_t CmapType; // Color Map Type
+ uint8_t ImageType; // Image Type
+
+ uint16_t CmapIndex; // First Entry Index
+ uint16_t CmapLength; // Color Map Length
+ uint8_t CmapEntrySize; // Color Map Entry Size
+
+ uint16_t X_Origin; // X-origin of Image
+ uint16_t Y_Origin; // Y-origin of Image
+ uint16_t ImageWidth; // Image Width
+ uint16_t ImageHeight; // Image Height
+ uint8_t PixelDepth; // Pixel Depth
+ uint8_t 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:
+ uint8_t ExpandCompressedLine(uint8_t* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int32_t width, int32_t y, uint8_t rleLeftover);
+ void ExpandUncompressedLine(uint8_t* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int32_t width, int32_t y, int32_t xoffset);
+ void tga_toh(TGAHEADER* p);
+};
+
+#endif
+
+#endif