home *** CD-ROM | disk | FTP | other *** search
-
- // graphics.h.jpeg
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_jpeg_H
- #define dreamscape_jpeg_H
-
- #include "graphic.h"
-
- class JPEGImage: public Graphic {
- static class Initialise: public Graphic::Handler {
- public:
- bool accept(Filetype type);
- Graphic *load_file(const char *filename, Filetype type);
- Graphic *load_data(istream &stream, int size, Filetype type);
- } init;
- friend Initialise;
-
- struct jpeg_image *data;
- int size;
- void output(ostream &stream) const;
-
- public:
- JPEGImage(const char *filename);
- JPEGImage(istream &stream, int size);
- virtual ~JPEGImage();
-
- int get_data_size() const;
- Filetype get_filetype() const;
- enum { filetype = 0xC85 };
-
- void redraw(const RedrawInfo &info) const;
-
- WinBBox get_bbox() const;
- WinBBox get_transformed_bbox() const;
- WinBBox get_transformed_bbox(const WinTransform &matrix) const;
-
- // Graphic-specific methods
- void get_resolution(int &xdpi, int &ydpi) const;
- jpeg_image *get_jpeg_data() { return data; }
- const jpeg_image *get_jpeg_data() const { return data; }
- };
-
- #endif
-