OpenShot Library | libopenshot
0.4.0
|
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. More... | |
virtual void | End (float value) |
Set end position (in seconds) of clip (trim end of video) More... | |
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. More... | |
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. 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) |
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::TimelineBase * | timeline |
Pointer to the parent timeline instance (if any) More... | |
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::Whisperization::PropertiesJSON(), openshot::Robotization::PropertiesJSON(), openshot::Deinterlace::PropertiesJSON(), openshot::Mask::PropertiesJSON(), openshot::Crop::PropertiesJSON(), openshot::ChromaKey::PropertiesJSON(), openshot::ObjectDetection::PropertiesJSON(), and openshot::Clip::PropertiesJSON().
|
protected |
Generate JSON for a property.
Definition at line 96 of file ClipBase.cpp.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Noise::PropertiesJSON(), openshot::Distortion::PropertiesJSON(), openshot::ParametricEQ::PropertiesJSON(), openshot::Delay::PropertiesJSON(), openshot::Whisperization::PropertiesJSON(), openshot::Echo::PropertiesJSON(), openshot::Robotization::PropertiesJSON(), openshot::Deinterlace::PropertiesJSON(), openshot::Hue::PropertiesJSON(), openshot::Brightness::PropertiesJSON(), openshot::Shift::PropertiesJSON(), openshot::Compressor::PropertiesJSON(), openshot::Expander::PropertiesJSON(), openshot::Bars::PropertiesJSON(), openshot::Wave::PropertiesJSON(), openshot::Mask::PropertiesJSON(), openshot::Pixelate::PropertiesJSON(), openshot::Blur::PropertiesJSON(), openshot::Saturation::PropertiesJSON(), openshot::ColorShift::PropertiesJSON(), openshot::Crop::PropertiesJSON(), openshot::ChromaKey::PropertiesJSON(), openshot::Stabilizer::PropertiesJSON(), openshot::Caption::PropertiesJSON(), openshot::ObjectDetection::PropertiesJSON(), and openshot::Clip::PropertiesJSON().
|
virtual |
Set end position (in seconds) of clip (trim end of video)
Reimplemented in openshot::Clip.
Definition at line 53 of file ClipBase.cpp.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Clip::Clip(), openshot::Clip::End(), openshot::Clip::init_settings(), openshot::EffectBase::InitEffectInfo(), JsonValue(), openshot::Clip::Open(), and SetJsonValue().
|
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::ObjectDetection, openshot::Stabilizer, openshot::ChromaKey, openshot::Caption, openshot::Crop, openshot::Expander, openshot::Compressor, openshot::ColorShift, openshot::Blur, openshot::Saturation, openshot::Mask, openshot::Bars, openshot::Wave, openshot::Pixelate, openshot::Tracker, openshot::Shift, openshot::Robotization, openshot::Whisperization, openshot::Brightness, openshot::Hue, openshot::Echo, openshot::ParametricEQ, openshot::Delay, openshot::Distortion, openshot::Deinterlace, openshot::Noise, openshot::Negate, and openshot::Clip.
|
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::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.
|
inline |
Definition at line 94 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().
|
pure virtual |
Generate JSON string of this object.
Implemented in openshot::Clip, openshot::ObjectDetection, openshot::Caption, openshot::Stabilizer, openshot::ChromaKey, openshot::Crop, openshot::ColorShift, openshot::Blur, openshot::Pixelate, openshot::Saturation, openshot::Mask, openshot::Bars, openshot::Wave, openshot::Expander, openshot::Compressor, openshot::Tracker, 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::EffectBase.
|
pure virtual |
Generate Json::Value for this object.
Implemented in openshot::Clip, openshot::ObjectDetection, openshot::Caption, openshot::Stabilizer, openshot::ChromaKey, openshot::Crop, openshot::ColorShift, openshot::Blur, openshot::Pixelate, openshot::Saturation, openshot::Mask, openshot::Bars, openshot::Wave, openshot::Expander, openshot::Compressor, openshot::Tracker, 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::EffectBase.
Definition at line 64 of file ClipBase.cpp.
Referenced by openshot::EffectBase::JsonValue(), and openshot::Clip::JsonValue().
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.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::Timeline::GetFrame(), openshot::Clip::init_settings(), openshot::EffectBase::InitEffectInfo(), JsonValue(), openshot::CompareClipEffects::operator()(), openshot::CompareClips::operator()(), openshot::CompareEffects::operator()(), openshot::Clip::PropertiesJSON(), and SetJsonValue().
|
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.
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.
Referenced by openshot::EffectBase::BasePropertiesJSON(), openshot::FrameMapper::GetFrame(), openshot::Timeline::GetFrame(), openshot::Clip::init_settings(), openshot::EffectBase::InitEffectInfo(), JsonValue(), openshot::CompareClipEffects::operator()(), openshot::CompareClips::operator()(), openshot::CompareEffects::operator()(), openshot::CompareClipEndFrames::operator()(), openshot::CompareEffectEndFrames::operator()(), operator<(), operator<=(), operator>(), operator>=(), openshot::Clip::PropertiesJSON(), SetJsonValue(), and openshot::Timeline::Timeline().
|
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::Clip, openshot::ObjectDetection, openshot::Caption, openshot::Stabilizer, openshot::ChromaKey, openshot::Crop, openshot::ColorShift, openshot::Blur, openshot::Pixelate, openshot::Saturation, openshot::Mask, openshot::Bars, openshot::Tracker, 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, and openshot::Noise.
|
pure virtual |
Load JSON string into this object.
Implemented in openshot::Clip, openshot::ObjectDetection, openshot::Caption, openshot::Stabilizer, openshot::ChromaKey, openshot::Crop, openshot::ColorShift, openshot::Blur, openshot::Pixelate, openshot::Saturation, openshot::Mask, openshot::Bars, openshot::Wave, openshot::Expander, openshot::Compressor, openshot::Tracker, 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::EffectBase.
|
pure virtual |
Load Json::Value into this object.
Implemented in openshot::Clip, openshot::ObjectDetection, openshot::Caption, openshot::Stabilizer, openshot::ChromaKey, openshot::Crop, openshot::ColorShift, openshot::Blur, openshot::Pixelate, openshot::Saturation, openshot::Mask, openshot::Bars, openshot::Wave, openshot::Expander, openshot::Compressor, openshot::Tracker, 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::EffectBase.
Definition at line 80 of file ClipBase.cpp.
Referenced by openshot::EffectBase::SetJsonValue(), and openshot::Clip::SetJsonValue().
void ClipBase::Start | ( | float | value | ) |
Set start position (in seconds) of clip (trim start of video)
Definition at line 42 of file ClipBase.cpp.
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().
|
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().
|
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().
|
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().
|
protected |
The position on the timeline where this clip should start playing.
Definition at line 36 of file ClipBase.h.
Referenced by 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 openshot::Deinterlace::GetFrame(), and Start().
|
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().