#[repr(C)]
pub struct RawPoint { pub position: Position, pub color: Rgb, }
Expand description

The Point type used for describing raw laser streams.

The point represents the location to which the scanner should point and the colour that the scanner should be at this point.

If two consecutive points have two different colours, the color values will be linearly interpolated.

Fields§

§position: Position

The position of the point. -1 represents the minimum value along the axis and 1 represents the maximum.

§color: Rgb

The color of the point.

Implementations§

source§

impl RawPoint

source

pub fn new(position: Position, color: Rgb) -> Self

Create a Point at the given position with the given colour.

source

pub fn with_weight(&self, weight: u32) -> Point

Convert to a point compatible with a laser frame stream with the given weight.

source

pub fn centered_blank() -> Self

Create a blank point at [0, 0].

source

pub fn blanked(&self) -> Self

Returns a point with the same position as self but with a black (blank) color.

source

pub fn is_blank(&self) -> bool

Whether or not the point is blank.

A point is considered blank if the colour is black.

Trait Implementations§

source§

impl Blanked for RawPoint

source§

fn blanked(&self) -> Self

Produce a point of the same type and position but that is blank.
source§

impl Clone for RawPoint

source§

fn clone(&self) -> RawPoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RawPoint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Point> for RawPoint

source§

fn from(p: Point) -> Self

Converts to this type from the input type.
source§

impl Lerp for RawPoint

§

type Scalar = f32

The type used to describe the amount of interpolation.
source§

fn lerp(&self, other: &Self, amt: f32) -> Self

Linearly interpolate from self to dest by the given amt.
source§

impl PartialEq for RawPoint

source§

fn eq(&self, other: &RawPoint) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for RawPoint

source§

impl StructuralPartialEq for RawPoint

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.