#ifndef GRAPHICSIMAGE_H
#define GRAPHICSIMAGE_H
+#include "Dimension.h"
+
#include <boost/function.hpp>
#include <boost/signal.hpp>
#include <vector>
-#include <utility>
namespace lyx {
*/
static boost::function<Image *()> newImage;
- ///
- typedef std::vector<std::string> FormatList;
- /// Return the list of loadable formats.
- static boost::function<FormatList()> loadableFormats;
-
///
virtual ~Image() {}
virtual Image * clone() const = 0;
/// Get the image width
- virtual unsigned int getWidth() const = 0;
+ virtual unsigned int width() const = 0;
/// Get the image height
- virtual unsigned int getHeight() const = 0;
+ virtual unsigned int height() const = 0;
/// Is the image drawable ?
virtual bool isDrawable() const = 0;
* The caller should expect this process to be asynchronous and
* so should connect to the "finished" signal above.
*/
- virtual void load(support::FileName const & filename) = 0;
+ virtual bool load(support::FileName const & filename) = 0;
/** Generate the pixmap.
* Uses the params to decide on color, grayscale etc.
*/
virtual bool setPixmap(Params const & params) = 0;
- /// Clip the image using params.
- virtual void clip(Params const & params) = 0;
-
- /// Rotate the image using params.
- virtual void rotate(Params const & params) = 0;
-
- /// Scale the image using params.
- virtual void scale(Params const & params) = 0;
-
protected:
/// Must define default c-tor explicitly as we define a copy c-tor.
Image() {}
Image(Image const &) {}
/** Uses the params to ascertain the dimensions of the scaled image.
- * Returned as make_pair(width, height).
- * If something goes wrong, returns make_pair(getWidth(), getHeight())
+ * Returned as Dimension(width, height, 0 descend).
+ * If something goes wrong, returns make_pair(getWidth(), getHeight(), 0)
*/
- std::pair<unsigned int, unsigned int>
- getScaledDimensions(Params const & params) const;
+ Dimension scaledDimension(Params const & params) const;
};