Skip to main content

Sample

Trait Sample 

Source
pub trait Sample:
    Sealed
    + Copy
    + Default
    + Ord
    + Debug
    + 'static {
    const STORAGE_BITS: u32;
}
Expand description

A pixel-sample storage primitive: u8 (8-bit) or u16 (10/12/16-bit, high-bit-depth).

Sealed — only u8 and u16 implement it. The supertrait bounds are chosen so that P::Sample transitively gives buffer types everything they need (copy, zero-fill via Default, ordering) without callers repeating where P::Sample: … clauses.

Required Associated Constants§

Source

const STORAGE_BITS: u32

Bits the primitive stores (8 or 16). Distinct from a stream’s coded bit depth (e.g. 10 or 12), which is a codec concern carried separately (see gamut_color::BitDepth).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Sample for u8

Source§

impl Sample for u16

Implementors§