YUVAPixmapInfo
- class YUVAPixmapInfo
YUVAInfocombined with per-planeColorTypeand row bytes. Fully specifies thePixmapsfor 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
DefaultColorTypeForDataType(dataType: skia.YUVAPixmapInfo.DataType, numChannels: int) -> skia.ColorType
NumChannelsAndDataType(colorType: skia.ColorType) -> tuple[int, skia.YUVAPixmapInfo.DataType]
computeTotalBytes(self: skia.YUVAPixmapInfo, returnPlaneSizes: bool = False) -> object
dataType(self: skia.YUVAPixmapInfo) -> skia.YUVAPixmapInfo.DataType
initPixmapsFromSingleAllocation(self: skia.YUVAPixmapInfo, memory: Buffer) -> list[skia.Pixmap]
isSupported(self: skia.YUVAPixmapInfo, supportedDataTypes: skia.YUVAPixmapInfo.SupportedDataTypes) -> bool
isValid(self: skia.YUVAPixmapInfo) -> bool
numPlanes(self: skia.YUVAPixmapInfo) -> int
planeInfo(self: skia.YUVAPixmapInfo, i: int) -> skia.ImageInfo
rowBytes(self: skia.YUVAPixmapInfo, i: int) -> int
yuvColorSpace(self: skia.YUVAPixmapInfo) -> skia.YUVColorSpace
yuvaInfo(self: skia.YUVAPixmapInfo) -> skia.YUVAInfo
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
ColorTypeis 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 theColorTypeis 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
YUVAPixmapInfofrom aYUVAInfowith per-plane color types and row bytes. This will be invalid if the colorTypes aren’t compatible with theYUVAInfoor 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 inYUVAInfoare ignored. AllColorTypesmust have the same DataType or this will be invalid.If rowBytes is nullptr then
bpp*widthis 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
YUVAPixmapInfois 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 thisYUVAPixmapInfonot 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
YUVAInfowith compatible color types and row bytes.
- YUVAPixmapInfo.numPlanes(self: skia.YUVAPixmapInfo) int
The number of
Pixmapplanes, 0 if thisYUVAPixmapInfois invalid.
- YUVAPixmapInfo.planeInfo(self: skia.YUVAPixmapInfo, i: int) skia.ImageInfo
Image info for the ith plane, or default
ImageInfoifi >= numPlanes()
- YUVAPixmapInfo.rowBytes(self: skia.YUVAPixmapInfo, i: int) int
Row bytes for the ith plane. Returns zero if
i >= numPlanes()or thisYUVAPixmapInfois 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>