Papyrus::Image Class Reference

#include <papyrus/image.h>

Inheritance diagram for Papyrus::Image:

Inheritance graph
[legend]
List of all members.

Detailed Description

The Image class is used to represent an image to be drawn into the canvas.

It can be scaled and transformed just like any other drawable.

Author:
Rick L Vinyard Jr


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


Constructor & Destructor Documentation

Papyrus::Image::Image ( Cairo::RefPtr< Cairo::ImageSurface >  img  ) 

Constructor which sets the image to a cairo surface.

Parameters:
img The Cairo image surface to be drawn into the canvas.


Member Function Documentation

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.

Parameters:
img The cairo image surface containing the image.
Returns:
smart pointer to the new instance

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.

Parameters:
img The cairo image surface containing the image.


The documentation for this class was generated from the following files:
Generated on Sun Mar 11 10:01:41 2007 by  doxygen 1.5.1