skia_safe

Type Alias YUVAInfo

Source
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§

Source§

impl YUVAInfo

Source

pub const MAX_PLANES: usize = 4usize

Source

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).

Source

pub fn plane_config(&self) -> PlaneConfig

Source

pub fn subsampling(&self) -> Subsampling

Source

pub fn plane_subsampling_factors(&self, plane_index: usize) -> (i32, i32)

Source

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).

Source

pub fn width(&self) -> i32

Source

pub fn height(&self) -> i32

Source

pub fn yuv_color_space(&self) -> YUVColorSpace

Source

pub fn siting_xy(&self) -> (Siting, Siting)

Source

pub fn origin(&self) -> EncodedOrigin

Source

pub fn origin_matrix(&self) -> Matrix

Source

pub fn has_alpha(&self) -> bool

Source

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)].

Source

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.

Source

pub fn num_planes(&self) -> usize

Source

pub fn num_channels_in_plane(&self, i: usize) -> Option<usize>

Source

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.

Source

pub fn with_dimensions(&self, dimensions: impl Into<ISize>) -> Option<Self>

Returns a YUVAInfo that is identical to this one but with the passed dimensions. If the passed dimensions is empty then the result will be None.

Trait Implementations§

Source§

impl Debug for YUVAInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for YUVAInfo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Send for YUVAInfo

Source§

impl Sync for YUVAInfo