#[non_exhaustive]pub enum DepthPolicy {
Forbid,
Round,
Truncate,
OrderedDither,
}Expand description
Policy when destination has lower numeric precision than source (e.g. F32 → U8, U16 → U8).
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 any precision reduction (ConvertError::DepthReductionForbidden).
Round
Round to nearest integer (floor(v * max + 0.5)). Default for display/lossy output.
Truncate
Truncate toward zero (floor(v * max) / high-byte drop for U16 → U8).
OrderedDither
Ordered 4×4 Bayer dithering before quantization (reduces banding in 8-bit gradients).
Trait Implementations§
Source§impl Clone for DepthPolicy
impl Clone for DepthPolicy
Source§fn clone(&self) -> DepthPolicy
fn clone(&self) -> DepthPolicy
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 DepthPolicy
Source§impl Debug for DepthPolicy
impl Debug for DepthPolicy
Source§impl Default for DepthPolicy
impl Default for DepthPolicy
Source§fn default() -> DepthPolicy
fn default() -> DepthPolicy
Returns the “default value” for a type. Read more
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