#[non_exhaustive]#[repr(u32)]pub enum DepthPolicy {
Reject = 0,
Rescale = 1,
}Expand description
What to do when the target’s samples are narrower than the source’s.
Covers any reduction in sample precision: 16-bit samples into an 8-bit layout, and reducing a
grey or colour image to Bilevel. Widening is lossless and always permitted.
Discriminants are explicit and permanent — they are C ABI values; new variants append.
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.
Reject = 0
Refuse the conversion with Error::Unsupported. The default.
Rescale = 1
Rescale to the narrower range, rounding to nearest.
Narrowing 16-bit to 8-bit maps the full range onto the full range (65535 → 255), the exact
inverse of the widening PNG specifies in §13.12 — not a truncating shift, which would make
white slightly grey. A reduction to bilevel compares luma against
ConvertPolicy::threshold.
Trait Implementations§
Source§impl Clone for DepthPolicy
impl Clone for DepthPolicy
impl Copy for DepthPolicy
Source§impl Debug for DepthPolicy
impl Debug for DepthPolicy
Source§impl Default for DepthPolicy
impl Default for DepthPolicy
impl Eq for DepthPolicy
Source§impl Hash for DepthPolicy
impl Hash for DepthPolicy
Source§impl PartialEq for DepthPolicy
impl PartialEq for DepthPolicy
impl StructuralPartialEq for DepthPolicy
Auto Trait Implementations§
impl Freeze for DepthPolicy
impl RefUnwindSafe for DepthPolicy
impl Send for DepthPolicy
impl Sync for DepthPolicy
impl Unpin for DepthPolicy
impl UnsafeUnpin for DepthPolicy
impl UnwindSafe for DepthPolicy
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