Summary Files Commits Branches @commit @diff @stats
path: root / src / LEDVideoWall.cpp
diff options
context:
space:
mode:
Commitd71c054e221013f5d5f24648ded514b475aed3df (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-23 14:27:10 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-23 14:27:10 +0300
Files83a260efd5f3881601c7a9ae6414d2daeee913f9 /src/LEDVideoWall.cpp
screen-generator-nemetschek-d71c054e221013f5d5f24648ded514b475aed3df.tar
screen-generator-nemetschek-d71c054e221013f5d5f24648ded514b475aed3df.tar.gz
screen-generator-nemetschek-d71c054e221013f5d5f24648ded514b475aed3df.zip
Parente2ddd0cbd2c28a33398118060294ef2479d2f63f (diff)
feat(LEDVideoWall): Store rows and columns of panels
1 files changed, 22 insertions, 6 deletions
-rw-r--r--src/LEDVideoWall.cpp28
diff --git a/src/LEDVideoWall.cpp b/src/LEDVideoWall.cpp
index 2d42fbf..45f66ba 100644
--- a/src/LEDVideoWall.cpp
+++ b/src/LEDVideoWall.cpp
@@ -1,22 +1,36 @@
#include "LEDVideoWall.h"
#include "cli.hpp"
-#include <stdio.h>
+#include <sstream>
LEDVideoWall::~LEDVideoWall() { }
LEDVideoWall* LEDVideoWall::Freeform(mm panel_width, mm panel_height, mm wall_max_width, mm wall_max_height) {
+ unsigned int columns = wall_max_width / panel_width;
+ unsigned int rows = wall_max_height / panel_height;
return new LEDVideoWall(
- (wall_max_width / panel_width) * panel_width,
- (wall_max_height / panel_height) * panel_height);
+ columns * panel_width,
+ rows * panel_height,
+ columns,
+ rows);
}
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);
+ aspect_height * panel_height,
+ aspect_width,
+ aspect_height);
}
-LEDVideoWall::LEDVideoWall(mm width, mm height) : Screen(width, height) { }
+LEDVideoWall::LEDVideoWall(
+ mm width,
+ mm height,
+ unsigned int columns_of_panels,
+ unsigned int rows_of_panels) :
+ Screen(width, height),
+ columns_of_panels(columns_of_panels),
+ rows_of_panels(rows_of_panels)
+{ }
enum class LEDVideoWallType {
Freeform = 0, Aspect
@@ -68,5 +82,7 @@ LEDVideoWall* LEDVideoWall::fromCommandLine() {
}
std::string LEDVideoWall::extraOutput() const {
- return std::string();
+ std::ostringstream output;
+ output << " (" << this->columns_of_panels << " columns by " << this->rows_of_panels << " rows of tiles)";
+ return output.str();
}