suggest inlining Harrogate render helper

This commit is contained in:
Tangent 128 2019-11-06 19:47:45 -05:00
parent bc018751c8
commit 1ad2db3960
1 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@ pub struct Harrogate<PB, PF> {
pub porch_front: PF,
}
#[inline]
fn white_balance(HardwareRgb(r, g, b): HardwareRgb, white: Rgb) -> HardwareRgb {
let Rgb(r, g, b) = Rgb(r, g, b) * white;
HardwareRgb(r, g, b)
@ -26,6 +27,7 @@ where
PB: IntoIterator<Item = Rgb>,
PF: IntoIterator<Item = Rgb>,
{
#[inline]
pub fn render_to<L: Lights<Pixel = HardwareRgb>>(self, lights: &mut L) {
let mut buffer = [HardwareRgb(255,0,255); PORCH_BACK_LEN + PORCH_FRONT_LEN];