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"
26 class QLImage : public Image {
28 /// Access to this class is through this static method.
29 static ImagePtr newImage();
31 /// Return the list of loadable formats.
32 static FormatList loadableFormats();
34 /// Retrieve the buffered pixmap.
35 QPixmap const & qpixmap() const { return transformed_pixmap_; }
37 /// Retrieve the buffered pixmap.
38 QImage const & qimage() const { return transformed_; }
42 virtual Image * clone_impl() const;
43 /// Get the image width
44 virtual unsigned int getWidth_impl() const;
45 /// Get the image height
46 virtual unsigned int getHeight_impl() const;
47 // FIXME Is the image drawable ?
48 virtual bool isDrawable_impl() const { return true; }
50 * Load the image file into memory.
51 * The process is asynchronous, so this method starts the loading.
52 * When finished, the Image::finishedLoading signal is emitted.
54 virtual void load_impl(support::FileName const & filename);
56 * Finishes the process of modifying transformed_, using
57 * \c params to decide on color, grayscale etc.
58 * \returns true if successful.
60 virtual bool setPixmap_impl(Params const & params);
61 /// Clip the image using params.
62 virtual void clip_impl(Params const & params);
63 /// Rotate the image using params.
64 virtual void rotate_impl(Params const & params);
65 /// Scale the image using params.
66 virtual void scale_impl(Params const & params);
68 /// Access to the class is through newImage() and clone.
71 QLImage(QLImage const &);
73 /// The original loaded image.
76 /// The transformed image for display.
78 /// Buffer the pixmap itself
79 QPixmap transformed_pixmap_;
82 } // namespace graphics