Function vizia_core::vg::image::images::raster_from_data

pub fn raster_from_data(
    info: &Handle<SkImageInfo>,
    pixels: impl Into<RCHandle<SkData>>,
    row_bytes: usize,
) -> Option<RCHandle<SkImage>>
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, ColorSpace
  • pixels - address or pixel storage
  • row_bytes - size of pixel row or larger Returns: Image sharing pixels, or None