forked from adafruit/rpi-fb-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.h
60 lines (54 loc) · 1.21 KB
/
Config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Matrix configuration parsing class declaration.
// Author: Tony DiCola
#ifndef CONFIG_H
#define CONFIG_H
#include <string>
#include <vector>
#include "GridTransformer.h"
class Config {
public:
Config(const std::string& filename);
// Attribute accessors:
int getDisplayWidth() const {
return _display_width;
}
int getDisplayHeight() const {
return _display_height;
}
int getPanelWidth() const {
return _panel_width;
}
int getPanelHeight() const {
return _panel_height;
}
int getChainLength() const {
return _chain_length;
}
int getParallelCount() const {
return _parallel_count;
}
GridTransformer getGridTransformer() const {
return GridTransformer(_display_width, _display_height, _panel_width,
_panel_height, _chain_length, _panels);
}
bool hasCropOrigin() const {
return (_crop_x > -1) && (_crop_y > -1);
}
int getCropX() const {
return _crop_x;
}
int getCropY() const {
return _crop_y;
}
private:
int _display_width,
_display_height,
_panel_width,
_panel_height,
_chain_length,
_parallel_count,
_crop_x,
_crop_y;
std::vector<GridTransformer::Panel> _panels;
};
#endif