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"
24 class QLImage : public Image {
26 /// Access to this class is through this static method.
27 static ImagePtr newImage();
29 /// Return the list of loadable formats.
30 static FormatList loadableFormats();
35 virtual Image * clone() const;
37 QPixmap const & qpixmap() const { return xformed_pixmap_; }
39 /// Get the image width
40 virtual unsigned int getWidth() const;
42 /// Get the image height
43 virtual unsigned int getHeight() const;
46 virtual bool isDrawable() const { return true; }
49 * Load the image file into memory.
50 * The process is asynchronous, so this method starts the loading.
51 * When finished, the Image::finishedLoading signal is emitted.
53 virtual void load(string const & filename);
56 * Generate the pixmap, based on the current state of
57 * image_ (clipped, rotated, scaled etc).
58 * Uses the params to decide on color, grayscale etc.
59 * Returns true if the pixmap is created.
61 virtual bool setPixmap(Params const & params);
63 /// Clip the image using params.
64 virtual void clip(Params const & params);
66 /// Rotate the image using params.
67 virtual void rotate(Params const & params);
69 /// Scale the image using params.
70 virtual void scale(Params const & params);
72 /// Access to the class is through newImage() and clone.
75 QLImage(QLImage const &);
77 /// the original loaded image
80 /// the transformed pixmap for display
81 QPixmap xformed_pixmap_;
84 } // namespace graphics