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

This abstract class is the base class, used by all clips in libopenshot. More...

#include <ClipBase.h>

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

Public Member Functions

 ClipBase ()
 Constructor for the base clip. More...
 
virtual void End (float value)
 Set end position (in seconds) of clip (trim end of video) More...
 
virtual std::shared_ptr< openshot::FrameGetFrame (int64_t frame_number)=0
 This method is required for all derived classes of ClipBase, and returns a new openshot::Frame object. All Clip keyframes and effects are resolved into pixels. More...
 
virtual std::shared_ptr< openshot::FrameGetFrame (std::shared_ptr< openshot::Frame > frame, int64_t frame_number)=0
 This method is required for all derived classes of ClipBase, and returns a modified openshot::Frame object. More...
 
void Id (std::string value)
 
virtual std::string Json () const =0
 Generate JSON string of this object. More...
 
virtual Json::Value JsonValue () const =0
 Generate Json::Value for this object. More...
 
void Layer (int value)
 Set layer of clip on timeline (lower number is covered by higher numbers) More...
 
bool operator< (ClipBase &a)
 
bool operator<= (ClipBase &a)
 
bool operator> (ClipBase &a)
 
bool operator>= (ClipBase &a)
 
void Position (float value)
 

Set the Id of this clip object

More...
 
virtual std::string PropertiesJSON (int64_t requested_frame) const =0
 
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...
 
void Start (float value)
 Set start position (in seconds) of clip (trim start of video) More...
 
virtual ~ClipBase ()=default
 

Protected 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...
 
Json::Value add_property_json (std::string name, float value, std::string type, std::string memo, const Keyframe *keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame) const
 Generate JSON for a property. More...
 

Protected Attributes

float end
 The position in seconds to end playing (used to trim the ending of a clip) More...
 
std::string id
 ID Property for all derived Clip and Effect classes. More...
 
int layer
 The layer this clip is on. Lower clips are covered up by higher clips. More...
 
float position
 The position on the timeline where this clip should start playing. More...
 
std::string previous_properties
 This string contains the previous JSON properties. More...
 
float start
 The position in seconds to start playing (used to trim the beginning of a clip) More...
 
openshot::TimelineBasetimeline
 Pointer to the parent timeline instance (if any) More...
 

Detailed Description

This abstract class is the base class, used by all clips in libopenshot.

Clips are objects that attach to the timeline and can be layered and positioned together. There are 2 primary types of clips: Effects and Video/Audio Clips.

Definition at line 33 of file ClipBase.h.

Constructor & Destructor Documentation

◆ ClipBase()

openshot::ClipBase::ClipBase ( )
inline

Constructor for the base clip.

Definition at line 51 of file ClipBase.h.

◆ ~ClipBase()

virtual openshot::ClipBase::~ClipBase ( )
virtualdefault

Member Function Documentation

◆ add_property_choice_json()

Json::Value ClipBase::add_property_choice_json ( std::string  name,
int  value,
int  selected_value 
) const
protected

◆ add_property_json()

Json::Value ClipBase::add_property_json ( std::string  name,
float  value,
std::string  type,
std::string  memo,
const Keyframe keyframe,
float  min_value,
float  max_value,
bool  readonly,
int64_t  requested_frame 
) const
protected

◆ End()

void ClipBase::End ( float  value)
virtual

◆ GetFrame() [1/2]

virtual std::shared_ptr<openshot::Frame> openshot::ClipBase::GetFrame ( int64_t  frame_number)
pure virtual

◆ GetFrame() [2/2]

virtual std::shared_ptr<openshot::Frame> openshot::ClipBase::GetFrame ( std::shared_ptr< openshot::Frame frame,
int64_t  frame_number 
)
pure virtual

This method is required for all derived classes of ClipBase, and returns a modified openshot::Frame object.

The frame object is passed into this method and used as a starting point / background (pixels). All Clip keyframes and effects are resolved into pixels.

Returns
The modified openshot::Frame object
Parameters
frameThis is ignored on Clip, due to caching optimizations. This frame instance is clobbered with the source frame.
frame_numberThe frame number (starting at 1) of the clip or effect on the timeline.

Implemented in openshot::ChromaKey, openshot::Caption, openshot::Crop, openshot::ColorShift, openshot::Blur, openshot::Pixelate, openshot::Saturation, openshot::Mask, openshot::Bars, openshot::Wave, openshot::Expander, openshot::Compressor, openshot::Shift, openshot::Brightness, openshot::Hue, openshot::Deinterlace, openshot::Robotization, openshot::Echo, openshot::Whisperization, openshot::Delay, openshot::ParametricEQ, openshot::Distortion, openshot::Negate, openshot::Noise, and openshot::Clip.

◆ Id()

void openshot::ClipBase::Id ( std::string  value)
inline

◆ Json()

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

◆ JsonValue()

Json::Value ClipBase::JsonValue ( ) const
pure virtual

◆ Layer()

void ClipBase::Layer ( int  value)

◆ operator<()

bool openshot::ClipBase::operator< ( ClipBase a)
inline

Definition at line 60 of file ClipBase.h.

◆ operator<=()

bool openshot::ClipBase::operator<= ( ClipBase a)
inline

Definition at line 61 of file ClipBase.h.

◆ operator>()

bool openshot::ClipBase::operator> ( ClipBase a)
inline

Definition at line 62 of file ClipBase.h.

◆ operator>=()

bool openshot::ClipBase::operator>= ( ClipBase a)
inline

Definition at line 63 of file ClipBase.h.

◆ Position()

void ClipBase::Position ( float  value)

◆ PropertiesJSON()

virtual std::string openshot::ClipBase::PropertiesJSON ( int64_t  requested_frame) const
pure virtual

◆ SetJson()

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

◆ SetJsonValue()

void ClipBase::SetJsonValue ( const Json::Value  root)
pure virtual

◆ Start()

void ClipBase::Start ( float  value)

Member Data Documentation

◆ end

float openshot::ClipBase::end
protected

The position in seconds to end playing (used to trim the ending of a clip)

Definition at line 39 of file ClipBase.h.

Referenced by End(), openshot::Clip::End(), and openshot::Clip::Open().

◆ id

std::string openshot::ClipBase::id
protected

ID Property for all derived Clip and Effect classes.

Definition at line 35 of file ClipBase.h.

Referenced by openshot::ObjectDetection::LoadObjDetectdData(), and openshot::Stabilizer::LoadStabilizedData().

◆ layer

int openshot::ClipBase::layer
protected

The layer this clip is on. Lower clips are covered up by higher clips.

Definition at line 37 of file ClipBase.h.

Referenced by Layer().

◆ position

float openshot::ClipBase::position
protected

The position on the timeline where this clip should start playing.

Definition at line 36 of file ClipBase.h.

Referenced by Position().

◆ previous_properties

std::string openshot::ClipBase::previous_properties
protected

This string contains the previous JSON properties.

Definition at line 40 of file ClipBase.h.

Referenced by openshot::Clip::init_settings().

◆ start

float openshot::ClipBase::start
protected

The position in seconds to start playing (used to trim the beginning of a clip)

Definition at line 38 of file ClipBase.h.

Referenced by openshot::Deinterlace::GetFrame(), and Start().

◆ timeline

openshot::TimelineBase* openshot::ClipBase::timeline
protected

Pointer to the parent timeline instance (if any)

Definition at line 41 of file ClipBase.h.

Referenced by openshot::Caption::GetFrame(), and openshot::Clip::ParentTimeline().


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