Struct laz::laszip::LasZipDecompressor
source · Expand description
LasZip decompressor that decompresses points.
Supports both fixed-size and variable-size chunks.
Implementations§
source§impl<'a, R: Read + Seek + Send + 'a> LasZipDecompressor<'a, R>
impl<'a, R: Read + Seek + Send + 'a> LasZipDecompressor<'a, R>
sourcepub fn new(source: R, vlr: LazVlr) -> Result<Self>
pub fn new(source: R, vlr: LazVlr) -> Result<Self>
Creates a new instance from a data source of compressed points and the LazVlr describing the compressed data.
The created decompressor will decompress all data
sourcepub fn selective(
source: R,
vlr: LazVlr,
selection: DecompressionSelection
) -> Result<Self>
pub fn selective(
source: R,
vlr: LazVlr,
selection: DecompressionSelection
) -> Result<Self>
Creates a new decompressor, that will only decompress
fields that are selected by the selection
.
sourcepub fn decompress_one(&mut self, out: &mut [u8]) -> Result<()>
pub fn decompress_one(&mut self, out: &mut [u8]) -> Result<()>
Decompress the next point and write the uncompressed data to the out buffer.
- The buffer should have at least enough byte to store the decompressed data
- The data is written in the buffer exactly as it would have been in a LAS File in Little Endian order,
sourcepub fn decompress_many(&mut self, out: &mut [u8]) -> Result<()>
pub fn decompress_many(&mut self, out: &mut [u8]) -> Result<()>
Decompress as many points as the out
slice can hold
Note
If the out
slice contains more space than there are points
the function will still decompress and thus and error will occur
sourcepub fn seek(&mut self, point_idx: u64) -> Result<()>
pub fn seek(&mut self, point_idx: u64) -> Result<()>
Seeks to the point designed by the index
Important
Seeking in compressed data has a higher cost than non compressed data because the stream has to be moved to the start of the chunk and then we have to decompress points in the chunk until we reach the one we want.
sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Consumes the decompressor and returns the data source.