Type Alias YUVAInfo
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.
Aliased Type§
struct YUVAInfo(/* private fields */);
Implementations
§impl Handle<SkYUVAInfo>
impl Handle<SkYUVAInfo>
pub const MAX_PLANES: usize = 4usize
pub fn new(
dimensions: impl Into<ISize>,
config: SkYUVAInfo_PlaneConfig,
subsampling: Subsampling,
color_space: SkYUVColorSpace,
origin: impl Into<Option<EncodedOrigin>>,
siting_xy: impl Into<Option<(SkYUVAInfo_Siting, SkYUVAInfo_Siting)>>,
) -> Option<Handle<SkYUVAInfo>>
pub fn new( dimensions: impl Into<ISize>, config: SkYUVAInfo_PlaneConfig, subsampling: Subsampling, color_space: SkYUVColorSpace, origin: impl Into<Option<EncodedOrigin>>, siting_xy: impl Into<Option<(SkYUVAInfo_Siting, SkYUVAInfo_Siting)>>, ) -> Option<Handle<SkYUVAInfo>>
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) -> SkYUVAInfo_PlaneConfig
pub fn subsampling(&self) -> Subsampling
pub fn plane_subsampling_factors(&self, plane_index: usize) -> (i32, i32)
pub 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) -> SkYUVColorSpace
pub fn siting_xy(&self) -> (SkYUVAInfo_Siting, SkYUVAInfo_Siting)
pub fn origin(&self) -> EncodedOrigin
pub fn origin_matrix(&self) -> Matrix
pub fn has_alpha(&self) -> bool
pub 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)].
pub 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>
pub fn with_subsampling(
&self,
subsampling: Subsampling,
) -> Option<Handle<SkYUVAInfo>>
pub fn with_subsampling( &self, subsampling: Subsampling, ) -> Option<Handle<SkYUVAInfo>>
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
.