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