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.
16 #include "graphics/GraphicsImage.h"
24 class GuiImage : public Image
27 /// Access to this class is through this static method.
28 static Image * newImage();
30 /// Retrieve the buffered pixmap.
31 QPixmap const & qpixmap() const { return transformed_pixmap_; }
33 /// Retrieve the buffered pixmap.
34 QImage const & qimage() const { return transformed_; }
38 virtual Image * clone() const;
39 /// Get the image width
40 virtual unsigned int width() const;
41 /// Get the image height
42 virtual unsigned int height() const;
43 // FIXME Is the image drawable ?
44 virtual bool isDrawable() const { return true; }
46 * Load the image file into memory.
47 * The process is asynchronous, so this method starts the loading.
48 * When finished, the Image::finishedLoading signal is emitted.
50 virtual void load(support::FileName const & filename);
52 * Finishes the process of modifying transformed_, using
53 * \c params to decide on color, grayscale etc.
54 * \returns true if successful.
56 virtual bool setPixmap(Params const & params);
57 /// Clip the image using params.
58 virtual void clip(Params const & params);
59 /// Rotate the image using params.
60 virtual void rotate(Params const & params);
61 /// Scale the image using params.
62 virtual void scale(Params const & params);
64 /// Access to the class is through newImage() and clone.
67 GuiImage(GuiImage const &);
69 /// The original loaded image.
72 /// The transformed image for display.
74 /// Buffer the pixmap itself
75 QPixmap transformed_pixmap_;
78 } // namespace graphics