YUVAPixmapInfo
- class YUVAPixmapInfo
YUVAInfo
combined with per-planeColorType
and row bytes. Fully specifies thePixmaps
for a YUVA image without the actual pixel memory and data.Classes
Data type for Y, U, V, and possibly A channels independent of how values are
Methods
Gets the default SkColorType to use with numChannels channels, each represented as DataType.
If the
ColorType
is supported for YUVA pixmaps this will return the number of YUVA channels that can be stored in a plane of this color type and what the DataType is of those channels.Overloaded function.
Determine size to allocate for all planes.
The per-YUV[A] channel data type.
Takes an allocation that is assumed to be at least
computeTotalBytes()
in size and configures the firstnumPlanes()
entries in pixmaps array to point into that memory.Is this valid and does it use color types allowed by the passed
SupportedDataTypes
?Returns true if this has been configured with a non-empty dimensioned
YUVAInfo
with compatible color types and row bytes.The number of
Pixmap
planes, 0 if thisYUVAPixmapInfo
is invalid.Image info for the ith plane, or default
ImageInfo
ifi >= numPlanes()
Row bytes for the ith plane.
Attributes
Methods
- static YUVAPixmapInfo.DefaultColorTypeForDataType(dataType: skia.YUVAPixmapInfo.DataType, numChannels: int) skia.ColorType
Gets the default SkColorType to use with numChannels channels, each represented as DataType. Returns kUnknown_SkColorType if no such color type.
- static YUVAPixmapInfo.NumChannelsAndDataType(colorType: skia.ColorType) tuple[int, skia.YUVAPixmapInfo.DataType]
If the
ColorType
is supported for YUVA pixmaps this will return the number of YUVA channels that can be stored in a plane of this color type and what the DataType is of those channels. If theColorType
is not supported as a YUVA plane the number of channels is reported as 0 and the DataType returned should be ignored.
- YUVAPixmapInfo.__init__(*args, **kwargs)
Overloaded function.
__init__(self: skia.YUVAPixmapInfo) -> None
Default SkYUVAPixmapInfo is invalid.
__init__(self: skia.YUVAPixmapInfo, info: skia.YUVAInfo, colorType: list[skia.ColorType], rowBytes: object = None) -> None
Initializes the
YUVAPixmapInfo
from aYUVAInfo
with per-plane color types and row bytes. This will be invalid if the colorTypes aren’t compatible with theYUVAInfo
or if a rowBytes entry is not valid for the plane dimensions and color type. Color type and row byte values beyond the number of planes inYUVAInfo
are ignored. AllColorTypes
must have the same DataType or this will be invalid.If rowBytes is nullptr then
bpp*width
is assumed for each plane.__init__(self: skia.YUVAPixmapInfo, info: skia.YUVAInfo, dataType: skia.YUVAPixmapInfo.DataType, rowBytes: object = None) -> None
Like above but uses DefaultColorTypeForDataType to determine each plane’s
ColorType
. If rowBytes is nullptr then bpp*width is assumed for each plane.
- YUVAPixmapInfo.computeTotalBytes(self: skia.YUVAPixmapInfo, returnPlaneSizes: bool = False) object
Determine size to allocate for all planes. Optionally returns the per-plane sizes if returnPlaneSizes is True. If total size overflows will return SIZE_MAX and set all planeSizes to SIZE_MAX. Returns 0 and fills planesSizes with 0 if this
YUVAPixmapInfo
is not valid.
- YUVAPixmapInfo.dataType(self: skia.YUVAPixmapInfo) skia.YUVAPixmapInfo.DataType
The per-YUV[A] channel data type.
- YUVAPixmapInfo.initPixmapsFromSingleAllocation(self: skia.YUVAPixmapInfo, memory: Buffer) list[skia.Pixmap]
Takes an allocation that is assumed to be at least
computeTotalBytes()
in size and configures the firstnumPlanes()
entries in pixmaps array to point into that memory. The remaining entries of pixmaps are default initialized. Fails if thisYUVAPixmapInfo
not valid.- Parameters:
memory – Buffer that is at least
computeTotalBytes()
in size.- Return type:
List[skia.Pixmap]
- YUVAPixmapInfo.isSupported(self: skia.YUVAPixmapInfo, supportedDataTypes: skia.YUVAPixmapInfo.SupportedDataTypes) bool
Is this valid and does it use color types allowed by the passed
SupportedDataTypes
?
- YUVAPixmapInfo.isValid(self: skia.YUVAPixmapInfo) bool
Returns true if this has been configured with a non-empty dimensioned
YUVAInfo
with compatible color types and row bytes.
- YUVAPixmapInfo.numPlanes(self: skia.YUVAPixmapInfo) int
The number of
Pixmap
planes, 0 if thisYUVAPixmapInfo
is invalid.
- YUVAPixmapInfo.planeInfo(self: skia.YUVAPixmapInfo, i: int) skia.ImageInfo
Image info for the ith plane, or default
ImageInfo
ifi >= numPlanes()
- YUVAPixmapInfo.rowBytes(self: skia.YUVAPixmapInfo, i: int) int
Row bytes for the ith plane. Returns zero if
i >= numPlanes()
or thisYUVAPixmapInfo
is invalid.
- YUVAPixmapInfo.yuvColorSpace(self: skia.YUVAPixmapInfo) skia.YUVColorSpace
- YUVAPixmapInfo.yuvaInfo(self: skia.YUVAPixmapInfo) skia.YUVAInfo
Attributes
- YUVAPixmapInfo.kFloat16 = <DataType.kFloat16: 2>
- YUVAPixmapInfo.kLast = <DataType.kUnorm10_Unorm2: 3>
- YUVAPixmapInfo.kMaxPlanes = 4
- YUVAPixmapInfo.kUnorm10_Unorm2 = <DataType.kUnorm10_Unorm2: 3>
- YUVAPixmapInfo.kUnorm16 = <DataType.kUnorm16: 1>
- YUVAPixmapInfo.kUnorm8 = <DataType.kUnorm8: 0>