OpenShot Library | libopenshot  0.3.3
Public Member Functions | Public Attributes | Protected Attributes | List of all members
openshot::TrackedObjectBase Class Referenceabstract

This abstract class is the base class of all Tracked Objects. More...

#include <TrackedObjectBase.h>

Inheritance diagram for openshot::TrackedObjectBase:
[legend]
Collaboration diagram for openshot::TrackedObjectBase:
[legend]

Public Member Functions

Json::Value add_property_choice_json (std::string name, int value, int selected_value) const
 Generate JSON choice for a property (dropdown properties) More...
 
virtual void AddBox (int64_t _frame_num, float _cx, float _cy, float _width, float _height, float _angle)
 Add a bounding box to the tracked object's BoxVec map. More...
 
virtual bool ExactlyContains (int64_t frame_number) const
 Check if there is data for the exact frame number. More...
 
virtual std::map< std::string, float > GetBoxValues (int64_t frame_number) const
 Return the main properties of a TrackedObjectBBox instance - such as position, size and rotation. More...
 
std::string Id () const
 Get the id of this object. More...
 
void Id (std::string _id)
 Set the id of this object. More...
 
virtual std::string Json () const =0
 Get and Set JSON methods. More...
 
virtual Json::Value JsonValue () const =0
 Generate Json::Value for this object. More...
 
ClipBaseParentClip () const
 Get and set the parentClip of this object. More...
 
void ParentClip (ClipBase *clip)
 
virtual Json::Value PropertiesJSON (int64_t requested_frame) const =0
 
virtual void ScalePoints (double scale)
 Scale an object's property. More...
 
virtual void SetJson (const std::string value)=0
 Load JSON string into this object. More...
 
virtual void SetJsonValue (const Json::Value root)=0
 Load Json::Value into this object. More...
 
 TrackedObjectBase ()
 Default constructor. More...
 
 TrackedObjectBase (std::string _id)
 Constructor which takes an object ID. More...
 
virtual ~TrackedObjectBase ()=default
 Destructor. More...
 

Public Attributes

Keyframe draw_box
 Keyframe to determine if a specific box is drawn (or hidden) More...
 
Keyframe visible
 Keyframe to track if a box is visible in the current frame (read-only) More...
 

Protected Attributes

std::string id
 
ClipBaseparentClip
 

Detailed Description

This abstract class is the base class of all Tracked Objects.

A Tracked Object is an object or a desired set of pixels in a digital image which properties (such as position, width and height) can be detected and predicted along the frames of a clip.

Definition at line 35 of file TrackedObjectBase.h.

Constructor & Destructor Documentation

◆ TrackedObjectBase() [1/2]

openshot::TrackedObjectBase::TrackedObjectBase ( )

Default constructor.

Definition at line 22 of file TrackedObjectBase.cpp.

◆ TrackedObjectBase() [2/2]

openshot::TrackedObjectBase::TrackedObjectBase ( std::string  _id)

Constructor which takes an object ID.

Definition at line 25 of file TrackedObjectBase.cpp.

◆ ~TrackedObjectBase()

virtual openshot::TrackedObjectBase::~TrackedObjectBase ( )
virtualdefault

Destructor.

Member Function Documentation

◆ add_property_choice_json()

Json::Value openshot::TrackedObjectBase::add_property_choice_json ( std::string  name,
int  value,
int  selected_value 
) const

Generate JSON choice for a property (dropdown properties)

Definition at line 28 of file TrackedObjectBase.cpp.

Referenced by openshot::TrackedObjectBBox::PropertiesJSON().

◆ AddBox()

virtual void openshot::TrackedObjectBase::AddBox ( int64_t  _frame_num,
float  _cx,
float  _cy,
float  _width,
float  _height,
float  _angle 
)
inlinevirtual

Add a bounding box to the tracked object's BoxVec map.

Reimplemented in openshot::TrackedObjectBBox.

Definition at line 73 of file TrackedObjectBase.h.

