YUVAInfo

class YUVAInfo

Specifies the structure of planes for a YUV image with optional alpha. The actual planar data is not part of this structure and depending on usage is in external textures or pixmaps.

Classes

PlaneConfig

Specifies how YUV (and optionally A) are divided among planes. Planes are separated by

Siting

Describes how subsampled chroma values are sited relative to luma values.

Subsampling

UV subsampling is also specified in the enum value names using J:a:b notation (e.g. 4:2:0 is

Methods

HasAlpha

Does the PlaneConfig have alpha values?

NumChannelsInPlane

Number of Y, U, V, A channels in the ith plane for a given PlaneConfig (or 0 if i is invalid).

NumPlanes

Number of planes for a given PlaneConfig.

PlaneDimensions

Given image dimensions, a planar configuration, and origin, determine the expected size of each plane.

__init__

Overloaded function.

computeTotalBytes

Given a per-plane row bytes, determine size to allocate for all planes.

dimensions

Dimensions of the full resolution image (after planes have been oriented to how the image is displayed as indicated by fOrigin).

hasAlpha

height

numChannelsInPlane

numPlanes

origin

planeConfig

planeDimensions

Returns the number of planes and initializes planeDimensions[0]..planeDimensions[<ret>] to the expected dimensions for each plane.

sitingX

sitingY

subSampling

width

yuvColorSpace

Attributes

k410

k411

k420

k422

k440

k444

kCentered

kMaxPlanes

kUYV

kUYVA

kUnknown

kYUV

kYUVA

kY_UV

kY_UV_A

kY_U_V

kY_U_V_A

kY_VU

kY_VU_A

kY_V_U

kY_V_U_A

Methods

static YUVAInfo.HasAlpha(config: skia.YUVAInfo.PlaneConfig) bool

Does the PlaneConfig have alpha values?

static YUVAInfo.NumChannelsInPlane(config: skia.YUVAInfo.PlaneConfig, i: int) int

Number of Y, U, V, A channels in the ith plane for a given PlaneConfig (or 0 if i is invalid).

static YUVAInfo.NumPlanes(config: skia.YUVAInfo.PlaneConfig) int

Number of planes for a given PlaneConfig.

static YUVAInfo.PlaneDimensions(imageDimensions: skia.ISize, config: skia.YUVAInfo.PlaneConfig, sampling: skia.YUVAInfo.Subsampling, origin: skia.EncodedOrigin) List[skia.ISize]

Given image dimensions, a planar configuration, and origin, determine the expected size of each plane. Returns a list of expected planes.

The input image dimensions are as displayed (after the planes have been transformed to the intended display orientation).

YUVAInfo.__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: skia.YUVAInfo) -> None

  2. __init__(self: skia.YUVAInfo, dimensions: skia.ISize, config: skia.YUVAInfo.PlaneConfig, sampling: skia.YUVAInfo.Subsampling, yuvColorSpace: skia.YUVColorSpace, origin: skia.EncodedOrigin = <EncodedOrigin.kTopLeft_EncodedOrigin: 1>, sittingX: skia.YUVAInfo.Siting = <Siting.kCentered: 0>, sittingY: skia.YUVAInfo.Siting = <Siting.kCentered: 0>) -> None

    ‘dimensions’ should specify the size of the full resolution image (after planes have been oriented to how the image is displayed as indicated by ‘origin’).

YUVAInfo.computeTotalBytes(self: skia.YUVAInfo, rowBytes: List[int], returnPlaneSizes: bool = False) object

Given a per-plane row bytes, determine size to allocate for all planes. Optionally retrieves the per-plane byte sizes if returnPlaneSizes is True. If total size overflows will return SIZE_MAX and set all planeSizes to SIZE_MAX.

YUVAInfo.dimensions(self: skia.YUVAInfo) skia.ISize

Dimensions of the full resolution image (after planes have been oriented to how the image is displayed as indicated by fOrigin).

YUVAInfo.hasAlpha(self: skia.YUVAInfo) bool
YUVAInfo.height(self: skia.YUVAInfo) int
YUVAInfo.numChannelsInPlane(self: skia.YUVAInfo, i: int) int
YUVAInfo.numPlanes(self: skia.YUVAInfo) int
YUVAInfo.origin(self: skia.YUVAInfo) skia.EncodedOrigin
YUVAInfo.planeConfig(self: skia.YUVAInfo) skia.YUVAInfo.PlaneConfig
YUVAInfo.planeDimensions(self: skia.YUVAInfo) List[skia.ISize]

Returns the number of planes and initializes planeDimensions[0]..planeDimensions[<ret>] to the expected dimensions for each plane. Dimensions are as stored in memory, before transformation to image display space as indicated by origin().

YUVAInfo.sitingX(self: skia.YUVAInfo) skia.YUVAInfo.Siting
YUVAInfo.sitingY(self: skia.YUVAInfo) skia.YUVAInfo.Siting
YUVAInfo.subSampling(self: skia.YUVAInfo) skia.YUVAInfo.Subsampling
YUVAInfo.width(self: skia.YUVAInfo) int
YUVAInfo.yuvColorSpace(self: skia.YUVAInfo) skia.YUVColorSpace

Attributes

YUVAInfo.k410 = <Subsampling.k410: 6>
YUVAInfo.k411 = <Subsampling.k411: 5>
YUVAInfo.k420 = <Subsampling.k420: 3>
YUVAInfo.k422 = <Subsampling.k422: 2>
YUVAInfo.k440 = <Subsampling.k440: 4>
YUVAInfo.k444 = <Subsampling.k444: 1>
YUVAInfo.kCentered = <Siting.kCentered: 0>
YUVAInfo.kMaxPlanes = 4
YUVAInfo.kUYV = <PlaneConfig.kUYV: 6>
YUVAInfo.kUYVA = <PlaneConfig.kUYVA: 12>
YUVAInfo.kUnknown = <Subsampling.kUnknown: 0>
YUVAInfo.kYUV = <PlaneConfig.kYUV: 5>
YUVAInfo.kYUVA = <PlaneConfig.kYUVA: 11>
YUVAInfo.kY_UV = <PlaneConfig.kY_UV: 3>
YUVAInfo.kY_UV_A = <PlaneConfig.kY_UV_A: 9>
YUVAInfo.kY_U_V = <PlaneConfig.kY_U_V: 1>
YUVAInfo.kY_U_V_A = <PlaneConfig.kY_U_V_A: 7>
YUVAInfo.kY_VU = <PlaneConfig.kY_VU: 4>
YUVAInfo.kY_VU_A = <PlaneConfig.kY_VU_A: 10>
YUVAInfo.kY_V_U = <PlaneConfig.kY_V_U: 2>
YUVAInfo.kY_V_U_A = <PlaneConfig.kY_V_U_A: 8>