Skip to main content

Sample

Trait Sample 

Source
pub trait Sample:
    Copy
    + Default
    + PartialEq
    + Send
    + Sync {
    // Required methods
    fn depth(coded: u8) -> u8;
    fn from_u16(value: u16) -> Self;
    fn to_u16(self) -> u16;
}
Expand description

A sample of a decoded image: u16 keeps the coded bit depth, u8 takes half the memory.

Required Methods§

Source

fn depth(coded: u8) -> u8

Bit depth of an image of these samples, for a picture coded on coded bits.

Source

fn from_u16(value: u16) -> Self

A value that fits the depth given by Sample::depth.

Source

fn to_u16(self) -> u16

The value of this sample.

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§

fn depth(_coded: u8) -> u8

Source§

fn from_u16(value: u16) -> Self

Source§

fn to_u16(self) -> u16

Source§

impl Sample for u16

Source§

fn depth(coded: u8) -> u8

Source§

fn from_u16(value: u16) -> Self

Source§

fn to_u16(self) -> u16

Implementors§