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 {
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();
32 /// Retrieve the buffered pixmap.
33 QPixmap const & qpixmap() const { return transformed_pixmap_; }
35 /// Retrieve the buffered pixmap.
36 QImage const & qimage() const { return transformed_; }
40 virtual Image * clone_impl() const;
41 /// Get the image width
42 virtual unsigned int getWidth_impl() const;
43 /// Get the image height
44 virtual unsigned int getHeight_impl() const;
45 // FIXME Is the image drawable ?
46 virtual bool isDrawable_impl() 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_impl(support::FileName const & filename);
54 * Finishes the process of modifying transformed_, using
55 * \c params to decide on color, grayscale etc.
56 * \returns true if successful.
58 virtual bool setPixmap_impl(Params const & params);
59 /// Clip the image using params.
60 virtual void clip_impl(Params const & params);
61 /// Rotate the image using params.
62 virtual void rotate_impl(Params const & params);
63 /// Scale the image using params.
64 virtual void scale_impl(Params const & params);
66 /// Access to the class is through newImage() and clone.
69 GuiImage(GuiImage const &);
71 /// The original loaded image.
74 /// The transformed image for display.
76 /// Buffer the pixmap itself
77 QPixmap transformed_pixmap_;
80 } // namespace graphics