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

A class for targa pictures. More...

#include <targa.hpp>

Inheritance diagram for claw::graphic::targa:
claw::graphic::image

Classes

class  reader
 This class read data from a targa file and store it in an image. More...
 
class  writer
 This class write an image in a targa file. More...
 

Public Member Functions

 targa (unsigned int w, unsigned int h)
 Constructor. Creates an empty image. More...
 
 targa (const image &that)
 Copy constructor. More...
 
 targa (std::istream &f)
 Constructor. Load an image from a targa file. More...
 
void save (std::ostream &os, bool rle) const
 Save the content of the image in a stream. More...
 
- Public Member Functions inherited from claw::graphic::image
 image ()
 Constructor. Creates an image without datas. More...
 
 image (unsigned int w, unsigned int h)
 Constructor. Creates an empty image. More...
 
 image (std::istream &f)
 Constructor. Reads an image from an input stream. More...
 
void swap (image &that)
 Swap the content of two images. More...
 
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
 
const_iterator end () const
 
void merge (const image &that)
 Merge an image on the current image. More...
 
void merge (const image &that, const math::coordinate_2d< int > &pos)
 Merge an image on the current image. More...
 
void partial_copy (const image &that, const math::coordinate_2d< int > &pos)
 Copy an image on the current image. More...
 
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. More...
 
void set_size (unsigned int w, unsigned int h)
 Set a new size to the image. More...
 
void load (std::istream &f)
 Read the image from a stream. More...
 

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_typeiterator
 The type of the iterator on the pixels of the image. More...
 
typedef base_iterator< const image, const pixel_typeconst_iterator
 The type of the iterator to access constant pixels. More...
 

Detailed Description

A class for targa pictures.

Author
Julien Jorge

Definition at line 48 of file targa.hpp.

Constructor & Destructor Documentation

◆ targa() [1/3]

claw::graphic::targa::targa ( 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 targa.cpp.

◆ targa() [2/3]

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

Copy constructor.

Parameters
thatImage to copy from.

Definition at line 50 of file targa.cpp.

◆ targa() [3/3]

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

Constructor. Load an image from a targa file.

Parameters
fTarga file.

Definition at line 61 of file targa.cpp.

Member Function Documentation

◆ save()

void claw::graphic::targa::save ( std::ostream &  os,
bool  rle 
) const

Save the content of the image in a stream.

Parameters
osThe stream in which we write.
rleTell if we must encode the data.

Definition at line 72 of file targa.cpp.

Referenced by claw::graphic::targa::writer::writer().


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