Crate kodak

Source
Expand description

Kodak is a crate for image creation and manipulation. It aims to be easy to use, fast and well-documented.

Kodak makes use of chaining API methods, like seen in functional programming languages. A typical piece of Kodak code might look like this:

// Add a white border around an image.
extern crate kodak;
use kodak::*;

let border_width = 16;

let src_img = Image::load_png("assets/olle_voader.png").unwrap();
let new_img = Image::blank(src_img.get_dimensions().expand(2 * border_width))
    .fill(Colour::WHITE)
    .overlay(src_img, Loc { x: border_width, y: border_width });
new_img.save_png("assets/olle_koader.png");

Structs§

Colour
A struct to represent colours
Dim
This struct is used to indicate dimensions of an image.
Image
The Image struct is at the heart of Kodak. You’ll be using functions on this 95% of the time.
Loc
This struct is used to indicate locations on an image.
Region
This struct is used to indicate a region, specified by a top-left Loc and a Dim.