pub type YUVAPixmapInfo = Handle<SkYUVAPixmapInfo>;
Expand description
Aliased Type§
struct YUVAPixmapInfo(/* private fields */);
Implementations§
Source§impl YUVAPixmapInfo
impl YUVAPixmapInfo
pub const MAX_PLANES: usize = 4usize
pub const DATA_TYPE_CNT: usize = 3usize
Sourcepub fn new(
info: &YUVAInfo,
color_types: &[ColorType],
row_bytes: Option<&[usize]>,
) -> Option<Self>
pub fn new( info: &YUVAInfo, color_types: &[ColorType], row_bytes: Option<&[usize]>, ) -> Option<Self>
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.
Sourcepub fn from_data_type(
info: &YUVAInfo,
data_type: DataType,
row_bytes: Option<&[usize]>,
) -> Option<Self>
pub fn from_data_type( info: &YUVAInfo, data_type: DataType, row_bytes: Option<&[usize]>, ) -> Option<Self>
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) -> &YUVAInfo
pub fn yuv_color_space(&self) -> YUVColorSpace
Sourcepub fn num_planes(&self) -> usize
pub fn num_planes(&self) -> usize
The number of Pixmap planes.
Sourcepub fn row_bytes(&self, i: usize) -> Option<usize>
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.
Sourcepub fn row_bytes_iter(&self) -> impl Iterator<Item = usize> + use<'_>
pub fn row_bytes_iter(&self) -> impl Iterator<Item = usize> + use<'_>
Row bytes for all planes.
Sourcepub fn plane_info(&self, i: usize) -> Option<&ImageInfo>
pub fn plane_info(&self, i: usize) -> Option<&ImageInfo>
Image info for the ith plane, or None
if i
>= Self::num_planes()
Sourcepub fn plane_infos(&self) -> impl Iterator<Item = &ImageInfo>
pub fn plane_infos(&self) -> impl Iterator<Item = &ImageInfo>
An iterator of all planes’ image infos.
Sourcepub fn compute_total_bytes(&self, plane_sizes: Option<&mut [usize; 4]>) -> usize
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.
Sourcepub unsafe fn init_pixmaps_from_single_allocation(
&self,
memory: *mut c_void,
) -> Option<[Pixmap<'_>; 4]>
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.
Sourcepub fn is_supported(&self, data_types: &SupportedDataTypes) -> bool
pub fn is_supported(&self, data_types: &SupportedDataTypes) -> bool
Is this valid and does it use color types allowed by the passed SupportedDataTypes?