OpenShot Library | libopenshot  0.1.2
Public Member Functions | Public Attributes | List of all members
openshot::Point Class Reference

A Point is the basic building block of a key-frame curve. More...

#include <Point.h>

Public Member Functions

void Initialize_Handles (float Offset=0.0f)
 
string Json ()
 Get and Set JSON methods. More...
 
Json::Value JsonValue ()
 Generate Json::JsonValue for this object. More...
 
 Point ()
 Default constructor (defaults to 1,0) More...
 
 Point (float y)
 Constructor which creates a single coordinate at X=1. 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 (Coordinate co)
 
 Point (Coordinate co, InterpolationType interpolation)
 
 Point (Coordinate co, InterpolationType interpolation, HandleType handle_type)
 
void SetJson (string value) throw (InvalidJSON)
 Load JSON string into this object. More...
 
void SetJsonValue (Json::Value root)
 Load Json::JsonValue into this object. More...
 

Public Attributes

Coordinate co
 This is the primary coordinate. More...
 
Coordinate handle_left
 This is the left handle coordinate. More...
 
Coordinate handle_right
 This is the right handle coordinate. More...
 
HandleType handle_type
 This is the handle mode. More...
 
InterpolationType interpolation
 This is the interpolation mode. More...
 

Detailed Description

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:

Coordinate c1(3,9);
assert(c1.X == 3);
assert(c1.Y == 9);

Definition at line 81 of file Point.h.

Constructor & Destructor Documentation

◆ Point() [1/7]

Point::Point ( )

Default constructor (defaults to 1,0)

Definition at line 34 of file Point.cpp.

◆ Point() [2/7]

Point::Point ( float  y)

Constructor which creates a single coordinate at X=1.

Definition at line 44 of file Point.cpp.

◆ Point() [3/7]

Point::Point ( float  x,
float  y 
)

Constructor which also creates a Point and sets the X and Y of the Point.

Definition at line 53 of file Point.cpp.

◆ Point() [4/7]

Point::Point ( float  x,
float  y,
InterpolationType  interpolation 
)

Constructor which also creates a Point and sets the X,Y, and interpolation of the Point.

Definition at line 63 of file Point.cpp.

◆ Point() [5/7]

Point::Point ( Coordinate  co)

Definition at line 72 of file Point.cpp.

◆ Point() [6/7]

Point::Point ( Coordinate  co,
InterpolationType  interpolation 
)

Definition at line 78 of file Point.cpp.

◆ Point() [7/7]

Point::Point ( Coordinate  co,
InterpolationType  interpolation,
HandleType  handle_type 
)

Definition at line 84 of file Point.cpp.

Member Function Documentation

◆ Initialize_Handles()

void Point::Initialize_Handles ( float  Offset = 0.0f)

Set the left and right handles to the same Y coordinate as the primary coordinate, but offset the X value by a given amount. This is typically used to smooth the curve (if BEZIER interpolation mode is used)

Definition at line 90 of file Point.cpp.

◆ Json()

string Point::Json ( )

Get and Set JSON methods.

Generate JSON string of this object

Definition at line 97 of file Point.cpp.

◆ JsonValue()

Json::Value Point::JsonValue ( )

Generate Json::JsonValue for this object.

Definition at line 104 of file Point.cpp.

◆ SetJson()

void Point::SetJson ( string  value)
throw (InvalidJSON
)

Load JSON string into this object.

Definition at line 121 of file Point.cpp.

◆ SetJsonValue()

void Point::SetJsonValue ( Json::Value  root)

Load Json::JsonValue into this object.

Definition at line 144 of file Point.cpp.

Member Data Documentation

◆ co

Coordinate openshot::Point::co

This is the primary coordinate.

Definition at line 83 of file Point.h.

◆ handle_left

Coordinate openshot::Point::handle_left

This is the left handle coordinate.

Definition at line 84 of file Point.h.

◆ handle_right

Coordinate openshot::Point::handle_right

This is the right handle coordinate.

Definition at line 85 of file Point.h.

◆ handle_type

HandleType openshot::Point::handle_type

This is the handle mode.

Definition at line 87 of file Point.h.

◆ interpolation

InterpolationType openshot::Point::interpolation

This is the interpolation mode.

Definition at line 86 of file Point.h.


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