home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / win32 / include / cximage / ximajbg.h < prev    next >
C/C++ Source or Header  |  2004-02-29  |  2KB  |  61 lines

  1. /*
  2.  * File:    ximajbg.h
  3.  * Purpose:    JBG Image Class Loader and Writer
  4.  */
  5. /* === C R E D I T S  &  D I S C L A I M E R S ==============
  6.  * CxImageJBG (c) 18/Aug/2002 Davide Pizzolato - www.xdp.it
  7.  * Permission is given by the author to freely redistribute and include
  8.  * this code in any program as long as this credit is given where due.
  9.  *
  10.  * CxImage version 5.99a 08/Feb/2004
  11.  * See the file history.htm for the complete bugfix and news report.
  12.  *
  13.  * based on LIBJBG Copyright (c) 2002, Markus Kuhn - All rights reserved.
  14.  *
  15.  * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
  16.  * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
  17.  * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
  18.  * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
  19.  * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
  20.  * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
  21.  * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
  22.  * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
  23.  * THIS DISCLAIMER.
  24.  *
  25.  * Use at your own risk!
  26.  * ==========================================================
  27.  */
  28. #if !defined(__ximaJBG_h)
  29. #define __ximaJBG_h
  30.  
  31. #include "ximage.h"
  32.  
  33. #if CXIMAGE_SUPPORT_JBG
  34.  
  35. extern "C" {
  36. #include "../jbig/jbig.h"
  37. };
  38.  
  39. class CxImageJBG: public CxImage
  40. {
  41. public:
  42.     CxImageJBG(): CxImage(CXIMAGE_FORMAT_JBG) {}
  43.  
  44. //    bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_JBG);}
  45. //    bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_JBG);}
  46.     bool Decode(CxFile * hFile);
  47.     bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); }
  48.  
  49. #if CXIMAGE_SUPPORT_ENCODE
  50.     bool Encode(CxFile * hFile);
  51.     bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); }
  52. #endif // CXIMAGE_SUPPORT_ENCODE
  53. protected:
  54.     static void jbig_data_out(BYTE *buffer, unsigned int len, void *file)
  55.                             {((CxFile*)file)->Write(buffer,len,1);}
  56. };
  57.  
  58. #endif
  59.  
  60. #endif
  61.