home *** CD-ROM | disk | FTP | other *** search
/ Compressed Image File Formats / CompressedImageFileFormatsJohnMiano.iso / pc / Examples / c03 / inc / xbmdecod.h next >
Encoding:
C/C++ Source or Header  |  1998-12-17  |  1.5 KB  |  62 lines

  1. #ifndef __XBMDECOD_H
  2. #define __XBMDECOD_H
  3. //
  4. // Copyright (c) 1997,1998 Colosseum Builders, Inc.
  5. // All rights reserved.
  6. //
  7. // Colosseum Builders, Inc. makes no warranty, expressed or implied
  8. // with regards to this software. It is provided as is.
  9. //
  10. // See the README.TXT file that came with this software for restrictions
  11. // on the use and redistribution of this file or send E-mail to
  12. // info@colosseumbuilders.com
  13. //
  14.  
  15. //
  16. //  Title:  XBM Decoder Class Definition
  17. //
  18. //  Author:  John M. Miano  miano@colosseumbuilers.com
  19. //
  20.  
  21. #include "bitimage.h"
  22. #include "grexcept.h"
  23.  
  24. class XbmDecoder : public BitmapImageDecoder
  25. {
  26. public:
  27.   XbmDecoder () ;
  28.   XbmDecoder (const XbmDecoder &) ;
  29.   virtual ~XbmDecoder () ;
  30.   XbmDecoder &operator=(const XbmDecoder &) ;
  31.   void ReadImage (std::istream &, BitmapImage &) ;
  32.   int GetHotSpotX () const ;
  33.   int GetHotSpotY () const ;
  34.   std::string GetImageName () const ;
  35.  
  36. private:
  37.   void Initialize () ;
  38.   void DoCopy (const XbmDecoder &) ;
  39.  
  40.   int NextChar (std::istream &) ;
  41.   int NextToken (std::istream &) ;
  42.  
  43.   // This variables contain information from the image that the caller
  44.   // can retrieve after decoding.
  45.   int hot_spot_x ;
  46.   int hot_spot_y ;
  47.   std::string image_name ;
  48.  
  49.   int last_char ;  // One character push back buffer.
  50.   unsigned int lexical_value ;  // Value of an integer token
  51. } ;
  52.  
  53.  
  54. class EXbmInvalid : public EGraphicsException
  55. {
  56. public:
  57.   EXbmInvalid () : EGraphicsException ("Invalid XBM Format") {}
  58. } ;
  59.  
  60. #endif
  61.  
  62.