31 #ifndef OPENSHOT_KEYFRAME_H
32 #define OPENSHOT_KEYFRAME_H
66 std::vector<Point> Points;
95 double GetValue(int64_t index)
const;
98 int GetInt(int64_t index)
const;
101 int64_t
GetLong(int64_t index)
const;
107 double GetDelta(int64_t index)
const;
135 std::string
Json()
const;
137 void SetJson(
const std::string value);
Header file for Fraction class.
void FlipPoints()
Flip all the points in this openshot::Keyframe (useful for reversing an effect or transition...
Point GetClosestPoint(Point p) const
Get current point (or closest point to the right) from the X coordinate (i.e. the frame number) ...
int64_t GetLong(int64_t index) const
Get the rounded LONG value at a specific index.
Header file for Point class.
void ScalePoints(double scale)
A Point is the basic building block of a key-frame curve.
bool Contains(Point p) const
Does this keyframe contain a specific point.
Json::Value JsonValue() const
Generate Json::Value for this object.
Fraction GetRepeatFraction(int64_t index) const
Get the fraction that represents how many times this value is repeated in the curve.
int64_t GetLength() const
void UpdatePoint(int64_t index, Point p)
Replace an existing point with a new point.
void AddPoint(Point p)
Add a new point on the key-frame. Each point has a primary coordinate, a left handle, and a right handle.
Keyframe()=default
Default constructor for the Keyframe class.
Header file for all Exception classes.
Point const & GetPoint(int64_t index) const
Get a point at a specific index.
int64_t FindIndex(Point p) const
Get the index of a point by matching a coordinate.
double GetValue(int64_t index) const
Get the value at a specific index.
void RemovePoint(Point p)
Remove a point by matching a coordinate.
Header file for JSON class.
std::string Json() const
Get and Set JSON methods.
This class represents a fraction.
bool IsIncreasing(int index) const
Get the direction of the curve at a specific index (increasing or decreasing)
int GetInt(int64_t index) const
Get the rounded INT value at a specific index.
InterpolationType
This controls how a Keyframe uses this point to interpolate between two points.
void PrintValues() const
Print just the Y value of the point's primary coordinate.
Point GetMaxPoint() const
Get max point (by Y coordinate)
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
This namespace is the default namespace for all code in the openshot library.
Header file for Coordinate class.
Point GetPreviousPoint(Point p) const
Get previous point (.
double GetDelta(int64_t index) const
Get the change in Y value (from the previous Y value)
void SetJson(const std::string value)
Load JSON string into this object.
int64_t GetCount() const
Get the number of points (i.e. # of points)
A Keyframe is a collection of Point instances, which is used to vary a number or property over time...
void PrintPoints() const
Print a list of points.