claw::graphic::targa::reader::mapped_file_input_buffer< Pixel > Class Template Reference

Inheritance diagram for claw::graphic::targa::reader::mapped_file_input_buffer< Pixel >:

claw::buffered_istream< std::istream >

List of all members.


Detailed Description

template<typename Pixel>
class claw::graphic::targa::reader::mapped_file_input_buffer< Pixel >

The type of the input buffer associated with the file when decoding RLE files using a color palette.

Template parameters

Definition at line 246 of file targa.hpp.


Public Member Functions

 mapped_file_input_buffer (std::istream &f, const color_palette32 &p)
 Constructor.
pixel32 get_pixel ()
template<>
pixel32 get_pixel ()

Private Types

typedef Pixel pixel_type
 The type of the pixels in the input buffer.

Private Attributes

const color_palette32m_palette
 The color map of the image.

Member Typedef Documentation

template<typename Pixel>
typedef Pixel claw::graphic::targa::reader::mapped_file_input_buffer< Pixel >::pixel_type [private]

The type of the pixels in the input buffer.

Definition at line 251 of file targa.hpp.


Constructor & Destructor Documentation

template<typename Pixel>
claw::graphic::targa::reader::mapped_file_input_buffer< Pixel >::mapped_file_input_buffer ( std::istream &  f,
const color_palette32 p 
) [inline]

Constructor.

Parameters:
f The file to read.
p The color palette.

Definition at line 64 of file targa_reader.tpp.

00065   : buffered_istream<std::istream>(f), m_palette(p)
00066 {
00067   
00068 } // targa::reader::mapped_file_input_buffer::mapped_file_input_buffer


Member Function Documentation

template<typename Pixel>
pixel32 claw::graphic::targa::reader::mapped_file_input_buffer< Pixel >::get_pixel (  ) 

Remarks:
This method is specialized for the pixels of type claw::graphic::pixel8.

Definition at line 164 of file targa_reader.cpp.

References claw::buffered_istream< std::istream >::get_next(), claw::graphic::targa::reader::mapped_file_input_buffer< Pixel >::m_palette, claw::buffered_istream< std::istream >::read_more(), and claw::buffered_istream< std::istream >::remaining().

00165     {
00166       if ( this->remaining() < 1 )
00167         this->read_more(1);
00168       
00169       assert( this->remaining() >= 1 );
00170       
00171       unsigned char index = this->get_next();
00172 
00173       return m_palette[index];
00174     } // targa::reader::mapped_file_input_buffer::get_pixel()


Member Data Documentation

template<typename Pixel>
const color_palette32& claw::graphic::targa::reader::mapped_file_input_buffer< Pixel >::m_palette [private]

The color map of the image.

Definition at line 259 of file targa.hpp.

Referenced by claw::graphic::targa::reader::mapped_file_input_buffer< Pixel >::get_pixel().


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

Generated on Thu Jun 26 09:35:07 2008 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.5.6