skia_safe

Type Alias YUVAPixmaps

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

Source§

impl YUVAPixmaps

Source

pub const MAX_PLANES: usize = 4usize

Source

pub fn recommended_rgba_color_type(dt: DataType) -> ColorType

Source

pub fn allocate(info: &YUVAPixmapInfo) -> Option<Self>

Allocate space for pixmaps’ pixels in the YUVAPixmaps.

Source

pub fn from_data(info: &YUVAPixmapInfo, data: impl Into<Data>) -> Option<Self>

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

Source

pub unsafe fn from_external_memory( info: &YUVAPixmapInfo, memory: *mut c_void, ) -> Option<Self>

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.

Source

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

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

Source

pub fn yuva_info(&self) -> &YUVAInfo

Source

pub fn data_type(&self) -> DataType

Source

pub fn pixmaps_info(&self) -> YUVAPixmapInfo

Source

pub fn num_planes(&self) -> usize

Number of pixmap planes.

Source

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

Access the Pixmap planes.

Source

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

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

Trait Implementations§

Source§

impl Debug for YUVAPixmaps

Source§

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

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

impl Send for YUVAPixmaps

Source§

impl Sync for YUVAPixmaps