I'm using Piston's image
crate, with this code:
use image::{Rgb, ImageBuffer, Pixel};
let image = Vec::<Rgb<u8>>::new();
let image_buffer = ImageBuffer::<Rgb<u8>, Vec<Rgb<u8>>>::from_vec(
width, height
image,
).unwrap();
However I get this error:
error[E0599]: no function or associated item named `from_vec` found for type `image::ImageBuffer<image::Rgb<u8>, std::vec::Vec<image::Rgb<u8>>>` in the current scope
--> src/main.rs:348:21
|
348 | let image_buffer = ImageBuffer::<Rgb<u8>, Vec<Rgb<u8>>>::from_vec(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `image::ImageBuffer<image::Rgb<u8>, std::vec::Vec<image::Rgb<u8>>>`
I can't work out why. It's clearly in the documentation, and the types seem right as far as I can tell.