pub trait Sample:
Copy
+ Clone
+ Default
+ Into<i32>
+ Debug
+ Send
+ Sync
+ 'static {
const MAX_VAL_DEFAULT: i32;
const BYTES: usize;
// Required methods
fn from_i32_clamped(val: i32, max_val: i32) -> Self;
fn read_le(data: &[u8], offset: usize) -> Self;
fn write_le(data: &mut [u8], offset: usize, val: Self);
}Expand description
Trait abstracting a pixel sample type for JPEG-LS encoding/decoding.
Required Associated Constants§
Sourceconst MAX_VAL_DEFAULT: i32
const MAX_VAL_DEFAULT: i32
The maximum sample value (e.g. 255 for 8-bit, 65535 for 16-bit).
Required Methods§
Sourcefn from_i32_clamped(val: i32, max_val: i32) -> Self
fn from_i32_clamped(val: i32, max_val: i32) -> Self
Convert from an i32, clamping to [0, max_val].
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.