mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-08 11:01:35 +00:00
more colors
This commit is contained in:
1 parent
9ce8f1837c
commit
2b8bdf69df
2 files changed
+16
-1
No files matched your search
@@ -75,7 +75,7 @@ pub fn calculate_point_cloud2(depth_image: &Image, xy_table_image: &Image) -> An
|
||||
let x = (*xy_table_data.offset(i)).xy.x * ((*depth_data.offset(i)) as f32);
|
||||
let y = (*xy_table_data.offset(i)).xy.y * ((*depth_data.offset(i)) as f32);
|
||||
let z = (*depth_data.offset(i)) as f32;
|
||||
points.push(Point::at(x, y, z, Color::Blue));
|
||||
points.push(Point::at(x, y, z, Color::Yellow));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ pub enum Color {
|
||||
Red,
|
||||
Green,
|
||||
Blue,
|
||||
Yellow, // Red + Green
|
||||
Teal, // Green + Blue
|
||||
Purple, // Red + Blue
|
||||
Custom { r: u8, g: u8, b: u8, a: u8 },
|
||||
}
|
||||
|
||||
@@ -16,6 +19,9 @@ impl Color {
|
||||
Color::Red => 255,
|
||||
Color::Green => 0,
|
||||
Color::Blue => 0,
|
||||
Color::Yellow => 255,
|
||||
Color::Teal => 0,
|
||||
Color::Purple => 255,
|
||||
Color::Custom {r, g, b, a} => *r,
|
||||
}
|
||||
}
|
||||
@@ -27,6 +33,9 @@ impl Color {
|
||||
Color::Red => 0,
|
||||
Color::Green => 255,
|
||||
Color::Blue => 0,
|
||||
Color::Yellow => 255,
|
||||
Color::Teal => 255,
|
||||
Color::Purple => 0,
|
||||
Color::Custom {r, g, b, a} => *g,
|
||||
}
|
||||
}
|
||||
@@ -38,6 +47,9 @@ impl Color {
|
||||
Color::Red => 0,
|
||||
Color::Green => 0,
|
||||
Color::Blue => 255,
|
||||
Color::Yellow => 0,
|
||||
Color::Teal => 255,
|
||||
Color::Purple => 255,
|
||||
Color::Custom {r, g, b, a} => *b,
|
||||
}
|
||||
}
|
||||
@@ -49,6 +61,9 @@ impl Color {
|
||||
Color::Red => 255,
|
||||
Color::Green => 255,
|
||||
Color::Blue => 255,
|
||||
Color::Yellow => 255,
|
||||
Color::Teal => 255,
|
||||
Color::Purple => 255,
|
||||
Color::Custom {r, g, b, a} => *a,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user