#include <papyrus/image.h>
Inheritance diagram for Papyrus::Image:
It can be scaled and transformed just like any other drawable.
Public Types | |
typedef PapyrusSmartPointer< Image > | pointer |
Public Member Functions | |
Image (std::string filename) | |
Image (unsigned char *data, Cairo::Format format, int width, int height, int stride, bool convert_rgba=false) | |
Image (Cairo::Format format, int width, int height) | |
Image (Cairo::RefPtr< Cairo::ImageSurface > img) | |
Constructor which sets the image to a cairo surface. | |
~Image () | |
Destructor. | |
std::string | filename () const |
void | set_image (const std::string &filename) |
void | set_image (unsigned char *data, Cairo::Format format, int width, int height, int stride, bool convert_rgba=false) |
void | set_image (Cairo::Format format, int width, int height) |
void | set_image (Cairo::RefPtr< Cairo::ImageSurface > img) |
The set_image method is used to replace the image with the image in a cairo image surface. | |
virtual void | draw (Cairo::RefPtr< Cairo::Context > cairo) |
double | width () |
double | height () |
void | width_height (double &width, double &height) |
PAPYRUS_CLASS_NAME ("Image") | |
PAPYRUS_CLONE_METHOD (Image) | |
Static Public Member Functions | |
static Image::pointer | create () |
static Image::pointer | create (std::string filename) |
static Image::pointer | create (unsigned char *data, Cairo::Format format, int width, int height, int stride, bool convert_rgba=false) |
static Image::pointer | create (Cairo::Format format, int width, int height) |
static Image::pointer | create (Cairo::RefPtr< Cairo::ImageSurface > img) |
The create class method is used to create a new instance from a Cairo image surface. | |
Protected Member Functions | |
void | on_image_changed () |
Protected Attributes | |
std::string | m_filename |
double | m_width |
double | m_height |
Cairo::RefPtr< Cairo::ImageSurface > | m_image |
Papyrus::Image::Image | ( | Cairo::RefPtr< Cairo::ImageSurface > | img | ) |
Constructor which sets the image to a cairo surface.
img | The Cairo image surface to be drawn into the canvas. |
Image::pointer Papyrus::Image::create | ( | Cairo::RefPtr< Cairo::ImageSurface > | img | ) | [static] |
The create class method is used to create a new instance from a Cairo image surface.
img | The cairo image surface containing the image. |
void Papyrus::Image::set_image | ( | Cairo::RefPtr< Cairo::ImageSurface > | img | ) |
The set_image method is used to replace the image with the image in a cairo image surface.
img | The cairo image surface containing the image. |