Crate jpeg_encoder

source ·
Expand description

JPEG encoder

Using the encoder

use jpeg_encoder::{Encoder, ColorType};

// An array with 4 pixels in RGB format.
let data = [
    255,0,0,
    0,255,0,
    0,0,255,
    255,255,255,
];

// Create new encoder that writes to a file with maximum quality (100)
let mut encoder = Encoder::new_file("some.jpeg", 100)?;

// Encode the data with dimension 2x2
encoder.encode(&data, 2, 2, ColorType::Rgb)?;

Structs

Enums

Traits

  • Buffer used as input value for image encoding
  • A no_std alternative for std::io::Write

Functions