Summary Files Commits Branches @commit @diff @stats
path: root / src / LEDVideoWall.cpp
diff options
context:
space:
mode:
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();
}