platform: smart-leds: implement layer blending
This commit is contained in:
parent
b71a66146c
commit
0a28f9f5c6
@ -1,6 +1,7 @@
|
|||||||
use smart_leds_trait::SmartLedsWrite;
|
use smart_leds_trait::SmartLedsWrite;
|
||||||
use running_average::RealTimeRunningAverage;
|
use running_average::RealTimeRunningAverage;
|
||||||
|
|
||||||
|
use crate::lib8::Rgb8Blend;
|
||||||
use crate::render::{Surface, SurfacePool, Display, Surfaces};
|
use crate::render::{Surface, SurfacePool, Display, Surfaces};
|
||||||
use crate::task::Task;
|
use crate::task::Task;
|
||||||
use crate::power::{brightness_for_mw, AsMilliwatts};
|
use crate::power::{brightness_for_mw, AsMilliwatts};
|
||||||
@ -79,7 +80,7 @@ impl<T: SmartLedsWrite<Color = Rgb<u8>>, S: Surface> Display<S> for SmartLedDisp
|
|||||||
let mut pixel = Rgb::new(0, 0, 0);
|
let mut pixel = Rgb::new(0, 0, 0);
|
||||||
for surface in self.surfaces.iter() {
|
for surface in self.surfaces.iter() {
|
||||||
surface.with_shader(|shader| {
|
surface.with_shader(|shader| {
|
||||||
pixel = shader.draw(virt_coords.clone());
|
pixel = pixel.saturating_add(shader.draw(virt_coords.clone()));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
self.total_mw += pixel.as_milliwatts();
|
self.total_mw += pixel.as_milliwatts();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user