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

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 
) [private, virtual]

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

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

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

Definition at line 199 of file targa_reader.tpp.

{
  this->m_mode = this->stop;
  bool ok = !output.completed();

  if ( ok && (input.remaining() < 1) )
    ok = input.read_more(1);

  if (ok)
    {
      char key = input.get_next();

      this->m_count = (key & 0x7F) + 1;

      if (key & 0x80) // compressed
        {
          this->m_mode = this->compressed;
          this->m_pattern = input.get_pixel();
        }
      else
        this->m_mode = this->raw;
    }
} // targa::reader::rle_targa_decoder::read_mode()

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