Load Json::Value into this object
| 310 | |
| 311 | // Load Json::Value into this object |
| 312 | void Profile::SetJsonValue(const Json::Value root) { |
| 313 | |
| 314 | if (!root["description"].isNull()) |
| 315 | info.description = root["description"].asString(); |
| 316 | if (!root["height"].isNull()) |
| 317 | info.height = root["height"].asInt(); |
| 318 | if (!root["width"].isNull()) |
| 319 | info.width = root["width"].asInt(); |
| 320 | if (!root["pixel_format"].isNull()) |
| 321 | info.pixel_format = root["pixel_format"].asInt(); |
| 322 | if (!root["fps"].isNull()) { |
| 323 | info.fps.num = root["fps"]["num"].asInt(); |
| 324 | info.fps.den = root["fps"]["den"].asInt(); |
| 325 | } |
| 326 | if (!root["pixel_ratio"].isNull()) { |
| 327 | info.pixel_ratio.num = root["pixel_ratio"]["num"].asInt(); |
| 328 | info.pixel_ratio.den = root["pixel_ratio"]["den"].asInt(); |
| 329 | info.pixel_ratio.Reduce(); |
| 330 | } |
| 331 | if (!root["display_ratio"].isNull()) { |
| 332 | info.display_ratio.num = root["display_ratio"]["num"].asInt(); |
| 333 | info.display_ratio.den = root["display_ratio"]["den"].asInt(); |
| 334 | info.display_ratio.Reduce(); |
| 335 | } |
| 336 | if (!root["progressive"].isNull()) |
| 337 | info.interlaced_frame = !root["progressive"].asBool(); |
| 338 | if (!root["spherical"].isNull()) |
| 339 | info.spherical = root["spherical"].asBool(); |
| 340 | |
| 341 | } |