Trait pasture_core::containers::PerAttributePointBuffer[][src]

pub trait PerAttributePointBuffer: PointBuffer {
    fn get_raw_attribute_ref(
        &self,
        point_index: usize,
        attribute: &PointAttributeDefinition
    ) -> &[u8];
fn get_raw_attribute_range_ref(
        &self,
        index_range: Range<usize>,
        attribute: &PointAttributeDefinition
    ) -> &[u8];
fn slice(&self, range: Range<usize>) -> PerAttributePointBufferSlice<'_>; }

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, ...]

Required methods

fn get_raw_attribute_ref(
    &self,
    point_index: usize,
    attribute: &PointAttributeDefinition
) -> &[u8]
[src]

Returns a pointer to the raw memory for the attribute entry of the given point in this PointBuffer. In contrast to get_raw_attribute, this function performs no copy operations and thus can yield better performance. Panics if point_index is out of bounds or if the attribute is not part of the point_layout of this PointBuffer.

fn get_raw_attribute_range_ref(
    &self,
    index_range: Range<usize>,
    attribute: &PointAttributeDefinition
) -> &[u8]
[src]

Returns a pointer to the raw memory for the given attribute of a range of points in this PointBuffer. In contrast to get_raw_attribute_range, this function performs no copy operations and thus can yield better performance. Panics if any index in index_range is out of bounds or if the attribute is not part of the point_layout of this PointBuffer.

fn slice(&self, range: Range<usize>) -> PerAttributePointBufferSlice<'_>[src]

Returns a read-only slice of the associated PerAttributePointBuffer

Loading content...

Implementors

impl PerAttributePointBuffer for PerAttributeVecPointStorage[src]

impl<'d> PerAttributePointBuffer for PerAttributePointView<'d>[src]

impl<'p> PerAttributePointBuffer for PerAttributePointBufferSlice<'p>[src]

impl<'p> PerAttributePointBuffer for PerAttributePointBufferSliceMut<'p>[src]

Loading content...