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: f32X-coordinate.
y: f32Y-coordinate.
r: f32Red color value.
g: f32Green color value.
b: f32Blue color value.
is_blank: boolWhether 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
impl PipelinePoint
Sourcepub fn xy_rgb(x: f32, y: f32, r: f32, g: f32, b: f32) -> PipelinePoint
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?
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}Sourcepub fn xy_blank(x: f32, y: f32) -> PipelinePoint
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.
Sourcepub fn into_simple_pt(&self) -> SimplePoint
pub fn into_simple_pt(&self) -> SimplePoint
Transform a PipelinePoint into a SimplePoint for sending to the DAC.
Sourcepub fn xy_luma(x: f32, y: f32, luminance: f32) -> PipelinePoint
pub fn xy_luma(x: f32, y: f32, luminance: f32) -> PipelinePoint
PipelinePoint CTOR. Uses the same intensity value for all color channels.
Sourcepub fn xy_red(x: f32, y: f32, red: f32) -> PipelinePoint
pub fn xy_red(x: f32, y: f32, red: f32) -> PipelinePoint
PipelinePoint CTOR. Sets only the red color channel.
Sourcepub fn xy_green(x: f32, y: f32, green: f32) -> PipelinePoint
pub fn xy_green(x: f32, y: f32, green: f32) -> PipelinePoint
PipelinePoint CTOR. Sets only the green color channel.
Trait Implementations§
Source§impl Clone for PipelinePoint
impl Clone for PipelinePoint
Source§fn clone(&self) -> PipelinePoint
fn clone(&self) -> PipelinePoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more