OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
Coordinate.h
Go to the documentation of this file.
1
8
9
// Copyright (c) 2008-2019 OpenShot Studios, LLC
10
//
11
// SPDX-License-Identifier: LGPL-3.0-or-later
12
13
#ifndef OPENSHOT_COORDINATE_H
14
#define OPENSHOT_COORDINATE_H
15
16
#include <iostream>
17
#include "
Fraction.h
"
18
#include "
Json.h
"
19
20
namespace
openshot
{
21
38
class
Coordinate
{
39
public
:
40
double
X
;
41
double
Y
;
42
44
Coordinate
();
45
49
Coordinate
(
double
x,
double
y);
50
53
Coordinate
(
const
std::pair<double, double>& co);
54
55
// Get and Set JSON methods
56
std::string
Json
()
const
;
57
Json::Value
JsonValue
()
const
;
58
void
SetJson
(
const
std::string value);
59
void
SetJsonValue
(
const
Json::Value root);
60
};
61
63
template
<
class
char
T,
class
traits>
64
std::basic_ostream<charT, traits>&
65
operator<<
(std::basic_ostream<charT, traits>& o,
const
openshot::Coordinate
& co) {
66
std::basic_ostringstream<charT, traits> s;
67
s.flags(o.flags());
68
s.imbue(o.getloc());
69
s.precision(o.precision());
70
s <<
"("
<< co.
X
<<
", "
<< co.
Y
<<
")"
;
71
return
o << s.str();
72
}
73
74
}
75
76
#endif
Fraction.h
Header file for Fraction class.
Json.h
Header file for JSON class.
openshot::Coordinate
A Cartesian coordinate (X, Y) used in the Keyframe animation system.
Definition
Coordinate.h:38
openshot::Coordinate::SetJsonValue
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
Definition
Coordinate.cpp:70
openshot::Coordinate::JsonValue
Json::Value JsonValue() const
Generate Json::Value for this object.
Definition
Coordinate.cpp:36
openshot::Coordinate::Json
std::string Json() const
Generate JSON string of this object.
Definition
Coordinate.cpp:29
openshot::Coordinate::SetJson
void SetJson(const std::string value)
Load JSON string into this object.
Definition
Coordinate.cpp:53
openshot::Coordinate::X
double X
The X value of the coordinate (usually representing the frame #).
Definition
Coordinate.h:40
openshot::Coordinate::Y
double Y
The Y value of the coordinate (usually representing the value of the property being animated).
Definition
Coordinate.h:41
openshot::Coordinate::Coordinate
Coordinate()
The default constructor, which defaults to (0,0).
Definition
Coordinate.cpp:19
openshot
This namespace is the default namespace for all code in the openshot library.
Definition
AnimatedCurve.h:24
openshot::operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &o, const openshot::Coordinate &co)
Stream output operator for openshot::Coordinate.
Definition
Coordinate.h:65
Coordinate.h
Generated by
1.17.0