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

Method SetJsonValue

src/effects/Mask.cpp:207–226  ·  view source on GitHub ↗

Load Json::Value into this object

Source from the content-addressed store, hash-verified

205
206// Load Json::Value into this object
207void Mask::SetJsonValue(const Json::Value root) {
208 Json::Value normalized_root = root;
209 // Legacy compatibility: keep accepting "reader" on Mask effects.
210 if (!normalized_root["reader"].isNull() && normalized_root["mask_reader"].isNull())
211 normalized_root["mask_reader"] = normalized_root["reader"];
212
213 // Set parent data
214 EffectBase::SetJsonValue(normalized_root);
215
216 // Set data from Json (if key is found)
217 if (!normalized_root["replace_image"].isNull())
218 replace_image = normalized_root["replace_image"].asBool();
219 if (!normalized_root["fade_audio_hint"].isNull())
220 fade_audio_hint = normalized_root["fade_audio_hint"].asBool();
221 if (!normalized_root["brightness"].isNull())
222 brightness.SetJsonValue(normalized_root["brightness"]);
223 if (!normalized_root["contrast"].isNull())
224 contrast.SetJsonValue(normalized_root["contrast"]);
225
226}
227
228// Get all properties for a specific frame
229std::string Mask::PropertiesJSON(int64_t requested_frame) const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected