#[non_exhaustive]pub enum AlphaPolicy {
DiscardIfOpaque,
DiscardUnchecked,
CompositeOnto {
r: u8,
g: u8,
b: u8,
},
Forbid,
}Expand description
Policy for alpha channel removal. Required when converting from a layout with alpha to one without.
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.
DiscardIfOpaque
Discard only if every pixel is fully opaque. Returns error otherwise.
DiscardUnchecked
Discard unconditionally. Caller acknowledges data loss.
CompositeOnto
Composite onto solid background (values in source range, 0–255 for U8).
Forbid
Return error rather than 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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlphaPolicy
impl Debug for AlphaPolicy
Source§impl Hash for AlphaPolicy
impl Hash for AlphaPolicy
Source§impl PartialEq for AlphaPolicy
impl PartialEq for AlphaPolicy
impl Copy for AlphaPolicy
impl Eq 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