Struct PipelinePoint

Source
pub struct PipelinePoint {
    pub x: f32,
    pub y: f32,
    pub r: f32,
    pub g: f32,
    pub b: f32,
    pub is_blank: bool,
}
Expand description

Working point type. Do math calculations on this point type. Supports position (x, y), color (r, g, b), and an is_blank flag.

Fields§

§x: f32

X-coordinate.

§y: f32

Y-coordinate.

§r: f32

Red color value.

§g: f32

Green color value.

§b: f32

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 PipelinePoint

Source

pub const MIN_COLOR: f32 = 0f32

Minimum value of the color channels.

Source

pub const MAX_COLOR: f32 = 255f32

Maximum value of the color channels.

Source

pub fn xy_rgb(x: f32, y: f32, r: f32, g: f32, b: f32) -> PipelinePoint

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

Examples found in repository?
examples/usage.rs (line 18)
9fn main() {
10  let pt = SimplePoint::xy_rgb(0, -100, 100, 200, 255);
11  println!("Simple point: {}", pt);
12  println!("Simple point: {:?}", pt);
13
14  println!("Min color: {}, Max color: {}",
15    SimplePoint::MIN_COLOR,
16    SimplePoint::MAX_COLOR);
17
18  let pt = PipelinePoint::xy_rgb(0.5, 0.5, 10.0, 20.5, 255.0);
19  println!("Pipeline point: {}", pt);
20  println!("Pipeline point: {:?}", pt);
21
22  println!("Min color: {}, Max color: {}",
23      PipelinePoint::MIN_COLOR,
24      PipelinePoint::MAX_COLOR);
25}
Source

pub fn xy_blank(x: f32, y: f32) -> PipelinePoint

PipelinePoint 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_simple_pt(&self) -> SimplePoint

Transform a PipelinePoint into a SimplePoint for sending to the DAC.

Source

pub fn xy_luma(x: f32, y: f32, luminance: f32) -> PipelinePoint

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

Source

pub fn xy_red(x: f32, y: f32, red: f32) -> PipelinePoint

PipelinePoint CTOR. Sets only the red color channel.

Source

pub fn xy_green(x: f32, y: f32, green: f32) -> PipelinePoint

PipelinePoint CTOR. Sets only the green color channel.

Source

pub fn xy_blue(x: f32, y: f32, blue: f32) -> PipelinePoint

PipelinePoint CTOR. Sets only the blue color channel.

Source

pub fn xy_binary(x: f32, y: f32, on: bool) -> PipelinePoint

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

Source§

fn clone(&self) -> PipelinePoint

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 PipelinePoint

Source§

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

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

impl Default for PipelinePoint

Source§

fn default() -> PipelinePoint

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

impl Display for PipelinePoint

Source§

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

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

impl Copy for PipelinePoint

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.