55 m_stream << p.components.blue << p.components.green
56 << p.components.red << p.components.alpha;
86 (
const image& img, std::ostream& f,
bool rle )
105 h.image_type = true_color;
107 os.write( reinterpret_cast<char*>(&h),
sizeof(
header) );
110 save_rle_true_color(os);
115 os.write( reinterpret_cast<char*>(&f),
sizeof(
footer) );
123 void claw::graphic::targa::writer::save_true_color( std::ostream& os )
const 136 void claw::graphic::targa::writer::save_rle_true_color( std::ostream& os )
const 141 for (
unsigned int y=0; y!=m_image.
height(); ++y )
142 encoder.encode( m_image[y].
begin(), m_image[y].
end(), output_buffer );
void save(std::ostream &f, bool rle) const
Save the content of the image in a stream.
iterator end()
Get an iterator pointing just past the last pixel.
unsigned int height() const
Gets image's height.
RLE encoder for targa format.
Base class for iterators on an image.
unsigned int width() const
Gets image's width.
void order_pixel_bytes(const pixel_type &p)
Write a pixel in the stream and set its value in the good order.
A simple class to use as exception with string message.
writer(const image &img)
Constructor.
Pixel pixel_type
The type of the pixels in the input buffer.
iterator begin()
Get an iterator pointing on the first pixel.
A class to deal with images.
A class for targa pictures.
This is the main namespace.
The type of the output buffer associated with the file when encoding RLE data.