OpenShot Library | libopenshot 0.2.7
|
This abstract class is the base class, used by all effects in libopenshot. More...
#include <EffectBase.h>
Public Member Functions | |
int | constrain (int color_value) |
Constrain a color value from 0 to 255. More... | |
void | DisplayInfo () |
Display effect information in the standard output stream (stdout) More... | |
virtual std::string | GetVisibleObjects (int64_t frame_number) const |
Get the indexes and IDs of all visible objects in the given frame. More... | |
void | InitEffectInfo () |
virtual std::string | Json () const |
Generate JSON string of this object. More... | |
virtual std::string | Json (int64_t requested_frame) const |
Json::Value | JsonInfo () const |
Generate JSON object of meta data / info. More... | |
virtual Json::Value | JsonValue () const |
Generate Json::Value for this object. More... | |
int | Order () const |
Get the order that this effect should be executed. More... | |
void | Order (int new_order) |
Set the order that this effect should be executed. More... | |
openshot::ClipBase * | ParentClip () |
Parent clip object of this effect (which can be unparented and NULL) More... | |
void | ParentClip (openshot::ClipBase *new_clip) |
Set parent clip object of this effect. More... | |
std::string | ParentClipId () const |
Return the ID of this effect's parent clip. More... | |
virtual void | SetJson (const std::string value) |
Load JSON string into this object. More... | |
virtual void | SetJson (int64_t requested_frame, const std::string value) |
virtual void | SetJsonValue (const Json::Value root) |
Load Json::Value into this object. More... | |
void | SetParentEffect (std::string parentEffect_id) |
Set the parent effect from which this properties will be set to. More... | |
virtual | ~EffectBase ()=default |
![]() | |
ClipBase () | |
Constructor for the base clip. More... | |
float | Duration () const |
Get the length of this clip (in seconds) More... | |
float | End () const |
Get end position (in seconds) of clip (trim end of video) More... | |
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... | |
std::string | Id () const |
Get the Id of this clip 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... | |
int | Layer () const |
Get layer of clip on timeline (lower number is covered by higher numbers) 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) |
openshot::TimelineBase * | ParentTimeline () |
Get the associated Timeline pointer (if any) More... | |
void | ParentTimeline (openshot::TimelineBase *new_timeline) |
Set associated Timeline pointer. More... | |
float | Position () const |
Get position on timeline (in seconds) More... | |
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... | |
float | Start () const |
Get start position (in seconds) of clip (trim start of video) More... | |
void | Start (float value) |
Set start position (in seconds) of clip (trim start of video) More... | |
virtual | ~ClipBase ()=default |
Public Attributes | |
EffectInfoStruct | info |
Information about the current effect. More... | |
EffectBase * | parentEffect |
Parent effect (which properties will set this effect properties) More... | |
std::map< int, std::shared_ptr< openshot::TrackedObjectBase > > | trackedObjects |
Map of Tracked Object's by their indices (used by Effects that track objects on clips) More... | |
![]() | |
CacheMemory | cache |
Protected Attributes | |
openshot::ClipBase * | clip |
Pointer to the parent clip instance (if any) More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
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... | |
This abstract class is the base class, used by all effects in libopenshot.
Effects are types of classes that manipulate the image or audio data of an openshot::Frame object. The only requirements for an 'effect', is to derive from this base class, implement the Apply() method, and call the InitEffectInfo() method.
Definition at line 70 of file EffectBase.h.
|
virtualdefault |
int EffectBase::constrain | ( | int | color_value | ) |
Constrain a color value from 0 to 255.
Definition at line 73 of file EffectBase.cpp.
Referenced by openshot::Brightness::GetFrame(), openshot::Hue::GetFrame(), openshot::Mask::GetFrame(), and openshot::Saturation::GetFrame().
void EffectBase::DisplayInfo | ( | ) |
Display effect information in the standard output stream (stdout)
Definition at line 60 of file EffectBase.cpp.
|
inlinevirtual |
Get the indexes and IDs of all visible objects in the given frame.
Reimplemented in openshot::ObjectDetection, and openshot::Tracker.
Definition at line 112 of file EffectBase.h.
void EffectBase::InitEffectInfo | ( | ) |
Initialize the values of the EffectInfo struct. It is important for derived classes to call this method, or the EffectInfo struct values will not be initialized.
Definition at line 39 of file EffectBase.cpp.
Referenced by openshot::Negate::Negate().
|
virtual |
Generate JSON string of this object.
Implements openshot::ClipBase.
Reimplemented in 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.
Definition at line 85 of file EffectBase.cpp.
|
inlinevirtual |
Definition at line 120 of file EffectBase.h.
Json::Value EffectBase::JsonInfo | ( | ) | const |
Generate JSON object of meta data / info.
Definition at line 173 of file EffectBase.cpp.
|
virtual |
Generate Json::Value for this object.
Implements openshot::ClipBase.
Reimplemented in 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.
Definition at line 92 of file EffectBase.cpp.
Referenced by Json(), openshot::Compressor::JsonValue(), openshot::Delay::JsonValue(), openshot::Distortion::JsonValue(), openshot::Echo::JsonValue(), openshot::Expander::JsonValue(), openshot::Noise::JsonValue(), openshot::ParametricEQ::JsonValue(), openshot::Robotization::JsonValue(), openshot::Whisperization::JsonValue(), openshot::Bars::JsonValue(), openshot::Blur::JsonValue(), openshot::Brightness::JsonValue(), openshot::Caption::JsonValue(), openshot::ChromaKey::JsonValue(), openshot::ColorShift::JsonValue(), openshot::Crop::JsonValue(), openshot::Deinterlace::JsonValue(), openshot::Hue::JsonValue(), openshot::Mask::JsonValue(), openshot::Negate::JsonValue(), openshot::ObjectDetection::JsonValue(), openshot::Pixelate::JsonValue(), openshot::Saturation::JsonValue(), openshot::Shift::JsonValue(), openshot::Stabilizer::JsonValue(), openshot::Tracker::JsonValue(), openshot::Wave::JsonValue(), SetJsonValue(), and SetParentEffect().
|
inline |
Get the order that this effect should be executed.
Definition at line 130 of file EffectBase.h.
Referenced by InitEffectInfo(), JsonValue(), openshot::CompareClipEffects::operator()(), openshot::CompareEffects::operator()(), and SetJsonValue().
|
inline |
Set the order that this effect should be executed.
Definition at line 133 of file EffectBase.h.
openshot::ClipBase * EffectBase::ParentClip | ( | ) |
Parent clip object of this effect (which can be unparented and NULL)
Parent clip object of this reader (which can be unparented and NULL)
Definition at line 188 of file EffectBase.cpp.
Referenced by openshot::Clip::AddEffect(), openshot::Caption::GetFrame(), InitEffectInfo(), openshot::ObjectDetection::LoadObjDetectdData(), and openshot::Tracker::Tracker().
void EffectBase::ParentClip | ( | openshot::ClipBase * | new_clip | ) |
Set parent clip object of this effect.
Set parent clip object of this reader.
Definition at line 193 of file EffectBase.cpp.
std::string EffectBase::ParentClipId | ( | ) | const |
Return the ID of this effect's parent clip.
Definition at line 223 of file EffectBase.cpp.
|
virtual |
Load JSON string into this object.
Implements openshot::ClipBase.
Reimplemented in 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.
Definition at line 110 of file EffectBase.cpp.
|
inlinevirtual |
Definition at line 123 of file EffectBase.h.
|
virtual |
Load Json::Value into this object.
Implements openshot::ClipBase.
Reimplemented in 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.
Definition at line 127 of file EffectBase.cpp.
Referenced by SetJson(), openshot::Compressor::SetJsonValue(), openshot::Delay::SetJsonValue(), openshot::Distortion::SetJsonValue(), openshot::Echo::SetJsonValue(), openshot::Expander::SetJsonValue(), openshot::Noise::SetJsonValue(), openshot::ParametricEQ::SetJsonValue(), openshot::Robotization::SetJsonValue(), openshot::Whisperization::SetJsonValue(), openshot::Clip::SetJsonValue(), openshot::Bars::SetJsonValue(), openshot::Blur::SetJsonValue(), openshot::Brightness::SetJsonValue(), openshot::Caption::SetJsonValue(), openshot::ChromaKey::SetJsonValue(), openshot::ColorShift::SetJsonValue(), openshot::Crop::SetJsonValue(), openshot::Deinterlace::SetJsonValue(), openshot::Hue::SetJsonValue(), openshot::Mask::SetJsonValue(), openshot::Negate::SetJsonValue(), openshot::ObjectDetection::SetJsonValue(), openshot::Pixelate::SetJsonValue(), openshot::Saturation::SetJsonValue(), openshot::Shift::SetJsonValue(), openshot::Stabilizer::SetJsonValue(), openshot::Tracker::SetJsonValue(), openshot::Wave::SetJsonValue(), openshot::Timeline::SetJsonValue(), and SetParentEffect().
void EffectBase::SetParentEffect | ( | std::string | parentEffect_id | ) |
Set the parent effect from which this properties will be set to.
Definition at line 198 of file EffectBase.cpp.
Referenced by SetJsonValue().
|
protected |
Pointer to the parent clip instance (if any)
Definition at line 76 of file EffectBase.h.
Referenced by openshot::Caption::GetFrame(), ParentClip(), and ParentClipId().
EffectInfoStruct openshot::EffectBase::info |
Information about the current effect.
Definition at line 87 of file EffectBase.h.
Referenced by openshot::Clip::AddEffect(), DisplayInfo(), InitEffectInfo(), JsonInfo(), JsonValue(), openshot::Compressor::JsonValue(), openshot::Delay::JsonValue(), openshot::Distortion::JsonValue(), openshot::Echo::JsonValue(), openshot::Expander::JsonValue(), openshot::Noise::JsonValue(), openshot::ParametricEQ::JsonValue(), openshot::Robotization::JsonValue(), openshot::Whisperization::JsonValue(), openshot::Bars::JsonValue(), openshot::Blur::JsonValue(), openshot::Brightness::JsonValue(), openshot::Caption::JsonValue(), openshot::ChromaKey::JsonValue(), openshot::ColorShift::JsonValue(), openshot::Crop::JsonValue(), openshot::Deinterlace::JsonValue(), openshot::Hue::JsonValue(), openshot::Mask::JsonValue(), openshot::Negate::JsonValue(), openshot::ObjectDetection::JsonValue(), openshot::Pixelate::JsonValue(), openshot::Saturation::JsonValue(), openshot::Shift::JsonValue(), openshot::Stabilizer::JsonValue(), openshot::Tracker::JsonValue(), openshot::Wave::JsonValue(), openshot::Negate::Negate(), 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::Negate::PropertiesJSON(), openshot::Pixelate::PropertiesJSON(), openshot::Saturation::PropertiesJSON(), openshot::Shift::PropertiesJSON(), openshot::Stabilizer::PropertiesJSON(), openshot::Wave::PropertiesJSON(), SetJsonValue(), openshot::Tracker::SetJsonValue(), and SetParentEffect().
EffectBase* openshot::EffectBase::parentEffect |
Parent effect (which properties will set this effect properties)
Definition at line 81 of file EffectBase.h.
Referenced by InitEffectInfo(), SetJsonValue(), and SetParentEffect().
std::map<int, std::shared_ptr<openshot::TrackedObjectBase> > openshot::EffectBase::trackedObjects |
Map of Tracked Object's by their indices (used by Effects that track objects on clips)
Definition at line 84 of file EffectBase.h.
Referenced by openshot::Clip::AddEffect(), openshot::ObjectDetection::GetFrame(), openshot::ObjectDetection::GetVisibleObjects(), openshot::Tracker::GetVisibleObjects(), openshot::ObjectDetection::JsonValue(), openshot::Tracker::JsonValue(), openshot::ObjectDetection::LoadObjDetectdData(), openshot::ObjectDetection::ObjectDetection(), openshot::ObjectDetection::PropertiesJSON(), openshot::Tracker::PropertiesJSON(), openshot::ObjectDetection::SetJsonValue(), openshot::Tracker::SetJsonValue(), and openshot::Tracker::Tracker().