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>

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

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

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>

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

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

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.

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

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

§

impl<N> AsRef<Handle<N>> for Handle<N>
where N: NativeDrop,

§

fn as_ref(&self) -> &Handle<N>

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<N> Clone for Handle<N>
where N: NativeDrop + NativeClone,

§

fn clone(&self) -> Handle<N>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Handle<SkYUVAInfo>

§

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

Formats the value using the given formatter. Read more
§

impl Default for Handle<SkYUVAInfo>

§

fn default() -> Handle<SkYUVAInfo>

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

impl<N> Drop for Handle<N>
where N: NativeDrop,

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl<N> Hash for Handle<N>
where N: NativeDrop + NativeHash,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<N> PartialEq for Handle<N>
where N: NativeDrop + NativePartialEq,

§

fn eq(&self, rhs: &Handle<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<N> RefWrapper<N> for Handle<N>
where N: NativeDrop,

§

fn wrap_ref(native: &N) -> &Handle<N>

§

fn wrap_mut(native: &mut N) -> &mut Handle<N>

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

§

impl<N> ValueWrapper<N> for Handle<N>
where N: NativeDrop,

§

fn wrap(native: N) -> Handle<N>
where N: NativeDrop,

§

fn unwrap(self) -> N

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

§

impl Send for Handle<SkYUVAInfo>

§

impl Sync for Handle<SkYUVAInfo>