home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / dreamscape / source / Dreamscape / Headers / graphics / h / jpeg < prev    next >
Encoding:
Text File  |  1996-08-27  |  1.4 KB  |  53 lines

  1.  
  2. // graphics.h.jpeg
  3.  
  4. // Dreamscape - C++ class library for RISC OS
  5. // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
  6. //
  7. // This library is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU Library General Public
  9. // License as published by the Free Software Foundation; either
  10. // version 2 of the License, or (at your option) any later version.
  11. // See the Dreamscape documentation for more information.
  12.  
  13. #ifndef dreamscape_jpeg_H
  14. #define dreamscape_jpeg_H
  15.  
  16. #include "graphic.h"
  17.  
  18. class JPEGImage: public Graphic {
  19.   static class Initialise: public Graphic::Handler {
  20.   public:
  21.     bool accept(Filetype type);
  22.     Graphic *load_file(const char *filename, Filetype type);
  23.     Graphic *load_data(istream &stream, int size, Filetype type);
  24.   } init;
  25.   friend Initialise;
  26.  
  27.   struct jpeg_image *data;
  28.   int size;
  29.   void output(ostream &stream) const;
  30.  
  31. public:
  32.   JPEGImage(const char *filename);
  33.   JPEGImage(istream &stream, int size);
  34.   virtual ~JPEGImage();
  35.  
  36.   int get_data_size() const;
  37.   Filetype get_filetype() const;
  38.   enum { filetype = 0xC85 };
  39.  
  40.   void redraw(const RedrawInfo &info) const;
  41.  
  42.   WinBBox get_bbox() const;
  43.   WinBBox get_transformed_bbox() const;
  44.   WinBBox get_transformed_bbox(const WinTransform &matrix) const;
  45.  
  46.   // Graphic-specific methods
  47.   void get_resolution(int &xdpi, int &ydpi) const;
  48.   jpeg_image *get_jpeg_data() { return data; }
  49.   const jpeg_image *get_jpeg_data() const { return data; }
  50. };
  51.  
  52. #endif
  53.