lj_rust/src/transformer/intensity.rs

28 lines
733 B
Rust

use crate::point::Point;
use crate::transformer::Transformers;
use crate::worldstate::WorldState;
use log::debug;
use serde::{Deserialize, Serialize};
/// 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
}
}