Struct SimplePoint

Source
pub struct SimplePoint {
    pub x: i16,
    pub y: i16,
    pub r: u8,
    pub g: u8,
    pub b: u8,
    pub is_blank: bool,
}
Expand description

Core point type. Supports position (x, y), color (r, g, b), and an is_blank flag.

Fields§

§x: i16

X-coordinate.

§y: i16

Y-coordinate.

§r: u8

Red color value.

§g: u8

Green color value.

§b: u8

Blue color value.

§is_blank: bool

Whether the point is semantically considered a “blanking” point. A blanking point may still encode color information, but we generally do not render these points unless we’re debugging.

Implementations§

Source§

impl SimplePoint

Source

pub const MIN_COLOR: u8 = 0u8

Minimum value of the color channels.

Source

pub const MAX_COLOR: u8 = 255u8

Maximum value of the color channels.

Source

pub fn xy_rgb(x: i16, y: i16, r: u8, g: u8, b: u8) -> SimplePoint

SimplePoint CTOR. Lets you specify colors for each channel separately.

Source

pub fn xy_blank(x: i16, y: i16) -> SimplePoint

SimplePoint CTOR. Crates a blanking point. The blanking boolean is set to true, meaning this is semantically considered to be used for blanking purposes.

Source

pub fn into_pipeline_pt(&self) -> PipelinePoint

Transform a SimplePoint into a PipelinePoint for math operations.

Source

pub fn xy_luma(x: i16, y: i16, luminance: u8) -> SimplePoint

SimplePoint CTOR. Uses the same intensity value for all color channels.

Source

pub fn xy_red(x: i16, y: i16, red: u8) -> SimplePoint

SimplePoint CTOR. Sets only the red color channel.

Source

pub fn xy_green(x: i16, y: i16, green: u8) -> SimplePoint

SimplePoint CTOR. Sets only the green color channel.

Source

pub fn xy_blue(x: i16, y: i16, blue: u8) -> SimplePoint

SimplePoint CTOR. Sets only the blue color channel.

Source

pub fn xy_binary(x: i16, y: i16, on: bool) -> SimplePoint

SimplePoint CTOR. If set to on, the lasers are at full power. Otherwise, they’re off. An “off” point is not considered a blanking point.

Trait Implementations§

Source§

impl Clone for SimplePoint

Source§

fn clone(&self) -> SimplePoint

Returns a duplicate 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 SimplePoint

Source§

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

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

impl Default for SimplePoint

Source§

fn default() -> SimplePoint

Returns the “default value” for a type. Read more
Source§

impl Display for SimplePoint

Source§

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

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

impl Copy for SimplePoint

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.