claw::graphic::pcx::writer::file_output_buffer Class Reference

#include <pcx.hpp>

List of all members.


Detailed Description

The type of the output buffer associated with the file when encoding RLE data.

Definition at line 311 of file pcx.hpp.


Public Types

typedef u_int_8 pattern_type
 The typ of the output patterns.

Public Member Functions

 file_output_buffer (std::ostream &os)
 Constructor.
void encode (unsigned int n, pattern_type pattern)
 Encode a pixel data.
template<typename Iterator>
void raw (Iterator first, Iterator last)
 Write raw data int the stream.
unsigned int min_interesting () const
 Get the minimum number of pixels needed for encoding.
unsigned int max_encodable () const
 Get the maximum number of pixel a code can encode.

Private Attributes

std::ostream & m_stream
 The stream in which we write.

Member Typedef Documentation

The typ of the output patterns.

Definition at line 315 of file pcx.hpp.


Constructor & Destructor Documentation

claw::graphic::pcx::writer::file_output_buffer::file_output_buffer ( std::ostream &  os  ) 

Constructor.

Parameters:
os The stream in which we write the encoded data.

Definition at line 38 of file pcx_writer.cpp.

00039   : m_stream(os)
00040 {
00041 
00042 } // pcx::writer::file_output_buffer::file_output_buffer()


Member Function Documentation

void claw::graphic::pcx::writer::file_output_buffer::encode ( unsigned int  n,
pattern_type  pattern 
)

Encode a pixel data.

Parameters:
n The number of time the pixel appears.
pattern The data of the pixel.

Definition at line 51 of file pcx_writer.cpp.

00052 {
00053   if ( (pattern > 63) || (n > 1) )
00054     {
00055       u_int_8 cnt = 0xC0 | (u_int_8)n;
00056       m_stream.write( reinterpret_cast<char*>(&cnt), sizeof(u_int_8) );
00057     }
00058 
00059   m_stream.write( reinterpret_cast<char*>(&pattern), sizeof(u_int_8));
00060 } // pcx::writer::file_output_buffer::encode()

template<typename Iterator>
void claw::graphic::pcx::writer::file_output_buffer::raw ( Iterator  first,
Iterator  last 
) [inline]

Write raw data int the stream.

Parameters:
first Iterator on the first data.
last Iterator past the last data.

Definition at line 40 of file pcx_writer.tpp.

References CLAW_ASSERT.

00041 {
00042   CLAW_ASSERT( false, "This method should not have been called" );
00043 } // pcx::writer::file_output_buffer::raw()

unsigned int claw::graphic::pcx::writer::file_output_buffer::min_interesting (  )  const

Get the minimum number of pixels needed for encoding.

Definition at line 67 of file pcx_writer.cpp.

00068 {
00069   return 1;
00070 } // pcx::writer::file_output_buffer::min_interesting()

unsigned int claw::graphic::pcx::writer::file_output_buffer::max_encodable (  )  const

Get the maximum number of pixel a code can encode.

Definition at line 77 of file pcx_writer.cpp.

00078 {
00079   return 63;
00080 } // pcx::writer::file_output_buffer::max_encodable()


Member Data Documentation

The stream in which we write.

Definition at line 329 of file pcx.hpp.


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

Generated on Thu May 22 21:07:38 2008 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.5.5