Loading...
Searching...
No Matches
EffectInfo.cpp
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "EffectInfo.h"
#include "Effects.h"
using namespace openshot;
// Generate JSON string of this object
std::string EffectInfo::Json() {
// Return formatted string
return JsonValue().toStyledString();
}
// Create a new effect instance
EffectBase* EffectInfo::CreateEffect(std::string effect_type) {
// Init the matching effect object
if (effect_type == "Bars")
return new Bars();
if (effect_type == "Blur")
return new Blur();
else if (effect_type == "Brightness")
return new Brightness();
else if (effect_type == "Caption")
return new Caption();
else if (effect_type == "ChromaKey")
return new ChromaKey();
else if (effect_type == "ColorShift")
return new ColorShift();
else if (effect_type == "Crop")
return new Crop();
else if (effect_type == "Deinterlace")
return new Deinterlace();
else if (effect_type == "Hue")
return new Hue();
else if (effect_type == "Mask")
return new Mask();
else if (effect_type == "Negate")
return new Negate();
else if (effect_type == "Pixelate")
return new Pixelate();
else if (effect_type == "Saturation")
return new Saturation();
else if (effect_type == "Shift")
return new Shift();
else if (effect_type == "Wave")
return new Wave();
else if(effect_type == "Noise")
return new Noise();
else if(effect_type == "Delay")
return new Delay();
else if(effect_type == "Echo")
return new Echo();
else if(effect_type == "Distortion")
return new Distortion();
else if(effect_type == "ParametricEQ")
return new ParametricEQ();
else if(effect_type == "Compressor")
return new Compressor();
else if(effect_type == "Expander")
return new Expander();
else if(effect_type == "Robotization")
return new Robotization();
else if(effect_type == "Whisperization")
return new Whisperization();
#ifdef USE_OPENCV
else if(effect_type == "Stabilizer")
return new Stabilizer();
else if(effect_type == "Tracker")
return new Tracker();
else if(effect_type == "ObjectDetection")
return new ObjectDetection();
#endif
return NULL;
}
// Generate Json::Value for this object
Json::Value EffectInfo::JsonValue() {
// Create root json object
Json::Value root;
// Append info JSON from each supported effect
root.append(Bars().JsonInfo());
root.append(Blur().JsonInfo());
root.append(Brightness().JsonInfo());
root.append(Caption().JsonInfo());
root.append(ChromaKey().JsonInfo());
root.append(ColorShift().JsonInfo());
root.append(Crop().JsonInfo());
root.append(Deinterlace().JsonInfo());
root.append(Hue().JsonInfo());
root.append(Mask().JsonInfo());
root.append(Negate().JsonInfo());
root.append(Pixelate().JsonInfo());
root.append(Saturation().JsonInfo());
root.append(Shift().JsonInfo());
root.append(Wave().JsonInfo());
/* Audio */
root.append(Noise().JsonInfo());
root.append(Delay().JsonInfo());
root.append(Echo().JsonInfo());
root.append(Distortion().JsonInfo());
root.append(ParametricEQ().JsonInfo());
root.append(Compressor().JsonInfo());
root.append(Expander().JsonInfo());
root.append(Robotization().JsonInfo());
root.append(Whisperization().JsonInfo());
#ifdef USE_OPENCV
root.append(Stabilizer().JsonInfo());
root.append(Tracker().JsonInfo());
root.append(ObjectDetection().JsonInfo());
#endif
// return JsonValue
return root;
}
EffectInfo.h
Header file for the EffectInfo class.
Effects.h
This header includes all commonly used effects for libopenshot, for ease-of-use.
openshot::Bars
This class draws black bars around your video (from any side), and can be animated with openshot::Key...
Definition Bars.h:37
openshot::Blur
This class adjusts the blur of an image, and can be animated with openshot::Keyframe curves over time...
Definition Blur.h:37
openshot::Brightness
This class adjusts the brightness and contrast of an image, and can be animated with openshot::Keyfra...
Definition Brightness.h:35
openshot::Caption
This class adds captions/text over a video, based on timestamps. You can also animate some limited as...
Definition Caption.h:39
openshot::ChromaKey
This class removes (i.e. keys out) a color (i.e. greenscreen)
Definition ChromaKey.h:37
openshot::ColorShift
This class shifts the pixels of an image up, down, left, or right, and can be animated with openshot:...
Definition ColorShift.h:36
openshot::Compressor
This class adds a compressor into the audio.
Definition Compressor.h:36
openshot::Crop
This class crops a frame image (from any side), and can be animated with openshot::Keyframe curves ov...
Definition Crop.h:38
openshot::Deinterlace
This class uses the ImageMagick++ libraries, to de-interlace the image, which removes the EVEN or ODD...
Definition Deinterlace.h:35
openshot::Delay
This class adds a delay into the audio.
Definition Delay.h:36
openshot::Distortion
This class adds a distortion into the audio.
Definition Distortion.h:38
openshot::Echo
This class adds a echo into the audio.
Definition Echo.h:36
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:53
openshot::EffectInfo::JsonValue
static Json::Value JsonValue()
Generate Json::Value for this object.
Definition EffectInfo.cpp:115
openshot::EffectInfo::Json
static std::string Json()
Generate JSON string of this object.
Definition EffectInfo.cpp:19
openshot::EffectInfo::CreateEffect
EffectBase * CreateEffect(std::string effect_type)
Create an instance of an effect (factory style)
Definition EffectInfo.cpp:26
openshot::Expander
This class adds a expander (or noise gate) into the audio.
Definition Expander.h:37
openshot::Hue
This class shifts the hue of an image, and can be animated with openshot::Keyframe curves over time.
Definition Hue.h:36
openshot::Mask
This class uses the image libraries to apply alpha (or transparency) masks to any frame....
Definition Mask.h:37
openshot::Negate
This class uses the ImageMagick++ libraries, to negate image (i.e. negative)
Definition Negate.h:35
openshot::Noise
This class adds a noise into the audio.
Definition Noise.h:36
openshot::ObjectDetection
This effect displays all the detected objects on a clip.
Definition ObjectDetection.h:58
openshot::ParametricEQ
This class adds a equalization into the audio.
Definition ParametricEQ.h:38
openshot::Pixelate
This class pixelates an image, and can be animated with openshot::Keyframe curves over time.
Definition Pixelate.h:35
openshot::Robotization
This class adds a robotization effect into the audio.
Definition Robotization.h:43
openshot::Saturation
This class adjusts the saturation of color on a frame's image.
Definition Saturation.h:43
openshot::Shift
This class shifts the pixels of an image up, down, left, or right, and can be animated with openshot:...
Definition Shift.h:37
openshot::Stabilizer
This class stabilizes a video clip to remove undesired shaking and jitter.
Definition Stabilizer.h:67
openshot::Tracker
This class tracks a given object through the clip, draws a box around it and allow the user to attach...
Definition Tracker.h:42
openshot::Wave
This class distorts an image using a wave pattern.
Definition Wave.h:36
openshot::Whisperization
This class adds a whisperization effect into the audio.
Definition Whisperization.h:42
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29