4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
12 /* An instantiation of Image that makes use of the xforms lirary routines
13 * to load and store the image in memory.
20 #include "graphics/GraphicsImage.h"
25 typedef flimage_ FL_IMAGE;
30 class xformsImage : public Image
33 /// Access to this class is through this static method.
34 static ImagePtr newImage();
36 /// Return the list of loadable formats.
37 static FormatList loadableFormats();
42 Pixmap getPixmap() const;
44 /// Internal callbacks.
45 void statusCB(std::string const &);
46 void errorCB(std::string const &);
50 virtual Image * clone_impl() const;
51 /// Get the image width
52 virtual unsigned int getWidth_impl() const;
53 /// Get the image height
54 virtual unsigned int getHeight_impl() const;
55 /// Is the image drawable ?
56 virtual bool isDrawable_impl() const;
57 /** Load the image file into memory.
58 * The process is asynchronous, so this method starts the loading.
59 * When finished, the Image::finishedLoading signal is emitted.
61 virtual void load_impl(std::string const & filename);
62 /** Generate the pixmap, based on the current state of
63 * image_ (clipped, rotated, scaled etc).
64 * Uses the params to decide on color, grayscale etc.
65 * Returns true if the pixmap is created.
67 bool setPixmap_impl(Params const & params);
68 /// Clip the image using params.
69 virtual void clip_impl(Params const & params);
71 /// Rotate the image using params.
72 virtual void rotate_impl(Params const & params);
74 /// Scale the image using params.
75 virtual void scale_impl(Params const & params);
77 /// Access to the class is through newImage() and clone.
80 xformsImage(xformsImage const &);
82 /// The xforms container.
85 /// The pixmap itself.
88 /// Is the pixmap initialized?
98 PixmapStatus pixmap_status_;
101 } // namespace graphics
104 #endif // XFORMSIMAGE_H