SkColorFilter Class Reference

#include <SkColorFilter.h>

Inherits SkFlattenable.

Inherited by SkColorMatrixFilter.

Collaboration diagram for SkColorFilter:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Flags { kAlphaUnchanged_Flag = 0x01, kHasFilter16_Flag = 0x02 }

Public Member Functions

virtual void filterSpan (const SkPMColor src[], int count, SkPMColor result[])=0
virtual void filterSpan16 (const uint16_t shader[], int count, uint16_t result[])
virtual uint32_t getFlags ()

Static Public Member Functions

static SkColorFilterCreateModeFilter (SkColor c, SkXfermode::Mode mode)
static SkColorFilterCreateProcFilter (SkColor srcColor, SkXfermodeProc proc, SkXfermodeProc16 proc16=NULL)
static SkColorFilterCreateLightingFilter (SkColor mul, SkColor add)

Protected Member Functions

 SkColorFilter ()
 SkColorFilter (SkFlattenableReadBuffer &rb)

Detailed Description

Definition at line 24 of file SkColorFilter.h.


Member Enumeration Documentation

Enumerator:
kAlphaUnchanged_Flag 

If set the filter methods will not change the alpha channel of the colors.

kHasFilter16_Flag 

If set, this subclass implements filterSpan16(). If this flag is set, then kAlphaUnchanged_Flag must also be set.

Definition at line 45 of file SkColorFilter.h.


Constructor & Destructor Documentation

SkColorFilter::SkColorFilter (  )  [inline, protected]

Definition at line 88 of file SkColorFilter.h.

SkColorFilter::SkColorFilter ( SkFlattenableReadBuffer rb  )  [inline, protected]

Definition at line 89 of file SkColorFilter.h.


Member Function Documentation

static SkColorFilter* SkColorFilter::CreateLightingFilter ( SkColor  mul,
SkColor  add 
) [static]

Create a colorfilter that multiplies the RGB channels by one color, and then adds a second color, pinning the result for each component to [0..255]. The alpha components of the mul and add arguments are ignored.

static SkColorFilter* SkColorFilter::CreateModeFilter ( SkColor  c,
SkXfermode::Mode  mode 
) [static]

Create a colorfilter that uses the specified color and mode. If the Mode is DST, this function will return NULL (since that mode will have no effect on the result).

Parameters:
c The source color used with the specified mode
mode The xfermode mode that is applied to each color in the colorfilter's filterSpan[16,32] methods
Returns:
colorfilter object that applies the src color and mode, or NULL if the mode will have no effect.
static SkColorFilter* SkColorFilter::CreateProcFilter ( SkColor  srcColor,
SkXfermodeProc  proc,
SkXfermodeProc16  proc16 = NULL 
) [static]

Create a colorfilter that calls through to the specified procs to filter the colors. The SkXfermodeProc parameter must be non-null, but the SkXfermodeProc16 is optional, and may be null.

virtual void SkColorFilter::filterSpan ( const SkPMColor  src[],
int  count,
SkPMColor  result[] 
) [pure virtual]

Called with a scanline of colors, as if there was a shader installed. The implementation writes out its filtered version into result[]. Note: shader and result may be the same buffer.

Parameters:
src array of colors, possibly generated by a shader
count the number of entries in the src[] and result[] arrays
result written by the filter

Implemented in SkColorMatrixFilter.

virtual void SkColorFilter::filterSpan16 ( const uint16_t  shader[],
int  count,
uint16_t  result[] 
) [virtual]

Called with a scanline of colors, as if there was a shader installed. The implementation writes out its filtered version into result[]. Note: shader and result may be the same buffer.

Parameters:
src array of colors, possibly generated by a shader
count the number of entries in the src[] and result[] arrays
result written by the filter

Reimplemented in SkColorMatrixFilter.

virtual uint32_t SkColorFilter::getFlags (  )  [inline, virtual]

Returns the flags for this filter. Override in subclasses to return custom flags.

Reimplemented in SkColorMatrixFilter.

Definition at line 59 of file SkColorFilter.h.


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

Generated on Tue Oct 20 11:03:42 2009 for Skia by  doxygen 1.6.1