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

  1. /*
  2.  * File:    ximaico.h
  3.  * Purpose:    ICON 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.  * CxImageICO (c) 07/Aug/2001 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.  * Parts of the code come from FreeImage 2
  14.  * Design and implementation by Floris van den Berg <flvdberg(at)wxs(dot)nl>
  15.  *
  16.  * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
  17.  * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
  18.  * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
  19.  * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
  20.  * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
  21.  * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
  22.  * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
  23.  * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
  24.  * THIS DISCLAIMER.
  25.  *
  26.  * Use at your own risk!
  27.  * ==========================================================
  28.  */
  29. #if !defined(__ximaICO_h)
  30. #define __ximaICO_h
  31.  
  32. #include "ximage.h"
  33.  
  34. #if CXIMAGE_SUPPORT_ICO
  35.  
  36. class CxImageICO: public CxImage
  37. {
  38. typedef struct tagIconDirectoryEntry {
  39.     BYTE  bWidth;
  40.     BYTE  bHeight;
  41.     BYTE  bColorCount;
  42.     BYTE  bReserved;
  43.     WORD  wPlanes;
  44.     WORD  wBitCount;
  45.     DWORD dwBytesInRes;
  46.     DWORD dwImageOffset;
  47. } ICONDIRENTRY;
  48.  
  49. typedef struct tagIconDir {
  50.     WORD          idReserved;
  51.     WORD          idType;
  52.     WORD          idCount;
  53. } ICONHEADER;
  54.  
  55. public:
  56.     CxImageICO(): CxImage(CXIMAGE_FORMAT_ICO) {}
  57.  
  58. //    bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_ICO);}
  59. //    bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_ICO);}
  60.     bool Decode(CxFile * hFile);
  61.     bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); }
  62.  
  63. #if CXIMAGE_SUPPORT_ENCODE
  64.     bool Encode(CxFile * hFile);
  65.     bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); }
  66. #endif // CXIMAGE_SUPPORT_ENCODE
  67. };
  68.  
  69. #endif
  70.  
  71. #endif
  72.