move output factors to Scene class

This commit is contained in:
Shuo Feng 2024-02-01 18:42:40 -05:00
parent 8550abf235
commit baea2db514
Signed by: sfeng
GPG key ID: 1E83AE6CD1C037B1
2 changed files with 41 additions and 0 deletions

18
src/Scene.cc Normal file
View file

@ -0,0 +1,18 @@
#include "Scene.h"
Scene::Scene(const nlohmann::json &output) {
for (auto i = output.begin(); i != output.end(); ++i) {
if (i->contains("filename")) {
this->name = (*i)["filename"].get<string>();
}
if (i->contains("size")) {
this->width = (*i)["size"].at(0).get<int>();
this->height = (*i)["size"].at(1).get<int>();
}
}
}
string Scene::getName() { return this->name; }
int Scene::getWidth() { return this->width; }
int Scene::getHeight() { return this->height; }