From 37d586c5de451bc7d9501ab95a4d137ddb14fd51 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Fri, 15 Jul 2022 11:13:38 +1200 Subject: [PATCH] Additional comments in animeimage --- rog-anime/src/image.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rog-anime/src/image.rs b/rog-anime/src/image.rs index 3a14a421..10fd2983 100644 --- a/rog-anime/src/image.rs +++ b/rog-anime/src/image.rs @@ -203,7 +203,8 @@ impl AnimeImage { &mut self.img_pixels } - /// Generate the data used to + /// Generate a list of LED positions. These are then used to sample the Image data, + /// and will contain their resulting brightness. #[inline] pub fn generate_image_positioning(anime_type: AnimeType) -> Vec> { match anime_type { @@ -215,7 +216,7 @@ impl AnimeImage { let x = AnimeImage::first_x(anime_type, y) + l; Some(Led::new(x as f32 - 0.5 * (y % 2) as f32, y as f32)) } else { - None // dead pixels to the left + None // dead/non-existant pixels to the left } }) }) @@ -226,7 +227,10 @@ impl AnimeImage { /// Called after setting new angle, position, or scale to refresh the image /// samples, the result can then been transformed to the appropriate data - /// for displaying + /// for displaying. + /// + /// The internal for loop iterates over the LED positions, skipping the blank/dead + /// pixels if any. #[inline] pub fn update(&mut self) { let width = self.width as i32;