MCPcopy Create free account
hub / github.com/ImageOptim/libimagequant / liq_image_create_rgba_rows_impl

Function liq_image_create_rgba_rows_impl

src/capi.rs:20–27  ·  view source on GitHub ↗
(attr: &Attributes, rows: &'rows [*const RGBA], width: u32, height: u32, gamma: f64)

Source from the content-addressed store, hash-verified

18
19#[must_use]
20pub unsafe fn liq_image_create_rgba_rows_impl<'rows>(attr: &Attributes, rows: &'rows [*const RGBA], width: u32, height: u32, gamma: f64) -> Option<crate::image::Image<'rows>> {
21 let rows = SeaCow::borrowed(&*(rows as *const [*const rgb::Rgba<u8>] as *const [Pointer<rgb::Rgba<u8>>]));
22 let rows_slice = rows.as_slice();
23 if rows_slice.iter().any(|r| r.0.is_null()) {
24 return None;
25 }
26 crate::image::Image::new_internal(attr, crate::rows::PixelsSource::Pixels { rows, pixels: None }, width, height, gamma).ok()
27}
28
29#[must_use]
30pub unsafe fn liq_image_create_rgba_bitmap_impl<'rows>(attr: &Attributes, rows: Box<[*const RGBA]>, width: u32, height: u32, gamma: f64) -> Option<crate::image::Image<'rows>> {

Callers 1

Calls 1

as_sliceMethod · 0.45

Tested by

no test coverage detected