]> Creatis software - clitk.git/blob - utilities/CxImage/ximajbg.h
137eedfa0d540a42da102211497e215dd302a931
[clitk.git] / utilities / CxImage / ximajbg.h
1 /*\r
2  * File:        ximajbg.h\r
3  * Purpose:     JBG Image Class Loader and Writer\r
4  */\r
5 /* ==========================================================\r
6  * CxImageJBG (c) 18/Aug/2002 Davide Pizzolato - www.xdp.it\r
7  * For conditions of distribution and use, see copyright notice in ximage.h\r
8  *\r
9  * based on LIBJBG Copyright (c) 2002, Markus Kuhn - All rights reserved.\r
10  * ==========================================================\r
11  */\r
12 #if !defined(__ximaJBG_h)\r
13 #define __ximaJBG_h\r
14 \r
15 #include "ximage.h"\r
16 \r
17 #if CXIMAGE_SUPPORT_JBG\r
18 \r
19 extern "C" {\r
20 #include "../jbig/jbig.h"\r
21 };\r
22 \r
23 class CxImageJBG: public CxImage\r
24 {\r
25 public:\r
26         CxImageJBG(): CxImage(CXIMAGE_FORMAT_JBG) {}\r
27 \r
28 //      bool Load(const TCHAR * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_JBG);}\r
29 //      bool Save(const TCHAR * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_JBG);}\r
30         bool Decode(CxFile * hFile);\r
31         bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); }\r
32 \r
33 #if CXIMAGE_SUPPORT_ENCODE\r
34         bool Encode(CxFile * hFile);\r
35         bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); }\r
36 #endif // CXIMAGE_SUPPORT_ENCODE\r
37 protected:\r
38         static void jbig_data_out(BYTE *buffer, unsigned int len, void *file)\r
39                                                         {((CxFile*)file)->Write(buffer,len,1);}\r
40 };\r
41 \r
42 #endif\r
43 \r
44 #endif\r