claw::graphic::bitmap::reader::pixel4_to_pixel32 Class Reference

Functor converting a 4bpp buffer to a 32bpp buffer. More...

List of all members.

Public Member Functions

void operator() (scanline &dest, const char *src, const color_palette_type &palette) const
 Convert a 4bpp array to a pixel32 scanline.

Detailed Description

Functor converting a 4bpp buffer to a 32bpp buffer.

Definition at line 229 of file bitmap.hpp.


Member Function Documentation

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.

Parameters:
dest (out) Filled scanline.
src Pixel array to convert.
palette Color palette.
Precondition:
palette.size() == 16

Definition at line 218 of file bitmap_reader.cpp.

References claw::graphic::image::scanline::begin(), and claw::graphic::image::scanline::size().

00219 {
00220   assert(palette.size() == 16);
00221 
00222   scanline::iterator it( dest.begin() );
00223   const unsigned int upper_bound = dest.size() / 2;
00224 
00225   for (unsigned int i=0; i!=upper_bound; ++i, ++src)
00226     {
00227       *it = palette[ (*src & 0xF0) >> 4 ];
00228       ++it;
00229       *it = palette[ *src & 0x0F ];
00230       ++it;
00231     }
00232 
00233   if (dest.size() % 2)
00234     *it = palette[ (*src & 0xF0) >> 4 ];
00235 } // bitmap::reader::pixel4_to_pixel32()


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

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1