MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / SetJsonValue

Method SetJsonValue

src/TextReader.cpp:225–260  ·  view source on GitHub ↗

Load Json::Value into this object

Source from the content-addressed store, hash-verified

223
224// Load Json::Value into this object
225void TextReader::SetJsonValue(const Json::Value root) {
226
227 // Set parent data
228 ReaderBase::SetJsonValue(root);
229
230 // Set data from Json (if key is found)
231 if (!root["width"].isNull())
232 width = root["width"].asInt();
233 if (!root["height"].isNull())
234 height = root["height"].asInt();
235 if (!root["x_offset"].isNull())
236 x_offset = root["x_offset"].asInt();
237 if (!root["y_offset"].isNull())
238 y_offset = root["y_offset"].asInt();
239 if (!root["text"].isNull())
240 text = root["text"].asString();
241 if (!root["font"].isNull())
242 font = root["font"].asString();
243 if (!root["size"].isNull())
244 size = root["size"].asDouble();
245 if (!root["text_color"].isNull())
246 text_color = root["text_color"].asString();
247 if (!root["background_color"].isNull())
248 background_color = root["background_color"].asString();
249 if (!root["text_background_color"].isNull())
250 text_background_color = root["text_background_color"].asString();
251 if (!root["gravity"].isNull())
252 gravity = (GravityType) root["gravity"].asInt();
253
254 // Re-Open path, and re-init everything (if needed)
255 if (is_open)
256 {
257 Close();
258 Open();
259 }
260}
261
262#endif //USE_IMAGEMAGICK

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected