Closed tl8roy closed 7 years ago
Good idea. I'll add in some additional functionality to the image generator so that it may return an image::ImageBuffer
object.
I've added this in as an optional method on the image generator, which returns an image::ImageBuffer
instead of a Vec<u8>
.
Usage will be something along the lines of this:
let itf = TF::interleaved("98766543561".to_owned()).unwrap();
let img = Image::ImageBuffer {
height: 130,
xdim: 1,
rotation: Rotation::Zero,
};
let generated = img.generate_buffer(&itf.encode()[..]).unwrap();
This is staged for the 0.8.0 release. I just need to add some more tests and update the documentation.
I'll close this now. Open it back up if you have any more comments. Thanks!
Cool. I will definitely have a play with this.
Ok, I've published version 0.8.0 to crates.io.
I've updated the README with examples on generating a barcode to an image buffer. I've also allowed for setting background/foreground/opacity in the native image generators.
Thanks!
It would be useful to be able to output the barcode to a image::RgbImage variable.
I assume that this is quite easy to do, but it would be easier to work out if there is an example that shows the operation.