Add "Unknown" to (not really) supported AniMe list

Intention is to allow users to at least control the power state of the
device (turn off) if the phyciscal display isn't yet supported.

Partial address of #354
This commit is contained in:
Luke D. Jones
2023-05-28 21:04:43 +12:00
parent fa671e53d8
commit 3a18506510
4 changed files with 21 additions and 1 deletions

View File

@@ -118,6 +118,7 @@ impl AnimeImage {
match anime_type {
AnimeType::GA401 => 0.8,
AnimeType::GA402 => 0.77,
AnimeType::Unknown => 0.0,
}
}
@@ -133,6 +134,7 @@ impl AnimeImage {
match anime_type {
AnimeType::GA401 => 0.3,
AnimeType::GA402 => 0.283,
AnimeType::Unknown => 0.0,
}
}
@@ -173,6 +175,7 @@ impl AnimeImage {
// and then their offset grows by one every two rows
(y + 1) / 2 - 5
}
AnimeType::Unknown => 0,
}
}
@@ -206,6 +209,7 @@ impl AnimeImage {
}
39 - y / 2
}
AnimeType::Unknown => 0,
}
}
@@ -215,6 +219,7 @@ impl AnimeImage {
// 33.0 = Longest row LED count (physical) plus half-pixel offset
AnimeType::GA401 => (33.0 + 0.5) * Self::scale_x(anime_type),
AnimeType::GA402 => (35.0 + 0.5) * Self::scale_x(anime_type),
AnimeType::Unknown => 0.0,
}
}
@@ -223,6 +228,7 @@ impl AnimeImage {
match anime_type {
AnimeType::GA401 => 55,
AnimeType::GA402 => 61,
AnimeType::Unknown => 0,
}
}
@@ -233,6 +239,7 @@ impl AnimeImage {
AnimeType::GA401 => (54.0 + 1.0) * Self::scale_y(anime_type),
// GA402 may not have dead pixels and require only the physical LED count
AnimeType::GA402 => 61.0 * Self::scale_y(anime_type),
AnimeType::Unknown => 0.0,
}
}
@@ -246,6 +253,7 @@ impl AnimeImage {
},
// GA402 does not have padding, equivalent to width
AnimeType::GA402 => AnimeImage::width(anime_type, y),
AnimeType::Unknown => 0,
}
}