ColorMatrixFilter

class ColorMatrixFilter

Classes

Flags

Members:

Type

Members:

Methods

Deserialize

MakeLightingFilter

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].

__init__

asAColorMatrix

If the filter can be represented by a 5x4 matrix, this returns list of floats appropriately.

asAColorMode

If the filter can be represented by a source color plus Mode, this returns color and mode appropriately.

asColorMode

filterColor

filterColor4f

Converts the src color (in src colorspace), into the dst colorspace, then applies this filter to it, returning the filtered color in the dst colorspace.

getFlags

Returns the flags for this filter.

getFlattenableType

getTypeName

Returns the name of the object’s class.

makeComposed

Construct a colorfilter whose effect is to first apply the inner filter and then apply this filter, applied to the output of the inner filter.

ref

Increment the reference count.

serialize

unique

May return true if the caller is the only owner.

unref

Decrement the reference count.

Attributes

kAlphaUnchanged_Flag

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 ColorMatrixFilter.Deserialize(data: buffer) skia.ColorFilter
static ColorMatrixFilter.MakeLightingFilter(mul: int, add: int) skia.ColorFilter

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.

ColorMatrixFilter.__init__(*args, **kwargs)
ColorMatrixFilter.asAColorMatrix(self: skia.ColorFilter) object

If the filter can be represented by a 5x4 matrix, this returns list of floats appropriately.

If not, this returns None.

Return type

List[float] or None

ColorMatrixFilter.asAColorMode(self: skia.ColorFilter) object

If the filter can be represented by a source color plus Mode, this returns color and mode appropriately.

If not, this returns None.

Return type

Tuple[int,skia.BlendMode] or None

ColorMatrixFilter.asColorMode(self: skia.ColorFilter) object
ColorMatrixFilter.filterColor(self: skia.ColorFilter, color: int) int
ColorMatrixFilter.filterColor4f(self: skia.ColorFilter, srcColor: skia.Color4f, srcCS: skia.ColorSpace, dstCS: skia.ColorSpace) skia.Color4f

Converts the src color (in src colorspace), into the dst colorspace, then applies this filter to it, returning the filtered color in the dst colorspace.

ColorMatrixFilter.getFlags(self: skia.ColorFilter) int

Returns the flags for this filter.

Override in subclasses to return custom flags.

ColorMatrixFilter.getFlattenableType(self: skia.Flattanable) skia.Flattanable.Type
ColorMatrixFilter.getTypeName(self: skia.Flattanable) str

Returns the name of the object’s class.

Implemented in Drawable.

ColorMatrixFilter.makeComposed(self: skia.ColorFilter, inner: skia.ColorFilter) skia.ColorFilter

Construct a colorfilter whose effect is to first apply the inner filter and then apply this filter, applied to the output of the inner filter.

result = this(inner(…))

ColorMatrixFilter.ref(self: skia.RefCntBase) None

Increment the reference count.

Must be balanced by a call to unref().

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

May return true if the caller is the only owner.

Ensures that all previous owner’s actions are complete.

ColorMatrixFilter.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

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