Loading...
Searching...
No Matches
openshot::Coordinate Class Reference

A Cartesian coordinate (X, Y) used in the Keyframe animation system. More...

`#include <Coordinate.h>`

## Public Member Functions

| Coordinate ()
| The default constructor, which defaults to (0,0)
| Coordinate (const std::pair< double, double > &co)
| Constructor which accepts a std::pair tuple for {X, Y}.
| Coordinate (double x, double y)
| Constructor which also sets the X and Y.
std::string | Json () const
| Generate JSON string of this object.
Json::Value | JsonValue () const
| Generate Json::Value for this object.
void | SetJson (const std::string value)
| Load JSON string into this object.
void | SetJsonValue (const Json::Value root)
| Load Json::Value into this object.

## Public Attributes

double | X
| The X value of the coordinate (usually representing the frame #)
double | Y
| The Y value of the coordinate (usually representing the value of the property being animated)

## Detailed Description

A Cartesian coordinate (X, Y) used in the Keyframe animation system.

Animation involves the changing (i.e. interpolation) of numbers over time. A series of Coordinate objects allows us to plot a specific curve or line used during interpolation. In other words, it helps us control how a value changes over time — whether it's increasing or decreasing (the direction of the slope) and how quickly (the steepness of the curve).

Please see the following Example Code:

Coordinate c1(2,4);
assert(c1.X == 2.0f);
assert(c1.Y == 4.0f);
openshot::Coordinate
A Cartesian coordinate (X, Y) used in the Keyframe animation system.
Definition Coordinate.h:38

Definition at line 38 of file Coordinate.h.

## Constructor & Destructor Documentation

## Coordinate() [1/3]

Coordinate::Coordinate | ( |  | ) |

The default constructor, which defaults to (0,0)

Definition at line 19 of file Coordinate.cpp.

## Coordinate() [2/3]

Coordinate::Coordinate | ( | double | x,
|  | double | y
| ) |  |

Constructor which also sets the X and Y.

Parameters

  x | The X coordinate (usually representing the frame #)
  y | The Y coordinate (usually representing the value of the property being animated)

Definition at line 22 of file Coordinate.cpp.

## Coordinate() [3/3]

Coordinate::Coordinate | ( | const std::pair< double, double > & | co | ) |

Constructor which accepts a std::pair tuple for {X, Y}.

Parameters

  co | A std::pair<double, double> tuple containing (X, Y)

Definition at line 25 of file Coordinate.cpp.

## Member Function Documentation

## Json()

std::string Coordinate::Json | ( |  | ) | const

Generate JSON string of this object.

Definition at line 29 of file Coordinate.cpp.

## JsonValue()

Json::Value Coordinate::JsonValue | ( |  | ) | const

Generate Json::Value for this object.

Definition at line 36 of file Coordinate.cpp.

Referenced by Json(), and openshot::Point::JsonValue().

## SetJson()

void Coordinate::SetJson | ( | const std::string | value | ) |

Load JSON string into this object.

Definition at line 53 of file Coordinate.cpp.

## SetJsonValue()

void Coordinate::SetJsonValue | ( | const Json::Value | root | ) |

Load Json::Value into this object.

Definition at line 70 of file Coordinate.cpp.

Referenced by SetJson(), and openshot::Point::SetJsonValue().

## Member Data Documentation

## X

double openshot::Coordinate::X

The X value of the coordinate (usually representing the frame #)

Definition at line 40 of file Coordinate.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::InterpolateBetween(), openshot::InterpolateBezierCurve(), openshot::InterpolateLinearCurve(), openshot::IsPointBeforeX(), JsonValue(), openshot::Keyframe::RemovePoint(), SearchBetweenPoints(), and SetJsonValue().

## Y

double openshot::Coordinate::Y

The Y value of the coordinate (usually representing the value of the property being animated)

Definition at line 41 of file Coordinate.h.

Referenced by openshot::Keyframe::FindIndex(), openshot::Keyframe::GetMaxPoint(), openshot::InterpolateBetween(), openshot::InterpolateBezierCurve(), openshot::TrackedObjectBBox::InterpolateBoxes(), openshot::InterpolateLinearCurve(), JsonValue(), openshot::Keyframe::RemovePoint(), and SetJsonValue().

The documentation for this class was generated from the following files:

- Coordinate.h
- Coordinate.cpp