#include #include "Setup.h" #include "Constant.h" using namespace std; map setup(); // 构造函数 Setup::Setup(string setupFileName) { this->mapSetup = loadSetup(setupFileName); this->setResolution(); }; // 打印所有设定项 void Setup::printSetup() { cout << "----- Print all setup -----" << endl; for (auto & x: this->mapSetup) { std::cout << "[" << x.first << "]:[" << x.second << "]" << endl; } }; // 设定分辨率 void Setup::setResolution() { this->resolution_width = stoi(mapSetup.at(RESOLUTION_WIDTH)); // 从设定处取得 this->resolution_height = stoi(mapSetup.at(RESOLUTION_HEIGHT)); // 从设定处取得 }; // 取得分辨率 int Setup::getResolution() { // 水平分辨率 X 垂直分辨率 return this->resolution_width * this->resolution_height; };