#[non_exhaustive]pub enum AlphaPolicy {
Forbid,
DiscardIfOpaque,
DiscardUnchecked,
CompositeOnto(Color),
}Expand description
Policy when destination drops an alpha channel (RGBA → RGB, GrayA → Gray).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Forbid
Refuse dropping any alpha channel unless destination also carries alpha (ConvertError::AlphaLossForbidden).
DiscardIfOpaque
Allow dropping alpha only when proven opaque (AlphaMode::Opaque or SampleClaims::exact.all_opaque).
DiscardUnchecked
Unconditionally drop the alpha channel without compositing.
CompositeOnto(Color)
Composite transparent pixels over an explicit linear-light matte Color before dropping alpha.
Trait Implementations§
Source§impl Clone for AlphaPolicy
impl Clone for AlphaPolicy
Source§fn clone(&self) -> AlphaPolicy
fn clone(&self) -> AlphaPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AlphaPolicy
Source§impl Debug for AlphaPolicy
impl Debug for AlphaPolicy
Source§impl Default for AlphaPolicy
impl Default for AlphaPolicy
Source§fn default() -> AlphaPolicy
fn default() -> AlphaPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for AlphaPolicy
impl PartialEq for AlphaPolicy
impl StructuralPartialEq for AlphaPolicy
Auto Trait Implementations§
impl Freeze for AlphaPolicy
impl RefUnwindSafe for AlphaPolicy
impl Send for AlphaPolicy
impl Sync for AlphaPolicy
impl Unpin for AlphaPolicy
impl UnsafeUnpin for AlphaPolicy
impl UnwindSafe for AlphaPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more