pub trait TiffWriteSample:
TiffSample
+ Copy
+ Send
+ Sync {
const SAMPLE_FORMAT: u16;
const BITS_PER_SAMPLE: u16;
const BYTES_PER_SAMPLE: usize;
// Required methods
fn encode_slice(samples: &[Self], byte_order: ByteOrder) -> Vec<u8> ⓘ;
fn lerc_encode_block(
samples: &[Self],
width: u32,
height: u32,
depth: u32,
max_z_error: f64,
index: usize,
) -> Result<Vec<u8>>;
}Expand description
Types that can be written as TIFF samples.
Required Associated Constants§
Sourceconst SAMPLE_FORMAT: u16
const SAMPLE_FORMAT: u16
TIFF SampleFormat code (1=uint, 2=int, 3=float).
Sourceconst BITS_PER_SAMPLE: u16
const BITS_PER_SAMPLE: u16
TIFF BitsPerSample value.
Sourceconst BYTES_PER_SAMPLE: usize
const BYTES_PER_SAMPLE: usize
Bytes per sample.
Required Methods§
Sourcefn encode_slice(samples: &[Self], byte_order: ByteOrder) -> Vec<u8> ⓘ
fn encode_slice(samples: &[Self], byte_order: ByteOrder) -> Vec<u8> ⓘ
Encode a slice of samples into file-order bytes.
Sourcefn lerc_encode_block(
samples: &[Self],
width: u32,
height: u32,
depth: u32,
max_z_error: f64,
index: usize,
) -> Result<Vec<u8>>
fn lerc_encode_block( samples: &[Self], width: u32, height: u32, depth: u32, max_z_error: f64, index: usize, ) -> Result<Vec<u8>>
Encode a block of samples as a LERC2 blob.
For LERC-compatible types (i8, u8, i16, u16, i32, u32, f32, f64) this
delegates to the lerc-writer crate. For types not supported by LERC
(u64, i64), this returns an error.
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.