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§

Encoder
The JPEG encoder

Enums§

ColorType
Color types for input images
Density
Density settings
EncodingError
The error type for encoding
JpegColorType
Color types used in encoding
QuantizationTableType
Quantization table used for encoding
SamplingFactor
Sampling factors for chroma subsampling

Traits§

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

Functions§

cmyk_to_ycck
Conversion from CMYK to YCCK (YCbCrK)
rgb_to_ycbcr
Conversion from RGB to YCbCr