Enum turbojpeg::Subsamp [−][src]
#[repr(u32)] pub enum Subsamp { None, Sub2x1, Sub2x2, Gray, Sub1x2, Sub4x1, }
Chrominance subsampling options.
When pixels are converted from RGB to YCbCr or from CMYK to YCCK as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity (the human eye is more sensitive to small changes in brightness than to small changes in color). This is called “chrominance subsampling”.
Variants
No chrominance subsampling (4:4:4);
The JPEG or YUV image will contain one chrominance component for every pixel in the source image.
2x1 chrominance subsampling (4:2:2).
The JPEG or YUV image will contain one chrominance component for every 2x1 block of pixels in the source image.
2x2 chrominance subsampling (4:2:0).
The JPEG or YUV image will contain one chrominance component for every 2x2 block of pixels in the source image.
Grayscale.
The JPEG or YUV image will contain no chrominance components.
1x2 chrominance subsampling (4:4:0).
The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.
Note
4:4:0 subsampling is not fully accelerated in libjpeg-turbo.
4x1 chrominance subsampling (4:1:1).
The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features.
Note
4:1:1 subsampling is not fully accelerated in libjpeg-turbo.
Implementations
Trait Implementations
impl PartialOrd<Subsamp> for Subsamp
[src]
impl PartialOrd<Subsamp> for Subsamp
[src]impl StructuralEq for Subsamp
[src]
impl StructuralEq for Subsamp
[src]impl StructuralPartialEq for Subsamp
[src]
impl StructuralPartialEq for Subsamp
[src]Auto Trait Implementations
impl RefUnwindSafe for Subsamp
impl RefUnwindSafe for Subsamp
impl UnwindSafe for Subsamp
impl UnwindSafe for Subsamp