Claw  1.7.3
Classes | Public Member Functions | List of all members
claw::graphic::bitmap Class Reference

A class for bitmap images. More...

#include <bitmap.hpp>

Inheritance diagram for claw::graphic::bitmap:
claw::graphic::image

Classes

class  file_structure
 Tool class used for defining the structures of the datas stored in a bitmap file.
class  reader
 This class read data from a bitmap file and store it in an image. More...
class  writer
 This class write an image in a bitmap file. More...

Public Member Functions

 bitmap (unsigned int w, unsigned int h)
 Constructor. Creates an empty image.
 bitmap (const image &that)
 Copy constructor.
 bitmap (std::istream &f)
 Constructor. Load an image from a bitmap file.
void save (std::ostream &f) const
 Save the bitmap in a file.
- Public Member Functions inherited from claw::graphic::image
 image ()
 Constructor. Creates an image without datas.
 image (unsigned int w, unsigned int h)
 Constructor. Creates an empty image.
 image (std::istream &f)
 Constructor. Reads an image from an input stream.
void swap (image &that)
 Swap the content of two images.
unsigned int width () const
 Gets image's width.
unsigned int height () const
 Gets image's height.
scanlineoperator[] (unsigned int i)
 Gets a line of the image.
const scanlineoperator[] (unsigned int i) const
 Gets a line of the image.
iterator begin ()
 Get an iterator pointing on the first pixel.
iterator end ()
 Get an iterator pointing just past the last pixel.
const_iterator begin () const
 Get an iterator pointing on the first pixel.
const_iterator end () const
 Get an iterator pointing just past the last pixel.
void merge (const image &that)
 Merge an image on the current image.
void merge (const image &that, const math::coordinate_2d< int > &pos)
 Merge an image on the current image.
void partial_copy (const image &that, const math::coordinate_2d< int > &pos)
 Copy an image on the current image.
void flip ()
 Set the image upside down.
void fill (const math::rectangle< int > r, const pixel_type &c)
 Fill an area of the image with a given color.
void set_size (unsigned int w, unsigned int h)
 Set a new size to the image.
void load (std::istream &f)
 Read the image from a stream.

Additional Inherited Members

- Public Types inherited from claw::graphic::image
typedef rgba_pixel pixel_type
 The type representing the colors of the pixels in the image.
typedef base_iterator< image,
pixel_type
iterator
 The type of the iterator on the pixels of the image.
typedef base_iterator< const
image, const pixel_type
const_iterator
 The type of the iterator to access constant pixels.

Detailed Description

A class for bitmap images.

Author
Julien Jorge

Definition at line 48 of file bitmap.hpp.

Constructor & Destructor Documentation

claw::graphic::bitmap::bitmap ( unsigned int  w,
unsigned int  h 
)

Constructor. Creates an empty image.

Parameters
wImage's width.
hImage's height.
Precondition
w > 0 and h > 0

Definition at line 39 of file bitmap.cpp.

claw::graphic::bitmap::bitmap ( const image that)

Copy constructor.

Parameters
thatImage to copy from.

Definition at line 50 of file bitmap.cpp.

claw::graphic::bitmap::bitmap ( std::istream &  f)

Constructor. Load an image from a bitmap file.

Parameters
fBitmap file.

Definition at line 61 of file bitmap.cpp.

Member Function Documentation

void claw::graphic::bitmap::save ( std::ostream &  f) const

Save the bitmap in a file.

Parameters
fDestination file.

Definition at line 71 of file bitmap.cpp.


The documentation for this class was generated from the following files: