- bool isDrawable() const;
-
- /** At the end of the loading process inform the outside world
- * by emitting a signal
- */
- typedef boost::signal<void(bool)> SignalType;
- ///
- SignalType finishedLoading;
-
- /** Start loading the image file.
- * The caller should expect this process to be asynchronous and
- * so should connect to the "finished" signal above.
- */
- void load(std::string const & filename);
-
- /** Generate the pixmap.
- * Uses the params to decide on color, grayscale etc.
- * Returns true if the pixmap is created.
- */
- bool setPixmap(Params const & params);
-
- /// Clip the image using params.
- void clip(Params const & params);
-
- /// Rotate the image using params.
- void rotate(Params const & params);
-
- /// Scale the image using params.
- void scale(Params const & params);
-
-protected:
- /// Must define default c-tor explicitly as we define a copy c-tor.
- Image() {}
- /// Don't copy the signal finishedLoading
- 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())
- */
- std::pair<unsigned int, unsigned int>
- getScaledDimensions(Params const & params) const;
-
-private:
- /// Create a copy
- virtual Image * clone_impl() const = 0;
- /// Get the image width
- virtual unsigned int getWidth_impl() const = 0;
-
- /// Get the image height
- virtual unsigned int getHeight_impl() const = 0;
-
- /// is the image drawable ?
- virtual bool isDrawable_impl() const = 0;