Struct nannou_laser::point::Point[][src]

#[repr(C)]
pub struct Point { pub position: Position, pub color: Rgb, pub weight: u32, }

The point type used within the laser frame stream API.

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.

weight: u32

The minimum number of extra times this point should be drawn.

0 is the default used for drawing sequences of smooth line segments.

Values greater than 0 are useful for accenting individual points.

Implementations

impl Point[src]

pub const DEFAULT_LINE_POINT_WEIGHT: u32[src]

The default weight for points used to draw lines.

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

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

pub fn with_weight(position: Position, color: Rgb, weight: u32) -> Self[src]

The same as Point::new but allows for specifying the weight of the point.

pub fn centered_blank() -> Self[src]

Create a blank point at [0, 0].

pub fn blanked(&self) -> Self[src]

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

pub fn is_blank(&self) -> bool[src]

Whether or not the point is blank.

A point is considered blank if the colour is black.

pub fn to_raw(&self) -> RawPoint[src]

Converts to a single raw point with the same position and color.

pub fn to_raw_weighted(&self) -> impl Iterator<Item = RawPoint>[src]

Converts to weight number of raw points with the same position and color.

Trait Implementations

impl AsRef<Point> for Point[src]

impl Clone for Point[src]

impl Copy for Point[src]

impl Debug for Point[src]

impl From<Point> for RawPoint[src]

impl Hash for Point[src]

impl IsBlank for Point[src]

impl PartialEq<Point> for Point[src]

impl Position for Point[src]

impl StructuralPartialEq for Point[src]

impl Weight for Point[src]

Auto Trait Implementations

impl RefUnwindSafe for Point

impl Send for Point

impl Sync for Point

impl Unpin for Point

impl UnwindSafe for Point

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.