◆ ExactlyContains()

virtual bool openshot::TrackedObjectBase::ExactlyContains ( int64_t  frame_number) const
inlinevirtual

Check if there is data for the exact frame number.

Reimplemented in openshot::TrackedObjectBBox.

Definition at line 66 of file TrackedObjectBase.h.

◆ GetBoxValues()

virtual std::map<std::string, float> openshot::TrackedObjectBase::GetBoxValues ( int64_t  frame_number) const
inlinevirtual

Return the main properties of a TrackedObjectBBox instance - such as position, size and rotation.

Reimplemented in openshot::TrackedObjectBBox.

Definition at line 71 of file TrackedObjectBase.h.

◆ Id() [1/2]

std::string openshot::TrackedObjectBase::Id ( ) const
inline

◆ Id() [2/2]

void openshot::TrackedObjectBase::Id ( std::string  _id)
inline

Set the id of this object.

Definition at line 60 of file TrackedObjectBase.h.

◆ Json()

virtual std::string openshot::TrackedObjectBase::Json ( ) const
pure virtual

Get and Set JSON methods.

Generate JSON string of this object

Implemented in openshot::TrackedObjectBBox.

◆ JsonValue()

virtual Json::Value openshot::TrackedObjectBase::JsonValue ( ) const
pure virtual

Generate Json::Value for this object.

Implemented in openshot::TrackedObjectBBox.

◆ ParentClip() [1/2]

ClipBase* openshot::TrackedObjectBase::ParentClip ( ) const
inline

Get and set the parentClip of this object.

Definition at line 62 of file TrackedObjectBase.h.

◆ ParentClip() [2/2]

void openshot::TrackedObjectBase::ParentClip ( ClipBase clip)
inline

Definition at line 63 of file TrackedObjectBase.h.

◆ PropertiesJSON()

virtual Json::Value openshot::TrackedObjectBase::PropertiesJSON ( int64_t  requested_frame) const
pure virtual

Get all properties for a specific frame (perfect for a UI to display the current state of all properties at any time)

Implemented in openshot::TrackedObjectBBox.

◆ ScalePoints()

virtual void openshot::TrackedObjectBase::ScalePoints ( double  scale)
inlinevirtual

Scale an object's property.

Reimplemented in openshot::TrackedObjectBBox.

Definition at line 69 of file TrackedObjectBase.h.

◆ SetJson()

virtual void openshot::TrackedObjectBase::SetJson ( const std::string  value)
pure virtual

Load JSON string into this object.

Implemented in openshot::TrackedObjectBBox.

◆ SetJsonValue()

virtual void openshot::TrackedObjectBase::SetJsonValue ( const Json::Value  root)
pure virtual

Load Json::Value into this object.

Implemented in openshot::TrackedObjectBBox.

Member Data Documentation

◆ draw_box

Keyframe openshot::TrackedObjectBase::draw_box

Keyframe to determine if a specific box is drawn (or hidden)

Definition at line 46 of file TrackedObjectBase.h.

Referenced by openshot::TrackedObjectBBox::JsonValue(), openshot::TrackedObjectBBox::PropertiesJSON(), and openshot::TrackedObjectBBox::SetJsonValue().

◆ id

std::string openshot::TrackedObjectBase::id
protected

Definition at line 37 of file TrackedObjectBase.h.

Referenced by Id().

◆ parentClip

ClipBase* openshot::TrackedObjectBase::parentClip
protected

Definition at line 38 of file TrackedObjectBase.h.

Referenced by ParentClip().

◆ visible

Keyframe openshot::TrackedObjectBase::visible

Keyframe to track if a box is visible in the current frame (read-only)

Definition at line 43 of file TrackedObjectBase.h.

Referenced by openshot::TrackedObjectBBox::JsonValue(), openshot::TrackedObjectBBox::PropertiesJSON(), and openshot::TrackedObjectBBox::SetJsonValue().


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