2023-07-24 16:53:19 +00:00
|
|
|
use log::debug;
|
|
|
|
use crate::transformer::Transformers;
|
|
|
|
use crate::point::Point;
|
|
|
|
use crate::worldstate::WorldState;
|
|
|
|
|
|
|
|
use serde::{Serialize, Deserialize};
|
|
|
|
|
|
|
|
/// Converts helios Geometry to Helios
|
|
|
|
#[allow(dead_code)]
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
|
2023-08-05 17:11:33 +00:00
|
|
|
pub struct Intensity {}
|
2023-07-24 16:53:19 +00:00
|
|
|
|
|
|
|
impl Transformers for Intensity {
|
|
|
|
fn apply(&self, point_list: &[Point], ws: &WorldState) -> Vec<Point> {
|
|
|
|
// debug!("list helios {:?}", point_list);
|
|
|
|
let out = point_list.iter().map(|pt| {
|
|
|
|
Point {
|
2023-08-05 17:11:33 +00:00
|
|
|
color: pt.color * ws.intensity,
|
|
|
|
..*pt
|
|
|
|
}
|
|
|
|
}).collect();
|
|
|
|
// debug!("list intensity {:?}", out);
|
2023-07-24 16:53:19 +00:00
|
|
|
out
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|