YUVAPixmaps

class YUVAPixmaps

Helper to store Pixmap planes as described by a YUVAPixmapInfo. Can be responsible for allocating/freeing memory for pixmaps or use external memory.

Methods

Allocate

Allocate space for pixmaps' pixels in the YUVAPixmaps.

FromData

Use storage in Data as backing store for pixmaps' pixels.

FromExternalMemory

Use passed in memory as backing store for pixmaps' pixels.

FromExternalPixmaps

Wraps existing Pixmap.

__init__

isValid

Does have initialized pixmaps compatible with its YUVAInfo.

numPlanes

Number of pixmap planes or 0 if this YUVAPixmaps is invalid.

plane

Get the ith Pixmap plane.

planes

Access the Pixmap planes.

yuvaInfo

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 the YUVAPixmaps.

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. The YUVAPixmaps will have no ownership of the Pixmap’ pixel memory so the caller must ensure it remains valid. Will return an invalid YUVAPixmaps if the YUVAInfo isn’t compatible with the Pixmap 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 this YUVAPixmaps 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 valid YUVAPixmaps.

YUVAPixmaps.yuvaInfo(self: skia.YUVAPixmaps) skia.YUVAInfo