Anime: incorrect dimensions and pitch

This commit is contained in:
Luke D. Jones
2023-06-16 00:34:45 +12:00
parent 40e00c4739
commit ea2d80cc44

View File

@@ -118,7 +118,7 @@ impl AnimeImage {
match anime_type {
AnimeType::GA401 => 0.8,
AnimeType::GA402 => 0.77,
AnimeType::GU604 => 0.77,
AnimeType::GU604 => 0.7,
AnimeType::Unknown => 0.0,
}
}
@@ -135,7 +135,7 @@ impl AnimeImage {
match anime_type {
AnimeType::GA401 => 0.3,
AnimeType::GA402 => 0.283,
AnimeType::GU604 => 0.283,
AnimeType::GU604 => 0.213,
AnimeType::Unknown => 0.0,
}
}
@@ -178,8 +178,8 @@ impl AnimeImage {
(y + 1) / 2 - 5
}
AnimeType::GU604 => {
// first 11 rows start at zero
if y <= 9 {
// first 9 rows start at zero
if y < 10 {
return 0;
}
// and then their offset grows by one every two rows
@@ -223,7 +223,7 @@ impl AnimeImage {
if y <= 9 {
return 39;
}
44 - y / 2
43 - y / 2
}
AnimeType::Unknown => 0,
}
@@ -235,7 +235,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::GU604 => (35.0 + 0.5) * Self::scale_x(anime_type),
AnimeType::GU604 => (39.0 + 0.5) * Self::scale_x(anime_type),
AnimeType::Unknown => 0.0,
}
}
@@ -245,7 +245,7 @@ impl AnimeImage {
match anime_type {
AnimeType::GA401 => 55,
AnimeType::GA402 => 61,
AnimeType::GU604 => 61,
AnimeType::GU604 => 86,
AnimeType::Unknown => 0,
}
}
@@ -257,7 +257,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::GU604 => 61.0 * Self::scale_y(anime_type),
AnimeType::GU604 => 86.0 * Self::scale_y(anime_type),
AnimeType::Unknown => 0.0,
}
}