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.
Definition at line 211 of file pcx.hpp.
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, and claw::graphic::white_pixel.
00045 { 00046 CLAW_PRECOND( scanline.size() == 1 ); 00047 00048 unsigned int x=0; 00049 00050 for ( unsigned int code=0; x!=img.width(); ++code ) 00051 { 00052 u_int_8 c = scanline[0][code]; // only one color plane for monochrome pcx 00053 00054 for( unsigned int i=0; (i!=8) && (x!=img.width()); ++x, ++i, c<<=1 ) 00055 if ( c & 0x80 ) 00056 img[y][x] = white_pixel; 00057 else 00058 img[y][x] = black_pixel; 00059 } 00060 } // pcx::reader::converter_mono::operator()()