Skia
2DGraphicsLibrary
|
Luminance-to-alpha color filter, as defined in http://www.w3.org/TR/SVG/masking.html#Masking http://www.w3.org/TR/css-masking/#MaskValues. More...
#include <SkLumaColorFilter.h>
Public Member Functions | |
void | filterSpan (const SkPMColor src[], int count, SkPMColor[]) const override |
Called with a scanline of colors, as if there was a shader installed. More... | |
![]() | |
virtual bool | asColorMode (SkColor *color, SkBlendMode *bmode) const |
If the filter can be represented by a source color plus Mode, this returns true, and sets (if not NULL) the color and mode appropriately. More... | |
virtual bool | asColorMatrix (SkScalar matrix[20]) const |
If the filter can be represented by a 5x4 matrix, this returns true, and sets the matrix appropriately. More... | |
virtual bool | asComponentTable (SkBitmap *table) const |
If the filter can be represented by per-component table, return true, and if table is not null, copy the bitmap containing the table into it. More... | |
void | appendStages (SkRasterPipeline *, SkColorSpace *, SkArenaAlloc *, bool shaderIsOpaque) const |
virtual uint32_t | getFlags () const |
Returns the flags for this filter. More... | |
virtual sk_sp< SkColorFilter > | makeComposed (sk_sp< SkColorFilter >) const |
If this subclass can optimally createa composition with the inner filter, return it as a new filter (which the caller must unref() when it is done). More... | |
SkColor | filterColor (SkColor) const |
Apply this colorfilter to the specified SkColor. More... | |
SkColor4f | filterColor4f (const SkColor4f &) const |
Filters a single color. | |
virtual sk_sp < GrFragmentProcessor > | asFragmentProcessor (GrContext *, SkColorSpace *dstColorSpace) const |
A subclass may implement this factory function to work with the GPU backend. More... | |
bool | affectsTransparentBlack () const |
![]() | |
virtual Factory | getFactory () const =0 |
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(). | |
virtual const char * | getTypeName () const |
Returns the name of the object's class. More... | |
![]() | |
SkRefCntBase () | |
Default construct, initializing the reference count to 1. | |
virtual | ~SkRefCntBase () |
Destruct, asserting that the reference count is 1. | |
int32_t | getRefCnt () const |
Return the reference count. More... | |
void | validate () const |
bool | unique () const |
May return true if the caller is the only owner. More... | |
void | ref () const |
Increment the reference count. More... | |
void | unref () const |
Decrement the reference count. More... | |
Static Public Member Functions | |
static sk_sp< SkColorFilter > | Make () |
![]() | |
static sk_sp< SkColorFilter > | MakeModeFilter (SkColor c, SkBlendMode mode) |
Create a colorfilter that uses the specified color and mode. More... | |
static sk_sp< SkColorFilter > | MakeComposeFilter (sk_sp< SkColorFilter > outer, sk_sp< SkColorFilter > inner) |
Construct a colorfilter whose effect is to first apply the inner filter and then apply the outer filter to the result of the inner's. More... | |
static sk_sp< SkColorFilter > | MakeMatrixFilterRowMajor255 (const SkScalar array[20]) |
Construct a color filter that transforms a color by a 4x5 matrix. More... | |
![]() | |
static Factory | NameToFactory (const char name[]) |
static const char * | FactoryToName (Factory) |
static bool | NameToType (const char name[], Type *type) |
static void | Register (const char name[], Factory, Type) |
Protected Member Functions | |
void | flatten (SkWriteBuffer &) const override |
Override this if your subclass needs to record data that it will need to recreate itself from its CreateProc (returned by getFactory()). | |
![]() | |
sk_sp< SkColorFilter > | makeColorSpace (SkColorSpaceXformer *xformer) const |
virtual sk_sp< SkColorFilter > | onMakeColorSpace (SkColorSpaceXformer *) const |
![]() | |
void | internal_dispose_restore_refcnt_to_1 () const |
Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More... | |
Private Types | |
typedef SkColorFilter | INHERITED |
Private Member Functions | |
void | onAppendStages (SkRasterPipeline *, SkColorSpace *, SkArenaAlloc *, bool shaderIsOpaque) const override |
Additional Inherited Members | |
![]() | |
enum | Flags { kAlphaUnchanged_Flag = 1 << 0 } |
![]() | |
enum | Type { kSkColorFilter_Type, kSkDrawable_Type, kSkDrawLooper_Type, kSkImageFilter_Type, kSkMaskFilter_Type, kSkPathEffect_Type, kSkPixelRef_Type, kSkRasterizer_Type, kSkShaderBase_Type, kSkUnused_Type, kSkUnused_Xfermode_Type, kSkNormalSource_Type } |
typedef sk_sp< SkFlattenable >(* | Factory )(SkReadBuffer &) |
Luminance-to-alpha color filter, as defined in http://www.w3.org/TR/SVG/masking.html#Masking http://www.w3.org/TR/css-masking/#MaskValues.
The resulting color is black with transparency equal to the luminance value modulated by alpha:
C' = [ Lum * a, 0, 0, 0 ]
|
overridevirtual |
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 |
Implements SkColorFilter.