(attr: &Attributes, rows: Box<[*const RGBA]>, width: u32, height: u32, gamma: f64)
| 28 | |
| 29 | #[must_use] |
| 30 | pub 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>> { |
| 31 | let rows = SeaCow::boxed(std::mem::transmute::<Box<[*const RGBA]>, Box<[Pointer<RGBA>]>>(rows)); |
| 32 | let rows_slice = rows.as_slice(); |
| 33 | if rows_slice.iter().any(|r| r.0.is_null()) { |
| 34 | return None; |
| 35 | } |
| 36 | crate::image::Image::new_internal(attr, crate::rows::PixelsSource::Pixels { rows, pixels: None }, width, height, gamma).ok() |
| 37 | } |
| 38 | |
| 39 | #[must_use] |
| 40 | pub unsafe fn liq_image_create_custom_impl<'rows>(attr: &Attributes, row_callback: Box<RowCallback<'rows>>, width: u32, height: u32, gamma: f64) -> Option<Image<'rows>> { |
no test coverage detected