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
impl YUVAPixmaps
pub const MAX_PLANES: usize = 4usize
pub fn recommended_rgba_color_type(dt: DataType) -> ColorType
Sourcepub fn allocate(info: &YUVAPixmapInfo) -> Option<Self>
pub fn allocate(info: &YUVAPixmapInfo) -> Option<Self>
Allocate space for pixmaps’ pixels in the YUVAPixmaps.
Sourcepub fn from_data(info: &YUVAPixmapInfo, data: impl Into<Data>) -> Option<Self>
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.
Sourcepub unsafe fn from_external_memory(
info: &YUVAPixmapInfo,
memory: *mut c_void,
) -> Option<Self>
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.
Sourcepub unsafe fn from_external_pixmaps(
info: &YUVAInfo,
pixmaps: &[Pixmap<'_>; 4],
) -> Option<Self>
pub unsafe fn from_external_pixmaps( info: &YUVAInfo, pixmaps: &[Pixmap<'_>; 4], ) -> Option<Self>
Wraps existing Pixmap
s. 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) -> &YUVAInfo
pub fn data_type(&self) -> DataType
pub fn pixmaps_info(&self) -> YUVAPixmapInfo
Sourcepub fn num_planes(&self) -> usize
pub fn num_planes(&self) -> usize
Number of pixmap planes.