Functor converting a 4bpp buffer to a 32bpp buffer. More...
Public Member Functions | |
| void | operator() (scanline &dest, const char *src, const color_palette_type &palette) const |
| Convert a 4bpp array to a pixel32 scanline. | |
Functor converting a 4bpp buffer to a 32bpp buffer.
Definition at line 229 of file bitmap.hpp.
| void claw::graphic::bitmap::reader::pixel4_to_pixel32::operator() | ( | scanline & | dest, | |
| const char * | src, | |||
| const color_palette_type & | palette | |||
| ) | const |
Convert a 4bpp array to a pixel32 scanline.
| dest | (out) Filled scanline. | |
| src | Pixel array to convert. | |
| palette | Color palette. |
Definition at line 218 of file bitmap_reader.cpp.
References claw::graphic::image::scanline::begin(), and claw::graphic::image::scanline::size().
{
assert(palette.size() == 16);
scanline::iterator it( dest.begin() );
const unsigned int upper_bound = dest.size() / 2;
for (unsigned int i=0; i!=upper_bound; ++i, ++src)
{
*it = palette[ (*src & 0xF0) >> 4 ];
++it;
*it = palette[ *src & 0x0F ];
++it;
}
if (dest.size() % 2)
*it = palette[ (*src & 0xF0) >> 4 ];
} // bitmap::reader::pixel4_to_pixel32()
1.7.1