Function skia_safe::images::raster_from_data
source · pub fn raster_from_data(
info: &ImageInfo,
pixels: impl Into<Data>,
row_bytes: usize
) -> Option<Image>Expand description
Creates CPU-backed Image from pixel data described by info.
The pixels data will not be copied.
Image is returned if ImageInfo is valid. Valid ImageInfo parameters include:
dimensions are greater than zero;
each dimension fits in 29 bits;
ColorType and AlphaType are valid, and ColorType is not ColorType::Unknown;
row_bytes are large enough to hold one row of pixels;
pixels is not None, and contains enough data for Image.
info- contains width, height,AlphaType,ColorType,ColorSpacepixels- address or pixel storagerow_bytes- size of pixel row or larger Returns:Imagesharing pixels, orNone