#include <SkColorFilter.h>
Inherits SkFlattenable.
Inherited by SkColorMatrixFilter.
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 SkColorFilter * | CreateModeFilter (SkColor c, SkXfermode::Mode mode) |
static SkColorFilter * | CreateProcFilter (SkColor srcColor, SkXfermodeProc proc, SkXfermodeProc16 proc16=NULL) |
static SkColorFilter * | CreateLightingFilter (SkColor mul, SkColor add) |
Protected Member Functions | |
SkColorFilter () | |
SkColorFilter (SkFlattenableReadBuffer &rb) |
Definition at line 24 of file SkColorFilter.h.
enum SkColorFilter::Flags |
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.
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.
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).
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 |
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.
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.
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.