pub struct CompressionConfig {
pub encoding: EncodingOptions,
pub compression: CompressionOption,
pub resolution: Option<f32>,
}Expand description
Controls how a PointCloud2Msg is encoded and compressed.
Use the smart constructors for common cases, or build one manually for
custom per-field resolution control via CompressionConfig::with_resolution.
§Examples
use cloudini::ros::CompressionConfig;
// 1 mm lossy + ZSTD (typical Lidar geometry)
let cfg = CompressionConfig::lossy_zstd(0.001);
// 1 cm lossy + LZ4 (real-time, slightly larger files)
let cfg = CompressionConfig::lossy_lz4(0.01);
// lossless XOR-encoding + ZSTD (preserves every float bit)
let cfg = CompressionConfig::lossless_zstd();Fields§
§encoding: EncodingOptionsField-level encoding algorithm.
compression: CompressionOptionBlock compression applied after field encoding.
resolution: Option<f32>Quantisation step for all float fields (None → copy verbatim / XOR lossless).
Implementations§
Source§impl CompressionConfig
impl CompressionConfig
Sourcepub fn lossy_zstd(resolution: f32) -> Self
pub fn lossy_zstd(resolution: f32) -> Self
Lossy float quantisation + ZSTD block compression.
resolution is the quantisation step (e.g. 0.001 for 1 mm precision).
Maximum per-component error is resolution / 2.
Sourcepub fn lossy_lz4(resolution: f32) -> Self
pub fn lossy_lz4(resolution: f32) -> Self
Lossy float quantisation + LZ4 block compression.
Faster than Self::lossy_zstd at the cost of a slightly larger output.
Sourcepub fn lossless_zstd() -> Self
pub fn lossless_zstd() -> Self
Lossless XOR encoding (Float64) + ZSTD block compression.
Every float bit is preserved exactly. Use when downstream algorithms are sensitive to floating-point rounding (e.g. ICP, odometry).
Sourcepub fn lossless_lz4() -> Self
pub fn lossless_lz4() -> Self
Lossless XOR encoding (Float64) + LZ4 block compression.
Sourcepub fn with_resolution(self, resolution: f32) -> Self
pub fn with_resolution(self, resolution: f32) -> Self
Override the quantisation resolution after construction.
Useful to start from a preset and then fine-tune:
use cloudini::ros::CompressionConfig;
let cfg = CompressionConfig::lossy_zstd(0.001).with_resolution(0.005);Trait Implementations§
Source§impl Clone for CompressionConfig
impl Clone for CompressionConfig
Source§fn clone(&self) -> CompressionConfig
fn clone(&self) -> CompressionConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompressionConfig
impl Debug for CompressionConfig
Auto Trait Implementations§
impl Freeze for CompressionConfig
impl RefUnwindSafe for CompressionConfig
impl Send for CompressionConfig
impl Sync for CompressionConfig
impl Unpin for CompressionConfig
impl UnsafeUnpin for CompressionConfig
impl UnwindSafe for CompressionConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.