pub type YUVAInfo = Handle<SkYUVAInfo>;
Expand description
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.
Implementations§
source§impl YUVAInfo
impl YUVAInfo
pub const MAX_PLANES: usize = 4usize
sourcepub fn new(
dimensions: impl Into<ISize>,
config: PlaneConfig,
subsampling: Subsampling,
color_space: YUVColorSpace,
origin: impl Into<Option<EncodedOrigin>>,
siting_xy: impl Into<Option<(Siting, Siting)>>
) -> Option<Self>
pub fn new( dimensions: impl Into<ISize>, config: PlaneConfig, subsampling: Subsampling, color_space: YUVColorSpace, origin: impl Into<Option<EncodedOrigin>>, siting_xy: impl Into<Option<(Siting, Siting)>> ) -> Option<Self>
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
).
pub fn plane_config(&self) -> PlaneConfig
pub fn subsampling(&self) -> Subsampling
pub fn plane_subsampling_factors(&self, plane_index: usize) -> (i32, i32)
sourcepub fn dimensions(&self) -> ISize
pub fn dimensions(&self) -> ISize
Dimensions of the full resolution image (after planes have been oriented to how the image is displayed as indicated by fOrigin).
pub fn width(&self) -> i32
pub fn height(&self) -> i32
pub fn yuv_color_space(&self) -> YUVColorSpace
pub fn siting_xy(&self) -> (Siting, Siting)
pub fn origin(&self) -> EncodedOrigin
pub fn origin_matrix(&self) -> Matrix
pub fn has_alpha(&self) -> bool
sourcepub fn plane_dimensions(&self) -> Vec<ISize>
pub fn plane_dimensions(&self) -> Vec<ISize>
Returns the dimensions for each plane. Dimensions are as stored in memory, before transformation to image display space as indicated by [origin(&self)].
sourcepub fn compute_total_bytes(
&self,
row_bytes: &[usize; 4],
plane_sizes: Option<&mut [usize; 4]>
) -> usize
pub fn compute_total_bytes( &self, row_bytes: &[usize; 4], plane_sizes: Option<&mut [usize; 4]> ) -> usize
Given a per-plane row bytes, determine size to allocate for all planes. Optionally retrieves
the per-plane byte sizes in planeSizes if not None
. If total size overflows will return
SIZE_MAX
and set all planeSizes to SIZE_MAX
.
pub fn num_planes(&self) -> usize
pub fn num_channels_in_plane(&self, i: usize) -> Option<usize>
sourcepub fn with_subsampling(&self, subsampling: Subsampling) -> Option<Self>
pub fn with_subsampling(&self, subsampling: Subsampling) -> Option<Self>
Returns a YUVAInfo that is identical to this one but with the passed Subsampling. If the
passed Subsampling is not Subsampling::S444 and this info’s PlaneConfig is not
compatible with chroma subsampling (because Y is in the same plane as UV) then the result
will be None
.