Inheritance diagram for claw::graphic::targa::reader::file_input_buffer< Pixel >:
Template parameters
Definition at line 225 of file targa.hpp.
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. |
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.
00042 : buffered_istream<std::istream>(f) 00043 { 00044 00045 } // targa::reader::file_input_buffer::file_input_buffer
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, and claw::graphic::rgba_pixel::red.
00115 { 00116 rgba_pixel_8 result; 00117 00118 if ( this->remaining() < 2 ) 00119 this->read_more(2); 00120 00121 assert( this->remaining() >= 2 ); 00122 00123 unsigned char second_byte = this->get_next(); 00124 unsigned char first_byte = this->get_next(); 00125 00126 unsigned char r = (first_byte & 0x7C) >> 2; 00127 unsigned char g = 00128 ((first_byte & 0x03) << 3) | ((second_byte & 0xE0) >> 5); 00129 unsigned char b = second_byte & 0x1F; 00130 00131 result.components.blue = b * 8; 00132 result.components.green = g * 8; 00133 result.components.red = r * 8; 00134 result.components.alpha = 00135 std::numeric_limits<claw::graphic::rgba_pixel_8::component_type>::max(); 00136 00137 return result; 00138 } // 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, and claw::graphic::rgba_pixel::red.
00083 { 00084 rgba_pixel_8 result; 00085 00086 if ( this->remaining() < 3 ) 00087 this->read_more(3); 00088 00089 assert( this->remaining() >= 3 ); 00090 00091 result.components.blue = this->get_next(); 00092 result.components.green = this->get_next(); 00093 result.components.red = this->get_next(); 00094 result.components.alpha = 00095 std::numeric_limits<claw::graphic::rgba_pixel_8::component_type>::max(); 00096 00097 return result; 00098 } // 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, and claw::graphic::rgba_pixel::red.
00052 { 00053 rgba_pixel_8 result; 00054 00055 if ( this->remaining() < 4 ) 00056 this->read_more(4); 00057 00058 assert( this->remaining() >= 4 ); 00059 00060 result.components.blue = this->get_next(); 00061 result.components.green = this->get_next(); 00062 result.components.red = this->get_next(); 00063 result.components.alpha = this->get_next(); 00064 00065 return result; 00066 } // targa::reader::file_input_buffer::get_pixel()
rgba_pixel_8 claw::graphic::targa::reader::file_input_buffer< Pixel >::get_pixel | ( | ) |
Referenced by claw::graphic::targa::reader::load_palette_content().