Skip to main content

Sample

Trait Sample 

Source
pub trait Sample:
    Sealed
    + Copy
    + Default
    + Ord
    + Debug
    + 'static { }
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. The storage width is available as size_of::<Self>(); a stream’s coded bit depth (e.g. 10 or 12) is a separate codec concern carried elsewhere (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§