CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
|
RLE decoder for bitmap RLE format. More...
Public Types | |
typedef OutputBuffer | output_buffer_type |
Type of the output buffer. | |
Private Member Functions | |
virtual void | read_mode (file_input_buffer &input, output_buffer_type &output) |
Get the type of the following data in the input buffer, eventually apply the special codes. |
RLE decoder for bitmap RLE format.
Template parameters :
The OutputBuffer type must match the type requirements of the template parameter OutputBuffer of the rle_decoder class, plus two methods :
Definition at line 196 of file bitmap.hpp.
typedef OutputBuffer claw::graphic::bitmap::reader::rle_bitmap_decoder< OutputBuffer >::output_buffer_type |
Type of the output buffer.
Reimplemented from claw::rle_decoder< char, file_input_buffer, OutputBuffer >.
Definition at line 201 of file bitmap.hpp.
void claw::graphic::bitmap::reader::rle_bitmap_decoder< OutputBuffer >::read_mode | ( | file_input_buffer & | input, |
output_buffer_type & | output | ||
) | [private, virtual] |
Get the type of the following data in the input buffer, eventually apply the special codes.
input | The input stream (the bitmap file). |
output | The output stream (the bitmap image). |
Definition at line 94 of file bitmap_reader.tpp.
References claw::buffered_istream< Stream >::get_next(), claw::buffered_istream< Stream >::read_more(), and claw::buffered_istream< Stream >::remaining().
{ this->m_mode = this->stop; bool ok = true; if ( input.remaining() < 2) ok = input.read_more(2); if (ok) { unsigned char key, pattern; key = input.get_next(); pattern = input.get_next(); // compressed data, next byte is the pattern if (key > 0) { this->m_mode = this->compressed; this->m_count = key; this->m_pattern = pattern; } else switch( pattern ) { // end of line case 0 : output.next_line(); read_mode(input, output); break; // end of file case 1 : this->m_mode = this->stop; break; // delta move case 2 : { if ( input.remaining() < 1 ) ok = input.read_more(1); if (ok) { unsigned char x, y; x = pattern; y = input.get_next(); output.delta_move(x, y); read_mode(input, output); break; } } // raw data default: this->m_mode = this->raw; this->m_count = pattern; break; } } } // bitmap::reader::rle_bitmap_decoder::read_mode()