pub trait Sample:
Copy
+ Default
+ Sealed
+ 'static {
const DATA_TYPE: DataType;
const IS_INTEGER: bool;
// Required methods
fn from_f64(value: f64) -> Self;
fn to_f64(self) -> f64;
fn read_le(bytes: &[u8]) -> Result<Self>;
fn write_le(self, out: &mut Vec<u8>);
fn into_pixel_data(values: Vec<Self>) -> PixelData;
// Provided method
fn read_vec(bytes: &[u8]) -> Result<Vec<Self>> { ... }
}Expand description
Primitive sample types supported by LERC.
This trait is sealed and implemented for i8, u8, i16, u16, i32,
u32, f32, and f64.
Required Associated Constants§
Sourceconst IS_INTEGER: bool
const IS_INTEGER: bool
Whether this sample is an integer type.
Required Methods§
Sourcefn into_pixel_data(values: Vec<Self>) -> PixelData
fn into_pixel_data(values: Vec<Self>) -> PixelData
Wraps a homogeneous buffer in PixelData.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".