Faith::Pixmap Class Reference

An image that can be efficiently drawn to the screen. More...

#include <faith/pixmap.h>

Inheritance diagram for Faith::Pixmap:

Faith::PaintDevice Faith::Bitmap List of all members.

Public Member Functions

 Pixmap ()
 Pixmap (const Image &image)
 Pixmap (const Pixmap &pixmap)
 Pixmap (int w, int h, int depth=-1)
 Pixmap (const Size &size, int depth=-1)
virtual ~Pixmap ()
virtual Handle handle ()
void resize (int w, int h)
Pixmapoperator= (const Pixmap &copy)
Pixmapoperator= (const Image &image)
const Bitmapmask () const
void setMask (const Bitmap &mask)
Size size () const
Rect rect () const
int width () const
int height () const
int depth () const
bool isNull () const
Faith::Image toImage (int fromx=0, int fromy=0, int w=-1, int h=-1) const
Faith::Image convertToImage () const
void fromImage (const Image &image)
void convertFromImage (const Image &image)
void detach () const
void reset ()

Protected Member Functions

virtual void init (const Size &size, int depth)

Detailed Description

An image that can be efficiently drawn to the screen.

a pixmap is like an image, except it doesn't exist in your application, but on the X-server. That means copying it to a widget is very fast, and you can also use a Painter object on it just like a widget.


Constructor & Destructor Documentation

Faith::Pixmap::Pixmap (  ) 

Faith::Pixmap::Pixmap ( const Image image  ) 

make a pixmap out of this image. The depth will be the same as the display's depth, not dependant on the depth of the image

if you want a 1 bit per pixel pixmap from a 1 bbp Image, use class Bitmap

Faith::Pixmap::Pixmap ( const Pixmap pixmap  ) 

a copy of the given image

Faith::Pixmap::Pixmap ( int  w,
int  h,
int  depth = -1 
)

create an image with undefined content

Parameters:
depth is the depth of this pixmap, or -1 to use the default

Faith::Pixmap::Pixmap ( const Size size,
int  depth = -1 
)

create an image with undefined content

Parameters:
depth is the depth of this pixmap, or -1 to use the default

virtual Faith::Pixmap::~Pixmap (  )  [virtual]


Member Function Documentation

void Faith::Pixmap::convertFromImage ( const Image image  )  [inline]

same as above

Faith::Image Faith::Pixmap::convertToImage (  )  const [inline]

The same as above

int Faith::Pixmap::depth (  )  const

Returns:
the color-depth of the pixmap: 8, 16, 24, ...
Will either be 1 (bits-per-pixel) for a monochrome image (mask) or a Bitmap, or will be the same as the depth of the screen itself

void Faith::Pixmap::detach (  )  const

void Faith::Pixmap::fromImage ( const Image image  ) 

Converts image (slowly!) to a pixmap, and assigns it to me

virtual Handle Faith::Pixmap::handle (  )  [virtual]

Implements Faith::PaintDevice.

int Faith::Pixmap::height (  )  const [inline]

Returns:
the height of the pixmap in pixels

virtual void Faith::Pixmap::init ( const Size size,
int  depth 
) [protected, virtual]

Reimplemented in Faith::Bitmap.

bool Faith::Pixmap::isNull (  )  const

Returns:
true if this is not a valid image

const Bitmap* Faith::Pixmap::mask (  )  const

Returns:
the mask, or 0 if there is none

Pixmap& Faith::Pixmap::operator= ( const Image image  ) 

same as convertFromImage

Pixmap& Faith::Pixmap::operator= ( const Pixmap copy  ) 

makes me copy of copy

Rect Faith::Pixmap::rect (  )  const

same as rect(0, 0, size())

void Faith::Pixmap::reset (  ) 

nullifies the image. Deletes the data if necessary. isNull() returns true

void Faith::Pixmap::resize ( int  w,
int  h 
)

changes the image, either cropping or expanding it, if there are new pixels, their value is undefined

void Faith::Pixmap::setMask ( const Bitmap mask  ) 

When drawing the Pixmap, bits that are not set in mask will not be drawn (will be transparent)

Size Faith::Pixmap::size (  )  const

Returns:
the size of the pixmap

Faith::Image Faith::Pixmap::toImage ( int  fromx = 0,
int  fromy = 0,
int  w = -1,
int  h = -1 
) const

converts the part of this pixmap as specified by Rect(fromx, fromy, w, h) to an image

int Faith::Pixmap::width (  )  const [inline]

Returns:
the width of the pixmap in pixels


The documentation for this class was generated from the following file:
Generated on Fri Sep 1 00:23:09 2006 for Faith by  doxygen 1.4.7