YUVAPixmaps
- class YUVAPixmaps
Helper to store
Pixmap
planes as described by aYUVAPixmapInfo
. Can be responsible for allocating/freeing memory for pixmaps or use external memory.Methods
Allocate space for pixmaps' pixels in the
YUVAPixmaps
.Use storage in
Data
as backing store for pixmaps' pixels.Use passed in memory as backing store for pixmaps' pixels.
Wraps existing
Pixmap
.Does have initialized pixmaps compatible with its
YUVAInfo
.Number of pixmap planes or 0 if this
YUVAPixmaps
is invalid.Get the ith
Pixmap
plane.Access the
Pixmap
planes.
Methods
- static YUVAPixmaps.Allocate(yuvaPixmapInfo: skia.YUVAPixmapInfo) skia.YUVAPixmaps
Allocate space for pixmaps’ pixels in the
YUVAPixmaps
.
- static YUVAPixmaps.FromData(yuvaPixmapInfo: skia.YUVAPixmapInfo, data: skia.Data) skia.YUVAPixmaps
Use storage in
Data
as backing store for pixmaps’ pixels.Data
is retained by theYUVAPixmaps
.
- static YUVAPixmaps.FromExternalMemory(yuvaPixmapInfo: skia.YUVAPixmapInfo, memory: Buffer) skia.YUVAPixmaps
Use passed in memory as backing store for pixmaps’ pixels. Caller must ensure memory remains allocated while pixmaps are in use. There must be at least
YUVAPixmapInfo.computeTotalBytes()
allocated starting at memory.
- static YUVAPixmaps.FromExternalPixmaps(yuvaInfo: skia.YUVAInfo, pixmaps: list[skia.Pixmap]) skia.YUVAPixmaps
Wraps existing
Pixmap
. TheYUVAPixmaps
will have no ownership of thePixmap
’ pixel memory so the caller must ensure it remains valid. Will return an invalidYUVAPixmaps
if theYUVAInfo
isn’t compatible with thePixmap
array (number of planes, plane dimensions, sufficient color channels in planes, …).
- YUVAPixmaps.__init__(self: skia.YUVAPixmaps) None
- YUVAPixmaps.isValid(self: skia.YUVAPixmaps) bool
Does have initialized pixmaps compatible with its
YUVAInfo
.
- YUVAPixmaps.numPlanes(self: skia.YUVAPixmaps) int
Number of pixmap planes or 0 if this
YUVAPixmaps
is invalid.
- YUVAPixmaps.plane(self: skia.YUVAPixmaps, i: int) skia.Pixmap
Get the ith
Pixmap
plane.Pixmap
will be default initialized if i >= numPlanes or thisYUVAPixmaps
is invalid.
- YUVAPixmaps.planes(self: skia.YUVAPixmaps) Annotated[list[skia.Pixmap], FixedSize(4)]
Access the
Pixmap
planes. They are default initialized if this is not a validYUVAPixmaps
.
- YUVAPixmaps.yuvaInfo(self: skia.YUVAPixmaps) skia.YUVAInfo