OpenShot Library | libopenshot 0.3.3
|
This abstract class is the base class, used by all clips in libopenshot. More...
#include <ClipBase.h>
Public Member Functions | |
ClipBase () | |
Constructor for the base clip. | |
float | Duration () const |
Get the length of this clip (in seconds) | |
virtual float | End () const |
Get end position (in seconds) of clip (trim end of video) | |
virtual void | End (float value) |
Set end position (in seconds) of clip (trim end of video) | |
virtual std::shared_ptr< openshot::Frame > | GetFrame (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. | |
virtual std::shared_ptr< openshot::Frame > | GetFrame (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. | |
std::string | Id () const |
Get the Id of this clip object. | |
void | Id (std::string value) |
virtual std::string | Json () const =0 |
Generate JSON string of this object. | |
virtual Json::Value | JsonValue () const =0 |
Generate Json::Value for this object. | |
int | Layer () const |
Get layer of clip on timeline (lower number is covered by higher numbers) | |
void | Layer (int value) |
Set layer of clip on timeline (lower number is covered by higher numbers) | |
bool | operator< (ClipBase &a) |
bool | operator<= (ClipBase &a) |
bool | operator> (ClipBase &a) |
bool | operator>= (ClipBase &a) |
virtual openshot::TimelineBase * | ParentTimeline () |
Get the associated Timeline pointer (if any) | |
virtual void | ParentTimeline (openshot::TimelineBase *new_timeline) |
Set associated Timeline pointer. | |
float | Position () const |
Get position on timeline (in seconds) | |
void | Position (float value) |
| |
virtual std::string | PropertiesJSON (int64_t requested_frame) const =0 |
virtual void | SetJson (const std::string value)=0 |
Load JSON string into this object. | |
virtual void | SetJsonValue (const Json::Value root)=0 |
Load Json::Value into this object. | |
float | Start () const |
Get start position (in seconds) of clip (trim start of video) | |
void | Start (float value) |
Set start position (in seconds) of clip (trim start of video) | |
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) | |
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. | |
Protected Attributes | |
float | end |
The position in seconds to end playing (used to trim the ending of a clip) | |
std::string | id |
ID Property for all derived Clip and Effect classes. | |
int | layer |
The layer this clip is on. Lower clips are covered up by higher clips. | |
float | position |
The position on the timeline where this clip should start playing. | |
std::string | previous_properties |
This string contains the previous JSON properties. | |
float | start |
The position in seconds to start playing (used to trim the beginning of a clip) | |
openshot::TimelineBase * | timeline |
Pointer to the parent timeline instance (if any) | |
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.
|
inline |
Constructor for the base clip.
Definition at line 51 of file ClipBase.h.
|
virtualdefault |
|
protected |
Generate JSON choice for a property (dropdown properties)
Definition at line 132 of file ClipBase.cpp.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Distortion::PropertiesJSON(), openshot::ParametricEQ::PropertiesJSON(), openshot::Robotization::PropertiesJSON(), openshot::Whisperization::PropertiesJSON(), openshot::Clip::PropertiesJSON(), openshot::ChromaKey::PropertiesJSON(), openshot::Crop::PropertiesJSON(), openshot::Deinterlace::PropertiesJSON(), openshot::Mask::PropertiesJSON(), and openshot::ObjectDetection::PropertiesJSON().
|
protected |
Generate JSON for a property.
Definition at line 96 of file ClipBase.cpp.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Compressor::PropertiesJSON(), openshot::Delay::PropertiesJSON(), openshot::Distortion::PropertiesJSON(), openshot::Echo::PropertiesJSON(), openshot::Expander::PropertiesJSON(), openshot::Noise::PropertiesJSON(), openshot::ParametricEQ::PropertiesJSON(), openshot::Robotization::PropertiesJSON(), openshot::Whisperization::PropertiesJSON(), openshot::Clip::PropertiesJSON(), openshot::Bars::PropertiesJSON(), openshot::Blur::PropertiesJSON(), openshot::Brightness::PropertiesJSON(), openshot::Caption::PropertiesJSON(), openshot::ChromaKey::PropertiesJSON(), openshot::ColorShift::PropertiesJSON(), openshot::Crop::PropertiesJSON(), openshot::Deinterlace::PropertiesJSON(), openshot::Hue::PropertiesJSON(), openshot::Mask::PropertiesJSON(), openshot::ObjectDetection::PropertiesJSON(), openshot::Pixelate::PropertiesJSON(), openshot::Saturation::PropertiesJSON(), openshot::Shift::PropertiesJSON(), openshot::Stabilizer::PropertiesJSON(), and openshot::Wave::PropertiesJSON().
|
inline |
Get the length of this clip (in seconds)
Definition at line 90 of file ClipBase.h.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Timeline::GetFrame(), JsonValue(), openshot::CompareClipEndFrames::operator()(), openshot::CompareEffectEndFrames::operator()(), openshot::Clip::PropertiesJSON(), and openshot::Timeline::Timeline().
|
inlinevirtual |
Get end position (in seconds) of clip (trim end of video)
Reimplemented in openshot::Clip.
Definition at line 89 of file ClipBase.h.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Clip::Clip(), openshot::Clip::Clip(), openshot::Clip::End(), openshot::Clip::init_settings(), openshot::EffectBase::InitEffectInfo(), JsonValue(), openshot::Clip::Open(), and SetJsonValue().
|
virtual |
Set end position (in seconds) of clip (trim end of video)
Reimplemented in openshot::Clip.
Definition at line 53 of file ClipBase.cpp.
|
pure virtual |
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.
frame_number | The frame number (starting at 1) of the clip or effect on the timeline. |
Implemented in openshot::Clip, openshot::Compressor, openshot::Delay, openshot::Distortion, openshot::Echo, openshot::Expander, openshot::Noise, openshot::ParametricEQ, openshot::Robotization, openshot::Whisperization, openshot::Bars, openshot::Blur, openshot::Brightness, openshot::Caption, openshot::ChromaKey, openshot::ColorShift, openshot::Crop, openshot::Deinterlace, openshot::Hue, openshot::Mask, openshot::Negate, openshot::ObjectDetection, openshot::Pixelate, openshot::Saturation, openshot::Shift, openshot::Stabilizer, openshot::Tracker, and openshot::Wave.
|
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.
frame | This is ignored on Clip, due to caching optimizations. This frame instance is clobbered with the source frame. |
frame_number | The frame number (starting at 1) of the clip or effect on the timeline. |
Implemented in openshot::Clip, openshot::Compressor, openshot::Delay, openshot::Distortion, openshot::Echo, openshot::Expander, openshot::Noise, openshot::ParametricEQ, openshot::Robotization, openshot::Whisperization, openshot::Bars, openshot::Blur, openshot::Brightness, openshot::Caption, openshot::ChromaKey, openshot::ColorShift, openshot::Crop, openshot::Deinterlace, openshot::Hue, openshot::Mask, openshot::Negate, openshot::Pixelate, openshot::Saturation, openshot::Shift, and openshot::Wave.
|
inline |
Get the Id of this clip object.
Definition at line 85 of file ClipBase.h.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Timeline::GetClip(), openshot::Timeline::GetFrame(), JsonValue(), openshot::EffectBase::ParentClipId(), openshot::Clip::PropertiesJSON(), openshot::EffectBase::SetJsonValue(), SetJsonValue(), and openshot::EffectBase::SetParentEffect().
|
inline |
Definition at line 94 of file ClipBase.h.
|
pure virtual |
Generate JSON string of this object.
Implemented in openshot::EffectBase, openshot::Compressor, openshot::Delay, openshot::Distortion, openshot::Echo, openshot::Expander, openshot::Noise, openshot::ParametricEQ, openshot::Robotization, openshot::Whisperization, openshot::Clip, openshot::Bars, openshot::Blur, openshot::Brightness, openshot::Caption, openshot::ChromaKey, openshot::ColorShift, openshot::Crop, openshot::Deinterlace, openshot::Hue, openshot::Mask, openshot::Negate, openshot::ObjectDetection, openshot::Pixelate, openshot::Saturation, openshot::Shift, openshot::Stabilizer, openshot::Tracker, and openshot::Wave.
|
pure virtual |
Generate Json::Value for this object.
Implemented in openshot::EffectBase, openshot::Compressor, openshot::Delay, openshot::Distortion, openshot::Echo, openshot::Expander, openshot::Noise, openshot::ParametricEQ, openshot::Robotization, openshot::Whisperization, openshot::Clip, openshot::Bars, openshot::Blur, openshot::Brightness, openshot::Caption, openshot::ChromaKey, openshot::ColorShift, openshot::Crop, openshot::Deinterlace, openshot::Hue, openshot::Mask, openshot::Negate, openshot::ObjectDetection, openshot::Pixelate, openshot::Saturation, openshot::Shift, openshot::Stabilizer, openshot::Tracker, and openshot::Wave.
Definition at line 64 of file ClipBase.cpp.
Referenced by openshot::EffectBase::JsonValue(), and openshot::Clip::JsonValue().
|
inline |
Get layer of clip on timeline (lower number is covered by higher numbers)
Definition at line 87 of file ClipBase.h.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Timeline::GetFrame(), openshot::Clip::init_settings(), openshot::EffectBase::InitEffectInfo(), JsonValue(), openshot::CompareClips::operator()(), openshot::CompareClipEffects::operator()(), openshot::CompareEffects::operator()(), openshot::Clip::PropertiesJSON(), and SetJsonValue().
void ClipBase::Layer | ( | int | value | ) |
Set layer of clip on timeline (lower number is covered by higher numbers)
Definition at line 31 of file ClipBase.cpp.
|
inline |
Definition at line 60 of file ClipBase.h.
|
inline |
Definition at line 61 of file ClipBase.h.
|
inline |
Definition at line 62 of file ClipBase.h.
|
inline |
Definition at line 63 of file ClipBase.h.
|
inlinevirtual |
Get the associated Timeline pointer (if any)
Reimplemented in openshot::Clip.
Definition at line 91 of file ClipBase.h.
Referenced by openshot::Timeline::AddClip(), openshot::Clip::AddEffect(), openshot::Timeline::AddEffect(), End(), openshot::Caption::GetFrame(), Layer(), Position(), openshot::EffectBase::SetJsonValue(), openshot::EffectBase::SetParentEffect(), and Start().
|
inlinevirtual |
Set associated Timeline pointer.
Reimplemented in openshot::Clip.
Definition at line 99 of file ClipBase.h.
|
inline |
Get position on timeline (in seconds)
Definition at line 86 of file ClipBase.h.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::FrameMapper::GetFrame(), openshot::Timeline::GetFrame(), openshot::Clip::init_settings(), openshot::EffectBase::InitEffectInfo(), JsonValue(), openshot::CompareClipEndFrames::operator()(), openshot::CompareEffectEndFrames::operator()(), openshot::CompareClips::operator()(), openshot::CompareClipEffects::operator()(), openshot::CompareEffects::operator()(), operator<(), operator<=(), operator>(), operator>=(), openshot::Clip::PropertiesJSON(), SetJsonValue(), and openshot::Timeline::Timeline().
void ClipBase::Position | ( | float | value | ) |
Set the Id of this clip object
Set position on timeline (in seconds)
Definition at line 19 of file ClipBase.cpp.
|
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::Compressor, openshot::Delay, openshot::Distortion, openshot::Echo, openshot::Expander, openshot::Noise, openshot::ParametricEQ, openshot::Robotization, openshot::Whisperization, openshot::Clip, openshot::Bars, openshot::Blur, openshot::Brightness, openshot::Caption, openshot::ChromaKey, openshot::ColorShift, openshot::Crop, openshot::Deinterlace, openshot::Hue, openshot::Mask, openshot::Negate, openshot::ObjectDetection, openshot::Pixelate, openshot::Saturation, openshot::Shift, openshot::Stabilizer, openshot::Tracker, and openshot::Wave.
|
pure virtual |
Load JSON string into this object.
Implemented in openshot::EffectBase, openshot::Compressor, openshot::Delay, openshot::Distortion, openshot::Echo, openshot::Expander, openshot::Noise, openshot::ParametricEQ, openshot::Robotization, openshot::Whisperization, openshot::Clip, openshot::Bars, openshot::Blur, openshot::Brightness, openshot::Caption, openshot::ChromaKey, openshot::ColorShift, openshot::Crop, openshot::Deinterlace, openshot::Hue, openshot::Mask, openshot::Negate, openshot::ObjectDetection, openshot::Pixelate, openshot::Saturation, openshot::Shift, openshot::Stabilizer, openshot::Tracker, and openshot::Wave.
|
pure virtual |
Load Json::Value into this object.
Implemented in openshot::EffectBase, openshot::Compressor, openshot::Delay, openshot::Distortion, openshot::Echo, openshot::Expander, openshot::Noise, openshot::ParametricEQ, openshot::Robotization, openshot::Whisperization, openshot::Clip, openshot::Bars, openshot::Blur, openshot::Brightness, openshot::Caption, openshot::ChromaKey, openshot::ColorShift, openshot::Crop, openshot::Deinterlace, openshot::Hue, openshot::Mask, openshot::Negate, openshot::ObjectDetection, openshot::Pixelate, openshot::Saturation, openshot::Shift, openshot::Stabilizer, openshot::Tracker, and openshot::Wave.
Definition at line 80 of file ClipBase.cpp.
Referenced by openshot::EffectBase::SetJsonValue(), and openshot::Clip::SetJsonValue().
|
inline |
Get start position (in seconds) of clip (trim start of video)
Definition at line 88 of file ClipBase.h.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::CVObjectDetection::detectObjectsClip(), openshot::FrameMapper::GetFrame(), openshot::Timeline::GetFrame(), openshot::Clip::init_settings(), openshot::EffectBase::InitEffectInfo(), JsonValue(), openshot::Clip::PropertiesJSON(), SetJsonValue(), CVStabilization::stabilizeClip(), and openshot::CVTracker::trackClip().
void ClipBase::Start | ( | float | value | ) |
Set start position (in seconds) of clip (trim start of video)
Definition at line 42 of file ClipBase.cpp.
|
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 Duration(), End(), openshot::Clip::End(), End(), and openshot::Clip::Open().
|
protected |
ID Property for all derived Clip and Effect classes.
Definition at line 35 of file ClipBase.h.
Referenced by openshot::Clip::GetEffect(), Id(), openshot::ObjectDetection::LoadObjDetectdData(), and openshot::Stabilizer::LoadStabilizedData().
|
protected |
The layer this clip is on. Lower clips are covered up by higher clips.
Definition at line 37 of file ClipBase.h.
|
protected |
The position on the timeline where this clip should start playing.
Definition at line 36 of file ClipBase.h.
Referenced by Position(), and Position().
|
protected |
This string contains the previous JSON properties.
Definition at line 40 of file ClipBase.h.
Referenced by openshot::Clip::init_settings().
|
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 Duration(), openshot::Deinterlace::GetFrame(), Start(), and Start().
|
protected |
Pointer to the parent timeline instance (if any)
Definition at line 41 of file ClipBase.h.
Referenced by openshot::Caption::GetFrame(), ParentTimeline(), openshot::Clip::ParentTimeline(), ParentTimeline(), and openshot::Clip::ParentTimeline().