4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming (original Qt version)
8 * \author John Levon (original Qt version)
11 * Full author contact details are available in file CREDITS.
18 #include "graphics/GraphicsImage.h"
25 class LyXGdkImage : public Image {
27 /// Access to this class is through this static method.
28 static ImagePtr newImage();
30 /// Return the list of loadable formats.
31 static FormatList loadableFormats();
33 /// Retrieve the buffered pixmap.
34 Glib::RefPtr<Gdk::Pixbuf> const & pixbuf() const {return transformed_;}
38 virtual Image * clone_impl() const;
39 /// Get the image width
40 virtual unsigned int getWidth_impl() const;
41 /// Get the image height
42 virtual unsigned int getHeight_impl() const;
43 // FIXME Is the image drawable ?
44 virtual bool isDrawable_impl() const { return true; }
46 * Load the image file into memory.
47 * The process is asynchronous, so this method starts the loading.
48 * When finished, the Image::finishedLoading signal is emitted.
50 virtual void load_impl(std::string const & filename);
52 * Finishes the process of modifying transformed_, using
53 * \c params to decide on color, grayscale etc.
54 * \returns true if successful.
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 LyXGdkImage(LyXGdkImage const &);
69 Glib::RefPtr<Gdk::Pixbuf> original_;
70 Glib::RefPtr<Gdk::Pixbuf> transformed_;
73 } // namespace graphics
76 #endif // LYXGDKIMAGE_H