|
CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
|
Function object that converts a scanline of a monochrome pcx into 32 bpp pixels. More...
Public Member Functions | |
| void | operator() (const std::vector< color_plane_type > &scanline, image &img, unsigned int y) const |
| Converts a scan line of a monochrome pcx into 32 bpp pixels. | |
Function object that converts a scanline of a monochrome pcx into 32 bpp pixels.
| void claw::graphic::pcx::reader::converter_mono::operator() | ( | const std::vector< color_plane_type > & | scanline, |
| image & | img, | ||
| unsigned int | y | ||
| ) | const |
Converts a scan line of a monochrome pcx into 32 bpp pixels.
| scanline | the scan line to convert. |
| img | The image in which we write the results. |
| y | The line of img concerned by the pixels. |
Definition at line 43 of file pcx_reader.cpp.
References claw::graphic::black_pixel, CLAW_PRECOND, claw::graphic::image::scanline::size(), and claw::graphic::white_pixel.
{
CLAW_PRECOND( scanline.size() == 1 );
unsigned int x=0;
for ( unsigned int code=0; x!=img.width(); ++code )
{
u_int_8 c = scanline[0][code]; // only one color plane for monochrome pcx
for( unsigned int i=0; (i!=8) && (x!=img.width()); ++x, ++i, c<<=1 )
if ( c & 0x80 )
img[y][x] = white_pixel;
else
img[y][x] = black_pixel;
}
} // pcx::reader::converter_mono::operator()()
1.7.3