libqoi 0.3.2

A basic QOI encoder/decoder in rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use libqoi::encode_qoi;
use std::io::Read;
use std::fs;

fn main() {
    let (h, w) = (512, 512);
    // Generate some image data to encode
    let mut img: Vec<u8> = vec![0; h*w*4];
    // Do it.
    let file = encode_qoi(&img, 512, 512, 4, 0).unwrap();
    println!("Encoded {} pixels into {} bytes", img.len()/4, file.len())
}