feat: add privisional G635L image and gif support

This commit is contained in:
Ghoul
2026-01-24 01:39:28 +05:00
parent 3b5e82d6c5
commit cc5e6944ad

View File

@@ -164,7 +164,7 @@ impl AnimeImage {
/// first_x /// first_x
/// ``` /// ```
/// ///
/// For G835L (inverted pattern - triangle grows then rectangle shifts): /// For G835L/G635L (inverted pattern - triangle grows then rectangle shifts):
/// ```text /// ```text
/// ● <- Row 0: first_x = 0, width = 1 /// ● <- Row 0: first_x = 0, width = 1
/// ● <- Row 1: first_x = 0 (stagger), width = 1 /// ● <- Row 1: first_x = 0 (stagger), width = 1
@@ -193,8 +193,8 @@ impl AnimeImage {
// and then their offset grows by one every two rows // and then their offset grows by one every two rows
(y - 9) / 2 (y - 9) / 2
} }
AnimeType::G835L => { AnimeType::G635L | AnimeType::G835L => {
// G835L has inverted geometry - triangle at top-left, rectangle shifts right // G835L/G635L have inverted geometry - triangle at top-left, rectangle shifts right
// Triangle (rows 0-27): no cumulative shift, just alternating stagger // Triangle (rows 0-27): no cumulative shift, just alternating stagger
// Rectangle (rows 28-67): shifts right by ~0.5px per row // Rectangle (rows 28-67): shifts right by ~0.5px per row
if y < 28 { if y < 28 {
@@ -245,8 +245,8 @@ impl AnimeImage {
} }
38 - Self::first_x(anime_type, y) + y % 2 38 - Self::first_x(anime_type, y) + y % 2
} }
AnimeType::G835L => { AnimeType::G635L | AnimeType::G835L => {
// G835L rows GROW then stay constant (inverted from other devices) // G835L/G635L rows GROW then stay constant (inverted from other devices)
// Triangle (rows 0-27): pairs of rows with same length, 1→14 // Triangle (rows 0-27): pairs of rows with same length, 1→14
// Rectangle (rows 28-67): constant 15 LEDs // Rectangle (rows 28-67): constant 15 LEDs
if y < 28 { if y < 28 {
@@ -270,6 +270,7 @@ impl AnimeImage {
// 33.0 = Longest row LED count (physical) plus half-pixel offset // 33.0 = Longest row LED count (physical) plus half-pixel offset
AnimeType::GA401 => (33.0 + 0.5) * Self::scale_x(anime_type), AnimeType::GA401 => (33.0 + 0.5) * Self::scale_x(anime_type),
AnimeType::GU604 => (38.0 + 0.5) * Self::scale_x(anime_type), AnimeType::GU604 => (38.0 + 0.5) * Self::scale_x(anime_type),
AnimeType::G635L => (33.0 + 0.5) * Self::scale_x(anime_type),
AnimeType::G835L => (33.0 + 0.5) * Self::scale_x(anime_type), AnimeType::G835L => (33.0 + 0.5) * Self::scale_x(anime_type),
_ => (35.0 + 0.5) * Self::scale_x(anime_type), _ => (35.0 + 0.5) * Self::scale_x(anime_type),
} }
@@ -280,6 +281,7 @@ impl AnimeImage {
match anime_type { match anime_type {
AnimeType::GA401 => 55, AnimeType::GA401 => 55,
AnimeType::GU604 => 62, AnimeType::GU604 => 62,
AnimeType::G635L => 68,
AnimeType::G835L => 68, AnimeType::G835L => 68,
_ => 61, _ => 61,
} }
@@ -291,6 +293,7 @@ impl AnimeImage {
// 54.0 = End column LED count (physical) plus one dead pixel // 54.0 = End column LED count (physical) plus one dead pixel
AnimeType::GA401 => (54.0 + 1.0) * Self::scale_y(anime_type), AnimeType::GA401 => (54.0 + 1.0) * Self::scale_y(anime_type),
AnimeType::GU604 => 62.0 * Self::scale_y(anime_type), AnimeType::GU604 => 62.0 * Self::scale_y(anime_type),
AnimeType::G635L => 68.0 * Self::scale_y(anime_type),
AnimeType::G835L => 68.0 * Self::scale_y(anime_type), AnimeType::G835L => 68.0 * Self::scale_y(anime_type),
// GA402 may not have dead pixels and require only the physical LED count // GA402 may not have dead pixels and require only the physical LED count
_ => 61.0 * Self::scale_y(anime_type), _ => 61.0 * Self::scale_y(anime_type),
@@ -449,7 +452,7 @@ impl AnimeImage {
} }
fn led_center(&self) -> Vec2 { fn led_center(&self) -> Vec2 {
if self.anime_type != AnimeType::G835L { if !matches!(self.anime_type, AnimeType::G635L | AnimeType::G835L) {
return Vec2::new(20.0, 20.0); return Vec2::new(20.0, 20.0);
} }