The type of the input buffer associated with the file when decoding RLE files. More...
Public Member Functions | |
| file_input_buffer (std::istream &f) | |
| Constructor. | |
| rgba_pixel_8 | get_pixel () |
| template<> | |
| rgba_pixel_8 | get_pixel () |
| template<> | |
| rgba_pixel_8 | get_pixel () |
| template<> | |
| rgba_pixel_8 | get_pixel () |
Private Types | |
| typedef Pixel | pixel_type |
| The type of the pixels in the input buffer. | |
The type of the input buffer associated with the file when decoding RLE files.
Template parameters
Definition at line 225 of file targa.hpp.
typedef Pixel claw::graphic::targa::reader::file_input_buffer< Pixel >::pixel_type [private] |
| claw::graphic::targa::reader::file_input_buffer< Pixel >::file_input_buffer | ( | std::istream & | f | ) |
Constructor.
| f | The file to read. |
Definition at line 41 of file targa_reader.tpp.
: buffered_istream<std::istream>(f)
{
} // targa::reader::file_input_buffer::file_input_buffer
| rgba_pixel_8 claw::graphic::targa::reader::file_input_buffer< Pixel >::get_pixel | ( | ) |
Referenced by claw::graphic::targa::reader::load_palette_content().
| rgba_pixel_8 claw::graphic::targa::reader::file_input_buffer< targa::pixel16 >::get_pixel | ( | ) |
Definition at line 114 of file targa_reader.cpp.
References claw::graphic::rgba_pixel::alpha, claw::graphic::rgba_pixel::blue, claw::graphic::rgba_pixel::components, claw::buffered_istream< std::istream >::get_next(), claw::graphic::rgba_pixel::green, claw::buffered_istream< std::istream >::read_more(), claw::graphic::rgba_pixel::red, and claw::buffered_istream< std::istream >::remaining().
{
rgba_pixel_8 result;
if ( this->remaining() < 2 )
this->read_more(2);
assert( this->remaining() >= 2 );
unsigned char second_byte = this->get_next();
unsigned char first_byte = this->get_next();
unsigned char r = (first_byte & 0x7C) >> 2;
unsigned char g =
((first_byte & 0x03) << 3) | ((second_byte & 0xE0) >> 5);
unsigned char b = second_byte & 0x1F;
result.components.blue = b * 8;
result.components.green = g * 8;
result.components.red = r * 8;
result.components.alpha =
std::numeric_limits<claw::graphic::rgba_pixel_8::component_type>::max();
return result;
} // targa::reader::file_input_buffer::get_pixel()
| rgba_pixel_8 claw::graphic::targa::reader::file_input_buffer< rgb_pixel_8 >::get_pixel | ( | ) |
Definition at line 82 of file targa_reader.cpp.
References claw::graphic::rgba_pixel::alpha, claw::graphic::rgba_pixel::blue, claw::graphic::rgba_pixel::components, claw::buffered_istream< std::istream >::get_next(), claw::graphic::rgba_pixel::green, claw::buffered_istream< std::istream >::read_more(), claw::graphic::rgba_pixel::red, and claw::buffered_istream< std::istream >::remaining().
{
rgba_pixel_8 result;
if ( this->remaining() < 3 )
this->read_more(3);
assert( this->remaining() >= 3 );
result.components.blue = this->get_next();
result.components.green = this->get_next();
result.components.red = this->get_next();
result.components.alpha =
std::numeric_limits<claw::graphic::rgba_pixel_8::component_type>::max();
return result;
} // targa::reader::file_input_buffer::get_pixel()
| rgba_pixel_8 claw::graphic::targa::reader::file_input_buffer< rgba_pixel_8 >::get_pixel | ( | ) |
Definition at line 51 of file targa_reader.cpp.
References claw::graphic::rgba_pixel::alpha, claw::graphic::rgba_pixel::blue, claw::graphic::rgba_pixel::components, claw::buffered_istream< std::istream >::get_next(), claw::graphic::rgba_pixel::green, claw::buffered_istream< std::istream >::read_more(), claw::graphic::rgba_pixel::red, and claw::buffered_istream< std::istream >::remaining().
{
rgba_pixel_8 result;
if ( this->remaining() < 4 )
this->read_more(4);
assert( this->remaining() >= 4 );
result.components.blue = this->get_next();
result.components.green = this->get_next();
result.components.red = this->get_next();
result.components.alpha = this->get_next();
return result;
} // targa::reader::file_input_buffer::get_pixel()
1.7.1