claw::graphic::targa::reader::rle_targa_decoder< InputBuffer, OutputBuffer > Class Template Reference

RLE decoder for targa RLE format. More...

Inheritance diagram for claw::graphic::targa::reader::rle_targa_decoder< InputBuffer, OutputBuffer >:
claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >

List of all members.

Public Types

typedef InputBuffer input_buffer_type
 Type of the input buffer.
typedef OutputBuffer output_buffer_type
 Type of the output buffer.

Private Member Functions

virtual void read_mode (input_buffer_type &input, output_buffer_type &output)
 Get the type of the following data in the input buffer.

Detailed Description

template<typename InputBuffer, typename OutputBuffer = rle_targa_output_buffer<InputBuffer>>
class claw::graphic::targa::reader::rle_targa_decoder< InputBuffer, OutputBuffer >

RLE decoder for targa RLE format.

Template parameters :

The OutputBuffer type must match the type requirements of the template parameter OutputBuffer of the rle_decoder class.

Author:
Julien Jorge

Definition at line 326 of file targa.hpp.


Member Typedef Documentation

template<typename InputBuffer , typename OutputBuffer = rle_targa_output_buffer<InputBuffer>>
typedef InputBuffer claw::graphic::targa::reader::rle_targa_decoder< InputBuffer, OutputBuffer >::input_buffer_type

Type of the input buffer.

Reimplemented from claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >.

Definition at line 331 of file targa.hpp.

template<typename InputBuffer , typename OutputBuffer = rle_targa_output_buffer<InputBuffer>>
typedef OutputBuffer claw::graphic::targa::reader::rle_targa_decoder< InputBuffer, OutputBuffer >::output_buffer_type

Type of the output buffer.

Reimplemented from claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >.

Definition at line 334 of file targa.hpp.


Member Function Documentation

template<typename InputBuffer , typename OutputBuffer >
void claw::graphic::targa::reader::rle_targa_decoder< InputBuffer, OutputBuffer >::read_mode ( input_buffer_type input,
output_buffer_type output 
) [inline, private, virtual]

Get the type of the following data in the input buffer.

Parameters:
input The input stream (the targa file).
output The output stream (the targa image).

Implements claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >.

Definition at line 199 of file targa_reader.tpp.

References claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >::compressed, claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >::m_count, claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >::m_mode, claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >::m_pattern, claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >::raw, and claw::rle_decoder< rgba_pixel_8, InputBuffer, OutputBuffer >::stop.

00200 {
00201   this->m_mode = this->stop;
00202   bool ok = !output.completed();
00203 
00204   if ( ok && (input.remaining() < 1) )
00205     ok = input.read_more(1);
00206 
00207   if (ok)
00208     {
00209       char key = input.get_next();
00210 
00211       this->m_count = (key & 0x7F) + 1;
00212 
00213       if (key & 0x80) // compressed
00214         {
00215           this->m_mode = this->compressed;
00216           this->m_pattern = input.get_pixel();
00217         }
00218       else
00219         this->m_mode = this->raw;
00220     }
00221 } // targa::reader::rle_targa_decoder::read_mode()


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

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1