CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
Private Member Functions
claw::graphic::pcx::reader::rle_pcx_decoder Class Reference

RLE decoder for pcx RLE format. More...

Inheritance diagram for claw::graphic::pcx::reader::rle_pcx_decoder:
claw::rle_decoder< u_int_8, rle_pcx_input_buffer, rle_pcx_output_buffer >

List of all members.

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

RLE decoder for pcx RLE format.

Definition at line 195 of file pcx.hpp.


Member Function Documentation

void claw::graphic::pcx::reader::rle_pcx_decoder::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 pcx file).
outputThe output stream (the pcx image).

Definition at line 230 of file pcx_reader.cpp.

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

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

  if (ok)
    {
      unsigned char key = input.get_next();
      this->m_mode = this->compressed;
      
      if ( (key & 0xC0) == 0xC0 )
        {
          this->m_count = key & 0x3F;

          if ( input.remaining() < 1 )
            input.read_more(1);

          this->m_pattern = input.get_next();
        }
      else
        {
          this->m_count = 1;
          this->m_pattern = key;
        }
    }
} // pcx::reader::rle_pcx_decoder::read_mode()

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