Module pasture_core::containers[][src]

Expand description

Provides the core data structures and traits for storing point cloud data in memory.

Pasture exposes a hierarchy of traits that define the capabilities of the in-memory buffers that the point data is stored in. The most basic trait is PointBuffer, which is implemented by every specific point cloud buffer in Pasture. It provides basic access to the point data without making any assumptions about the memory layout of the point data. More specific types include InterleavedPointBuffer and PerAttributePointBuffer, which store data in an Interleaved or PerAttribute memory layout. For an explanation of these memory layouts, see the PointLayout type.

On top of these traits, Pasture provides some specific implementations for storing contiguous point data in Interleaved or PerAttribute layouts, as well as non-owning and sliced versions of these buffers.

Lastly, this module exposes some helper functions for iterating over the point data inside any of these buffers.

Modules

Contains iterators over a single point attribute

Contains Iterator implementations through which the untyped contents of PointBuffer structures can be accessed in a safe and strongly-typed manner.

Macros

Create an iterator over multiple attributes within a PointBuffer. This macro uses some special syntax to determine the attributes and their types:

Create an iterator over multiple attributes within a PointBuffer, supporting type converisons. This macro uses some special syntax to determine the attributes and their types:

Create an iterator over mutable references to multiple attributes within a PointBuffer. Requires that the buffer implements PerAttributePointBufferMut. This macro uses some special syntax to determine the attributes and their types:

Create an iterator over references to multiple attributes within a PointBuffer. Requires that the buffer implements PerAttributePointBuffer. This macro uses some special syntax to determine the attributes and their types:

Structs

Non-owning, read-only slice of the data of an InterleavedPointBuffer

A non-owning view for a contiguous slice of interleaved point data. This is like InterleavedVecPointBuffer, but it does not own the point data. It is useful for passing around point data in an untyped but safe manner, for example in I/O heavy code.

PointBuffer type that uses Interleaved memory layout and Vec-based owning storage for point data

Non-owning, read-only slice of the data of a PerAttributePointBuffer

Non-owning, mutable slice of the data of a PerAttributePointBufferMut

A non-owning view for per-attribute point data. This is like PerAttributeVecPointBuffer, but it does not own the point data. It is useful for passing around point data in an untyped but safe manner, for example in I/O heavy code.

PointBuffer type that uses PerAttribute memory layout and Vec-based owning storage for point data

Helper structure for pushing separate attributes into a PerAttributeVecPointStorage. Only through this type, using the builder pattern, is it possible to correctly push data for one attribute at a time into the buffer. This type enforces that, at the end of all attribute push operations, the PointLayout of the newly pushed attributes exactly matches the PointLayout of the buffer.

An implementaion of UntypedPoint trait that has an internal buffer.

An implementaion of UntypedPoint trait that handles an external buffer.

Traits

Trait for PointBuffer types that store point data in Interleaved memory layout. In an InterleavedPointBuffer, all attributes for a single point are stored together in memory. To illustrate this, suppose the PointLayout of some point type defines the default attributes POSITION_3D (Vector3<f64>), INTENSITY (u16) and CLASSIFICATION (u8). In an InterleavedPointBuffer, the data layout is like this:
[Vector3<f64>, u16, u8, Vector3<f64>, u16, u8, ...]
|------Point 1-------| |------Point 2-------| |--...

Extension trait that provides generic methods for accessing point data in an InterleavedPointBuffer

Trait for InterleavedPointBuffer types that provide mutable access to the point data

Extension trait that provides generic methods for accessing point data in an InterleavedPointBufferMut

Trait for PointBuffer types that store point data in PerAttribute memory layout. In buffers of this type, the data for a single attribute of all points in stored together in memory. To illustrate this, suppose the PointLayout of some point type defines the default attributes POSITION_3D (Vector3<f64>), INTENSITY (u16) and CLASSIFICATION (u8). In a PerAttributePointBuffer, the data layout is like this:
[Vector3<f64>, Vector3<f64>, Vector3<f64>, ...]
[u16, u16, u16, ...]
[u8, u8, u8, ...]

Extension trait that provides generic methods for accessing attribute data in an PerAttributePointBuffer

Trait for PerAttributePointBuffer types that provide mutable access to specific attributes

Extension trait that provides generic methods for accessing attribute data in an PerAttributePointBufferMut

Base trait for all containers that store point data. A PointBuffer stores any number of point entries with a layout defined by the PointBuffers associated PointLayout structure.

Extension trait that provides generic methods for accessing point data in a PointBuffer

Trait for all mutable PointBuffers, that is all PointBuffers where it is possible to push points into. Distinguishing between read-only PointBuffer and mutable PointBufferMut traits enables read-only, non-owning views of a PointBuffer with the same interface as an owning PointBuffer!

Extension trait that provides generic methods for manipulating point and attribute data in a PointBufferWriteable

A trait to handle points that layout can’t be known to compile time.