vips 0.2.0

Rust bindings for libvips: fast, low-memory image processing with a safe, ergonomic API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use vips::*;

fn main() {
    let mask = black(2, 2).unwrap();
    let output = {
        let pixels = vec![42; 4];
        let branch = VipsImage::from_memory_reference(
            &pixels, 2, 2, 1, VipsBandFormat::VIPS_FORMAT_UCHAR,
        ).unwrap();
        mask.ifthenelse(&branch, &mask).unwrap()
    };
    let _ = output.write_to_memory();
}