pub struct VtkCompression;Expand description
Provides simple run-length encoding for f64 data (for illustration).
Implementations§
Source§impl VtkCompression
impl VtkCompression
Sourcepub fn rle_encode_f64(data: &[f64]) -> Vec<(f64, usize)>
pub fn rle_encode_f64(data: &[f64]) -> Vec<(f64, usize)>
Run-length encode a slice of f64 values.
Consecutive equal values are stored as (value, count) pairs.
Sourcepub fn rle_decode_f64(runs: &[(f64, usize)]) -> Vec<f64>
pub fn rle_decode_f64(runs: &[(f64, usize)]) -> Vec<f64>
Decode RLE-encoded f64 data back to a flat vector.
Sourcepub fn compression_ratio(original_len: usize, n_runs: usize) -> f64
pub fn compression_ratio(original_len: usize, n_runs: usize) -> f64
Compute compression ratio: original_len / encoded_pairs.
Auto Trait Implementations§
impl Freeze for VtkCompression
impl RefUnwindSafe for VtkCompression
impl Send for VtkCompression
impl Sync for VtkCompression
impl Unpin for VtkCompression
impl UnsafeUnpin for VtkCompression
impl UnwindSafe for VtkCompression
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.