claw::graphic::pcx::reader::converter_mono Class Reference

Function object that converts a scanline of a monochrome pcx into 32 bpp pixels. More...

List of all members.

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.

Detailed Description

Function object that converts a scanline of a monochrome pcx into 32 bpp pixels.

Definition at line 211 of file pcx.hpp.


Member Function Documentation

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.

Parameters:
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()()


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