[][src]Crate resize

Simple resampling library in pure Rust.

Examples

use resize::Pixel::RGB24;
use resize::Type::Lanczos3;
use rgb::RGB8;

// Downscale by 2x.
let (w1, h1) = (640, 480);
let (w2, h2) = (320, 240);
// Don't forget to fill `src` with image data (RGB24).
let src = vec![0;w1*h1*3];
// Destination buffer. Must be mutable.
let mut dst = vec![0;w2*h2*3];
// Create reusable instance.
let mut resizer = resize::new(w1, h1, w2, h2, RGB24, Lanczos3);
// Do resize without heap allocations.
// Might be executed multiple times for different `src` or `dst`.
resizer.resize(&src, &mut dst);

Modules

Pixel

Supported pixel formats.

Structs

Filter

Resampling filter.

Resizer

Resampler with preallocated buffers and coeffecients for the given dimensions and filter type.

Enums

Type

Resizing type to use.

Traits

PixelFormat

Use Pixel presets to specify pixel format.

Functions

new

Create a new resizer instance. Alias for Resizer::new.

resizeDeprecated

Use new().resize() instead.