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

Function jsonFormat

examples/Example_opencv.cpp:189–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187
188
189string jsonFormat(string key, string value, string type){
190 stringstream jsonFormatMessage;
191 jsonFormatMessage << ( "\"" + key + "\": " );
192
193 if(type == "string")
194 jsonFormatMessage << ( "\"" + value + "\"" );
195 if(type == "rstring")
196 jsonFormatMessage << value;
197 if(type == "int")
198 jsonFormatMessage << stoi(value);
199 if(type == "float")
200 jsonFormatMessage << (float)stof(value);
201 if(type == "double")
202 jsonFormatMessage << (double)stof(value);
203 if (type == "bool")
204 jsonFormatMessage << ((value == "true" || value == "1") ? "true" : "false");
205
206 return jsonFormatMessage.str();
207}
208
209// Return JSON string for the tracker effect
210string trackerJson(cv::Rect2d r, bool onlyProtoPath){

Callers 3

trackerJsonFunction · 0.85
stabilizerJsonFunction · 0.85
objectDetectionJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected