Struct laz::laszip::parallel::ParLasZipCompressor
source · pub struct ParLasZipCompressor<W> { /* private fields */ }
Expand description
LasZip compressor that compresses using multiple threads
This supports both variable-size and fixed-size chunks. The method you need to call in order to compress data depends on which type of sized chunks you want to write.
Its the LazVlr
that controls which type of chunks you want to write.
You must call done
when you have compressed all the points you wanted.
Fixed-Size
Use compress_many
This works by forming complete chunks of points with the points
data passed when compress_many
is called. These complete chunks are
compressed & written right away and points that are ‘leftovers’ are kept until
the next call to compress_many
or done
.
Variable-Size
Use compress_chunks
Implementations§
source§impl<W: Write + Seek + Send> ParLasZipCompressor<W>
impl<W: Write + Seek + Send> ParLasZipCompressor<W>
sourcepub fn reserve_offset_to_chunk_table(&mut self) -> Result<()>
pub fn reserve_offset_to_chunk_table(&mut self) -> Result<()>
Reserves and prepares the offset to chunk table that will be updated when done is called.
This method will automatically be called on the first point(s) being compressed, but for some scenarios, manually calling this might be useful.
sourcepub fn compress_many(&mut self, points: &[u8]) -> Result<()>
pub fn compress_many(&mut self, points: &[u8]) -> Result<()>
sourcepub fn compress_chunks<Chunks, Item>(&mut self, chunks: Chunks) -> Result<()>where
Item: AsRef<[u8]> + Send,
Chunks: IntoParallelIterator<Item = Item>,
pub fn compress_chunks<Chunks, Item>(&mut self, chunks: Chunks) -> Result<()>where Item: AsRef<[u8]> + Send, Chunks: IntoParallelIterator<Item = Item>,
sourcepub fn done(&mut self) -> Result<()>
pub fn done(&mut self) -> Result<()>
Tells the compressor that no more points will be compressed
- Compresses & writes the rest of the points to form the last chunk
- Writes the chunk table
- update the offset to the chunk_table