OpenShot Library | libopenshot 0.5.0
Loading...
Searching...
No Matches
EffectInfo.cpp
Go to the documentation of this file.
1
8
9// Copyright (c) 2008-2019 OpenShot Studios, LLC
10//
11// SPDX-License-Identifier: LGPL-3.0-or-later
12
13#include "EffectInfo.h"
14#include "Effects.h"
15#include "effects/AnalogTape.h"
16
17using namespace openshot;
18
19// Generate JSON string of this object
20std::string EffectInfo::Json() {
21
22 // Return formatted string
23 return JsonValue().toStyledString();
24}
25
26// Create a new effect instance
27EffectBase* EffectInfo::CreateEffect(std::string effect_type) {
28 // Init the matching effect object
29 if (effect_type == "AnalogTape")
30 return new AnalogTape();
31
32 if (effect_type == "Bars")
33 return new Bars();
34
35 if (effect_type == "Blur")
36 return new Blur();
37
38 else if (effect_type == "Brightness")
39 return new Brightness();
40
41 else if (effect_type == "Caption")
42 return new Caption();
43
44 else if (effect_type == "ChromaKey")
45 return new ChromaKey();
46
47 else if (effect_type == "ColorMap")
48 return new ColorMap();
49
50 else if (effect_type == "ColorShift")
51 return new ColorShift();
52
53 else if (effect_type == "Crop")
54 return new Crop();
55
56 else if (effect_type == "Deinterlace")
57 return new Deinterlace();
58
59 else if (effect_type == "Hue")
60 return new Hue();
61
62 else if (effect_type == "LensFlare")
63 return new LensFlare();
64
65 else if (effect_type == "Mask")
66 return new Mask();
67
68 else if (effect_type == "Negate")
69 return new Negate();
70
71 else if (effect_type == "Pixelate")
72 return new Pixelate();
73
74 else if (effect_type == "Saturation")
75 return new Saturation();
76
77 else if (effect_type == "Sharpen")
78 return new Sharpen();
79
80 else if (effect_type == "Shift")
81 return new Shift();
82
83 else if (effect_type == "SphericalProjection")
84 return new SphericalProjection();
85
86 else if (effect_type == "Wave")
87 return new Wave();
88
89 else if(effect_type == "Noise")
90 return new Noise();
91
92 else if(effect_type == "Delay")
93 return new Delay();
94
95 else if(effect_type == "Echo")
96 return new Echo();
97
98 else if(effect_type == "Distortion")
99 return new Distortion();
100
101 else if(effect_type == "ParametricEQ")
102 return new ParametricEQ();
103
104 else if(effect_type == "Compressor")
105 return new Compressor();
106
107 else if(effect_type == "Expander")
108 return new Expander();
109
110 else if(effect_type == "Robotization")
111 return new Robotization();
112
113 else if(effect_type == "Whisperization")
114 return new Whisperization();
115
116 #ifdef USE_OPENCV
117 else if (effect_type == "Outline")
118 return new Outline();
119
120 else if(effect_type == "Stabilizer")
121 return new Stabilizer();
122
123 else if(effect_type == "Tracker")
124 return new Tracker();
125
126 else if(effect_type == "ObjectDetection")
127 return new ObjectDetection();
128 #endif
129
130 return NULL;
131}
132
133// Generate Json::Value for this object
135
136 // Create root json object
137 Json::Value root;
138
139 // Append info JSON from each supported effect
140 root.append(AnalogTape().JsonInfo());
141 root.append(Bars().JsonInfo());
142 root.append(Blur().JsonInfo());
143 root.append(Brightness().JsonInfo());
144 root.append(Caption().JsonInfo());
145 root.append(ChromaKey().JsonInfo());
146 root.append(ColorMap().JsonInfo());
147 root.append(ColorShift().JsonInfo());
148 root.append(Crop().JsonInfo());
149 root.append(Deinterlace().JsonInfo());
150 root.append(Hue().JsonInfo());
151 root.append(LensFlare().JsonInfo());
152 root.append(Mask().JsonInfo());
153 root.append(Negate().JsonInfo());
154 root.append(Pixelate().JsonInfo());
155 root.append(Saturation().JsonInfo());
156 root.append(Sharpen().JsonInfo());
157 root.append(Shift().JsonInfo());
158 root.append(SphericalProjection().JsonInfo());
159 root.append(Wave().JsonInfo());
160 /* Audio */
161 root.append(Noise().JsonInfo());
162 root.append(Delay().JsonInfo());
163 root.append(Echo().JsonInfo());
164 root.append(Distortion().JsonInfo());
165 root.append(ParametricEQ().JsonInfo());
166 root.append(Compressor().JsonInfo());
167 root.append(Expander().JsonInfo());
168 root.append(Robotization().JsonInfo());
169 root.append(Whisperization().JsonInfo());
170
171 #ifdef USE_OPENCV
172 root.append(Outline().JsonInfo());
173 root.append(Stabilizer().JsonInfo());
174 root.append(Tracker().JsonInfo());
175 root.append(ObjectDetection().JsonInfo());
176 #endif
177
178 // return JsonValue
179 return root;
180
181}
Header file for AnalogTape effect class.
Header file for the EffectInfo class.
This header includes all commonly used effects for libopenshot, for ease-of-use.
Analog video tape simulation effect.
Definition AnalogTape.h:41
This class draws black bars around your video (from any side), and can be animated with openshot::Key...
Definition Bars.h:37
This class adjusts the blur of an image, and can be animated with openshot::Keyframe curves over time...
Definition Blur.h:37
This class adjusts the brightness and contrast of an image, and can be animated with openshot::Keyfra...
Definition Brightness.h:35
This class adds captions/text over a video, based on timestamps. You can also animate some limited as...
Definition Caption.h:39
This class removes (i.e. keys out) a color (i.e. greenscreen).
Definition ChromaKey.h:37
Applies a 1D or 3D LUT (.cube) color transform to each frame.
Definition ColorMap.h:36
This class shifts the pixels of an image up, down, left, or right, and can be animated with openshot:...
Definition ColorShift.h:36
This class adds a compressor into the audio.
Definition Compressor.h:36
This class crops a frame image (from any side), and can be animated with openshot::Keyframe curves ov...
Definition Crop.h:38
This class uses the ImageMagick++ libraries, to de-interlace the image, which removes the EVEN or ODD...
Definition Deinterlace.h:35
This class adds a delay into the audio.
Definition Delay.h:36
This class adds a distortion into the audio.
Definition Distortion.h:38
This class adds a echo into the audio.
Definition Echo.h:36
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:54
static Json::Value JsonValue()
Generate Json::Value for this object.
static std::string Json()
Generate JSON string of this object.
EffectBase * CreateEffect(std::string effect_type)
Create an instance of an effect (factory style).
This class adds a expander (or noise gate) into the audio.
Definition Expander.h:37
This class shifts the hue of an image, and can be animated with openshot::Keyframe curves over time.
Definition Hue.h:36
This class uses the image libraries to apply alpha (or transparency) masks to any frame....
Definition Mask.h:37
This class uses the ImageMagick++ libraries, to negate image (i.e. negative).
Definition Negate.h:35
This class adds a noise into the audio.
Definition Noise.h:36
This effect displays all the detected objects on a clip.
This class add an outline around image with transparent background and can be animated with openshot:...
Definition Outline.h:38
This class adds a equalization into the audio.
This class pixelates an image, and can be animated with openshot::Keyframe curves over time.
Definition Pixelate.h:35
This class adds a robotization effect into the audio.
This class adjusts the saturation of color on a frame's image.
Definition Saturation.h:43
This class provides a sharpen effect for video frames.
Definition Sharpen.h:31
This class shifts the pixels of an image up, down, left, or right, and can be animated with openshot:...
Definition Shift.h:37
Projects 360° or fisheye video through a virtual camera. Supports yaw, pitch, roll,...
This class stabilizes a video clip to remove undesired shaking and jitter.
Definition Stabilizer.h:67
This class tracks a given object through the clip, draws a box around it and allow the user to attach...
Definition Tracker.h:42
This class distorts an image using a wave pattern.
Definition Wave.h:36
This class adds a whisperization effect into the audio.
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29