pub struct LasZipCompressor<'a, W: Write + Send + 'a> { /* private fields */ }
Expand description

Struct that handles the compression of the points into the given destination

This supports both variable-size and fixed-size chunks. Its the LazVlr that controls which type of chunks you want to write.

Fixed-Size

  • Use compress_one and/or compress_many.
  • The compressor will take care of managing the chunking.
  • Use done when you have compressed all the points you wanted.

Variable-Size

Or

  • Use compress_chunks to compress chunks.
  • Use done when you have compressed all the points you wanted.

Implementations§

source§

impl<'a, W: Write + Seek + Send + 'a> LasZipCompressor<'a, W>

source

pub fn new(output: W, vlr: LazVlr) -> Result<Self>

Creates a compressor using the provided vlr.

source

pub fn from_laz_items(output: W, items: Vec<LazItem>) -> Result<Self>

Creates a new LasZipCompressor using the items provided,

If you wish to use a different chunk size see from_laz_vlr

source

pub fn compress_one(&mut self, input: &[u8]) -> Result<()>

Compress the point and write the compressed data to the destination given when the compressor was constructed

The data is written in the buffer is expected to be exactly as it would have been in a LAS File, that is:

  • The fields/dimensions are in the same order than the LAS spec says
  • The data in the buffer is in Little Endian order
source

pub fn compress_many(&mut self, input: &[u8]) -> Result<()>

Compress all the points contained in the input slice

source

pub fn compress_chunks<Chunks, Item>(&mut self, chunks: Chunks) -> Result<()>where Item: AsRef<[u8]>, Chunks: IntoIterator<Item = Item>,

Compresses multiple chunks

Important

This must be called only when writing variable-size chunks.

source

pub fn done(&mut self) -> Result<()>

Must be called when you have compressed all your points.

source

pub fn finish_current_chunk(&mut self) -> Result<()>

Finished the current chunks.

All points compressed with the previous calls to compress_one and compress_many will form one chunk. And the subsequent calls to compress_one and compress_many will form a new chunk.

Important

Only call this when writing variable-size chunks.

source

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 being compressed, but for some scenarios, manually calling this might be useful.

source

pub fn vlr(&self) -> &LazVlr

Returns the vlr used by this compressor

source

pub fn into_inner(self) -> W

source

pub fn get_mut(&mut self) -> &mut W

source

pub fn get(&self) -> &W

Trait Implementations§

source§

impl<'a, W: Write + Seek + Send + 'a> LazCompressor for LasZipCompressor<'a, W>

source§

fn compress_many(&mut self, points: &[u8]) -> Result<()>

source§

fn done(&mut self) -> Result<()>

Auto Trait Implementations§

§

impl<'a, W> !RefUnwindSafe for LasZipCompressor<'a, W>

§

impl<'a, W> Send for LasZipCompressor<'a, W>

§

impl<'a, W> !Sync for LasZipCompressor<'a, W>

§

impl<'a, W> Unpin for LasZipCompressor<'a, W>

§

impl<'a, W> !UnwindSafe for LasZipCompressor<'a, W>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.