Skip to main content

CopcStreamingReader

Struct CopcStreamingReader 

Source
pub struct CopcStreamingReader<S: ByteSource> { /* private fields */ }
Expand description

Async streaming COPC reader.

open() reads the LAS header, VLRs, and root hierarchy page. Deeper hierarchy pages and point chunks are loaded on demand.

Implementations§

Source§

impl<S: ByteSource> CopcStreamingReader<S>

Source

pub async fn open(source: S) -> Result<Self, CopcError>

Open a COPC file.

Source

pub fn header(&self) -> &CopcHeader

The parsed COPC file header.

Source

pub fn copc_info(&self) -> &CopcInfo

Shortcut for header().copc_info().

Source

pub fn evlr_offset(&self) -> u64

File offset where EVLRs start.

Source

pub fn evlr_count(&self) -> u32

Number of EVLRs in the file.

Source

pub fn source(&self) -> &S

The underlying byte source.

Source

pub fn get(&self, key: &VoxelKey) -> Option<&HierarchyEntry>

Look up a hierarchy entry by voxel key.

Source

pub fn entries(&self) -> impl Iterator<Item = (&VoxelKey, &HierarchyEntry)>

Iterate all loaded hierarchy entries.

Source

pub fn node_count(&self) -> usize

Number of loaded hierarchy entries.

Source

pub fn has_pending_pages(&self) -> bool

Whether there are hierarchy pages that haven’t been loaded yet.

Source

pub async fn load_pending_pages(&mut self) -> Result<(), CopcError>

Load the next batch of pending hierarchy pages.

Source

pub async fn load_all_hierarchy(&mut self) -> Result<(), CopcError>

Load all remaining hierarchy pages.

Source

pub async fn fetch_chunk( &self, key: &VoxelKey, ) -> Result<DecompressedChunk, CopcError>

Fetch and decompress a single point chunk.

Source

pub fn read_points( &self, chunk: &DecompressedChunk, ) -> Result<Vec<Point>, CopcError>

Parse points from a decompressed chunk.

Auto Trait Implementations§

§

impl<S> Freeze for CopcStreamingReader<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for CopcStreamingReader<S>
where S: RefUnwindSafe,

§

impl<S> Send for CopcStreamingReader<S>
where S: Send,

§

impl<S> Sync for CopcStreamingReader<S>
where S: Sync,

§

impl<S> Unpin for CopcStreamingReader<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for CopcStreamingReader<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for CopcStreamingReader<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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.

Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.