ColorInfo
- class ColorInfo
Describes pixel and encoding.
ImageInfo
can be created fromColorInfo
by providing dimensions.It encodes how pixel bits describe alpha, transparency; color components red, blue, and green; and
ColorSpace
, the range and linearity of colors.Methods
Overloaded function.
Returns number of bytes per pixel required by
ColorType
.Creates
ColorInfo
with sameColorType
,ColorSpace
, withAlphaType
set to newAlphaType.Creates
ColorInfo
with sameAlphaType
,ColorType
, withColorSpace
set to cs.Creates new
ColorInfo
with sameAlphaType
,ColorSpace
, withColorType
set to newColorType.Returns bit shift converting row bytes to row pixels.
Methods
- ColorInfo.__init__(*args, **kwargs)
Overloaded function.
__init__(self: skia.ColorInfo) -> None
Creates an
ColorInfo
withkUnknown_ColorType
,kUnknown_AlphaType
, and noColorSpace
.__init__(self: skia.ColorInfo, ct: skia.ColorType, at: skia.AlphaType, cs: skia.ColorSpace = None) -> None
Creates
ColorInfo
fromColorType
ct,AlphaType
at, and optionallyColorSpace
cs.If
ColorSpace
cs is nullptr andColorInfo
is part of drawing source:ColorSpace
defaults to sRGB, mapping intoSurface
ColorSpace
.Parameters are not validated to see if their values are legal, or that the combination is supported.
__init__(self: skia.ColorInfo, arg0: skia.ColorInfo) -> None
- ColorInfo.alphaType(self: skia.ColorInfo) skia.AlphaType
- ColorInfo.bytesPerPixel(self: skia.ColorInfo) int
Returns number of bytes per pixel required by
ColorType
.Returns zero if
colorType()
iskUnknown_ColorType
.- Returns:
bytes in pixel
- ColorInfo.colorSpace(self: skia.ColorInfo) skia.ColorSpace
- ColorInfo.colorType(self: skia.ColorInfo) skia.ColorType
- ColorInfo.gammaCloseToSRGB(self: skia.ColorInfo) bool
- ColorInfo.isOpaque(self: skia.ColorInfo) bool
- ColorInfo.makeAlphaType(self: skia.ColorInfo, newAlphaType: skia.AlphaType) skia.ColorInfo
Creates
ColorInfo
with sameColorType
,ColorSpace
, withAlphaType
set to newAlphaType.Created
ColorInfo
contains newAlphaType even if it is incompatible withColorType
, in which caseAlphaType
inColorInfo
is ignored.
- ColorInfo.makeColorSpace(self: skia.ColorInfo, cs: skia.ColorSpace) skia.ColorInfo
Creates
ColorInfo
with sameAlphaType
,ColorType
, withColorSpace
set to cs.cs may be nullptr.
- ColorInfo.makeColorType(self: skia.ColorInfo, newColorType: skia.ColorType) skia.ColorInfo
Creates new
ColorInfo
with sameAlphaType
,ColorSpace
, withColorType
set to newColorType.
- ColorInfo.refColorSpace(self: skia.ColorInfo) skia.ColorSpace
- ColorInfo.shiftPerPixel(self: skia.ColorInfo) int
Returns bit shift converting row bytes to row pixels.
Returns zero for
ColorType.kUnknown_ColorType
.- Returns:
one of: 0, 1, 2, 3, 4; left shift to convert pixels to bytes