-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I want to know how to decode the images. Here's what I've tried
let camera = Camera::new_default_device();
camera.start();
let Some(frame) = camera.wait_for_frame() else {
return;
}; // always blockingly waiting for next new frame
let (w, h) = frame.size_u32();
camera.stop(); // or drop it}
println!("w, h {} {}", w, h);
let data = frame.data();
let image = data.data_u8(); // use this buffer, per default in ARGB format
// for real use cases processing or displaying frames can get more complicated when trying to be most efficient
image::save_buffer(format!("image.jpeg"), image, w, h, image::ColorType::Rgba8).unwrap();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels