4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS
17 #include "graphics/GraphicsImage.h"
23 class QLImage : public Image {
25 /// Access to this class is through this static method.
26 static ImagePtr newImage();
28 /// Return the list of loadable formats.
29 static FormatList loadableFormats();
34 virtual Image * clone() const;
36 QPixmap const & qpixmap() const { return xformed_pixmap_; }
38 /// Get the image width
39 virtual unsigned int getWidth() const;
41 /// Get the image height
42 virtual unsigned int getHeight() const;
45 virtual bool isDrawable() const { return true; }
48 * Load the image file into memory.
49 * The process is asynchronous, so this method starts the loading.
50 * When finished, the Image::finishedLoading signal is emitted.
52 virtual void load(string const & filename);
55 * Generate the pixmap, based on the current state of
56 * image_ (clipped, rotated, scaled etc).
57 * Uses the params to decide on color, grayscale etc.
58 * Returns true if the pixmap is created.
60 virtual bool setPixmap(Params const & params);
62 /// Clip the image using params.
63 virtual void clip(Params const & params);
65 /// Rotate the image using params.
66 virtual void rotate(Params const & params);
68 /// Scale the image using params.
69 virtual void scale(Params const & params);
71 /// Access to the class is through newImage() and clone.
74 QLImage(QLImage const &);
76 /// the original loaded image
79 /// the transformed pixmap for display
80 QPixmap xformed_pixmap_;