You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create DynamicImage from FlatSamples, which I got from another library.
use image::GenericImage;
fn main() {
let w = 640;
let h = 480;
let bits_per_pixel = 3;
let buffer = image::FlatSamples {
samples: vec![],
layout: image::flat::SampleLayout::row_major_packed(bits_per_pixel, w, h),
color_hint: None,
};
let view = buffer.as_view::<image::Rgb<u8>>().unwrap();
let mut dyn_img = image::DynamicImage::new_rgb8(w, h);
let _ = dyn_img.copy_from(&view, 0, 0);
}
I'm trying to create DynamicImage from FlatSamples, which I got from another library.
Playground link
This is the compilation error output:
How can I create DynamicImage without an Alpha channel?
The text was updated successfully, but these errors were encountered: