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
getting the same error when dealing with Video from ffmeg_the_third and Frame from the ffmpeg_frame_grabber
which is probably because ffmpeg returns raw rgb images (no format header), DynamicImage has a method to convert raw images to a specific format,
@xanderjakeq@yosefahab I wrote this function to do something very similar. Maybe it will help you. The trick is to use the PhotonImage::new() constructor with the raw pixels.
/// Convert an `RgbImage` (`image` crate) to a `PhotonImage` (`photon-rs` crate)pubfnrgb_to_photon(rgb:&RgbImage) -> PhotonImage{let rgb24 = rgb.to_vec();let rgb32 = rgb24_to_rgba32(rgb24);PhotonImage::new(rgb32, rgb.width(), rgb.height())}
I'm not sure where you got rgb24_to_rgb32() but this adds too much overhead (bytes -> image -> rgb -> rgb -> photon), it would be much better if we figure out why its not working.
I have ImageData from the
arboard
crate to get an image from the clipboard. I want to do something with that image withphoton
and save it.I'm trying to use it like this:
But I get this error:
Not sure what I'm doing wrong..
The text was updated successfully, but these errors were encountered: