Public Member Functions

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:
scanlinethe scan line to convert.
imgThe image in which we write the results.
yThe 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()()

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