| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * This file is part of the Falcon Player (FPP) and is Copyright (C) | ||
| 4 | * 2013-2022 by the Falcon Player Developers. | ||
| 5 | * | ||
| 6 | * The Falcon Player (FPP) is free software, and is covered under | ||
| 7 | * multiple Open Source licenses. Please see the included 'LICENSES' | ||
| 8 | * file for descriptions of what files are covered by each license. | ||
| 9 | * | ||
| 10 | * This source file is covered under the LGPL v2.1 as described in the | ||
| 11 | * included LICENSE.LGPL file. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <string> | ||
| 15 | #include <vector> | ||
| 16 | |||
| 17 | #include "ColorOrder.h" | ||
| 18 | |||
| 19 | #define MAX_MATRIX_OUTPUTS 24 | ||
| 20 | #define MAX_PANELS_PER_OUTPUT 24 | ||
| 21 | #define MAX_MATRIX_PANELS (MAX_MATRIX_OUTPUTS * MAX_PANELS_PER_OUTPUT) | ||
| 22 | |||
| 23 | class LEDPanel { | ||
| 24 | public: | ||
| 25 | int output; | ||
| 26 | int chain; | ||
| 27 | int width; | ||
| 28 | int height; | ||
| 29 | char orientation; | ||
| 30 | int xOffset; | ||
| 31 | int yOffset; | ||
| 32 | |||
| 33 | FPPColorOrder colorOrder; | ||
| 34 | |||
| 35 | std::vector<int> pixelMap; | ||
| 36 | |||
| 37 | void drawTestPattern(unsigned char* channelData, int cycleNum, float percentOfCycle, int testType); | ||
| 38 | |||
| 39 | private: | ||
| 40 | void drawFadePattern(unsigned char* channelData, float percentOfCycle, int testType); | ||
| 41 | void setPixel(unsigned char* channelData, int idx, int r, int g, int b); | ||
| 42 | void drawNumber(int v, int x, int y, unsigned char* channelData); | ||
| 43 | }; | ||
| 44 | |||
| 45 | class PanelMatrix { | ||
| 46 | public: | ||
| 47 | PanelMatrix(int panelWidth, int panelHeight, int invertedData = 0); | ||
| 48 | ~PanelMatrix(); | ||
| 49 | |||
| 50 | int AddPanel(int output, int chain, char orientation, | ||
| 51 | ✗ | int xOffset, int yOffset, FPPColorOrder colorOrder = FPPColorOrder::kColorOrderRGB); | |
| 52 | |||
| 53 | int ConfigurePanels(std::string layout); | ||
| 54 | |||
| 55 | 118 | int Width(void) { return m_width; } | |
| 56 | 118 | int Height(void) { return m_height; } | |
| 57 | 118 | int PanelCount(void) { return m_panelCount; } | |
| 58 | |||
| 59 | // Map of output channels to full matrix channels | ||
| 60 | std::vector<int> m_outputPixelMap[MAX_MATRIX_OUTPUTS]; | ||
| 61 | |||
| 62 | // Unsorted list of panels on a output | ||
| 63 | std::vector<int> m_outputPanels[MAX_MATRIX_OUTPUTS]; | ||
| 64 | LEDPanel m_panels[MAX_MATRIX_PANELS]; | ||
| 65 | |||
| 66 | private: | ||
| 67 | int AddPanel(std::string config); | ||
| 68 | |||
| 69 | int CalculateMaps(void); | ||
| 70 | |||
| 71 | int m_width; | ||
| 72 | int m_height; | ||
| 73 | int m_outputCount; | ||
| 74 | int m_pixelCount; | ||
| 75 | int m_panelCount; | ||
| 76 | int m_panelWidth; | ||
| 77 | int m_panelHeight; | ||
| 78 | int m_invertedData; | ||
| 79 | }; | ||
| 80 |