OpenShot Library | libopenshot
0.4.0
|
A Point is the basic building block of a key-frame curve. More...
#include <Point.h>
Public Member Functions | |
void | Initialize_Handles () |
void | Initialize_LeftHandle (float x, float y) |
Set the left handle to a percent of the primary coordinate (0 to 1) More... | |
void | Initialize_RightHandle (float x, float y) |
Set the right handle to a percent of the primary coordinate (0 to 1) More... | |
std::string | Json () const |
Generate JSON string of this object. More... | |
Json::Value | JsonValue () const |
Generate Json::Value for this object. More... | |
Point () | |
Default constructor (defaults to 1,0) More... | |
Point (const Coordinate &co) | |
Constructor which takes a coordinate. More... | |
Point (const Coordinate &co, InterpolationType interpolation) | |
Constructor which takes a coordinate and interpolation mode. More... | |
Point (const Coordinate &co, InterpolationType interpolation, HandleType handle_type) | |
Constructor which takes a coordinate, interpolation mode, and handle type. More... | |
Point (float x, float y) | |
Constructor which also creates a Point and sets the X and Y of the Point. More... | |
Point (float x, float y, InterpolationType interpolation) | |
Constructor which also creates a Point and sets the X,Y, and interpolation of the Point. More... | |
Point (float y) | |
Constructor which creates a single coordinate at X=1. More... | |
void | SetJson (const std::string value) |
Load JSON string into this object. More... | |
void | SetJsonValue (const Json::Value root) |
Load Json::Value into this object. More... | |
Public Attributes | |
Coordinate | co |
This is the primary coordinate. More... | |
Coordinate | handle_left |
This is the left handle coordinate (in percentages from 0 to 1) More... | |
Coordinate | handle_right |
This is the right handle coordinate (in percentages from 0 to 1) More... | |
HandleType | handle_type |
This is the handle mode. More... | |
InterpolationType | interpolation |
This is the interpolation mode. More... | |
A Point is the basic building block of a key-frame curve.
Points have a primary coordinate and a left and right handle coordinate. The handles are used to influence the direction of the curve as it moves between the primary coordinate and the next primary coordinate when the interpolation mode is BEZIER. When using LINEAR or CONSTANT, the handles are ignored.
Please see the following Example Code:
Point::Point | ( | float | y | ) |
Point::Point | ( | float | x, |
float | y | ||
) |
Point::Point | ( | float | x, |
float | y, | ||
InterpolationType | interpolation | ||
) |
Point::Point | ( | const Coordinate & | co | ) |
Point::Point | ( | const Coordinate & | co, |
InterpolationType | interpolation | ||
) |
Point::Point | ( | const Coordinate & | co, |
InterpolationType | interpolation, | ||
HandleType | handle_type | ||
) |
void Point::Initialize_Handles | ( | ) |
void Point::Initialize_LeftHandle | ( | float | x, |
float | y | ||
) |
Set the left handle to a percent of the primary coordinate (0 to 1)
Definition at line 52 of file Point.cpp.
Referenced by Initialize_Handles().
void Point::Initialize_RightHandle | ( | float | x, |
float | y | ||
) |
Set the right handle to a percent of the primary coordinate (0 to 1)
Definition at line 57 of file Point.cpp.
Referenced by Initialize_Handles().
std::string Point::Json | ( | ) | const |
Json::Value Point::JsonValue | ( | ) | const |
void Point::SetJson | ( | const std::string | value | ) |
void Point::SetJsonValue | ( | const Json::Value | root | ) |
Load Json::Value into this object.
Definition at line 104 of file Point.cpp.
Referenced by SetJson(), and openshot::Keyframe::SetJsonValue().
Coordinate openshot::Point::co |
This is the primary coordinate.
Definition at line 66 of file Point.h.
Referenced by openshot::ClipBase::add_property_json(), openshot::TrackedObjectBBox::add_property_json(), openshot::Keyframe::AddPoint(), openshot::Keyframe::Contains(), openshot::Keyframe::FindIndex(), openshot::Keyframe::GetClosestPoint(), openshot::Keyframe::GetMaxPoint(), openshot::InterpolateBetween(), openshot::InterpolateBezierCurve(), openshot::TrackedObjectBBox::InterpolateBoxes(), openshot::InterpolateLinearCurve(), openshot::IsPointBeforeX(), JsonValue(), openshot::operator<<(), openshot::Keyframe::RemovePoint(), SearchBetweenPoints(), and SetJsonValue().
Coordinate openshot::Point::handle_left |
This is the left handle coordinate (in percentages from 0 to 1)
Definition at line 67 of file Point.h.
Referenced by Initialize_LeftHandle(), openshot::InterpolateBezierCurve(), JsonValue(), openshot::operator<<(), and SetJsonValue().
Coordinate openshot::Point::handle_right |
This is the right handle coordinate (in percentages from 0 to 1)
Definition at line 68 of file Point.h.
Referenced by Initialize_RightHandle(), openshot::InterpolateBezierCurve(), JsonValue(), openshot::operator<<(), and SetJsonValue().
HandleType openshot::Point::handle_type |
This is the handle mode.
Definition at line 70 of file Point.h.
Referenced by JsonValue(), and SetJsonValue().
InterpolationType openshot::Point::interpolation |
This is the interpolation mode.
Definition at line 69 of file Point.h.
Referenced by openshot::ClipBase::add_property_json(), openshot::TrackedObjectBBox::add_property_json(), openshot::InterpolateBetween(), JsonValue(), openshot::operator<<(), and SetJsonValue().