pub trait ColumnarBuffer<'a>: BorrowedBuffer<'a> {
// Required methods
fn get_attribute_ref<'b>(
&'b self,
attribute: &PointAttributeDefinition,
index: usize,
) -> &'b [u8] ⓘ
where 'a: 'b;
fn get_attribute_range_ref<'b>(
&'b self,
attribute: &PointAttributeDefinition,
range: Range<usize>,
) -> &'b [u8] ⓘ
where 'a: 'b;
// Provided method
fn view_raw_attribute<'b>(
&'b self,
attribute: &PointAttributeMember,
) -> RawAttributeView<'b>
where 'a: 'b { ... }
}Expand description
Trait for point buffers that store their point data in columnar memory layout. This allows accessing point attributes by reference
Required Methods§
Sourcefn get_attribute_ref<'b>(
&'b self,
attribute: &PointAttributeDefinition,
index: usize,
) -> &'b [u8] ⓘwhere
'a: 'b,
fn get_attribute_ref<'b>(
&'b self,
attribute: &PointAttributeDefinition,
index: usize,
) -> &'b [u8] ⓘwhere
'a: 'b,
Get an immutable slice to the memory of the given attribute for the point at index. See InterleavedBuffer::get_point_ref for an explanation of the lifetime bounds.
§Panics
Should panic if attribute is not part of the PointLayout of this buffer.
Should panic if index is out of bounds.
Sourcefn get_attribute_range_ref<'b>(
&'b self,
attribute: &PointAttributeDefinition,
range: Range<usize>,
) -> &'b [u8] ⓘwhere
'a: 'b,
fn get_attribute_range_ref<'b>(
&'b self,
attribute: &PointAttributeDefinition,
range: Range<usize>,
) -> &'b [u8] ⓘwhere
'a: 'b,
Get an immutable slice to the memory for the attribute of the given range of points
§Panics
Should panic if attribute is not part of the PointLayout of this buffer.
Should panic if range is out of bounds.
Provided Methods§
Sourcefn view_raw_attribute<'b>(
&'b self,
attribute: &PointAttributeMember,
) -> RawAttributeView<'b>where
'a: 'b,
fn view_raw_attribute<'b>(
&'b self,
attribute: &PointAttributeMember,
) -> RawAttributeView<'b>where
'a: 'b,
Get a raw view over the given attribute from this point buffer. Unlike the typed view that view_attribute
returns, this view dereferences to byte slices, but it is potentially more efficient to use than calling
get_attribute repeatedly
Trait Implementations§
Source§impl<'a> BorrowedBufferExt<'a> for dyn ColumnarBuffer<'a> + 'a
impl<'a> BorrowedBufferExt<'a> for dyn ColumnarBuffer<'a> + 'a
Source§fn view<'b, T: PointType>(&'b self) -> PointView<'a, 'b, Self, T>where
'a: 'b,
fn view<'b, T: PointType>(&'b self) -> PointView<'a, 'b, Self, T>where
'a: 'b,
Source§fn view_attribute<'b, T: PrimitiveType>(
&'b self,
attribute: &PointAttributeDefinition,
) -> AttributeView<'a, 'b, Self, T>where
'a: 'b,
fn view_attribute<'b, T: PrimitiveType>(
&'b self,
attribute: &PointAttributeDefinition,
) -> AttributeView<'a, 'b, Self, T>where
'a: 'b,
attribute of all points in this buffer Read moreSource§fn view_attribute_with_conversion<'b, T: PrimitiveType>(
&'b self,
attribute: &PointAttributeDefinition,
) -> Result<AttributeViewConverting<'a, 'b, Self, T>>where
'a: 'b,
fn view_attribute_with_conversion<'b, T: PrimitiveType>(
&'b self,
attribute: &PointAttributeDefinition,
) -> Result<AttributeViewConverting<'a, 'b, Self, T>>where
'a: 'b,
view_attribute, but allows T::data_type() to be different from the data type ofthe
attribute within this buffer. Read more