animator.skia.ColorType

class animator.skia.ColorType

Bases: pybind11_builtins.pybind11_object

Members:

kUnknown_ColorType

kAlpha_8_ColorType

kRGB_565_ColorType

kARGB_4444_ColorType

kRGBA_8888_ColorType

kRGB_888x_ColorType

kBGRA_8888_ColorType

kRGBA_1010102_ColorType

kBGRA_1010102_ColorType

kRGB_101010x_ColorType

kBGR_101010x_ColorType

kBGR_101010x_XR_ColorType

kGray_8_ColorType

kRGBA_F16Norm_ColorType

kRGBA_F16_ColorType

kRGBA_F32_ColorType

kR8G8_unorm_ColorType

kA16_float_ColorType

kR16G16_float_ColorType

kA16_unorm_ColorType

kR16G16_unorm_ColorType

kR16G16B16A16_unorm_ColorType

kSRGBA_8888_ColorType

kR8_unorm_ColorType

kLastEnum_ColorType

kN32_ColorType

__init__(self: animator.skia.ColorType, value: int) None

Methods

__init__(self, value)

bytesPerPixel(self)

Returns the number of bytes required to store a pixel, including unused padding.

isAlwaysOpaque(self)

Returns true if ColorType always decodes alpha to 1.0, making the pixel fully opaque.

validateAlphaType(self, alphaType)

Returns a AlphaType if this colorType has a valid AlphaType.

Attributes

kA16_float_ColorType

kA16_unorm_ColorType

kARGB_4444_ColorType

kAlpha_8_ColorType

kBGRA_1010102_ColorType

kBGRA_8888_ColorType

kBGR_101010x_ColorType

kBGR_101010x_XR_ColorType

kGray_8_ColorType

kLastEnum_ColorType

kN32_ColorType

kR16G16B16A16_unorm_ColorType

kR16G16_float_ColorType

kR16G16_unorm_ColorType

kR8G8_unorm_ColorType

kR8_unorm_ColorType

kRGBA_1010102_ColorType

kRGBA_8888_ColorType

kRGBA_F16Norm_ColorType

kRGBA_F16_ColorType

kRGBA_F32_ColorType

kRGB_101010x_ColorType

kRGB_565_ColorType

kRGB_888x_ColorType

kSRGBA_8888_ColorType

kUnknown_ColorType

name

value

bytesPerPixel(self: animator.skia.ColorType) int

Returns the number of bytes required to store a pixel, including unused padding. Returns zero if this is kUnknown_ColorType or invalid.

Returns

bytes per pixel

isAlwaysOpaque(self: animator.skia.ColorType) bool

Returns true if ColorType always decodes alpha to 1.0, making the pixel fully opaque. If True, ColorType does not reserve bits to encode alpha.

Returns

true if alpha is always set to 1.0

property name
validateAlphaType(self: animator.skia.ColorType, alphaType: animator.skia.AlphaType) Optional[animator.skia.AlphaType]

Returns a AlphaType if this colorType has a valid AlphaType.

Returns None only if alphaType is kUnknown_AlphaType, color type is not kUnknown_ColorType, and ColorType is not always opaque.

Parameters

alphaType – alpha type

Returns

alpha type for this color type, or None

Return type

AlphaType | None