tinyppm
Simple .ppm loader written in Rust.
This is more of a toy project, I have written, to be able to easy reuse it for some of my experiments with 2d graphhics in Rust.
Usage
- Add
tinyppmto yourCargo.toml - Call
get_image_data:
extern crate tinyppm;
Details:
tinyppm supports only 'raw ppm' format (the most popular format of ppm. More details: ppm format specification ).
Another restriction that is important is that at them moment tinyppm supports reading only truecolor (24bpp - 3 color channels, 8b per channel) images. After the image is read it is converted to RGB+A format (32bpp) so that it is ready to be pushed directly to framebuffer.
Additional examples:
If you want to check how it works, please have a look at ppm_viewer which is simple image viewer written in Rust: https://github.com/MaciekTalaska/2d_effects/tree/master/ppm_viewer
License
This code is released under the MIT license.