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
20 #include "graphics/GraphicsImage.h"
26 class QLImage : public Image {
28 /// Access to this class is through this static method.
29 static ImagePtr newImage();
31 /// Return the list of loadable formats.
32 static FormatList loadableFormats();
37 virtual Image * clone() const;
39 QPixmap const & qpixmap() const { return xformed_pixmap_; }
41 /// Get the image width
42 virtual unsigned int getWidth() const;
44 /// Get the image height
45 virtual unsigned int getHeight() const;
48 virtual bool isDrawable() const { return true; }
51 * Load the image file into memory.
52 * The process is asynchronous, so this method starts the loading.
53 * When finished, the Image::finishedLoading signal is emitted.
55 virtual void load(string const & filename);
58 * Generate the pixmap, based on the current state of
59 * image_ (clipped, rotated, scaled etc).
60 * Uses the params to decide on color, grayscale etc.
61 * Returns true if the pixmap is created.
63 virtual bool setPixmap(Params const & params);
65 /// Clip the image using params.
66 virtual void clip(Params const & params);
68 /// Rotate the image using params.
69 virtual void rotate(Params const & params);
71 /// Scale the image using params.
72 virtual void scale(Params const & params);
74 /// Access to the class is through newImage() and clone.
77 QLImage(QLImage const &);
79 /// the original loaded image
82 /// the transformed pixmap for display
83 QPixmap xformed_pixmap_;