28 #include "../include/Coordinate.h" 34 Coordinate::Coordinate() :
35 X(0), Y(0), increasing(true), repeated(1,1), delta(0.0) {
40 X(x),
Y(y), increasing(true), repeated(1,1), delta(0.0) {
74 bool success = reader.parse( value, root );
77 throw InvalidJSON(
"JSON could not be parsed (or is invalid)",
"");
87 throw InvalidJSON(
"JSON is invalid (missing keys or invalid data types)",
"");
95 if (!root[
"X"].isNull())
96 X = root[
"X"].asDouble();
97 if (!root[
"Y"].isNull())
98 Y = root[
"Y"].asDouble();
99 if (!root[
"increasing"].isNull())
100 increasing = root[
"increasing"].asBool();
101 if (!root[
"repeated"].isNull() && root[
"repeated"].isObject())
103 if (!root[
"repeated"][
"num"].isNull())
104 repeated.
num = root[
"repeated"][
"num"].asInt();
105 if (!root[
"repeated"][
"den"].isNull())
106 repeated.
den = root[
"repeated"][
"den"].asInt();
108 if (!root[
"delta"].isNull())
109 delta = root[
"delta"].asDouble();
int num
Numerator for the fraction.
string Json()
Get and Set JSON methods.
void SetJsonValue(Json::Value root)
Load Json::JsonValue into this object.
double Y
The Y value of the coordinate (usually representing the value of the property being animated) ...
double X
The X value of the coordinate (usually representing the frame #)
This namespace is the default namespace for all code in the openshot library.
Coordinate()
The default constructor, which defaults to (0,0)
Exception for invalid JSON.
void SetJson(string value)
Load JSON string into this object.
int den
Denominator for the fraction.
Json::Value JsonValue()
Generate Json::JsonValue for this object.