MaskFilter

class MaskFilter

MaskFilter is the base class for object that perform transformations on the mask before drawing it.

An example subclass is Blur.

Subclasses

ShaderMaskFilter

TableMaskFilter

Applies a table lookup on each of the alpha values in the mask.

Classes

Type

Members:

Methods

Deserialize

MakeBlur

Create a blur maskfilter.

__init__

getFlattenableType

getTypeName

Returns the name of the object’s class.

ref

Increment the reference count.

serialize

unique

May return true if the caller is the only owner.

unref

Decrement the reference count.

Attributes

kColorFilter_Type

kDrawLooper_Type

kDrawable_Type

kImageFilter_Type

kMaskFilter_Type

kPathEffect_Type

kPixelRef_Type

kShaderBase_Type

kUnused_Type

kUnused_Type2

kUnused_Type3

kUnused_Type4

Methods

static MaskFilter.Deserialize(data: buffer) skia.MaskFilter
static MaskFilter.MakeBlur(style: skia.BlurStyle, sigma: float, respectCTM: bool = True) skia.MaskFilter

Create a blur maskfilter.

Parameters
  • style (skia.BlurStyle) – The BlurStyle to use

  • sigma (float) – Standard deviation of the Gaussian blur to apply. Must be > 0.

  • respectCTM (bool) – if true the blur’s sigma is modified by the CTM.

Returns

The new blur maskfilter

MaskFilter.__init__(*args, **kwargs)
MaskFilter.getFlattenableType(self: skia.Flattanable) skia.Flattanable.Type
MaskFilter.getTypeName(self: skia.Flattanable) str

Returns the name of the object’s class.

Implemented in Drawable.

MaskFilter.ref(self: skia.RefCntBase) None

Increment the reference count.

Must be balanced by a call to unref().

MaskFilter.serialize(self: skia.Flattanable) skia.Data
MaskFilter.unique(self: skia.RefCntBase) bool

May return true if the caller is the only owner.

Ensures that all previous owner’s actions are complete.

MaskFilter.unref(self: skia.RefCntBase) None

Decrement the reference count.

If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.

Attributes

MaskFilter.kColorFilter_Type = <Type.kColorFilter_Type: 0>
MaskFilter.kDrawLooper_Type = <Type.kDrawLooper_Type: 2>
MaskFilter.kDrawable_Type = <Type.kDrawable_Type: 1>
MaskFilter.kImageFilter_Type = <Type.kImageFilter_Type: 3>
MaskFilter.kMaskFilter_Type = <Type.kMaskFilter_Type: 4>
MaskFilter.kPathEffect_Type = <Type.kPathEffect_Type: 5>
MaskFilter.kPixelRef_Type = <Type.kPixelRef_Type: 6>
MaskFilter.kShaderBase_Type = <Type.kShaderBase_Type: 8>
MaskFilter.kUnused_Type = <Type.kUnused_Type: 9>
MaskFilter.kUnused_Type2 = <Type.kUnused_Type2: 10>
MaskFilter.kUnused_Type3 = <Type.kUnused_Type3: 11>
MaskFilter.kUnused_Type4 = <Type.kUnused_Type4: 7>