]> Creatis software - clitk.git/blob - utilities/CxImage/ximawbmp.h
CxImage sources taken from
[clitk.git] / utilities / CxImage / ximawbmp.h
1 /*\r
2  * File:        ximawbmp.h\r
3  * Purpose:     WBMP Image Class Loader and Writer\r
4  */\r
5 /* ==========================================================\r
6  * CxImageWBMP (c) 12/Jul/2002 Davide Pizzolato - www.xdp.it\r
7  * For conditions of distribution and use, see copyright notice in ximage.h\r
8  * ==========================================================\r
9  */\r
10 #if !defined(__ximaWBMP_h)\r
11 #define __ximaWBMP_h\r
12 \r
13 #include "ximage.h"\r
14 \r
15 #if CXIMAGE_SUPPORT_WBMP\r
16 \r
17 class CxImageWBMP: public CxImage\r
18 {\r
19 #pragma pack(1)\r
20 typedef struct tagWbmpHeader\r
21 {\r
22     DWORD  Type;            // 0\r
23     BYTE   FixHeader;       // 0\r
24     DWORD  ImageWidth;      // Image Width\r
25     DWORD  ImageHeight;     // Image Height\r
26 } WBMPHEADER;\r
27 #pragma pack()\r
28 public:\r
29         CxImageWBMP(): CxImage(CXIMAGE_FORMAT_WBMP) {}\r
30 \r
31 //      bool Load(const TCHAR * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_WBMP);}\r
32 //      bool Save(const TCHAR * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_WBMP);}\r
33         bool Decode(CxFile * hFile);\r
34         bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); }\r
35 protected:\r
36         bool ReadOctet(CxFile * hFile, DWORD *data);\r
37 \r
38 public:\r
39 #if CXIMAGE_SUPPORT_ENCODE\r
40         bool Encode(CxFile * hFile);\r
41         bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); }\r
42 protected:\r
43         bool WriteOctet(CxFile * hFile, const DWORD data);\r
44 #endif // CXIMAGE_SUPPORT_ENCODE\r
45 };\r
46 \r
47 #endif\r
48 \r
49 #endif\r