Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
rust-bmp
Small module for reading and writing bitmap images. Currently only 24-bit RGB BMP images are supported.
Usage
The library should be available on crates.io, but updated versions of the crate might lag behind until 1.0.0 of Rust has been released.
To ensure that the crate is up to date, add it as a git dependency to Cargo.toml
in your project.
[]
= "https://github.com/sondrele/rust-bmp"
###Initializing
Initialize a new image with the new
function, by specifying width
and height
.
extern crate bmp;
use Image;
let mut img = new;
###Editing
Edit image data using the get_pixel
and set_pixel
functions.
Save an image with the save
function, by specifying the path
. The function returns
an IoResult
which indicates whether the save was successful or not.
let pixel = img.get_pixel;
img.set_pixel;
let _ = img.save;
###Opening
Open an existing image with the open
function, by specifying the path
. The function
returns a BmpResult
, that contains either a Image
or a BmpError
.
extern crate bmp;
let img = open.unwrap_or_else;
Coordinate convention
The BMP images are accessed in row-major order, where point (0, 0) is defined to be in the upper left corner of the image. Example
extern crate bmp;
use ;