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();
33 QPixmap const & qpixmap() const { return xformed_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 * Generate the pixmap, based on the current state of
52 * image_ (clipped, rotated, scaled etc).
53 * Uses the params to decide on color, grayscale etc.
54 * Returns true if the pixmap is created.
56 virtual bool setPixmap_impl(Params const & params);
57 /// Clip the image using params.
58 virtual void clip_impl(Params const & params);
59 /// Rotate the image using params.
60 virtual void rotate_impl(Params const & params);
61 /// Scale the image using params.
62 virtual void scale_impl(Params const & params);
64 /// Access to the class is through newImage() and clone.
67 QLImage(QLImage const &);
69 /// the original loaded image
72 /// the transformed pixmap for display
73 QPixmap xformed_pixmap_;
76 } // namespace graphics