Type Alias YUVAPixmaps

pub type YUVAPixmaps = Handle<SkYUVAPixmaps>;
Expand description

Helper to store Pixmap planes as described by a YUVAPixmapInfo. Can be responsible for allocating/freeing memory for pixmaps or use external memory.

Aliased Type§

struct YUVAPixmaps(/* private fields */);

Implementations

§

impl Handle<SkYUVAPixmaps>

pub const MAX_PLANES: usize = 4usize

pub fn recommended_rgba_color_type(dt: SkYUVAPixmapInfo_DataType) -> ColorType

pub fn allocate( info: &Handle<SkYUVAPixmapInfo>, ) -> Option<Handle<SkYUVAPixmaps>>

Allocate space for pixmaps’ pixels in the YUVAPixmaps.

pub fn from_data( info: &Handle<SkYUVAPixmapInfo>, data: impl Into<RCHandle<SkData>>, ) -> Option<Handle<SkYUVAPixmaps>>

Use storage in Data as backing store for pixmaps’ pixels. Data is retained by the YUVAPixmaps.

pub unsafe fn from_external_memory( info: &Handle<SkYUVAPixmapInfo>, memory: *mut c_void, ) -> Option<Handle<SkYUVAPixmaps>>

Use passed in memory as backing store for pixmaps’ pixels. Caller must ensure memory remains allocated while pixmaps are in use. There must be at least [YUVAPixmapInfo::computeTotalBytes(&self)] allocated starting at memory.

pub unsafe fn from_external_pixmaps( info: &Handle<SkYUVAInfo>, pixmaps: &[Pixmap<'_>; 4], ) -> Option<Handle<SkYUVAPixmaps>>

Wraps existing Pixmaps. The YUVAPixmaps will have no ownership of the Pixmaps’ pixel memory so the caller must ensure it remains valid. Will return None if the YUVAInfo isn’t compatible with the Pixmap array (number of planes, plane dimensions, sufficient color channels in planes, …).

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

pub fn data_type(&self) -> SkYUVAPixmapInfo_DataType

pub fn pixmaps_info(&self) -> Handle<SkYUVAPixmapInfo>

pub fn num_planes(&self) -> usize

Number of pixmap planes.

pub fn planes(&self) -> &[Pixmap<'_>]

Access the Pixmap planes.

pub fn plane(&self, i: usize) -> &Pixmap<'_>

Get the ith Pixmap plane. Pixmap will be default initialized if i >= numPlanes.

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

§

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

§

impl Sync for Handle<SkYUVAPixmaps>