(attr: &Attributes, rows: &'rows [*const RGBA], width: u32, height: u32, gamma: f64)
| 18 | |
| 19 | #[must_use] |
| 20 | pub 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] |
| 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>> { |
no test coverage detected