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