OpenShot Library | libopenshot
0.3.3
|
This abstract class is the base class, used by all effects in libopenshot. More...
#include <EffectBase.h>
Public Member Functions | |
Json::Value | BasePropertiesJSON (int64_t requested_frame) const |
Generate JSON object of base properties (recommended to be used by all effects) More... | |
int | constrain (int color_value) |
Constrain a color value from 0 to 255. More... | |
void | DisplayInfo (std::ostream *out=&std::cout) |
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 |
Public Member Functions inherited from openshot::ClipBase | |
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) |
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 |
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... | |
Protected Attributes | |
openshot::ClipBase * | clip |
Pointer to the parent clip instance (if any) More... | |
Protected Attributes inherited from openshot::ClipBase | |
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 | |
Protected Member Functions inherited from openshot::ClipBase | |
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 53 of file EffectBase.h.
|
virtualdefault |
Json::Value EffectBase::BasePropertiesJSON | ( | int64_t | requested_frame | ) | const |
Generate JSON object of base properties (recommended to be used by all effects)
Definition at line 179 of file EffectBase.cpp.
Referenced by openshot::Noise::PropertiesJSON(), openshot::Negate::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(), and openshot::ObjectDetection::PropertiesJSON().
int EffectBase::constrain | ( | int | color_value | ) |
Constrain a color value from 0 to 255.
Definition at line 60 of file EffectBase.cpp.
Referenced by openshot::Hue::GetFrame(), openshot::Brightness::GetFrame(), openshot::Mask::GetFrame(), and openshot::Saturation::GetFrame().
void EffectBase::DisplayInfo | ( | std::ostream * | out = &std::cout | ) |
Display effect information in the standard output stream (stdout)
Definition at line 45 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 94 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 24 of file EffectBase.cpp.
Referenced by openshot::Negate::Negate().
|
virtual |
Generate JSON string of this object.
Implements openshot::ClipBase.
Reimplemented in 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, and openshot::Noise.
Definition at line 72 of file EffectBase.cpp.
|
inlinevirtual |
Definition at line 102 of file EffectBase.h.
Json::Value EffectBase::JsonInfo | ( | ) | const |
Generate JSON object of meta data / info.
Definition at line 164 of file EffectBase.cpp.
|
virtual |
Generate Json::Value for this object.
Implements openshot::ClipBase.
Reimplemented in 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, and openshot::Noise.
Definition at line 79 of file EffectBase.cpp.
Referenced by Json(), openshot::Noise::JsonValue(), openshot::Negate::JsonValue(), openshot::Distortion::JsonValue(), openshot::ParametricEQ::JsonValue(), openshot::Delay::JsonValue(), openshot::Whisperization::JsonValue(), openshot::Echo::JsonValue(), openshot::Robotization::JsonValue(), openshot::Deinterlace::JsonValue(), openshot::Hue::JsonValue(), openshot::Brightness::JsonValue(), openshot::Shift::JsonValue(), openshot::Compressor::JsonValue(), openshot::Expander::JsonValue(), openshot::Wave::JsonValue(), openshot::Bars::JsonValue(), openshot::Mask::JsonValue(), openshot::Blur::JsonValue(), openshot::Pixelate::JsonValue(), openshot::Saturation::JsonValue(), openshot::ColorShift::JsonValue(), openshot::Crop::JsonValue(), openshot::ChromaKey::JsonValue(), openshot::Stabilizer::JsonValue(), openshot::Caption::JsonValue(), openshot::ObjectDetection::JsonValue(), SetJsonValue(), and SetParentEffect().
|
inline |
Get the order that this effect should be executed.
Definition at line 116 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 119 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 201 of file EffectBase.cpp.
Referenced by openshot::Clip::AddEffect(), openshot::Caption::GetFrame(), InitEffectInfo(), and openshot::ObjectDetection::LoadObjDetectdData().
void EffectBase::ParentClip | ( | openshot::ClipBase * | new_clip | ) |
Set parent clip object of this effect.
Set parent clip object of this reader.
Definition at line 206 of file EffectBase.cpp.
std::string EffectBase::ParentClipId | ( | ) | const |
Return the ID of this effect's parent clip.
Definition at line 236 of file EffectBase.cpp.
|
virtual |
Load JSON string into this object.
Implements openshot::ClipBase.
Reimplemented in 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, and openshot::Noise.
Definition at line 98 of file EffectBase.cpp.
|
inlinevirtual |
Definition at line 105 of file EffectBase.h.
|
virtual |
Load Json::Value into this object.
Implements openshot::ClipBase.
Reimplemented in 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, and openshot::Noise.
Definition at line 115 of file EffectBase.cpp.
Referenced by SetJson(), openshot::Noise::SetJsonValue(), openshot::Negate::SetJsonValue(), openshot::Distortion::SetJsonValue(), openshot::ParametricEQ::SetJsonValue(), openshot::Delay::SetJsonValue(), openshot::Whisperization::SetJsonValue(), openshot::Echo::SetJsonValue(), openshot::Robotization::SetJsonValue(), openshot::Deinterlace::SetJsonValue(), openshot::Hue::SetJsonValue(), openshot::Brightness::SetJsonValue(), openshot::Shift::SetJsonValue(), openshot::Compressor::SetJsonValue(), openshot::Expander::SetJsonValue(), openshot::Bars::SetJsonValue(), openshot::Wave::SetJsonValue(), openshot::Mask::SetJsonValue(), openshot::Blur::SetJsonValue(), openshot::Pixelate::SetJsonValue(), openshot::Saturation::SetJsonValue(), openshot::ColorShift::SetJsonValue(), openshot::Crop::SetJsonValue(), openshot::ChromaKey::SetJsonValue(), openshot::Stabilizer::SetJsonValue(), openshot::Caption::SetJsonValue(), openshot::ObjectDetection::SetJsonValue(), openshot::Clip::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 211 of file EffectBase.cpp.
Referenced by SetJsonValue().
|
protected |
Pointer to the parent clip instance (if any)
Definition at line 59 of file EffectBase.h.
Referenced by openshot::Caption::GetFrame(), ParentClip(), and ParentClipId().
EffectInfoStruct openshot::EffectBase::info |
Information about the current effect.
Definition at line 69 of file EffectBase.h.
Referenced by openshot::Clip::AddEffect(), BasePropertiesJSON(), DisplayInfo(), InitEffectInfo(), JsonInfo(), openshot::Noise::JsonValue(), openshot::Negate::JsonValue(), openshot::Distortion::JsonValue(), openshot::ParametricEQ::JsonValue(), openshot::Delay::JsonValue(), openshot::Whisperization::JsonValue(), openshot::Echo::JsonValue(), openshot::Robotization::JsonValue(), openshot::Deinterlace::JsonValue(), openshot::Hue::JsonValue(), openshot::Brightness::JsonValue(), openshot::Shift::JsonValue(), openshot::Compressor::JsonValue(), openshot::Expander::JsonValue(), openshot::Wave::JsonValue(), openshot::Bars::JsonValue(), openshot::Mask::JsonValue(), openshot::Pixelate::JsonValue(), openshot::Blur::JsonValue(), openshot::Saturation::JsonValue(), openshot::ColorShift::JsonValue(), openshot::Crop::JsonValue(), JsonValue(), openshot::ChromaKey::JsonValue(), openshot::Stabilizer::JsonValue(), openshot::Caption::JsonValue(), openshot::ObjectDetection::JsonValue(), openshot::Negate::Negate(), SetJsonValue(), and SetParentEffect().
EffectBase* openshot::EffectBase::parentEffect |
Parent effect (which properties will set this effect properties)
Definition at line 63 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 66 of file EffectBase.h.
Referenced by openshot::Clip::AddEffect(), openshot::ObjectDetection::GetFrame(), openshot::ObjectDetection::GetVisibleObjects(), openshot::ObjectDetection::JsonValue(), openshot::ObjectDetection::LoadObjDetectdData(), openshot::ObjectDetection::ObjectDetection(), openshot::ObjectDetection::PropertiesJSON(), and openshot::ObjectDetection::SetJsonValue().