Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ImageFilterBlackWhite Class Reference

Converts images to black and white. More...

Inheritance diagram for ImageFilterBlackWhite:

Inheritance graph
[legend]
Collaboration diagram for ImageFilterBlackWhite:

Collaboration graph
[legend]
List of all members.

Public Member Functions

char * GetDescription () const
void FilterFrame (uint8_t *pixels, int width, int height, double position, double frame_delta)

Detailed Description

Converts images to black and white.

Definition at line 65 of file image_filters.cc.


Member Function Documentation

void ImageFilterBlackWhite::FilterFrame uint8_t *  pixels,
int  width,
int  height,
double  position,
double  frame_delta
[inline, virtual]
 

Implements ImageFilter.

Definition at line 73 of file image_filters.cc.

00074     {
00075         uint8_t r, g, b;
00076         uint8_t *p = pixels;
00077         while ( p < ( pixels + width * height * 3 ) )
00078         {
00079             r = *( p );
00080             g = *( p + 1 );
00081             b = *( p + 2 );
00082             r = ( uint8_t ) ( 0.299 * r + 0.587 * g + 0.114 * b );
00083             *p ++ = r;
00084             *p ++ = r;
00085             *p ++ = r;
00086         }
00087     }

char* ImageFilterBlackWhite::GetDescription  )  const [inline, virtual]
 

Implements ImageFilter.

Definition at line 68 of file image_filters.cc.

00069     {
00070         return _( "Black & White" );
00071     }


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 22:13:03 2007 for Kino by  doxygen 1.4.2