29 lines
627 B
Rust
29 lines
627 B
Rust
|
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)]
|
||
|
pub struct Intensity {
|
||
|
}
|
||
|
|
||
|
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 {
|
||
|
x: pt.x,
|
||
|
y: pt.y,
|
||
|
color: pt.color * ws.intensity
|
||
|
}
|
||
|
}).collect();
|
||
|
debug!("list intensity {:?}", out);
|
||
|
out
|
||
|
}
|
||
|
}
|
||
|
|