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 "support/utility.hpp"
25 /** Renderer is a base class that is used to take an image format, and
26 render it into a Pixmap in order to be able to display it later on
27 in LyX. Essentially it's job is to load an image format and create
28 a Pixmap from it. It also needs to do various transforms on the
29 image, like Rotation, Resize and color reduction.
31 class Renderer : public noncopyable {
38 /// Set the filename that we will render
39 bool setFilename(string const & filename);
41 /// Render the image, doing the necessary transforms.
42 virtual bool renderImage() = 0;
44 /// Get the last rendered pixmap.
45 Pixmap getPixmap() const;
47 /// Get the width of the pixmap.
48 unsigned int getWidth() const;
50 /// Get the height of the pixmap.
51 unsigned int getHeight() const;
54 /// Verify that the file is one that we can handle.
55 virtual bool isImageFormatOK(string const & filename) const = 0;
58 void setPixmap(Pixmap pixmap, unsigned int width, unsigned int height);
60 string const & getFilename() const;
63 /// Free the loaded pixmap
66 /// The filename of the image file that we are responsible for.
68 /// The last rendered pixmap.
70 /// The width of the rendered pixmap.
72 /// The height of the rendered pixmap.