Summary Files Commits Branches @commit @diff @stats
path: root / src / LEDVideoWall.cpp
diff options
context:
space:
mode:
Commit6244d8aa64d4d8ecf440b8cf6c0bcdd1ab2cd1d6 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-23 13:54:55 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-23 13:54:55 +0300
Filesc3eb560df5409d549c9b1c66e2ef176321158b93 /src/LEDVideoWall.cpp
screen-generator-nemetschek-6244d8aa64d4d8ecf440b8cf6c0bcdd1ab2cd1d6.tar
screen-generator-nemetschek-6244d8aa64d4d8ecf440b8cf6c0bcdd1ab2cd1d6.tar.gz
screen-generator-nemetschek-6244d8aa64d4d8ecf440b8cf6c0bcdd1ab2cd1d6.zip
Parent3cb54ae0a20f45b7681a23c7984592bd3a5aa863 (diff)
feat: Implement aspect LED video wall
1 files changed, 21 insertions, 4 deletions
-rw-r--r--src/LEDVideoWall.cpp25
diff --git a/src/LEDVideoWall.cpp b/src/LEDVideoWall.cpp
index b86afb0..ad3dc3c 100644
--- a/src/LEDVideoWall.cpp
+++ b/src/LEDVideoWall.cpp
@@ -10,10 +10,16 @@ LEDVideoWall* LEDVideoWall::Freeform(mm panel_width, mm panel_height, mm wall_ma
(wall_max_height / panel_height) * panel_height);
}
+LEDVideoWall* LEDVideoWall::Aspect(mm panel_width, mm panel_height, unsigned int aspect_width, unsigned int aspect_height) {
+ return new LEDVideoWall(
+ aspect_width * panel_width,
+ aspect_height * panel_height);
+}
+
LEDVideoWall::LEDVideoWall(mm width, mm height) : Screen(width, height) { }
enum class LEDVideoWallType {
- Freeform = 0
+ Freeform = 0, Aspect
};
LEDVideoWall* LEDVideoWall::fromCommandLine() {
@@ -29,11 +35,11 @@ LEDVideoWall* LEDVideoWall::fromCommandLine() {
"Enter height for a single panel (in mm): ",
"Invalid panel height, try again!");
- unsigned int itype = 1;
+ unsigned int itype = 2;
cli::readUserInputMax(
itype,
- (unsigned int)1,
- "Select an LED video wall type [0 for Freeform]: ",
+ (unsigned int)2,
+ "Select an LED video wall type [0 for Freeform, 1 for Aspect]: ",
"Invalid type, try again!");
LEDVideoWallType type = static_cast<LEDVideoWallType>(itype);
@@ -53,6 +59,17 @@ LEDVideoWall* LEDVideoWall::fromCommandLine() {
return LEDVideoWall::Freeform(ipanel_width, ipanel_height, iwall_max_width, iwall_max_height);
};
+
+ case LEDVideoWallType::Aspect: {
+ mm i_width = 0, i_height = 0;
+ printf("Enter aspect ratio (in the format 'width:height'): ");
+ while (scanf("%d:%d", &i_width, &i_height) != 2) {
+ printf("Invalid input, try again!\n");
+ printf("Enter aspect ratio (in the format 'width:height'): ");
+ }
+
+ return LEDVideoWall::Aspect(ipanel_width, ipanel_height, i_width, i_height);
+ };
}
throw std::logic_error("Implementation error: didn't handle all types of LED video walls!");
}