ColorInfo
- class ColorInfo
Describes pixel and encoding.
ImageInfocan be created fromColorInfoby 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
alphaType(self: skia.ColorInfo) -> skia.AlphaType
bytesPerPixel(self: skia.ColorInfo) -> int
colorSpace(self: skia.ColorInfo) -> skia.ColorSpace
colorType(self: skia.ColorInfo) -> skia.ColorType
gammaCloseToSRGB(self: skia.ColorInfo) -> bool
isOpaque(self: skia.ColorInfo) -> bool
makeAlphaType(self: skia.ColorInfo, newAlphaType: skia.AlphaType) -> skia.ColorInfo
makeColorSpace(self: skia.ColorInfo, cs: skia.ColorSpace) -> skia.ColorInfo
makeColorType(self: skia.ColorInfo, newColorType: skia.ColorType) -> skia.ColorInfo
refColorSpace(self: skia.ColorInfo) -> skia.ColorSpace
shiftPerPixel(self: skia.ColorInfo) -> int
Methods
- ColorInfo.__init__(*args, **kwargs)
Overloaded function.
__init__(self: skia.ColorInfo) -> None
Creates an
ColorInfowithkUnknown_ColorType,kUnknown_AlphaType, and noColorSpace.__init__(self: skia.ColorInfo, ct: skia.ColorType, at: skia.AlphaType, cs: skia.ColorSpace = None) -> None
Creates
ColorInfofromColorTypect,AlphaTypeat, and optionallyColorSpacecs.If
ColorSpacecs is nullptr andColorInfois part of drawing source:ColorSpacedefaults to sRGB, mapping intoSurfaceColorSpace.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
ColorInfowith sameColorType,ColorSpace, withAlphaTypeset to newAlphaType.Created
ColorInfocontains newAlphaType even if it is incompatible withColorType, in which caseAlphaTypeinColorInfois ignored.
- ColorInfo.makeColorSpace(self: skia.ColorInfo, cs: skia.ColorSpace) skia.ColorInfo
Creates
ColorInfowith sameAlphaType,ColorType, withColorSpaceset to cs.cs may be nullptr.
- ColorInfo.makeColorType(self: skia.ColorInfo, newColorType: skia.ColorType) skia.ColorInfo
Creates new
ColorInfowith sameAlphaType,ColorSpace, withColorTypeset 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