#include <SkAvoidXfermode.h>
Inherits SkXfermode.
Public Types | |
enum | Mode { kAvoidColor_Mode, kTargetColor_Mode } |
Public Member Functions | |
SkAvoidXfermode (SkColor opColor, U8CPU tolerance, Mode mode) | |
virtual void | xfer32 (SkPMColor dst[], const SkPMColor src[], int count, const SkAlpha aa[]) |
virtual void | xfer16 (uint16_t dst[], const SkPMColor src[], int count, const SkAlpha aa[]) |
virtual void | xfer4444 (uint16_t dst[], const SkPMColor src[], int count, const SkAlpha aa[]) |
virtual void | xferA8 (SkAlpha dst[], const SkPMColor src[], int count, const SkAlpha aa[]) |
virtual Factory | getFactory () |
virtual void | flatten (SkFlattenableWriteBuffer &) |
Protected Member Functions | |
SkAvoidXfermode (SkFlattenableReadBuffer &) |
This xfermode will draw the src everywhere except on top of the specified color.
Definition at line 27 of file SkAvoidXfermode.h.
List of predefined xfermodes. The algebra for the modes uses the following symbols: Sa, Sc - source alpha and color Da, Dc - destination alpha and color (before compositing) [a, c] - Resulting (alpha, color) values For these equations, the colors are in premultiplied state. If no xfermode is specified, kSrcOver is assumed.
kAvoidColor_Mode |
draw everywhere except on the opColor |
kTargetColor_Mode |
draw only on top of the opColor |
Reimplemented from SkXfermode.
Definition at line 29 of file SkAvoidXfermode.h.
This xfermode will draw the src everywhere except on top of the opColor or, depending on the Mode, draw only on top of the opColor.
opColor | the color to avoid (or to target depending on Mode). note: the alpha in opColor is ignored | |
tolerance | How closely we compare a pixel to the opColor. 0 - only operate if exact match 255 - maximum gradation (blending) based on how similar the pixel is to our opColor (max tolerance) | |
mode | If we should avoid or target the opColor |
SkAvoidXfermode::SkAvoidXfermode | ( | SkFlattenableReadBuffer & | ) | [protected] |
virtual void SkAvoidXfermode::flatten | ( | SkFlattenableWriteBuffer & | ) | [virtual] |
Override this to write data specific to your subclass into the buffer, being sure to call your super-class' version first. This data will later be passed to your Factory function, returned by getFactory().
Reimplemented from SkFlattenable.
virtual Factory SkAvoidXfermode::getFactory | ( | ) | [virtual] |
Implement this to return a factory function pointer that can be called to recreate your class given a buffer (previously written to by your override of flatten().
Implements SkFlattenable.
virtual void SkAvoidXfermode::xfer16 | ( | uint16_t | dst[], | |
const SkPMColor | src[], | |||
int | count, | |||
const SkAlpha | aa[] | |||
) | [virtual] |
Reimplemented from SkXfermode.
virtual void SkAvoidXfermode::xfer32 | ( | SkPMColor | dst[], | |
const SkPMColor | src[], | |||
int | count, | |||
const SkAlpha | aa[] | |||
) | [virtual] |
Reimplemented from SkXfermode.
virtual void SkAvoidXfermode::xfer4444 | ( | uint16_t | dst[], | |
const SkPMColor | src[], | |||
int | count, | |||
const SkAlpha | aa[] | |||
) | [virtual] |
Reimplemented from SkXfermode.
virtual void SkAvoidXfermode::xferA8 | ( | SkAlpha | dst[], | |
const SkPMColor | src[], | |||
int | count, | |||
const SkAlpha | aa[] | |||
) | [virtual] |
Reimplemented from SkXfermode.