Type Alias YUVAPixmapInfo

pub type YUVAPixmapInfo = Handle<SkYUVAPixmapInfo>;
Expand description

YUVAInfo combined with per-plane ColorTypes and row bytes. Fully specifies the Pixmap`s for a YUVA image without the actual pixel memory and data.

Aliased Type§

struct YUVAPixmapInfo(/* private fields */);

Implementations

§

impl Handle<SkYUVAPixmapInfo>

pub const MAX_PLANES: usize = 4usize

pub const DATA_TYPE_CNT: usize = 3usize

pub fn new( info: &Handle<SkYUVAInfo>, color_types: &[ColorType], row_bytes: Option<&[usize]>, ) -> Option<Handle<SkYUVAPixmapInfo>>

Initializes the YUVAPixmapInfo from a YUVAInfo with per-plane color types and row bytes. This will return None if the colorTypes aren’t compatible with the YUVAInfo or if a rowBytes entry is not valid for the plane dimensions and color type. Color type and row byte values beyond the number of planes in YUVAInfo are ignored. All ColorTypes must have the same DataType or this will return None.

If rowBytes is None then bpp*width is assumed for each plane.

pub fn from_data_type( info: &Handle<SkYUVAInfo>, data_type: SkYUVAPixmapInfo_DataType, row_bytes: Option<&[usize]>, ) -> Option<Handle<SkYUVAPixmapInfo>>

Like above but uses yuva_pixmap_info::default_color_type_for_data_type to determine each plane’s ColorType. If rowBytes is None then bpp*width is assumed for each plane.

pub fn yuva_info(&self) -> &Handle<SkYUVAInfo>

pub fn yuv_color_space(&self) -> SkYUVColorSpace

pub fn num_planes(&self) -> usize

The number of Pixmap planes.

pub fn data_type(&self) -> SkYUVAPixmapInfo_DataType

The per-YUV[A] channel data type.

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

Row bytes for the ith plane. Returns None if i >= Self::num_planes() or this YUVAPixmapInfo is invalid.

pub fn row_bytes_iter(&self) -> impl Iterator<Item = usize> + use<'_>

Row bytes for all planes.

pub fn plane_info(&self, i: usize) -> Option<&Handle<SkImageInfo>>

Image info for the ith plane, or None if i >= Self::num_planes()

pub fn plane_infos(&self) -> impl Iterator<Item = &Handle<SkImageInfo>>

An iterator of all planes’ image infos.

pub fn compute_total_bytes(&self, plane_sizes: Option<&mut [usize; 4]>) -> usize

Determine size to allocate for all planes. Optionally retrieves the per-plane sizes in planeSizes if not None. If total size overflows will return SIZE_MAX and set all plane_sizes to SIZE_MAX.

pub unsafe fn init_pixmaps_from_single_allocation( &self, memory: *mut c_void, ) -> Option<[Pixmap<'_>; 4]>

Takes an allocation that is assumed to be at least [compute_total_bytes(&self)] in size and configures the first [numPlanes(&self)] entries in pixmaps array to point into that memory. The remaining entries of pixmaps are default initialized. Returns None if this YUVAPixmapInfo not valid.

pub fn is_supported( &self, data_types: &Handle<SkYUVAPixmapInfo_SupportedDataTypes>, ) -> bool

Is this valid and does it use color types allowed by the passed SupportedDataTypes?

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

§

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

Formats the value using the given formatter. 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<SkYUVAPixmapInfo>

§

impl Sync for Handle<SkYUVAPixmapInfo>