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"
24 class QLImage : 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_; }
37 virtual Image * clone_impl() const;
38 /// Get the image width
39 virtual unsigned int getWidth_impl() const;
40 /// Get the image height
41 virtual unsigned int getHeight_impl() const;
42 // FIXME Is the image drawable ?
43 virtual bool isDrawable_impl() const { return true; }
45 * Load the image file into memory.
46 * The process is asynchronous, so this method starts the loading.
47 * When finished, the Image::finishedLoading signal is emitted.
49 virtual void load_impl(std::string const & filename);
51 * Finishes the process of modifying transformed_, using
52 * \c params to decide on color, grayscale etc.
53 * \returns true if successful.
55 virtual bool setPixmap_impl(Params const & params);
56 /// Clip the image using params.
57 virtual void clip_impl(Params const & params);
58 /// Rotate the image using params.
59 virtual void rotate_impl(Params const & params);
60 /// Scale the image using params.
61 virtual void scale_impl(Params const & params);
63 /// Access to the class is through newImage() and clone.
66 QLImage(QLImage const &);
68 /// The original loaded image.
71 /// The transformed image for display.
73 /// Buffer the pixmap itself
74 QPixmap transformed_pixmap_;
77 } // namespace graphics