CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
Classes | Public Member Functions | Private Types

claw::graphic::targa Class Reference

A class for targa pictures. More...

#include <targa.hpp>

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

List of all members.

Classes

class  file_structure
 Tool class used for defining the structures of the datas stored in a targa file. More...
struct  pixel16
 A pixel color in 16 bits in targa files. More...
struct  pixel8
 A pixel color in 8 bits in targa files. More...
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.
 targa (const image &that)
 Copy constructor.
 targa (std::istream &f)
 Constructor. Load an image from a targa file.
void save (std::ostream &os, bool rle) const
 Save the content of the image in a stream.

Private Types

typedef color_palette
< rgba_pixel_8
color_palette32
 A color palette of RGBA colors.

Detailed Description

A class for targa pictures.

Author:
Julien Jorge

Definition at line 48 of file targa.hpp.


Member Typedef Documentation

A color palette of RGBA colors.

Definition at line 204 of file targa.hpp.


Constructor & Destructor Documentation

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.

  : claw::graphic::image(w, h)
{

} // targa::targa() [constructor]
claw::graphic::targa::targa ( const image that)

Copy constructor.

Parameters:
thatImage to copy from.

Definition at line 50 of file targa.cpp.

  : claw::graphic::image(that)
{

} // targa::targa() [copy constructor]
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.

{
  reader(*this, f);
} // targa::targa() [constructor, from file]

Member Function Documentation

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().

{
  writer(*this, os, rle);
} // targa::save()

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