2 /* This file is part of
3 * =================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich.
7 * Copyright 1995-2000 The LyX Team.
9 * This file Copyright 2000 Baruch Even
10 * ================================================= */
23 #include "boost/utility.hpp"
27 /** Renderer is a base class that is used to take an image format, and
28 * render it into a Pixmap in order to be able to display it later on
29 * in LyX. Essentially it's job is to load an image format and create
30 * a Pixmap from it. It also needs to do various transforms on the
31 * image, like Rotation, Resize and color reduction.
33 * @Author Baruch Even, <baruch.even@writeme.com>
35 class Renderer : public noncopyable {
42 /// Set the filename that we will render
43 bool setFilename(string const & filename);
45 /// Render the image, doing the necessary transforms.
46 virtual bool renderImage() = 0;
48 /// Get the last rendered pixmap.
49 LyXImage * getPixmap() const;
51 /// Get the width of the pixmap.
52 unsigned int getWidth() const;
54 /// Get the height of the pixmap.
55 unsigned int getHeight() const;
58 /// Verify that the file is one that we can handle.
59 virtual bool isImageFormatOK(string const & filename) const = 0;
62 void setPixmap(LyXImage * pixmap, unsigned int width, unsigned int height);
64 string const & getFilename() const;
67 /// Free the loaded pixmap
70 /// The filename of the image file that we are responsible for.
72 /// The last rendered pixmap.
74 /// The width of the rendered pixmap.
76 /// The height of the rendered pixmap.