Enum ravif::AlphaColorMode
source · pub enum AlphaColorMode {
UnassociatedDirty,
UnassociatedClean,
Premultiplied,
}
Expand description
Handling of color channels in transparent images. For Encoder::with_alpha_color_mode
Variants§
UnassociatedDirty
Use unassociated alpha channel and leave color channels unchanged, even if there’s redundant color data in transparent areas.
UnassociatedClean
Use unassociated alpha channel, but set color channels of transparent areas to a solid color to eliminate invisible data and improve compression.
Premultiplied
Store color channels of transparent images in premultiplied form. This requires support for premultiplied alpha in AVIF decoders.
It may reduce file sizes due to clearing of fully-transparent pixels, but may also increase file sizes due to creation of new edges in the color channels.
Note that this is only internal detail for the AVIF file.
It does not change meaning of RGBA
in this library — it’s always unassociated.
Trait Implementations§
source§impl Clone for AlphaColorMode
impl Clone for AlphaColorMode
source§fn clone(&self) -> AlphaColorMode
fn clone(&self) -> AlphaColorMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AlphaColorMode
impl Debug for AlphaColorMode
source§impl PartialEq for AlphaColorMode
impl PartialEq for AlphaColorMode
source§fn eq(&self, other: &AlphaColorMode) -> bool
fn eq(&self, other: &AlphaColorMode) -> bool
self
and other
values to be equal, and is used
by ==
.