lib8: drop custom RGB8 struct for rgb crate

This commit is contained in:
2024-10-30 20:48:00 +01:00
parent b7995423d7
commit 1668db2c85
6 changed files with 54 additions and 75 deletions

View File

@@ -5,7 +5,6 @@ use crate::render::{Surface, SurfacePool, Display, Surfaces};
use crate::task::Task;
use crate::power::{brightness_for_mw, AsMilliwatts};
use crate::time::Periodically;
use crate::lib8::RGB8;
use crate::geometry::*;
use smart_leds::brightness;
@@ -77,14 +76,14 @@ impl<T: SmartLedsWrite<Color = Rgb<u8>>, S: Surface> Display<S> for SmartLedDisp
fn render_frame(&mut self) {
for x in 0..self.pixbuf.len() {
let virt_coords = VirtualCoordinates::new(x as u8, 0);
let mut pixel = RGB8::new(0, 0, 0);
let mut pixel = Rgb::new(0, 0, 0);
for surface in self.surfaces.iter() {
surface.with_shader(|shader| {
pixel = shader.draw(virt_coords.clone());
})
}
self.total_mw += pixel.as_milliwatts();
self.pixbuf[x] = Rgb::new(pixel.red, pixel.green, pixel.blue);
self.pixbuf[x] = Rgb::new(pixel.r, pixel.g, pixel.b);
};
}
}