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 /// Return the list of loadable formats.
31 static FormatList loadableFormats();
33 /// Retrieve the buffered pixmap.
34 QPixmap const & qpixmap() const { return transformed_pixmap_; }
36 /// Retrieve the buffered pixmap.
37 QImage const & qimage() const { return transformed_; }
41 virtual Image * clone() const;
42 /// Get the image width
43 virtual unsigned int getWidth() const;
44 /// Get the image height
45 virtual unsigned int getHeight() const;
46 // FIXME Is the image drawable ?
47 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(support::FileName const & filename);
55 * Finishes the process of modifying transformed_, using
56 * \c params to decide on color, grayscale etc.
57 * \returns true if successful.
59 virtual bool setPixmap(Params const & params);
60 /// Clip the image using params.
61 virtual void clip(Params const & params);
62 /// Rotate the image using params.
63 virtual void rotate(Params const & params);
64 /// Scale the image using params.
65 virtual void scale(Params const & params);
67 /// Access to the class is through newImage() and clone.
70 GuiImage(GuiImage const &);
72 /// The original loaded image.
75 /// The transformed image for display.
77 /// Buffer the pixmap itself
78 QPixmap transformed_pixmap_;
81 } // namespace graphics