pub struct LasZipDecompressor<'a, R: Read + Seek + 'a> { /* private fields */ }
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>

source

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

source

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.

source

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,
source

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

source

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.

source

pub fn vlr(&self) -> &LazVlr

Returns the vlr used.

source

pub fn into_inner(self) -> R

Consumes the decompressor and returns the data source.

source

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

source

pub fn get(&self) -> &R

Returns a reference to the data source.

Trait Implementations§

source§

impl<'a, R: Read + Seek + Send> LasPointReader for LasZipDecompressor<'a, R>

source§

fn read_next_into(&mut self, buffer: &mut [u8]) -> Result<()>

source§

impl<'a, R: Read + Seek + Send + 'a> LazDecompressor for LasZipDecompressor<'a, R>

source§

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

source§

fn seek(&mut self, index: u64) -> Result<()>

Auto Trait Implementations§

§

impl<'a, R> !RefUnwindSafe for LasZipDecompressor<'a, R>

§

impl<'a, R> Send for LasZipDecompressor<'a, R>

§

impl<'a, R> !Sync for LasZipDecompressor<'a, R>

§

impl<'a, R> Unpin for LasZipDecompressor<'a, R>

§

impl<'a, R> !UnwindSafe for LasZipDecompressor<'a, R>

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 = _

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.