OpenShot Library | libopenshot 1.1.1
EffectInfo.cpp
Go to the documentation of this file.
1
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 == "AudioVisualization")
33 return new AudioVisualization();
34
35 if (effect_type == "Bars")
36 return new Bars();
37
38 if (effect_type == "BeatSync")
39 return new BeatSync();
40
41 if (effect_type == "Blur")
42 return new Blur();
43
44 else if (effect_type == "Brightness")
45 return new Brightness();
46
47 else if (effect_type == "Caption")
48 return new Caption();
49
50 else if (effect_type == "ChromaKey")
51 return new ChromaKey();
52
53 else if (effect_type == "ColorGrade")
54 return new ColorGrade();
55
56 else if (effect_type == "ColorMap")
57 return new ColorMap();
58
59 else if (effect_type == "ColorShift")
60 return new ColorShift();
61
62 else if (effect_type == "Crop")
63 return new Crop();
64
65 else if (effect_type == "Deinterlace")
66 return new Deinterlace();
67
68 else if (effect_type == "Displace")
69 return new Displace();
70
71 else if (effect_type == "FilmGrain")
72 return new FilmGrain();
73
74 else if (effect_type == "Glow")
75 return new Glow();
76
77 else if (effect_type == "Hue")
78 return new Hue();
79
80 else if (effect_type == "LensFlare")
81 return new LensFlare();
82
83 else if (effect_type == "Mask")
84 return new Mask();
85
86 else if (effect_type == "Negate")
87 return new Negate();
88
89 else if (effect_type == "Pixelate")
90 return new Pixelate();
91
92 else if (effect_type == "Saturation")
93 return new Saturation();
94
95 else if (effect_type == "Sharpen")
96 return new Sharpen();
97
98 else if (effect_type == "Shadow")
99 return new Shadow();
100
101 else if (effect_type == "Shift")
102 return new Shift();
103
104 else if (effect_type == "SphericalProjection")
105 return new SphericalProjection();
106
107 else if (effect_type == "Timer")
108 return new Timer();
109
110 else if (effect_type == "DenoiseImage")
111 return new DenoiseImage();
112
113 else if (effect_type == "Wave")
114 return new Wave();
115
116 else if(effect_type == "Noise")
117 return new Noise();
118
119 else if(effect_type == "Delay")
120 return new Delay();
121
122 else if(effect_type == "Echo")
123 return new Echo();
124
125 else if(effect_type == "Distortion")
126 return new Distortion();
127
128 else if(effect_type == "ParametricEQ")
129 return new ParametricEQ();
130
131 else if(effect_type == "Compressor")
132 return new Compressor();
133
134 else if(effect_type == "Expander")
135 return new Expander();
136
137 else if(effect_type == "Robotization")
138 return new Robotization();
139
140 else if(effect_type == "Whisperization")
141 return new Whisperization();
142
143 #ifdef USE_OPENCV
144 else if (effect_type == "Outline")
145 return new Outline();
146
147 else if(effect_type == "Stabilizer")
148 return new Stabilizer();
149
150 else if(effect_type == "Tracker")
151 return new Tracker();
152
153 else if(effect_type == "ObjectDetection")
154 return new ObjectDetection();
155
156 else if(effect_type == "ObjectMask")
157 return new ObjectMask();
158 #endif
159
160 return NULL;
161}
162
163// Generate Json::Value for this object
165
166 // Create root json object
167 Json::Value root;
168
169 // Append info JSON from each supported effect
170 root.append(AnalogTape().JsonInfo());
171 root.append(AudioVisualization().JsonInfo());
172 root.append(Bars().JsonInfo());
173 root.append(BeatSync().JsonInfo());
174 root.append(Blur().JsonInfo());
175 root.append(Brightness().JsonInfo());
176 root.append(Caption().JsonInfo());
177 root.append(ChromaKey().JsonInfo());
178 root.append(ColorGrade().JsonInfo());
179 root.append(ColorMap().JsonInfo());
180 root.append(ColorShift().JsonInfo());
181 root.append(Crop().JsonInfo());
182 root.append(Deinterlace().JsonInfo());
183 root.append(Displace().JsonInfo());
184 root.append(FilmGrain().JsonInfo());
185 root.append(Glow().JsonInfo());
186 root.append(Hue().JsonInfo());
187 root.append(LensFlare().JsonInfo());
188 root.append(Mask().JsonInfo());
189 root.append(Negate().JsonInfo());
190 root.append(Pixelate().JsonInfo());
191 root.append(Saturation().JsonInfo());
192 root.append(Sharpen().JsonInfo());
193 root.append(Shadow().JsonInfo());
194 root.append(Shift().JsonInfo());
195 root.append(SphericalProjection().JsonInfo());
196 root.append(Timer().JsonInfo());
197 root.append(DenoiseImage().JsonInfo());
198 root.append(Wave().JsonInfo());
199 /* Audio */
200 root.append(Noise().JsonInfo());
201 root.append(Delay().JsonInfo());
202 root.append(Echo().JsonInfo());
203 root.append(Distortion().JsonInfo());
204 root.append(ParametricEQ().JsonInfo());
205 root.append(Compressor().JsonInfo());
206 root.append(Expander().JsonInfo());
207 root.append(Robotization().JsonInfo());
208 root.append(Whisperization().JsonInfo());
209
210 #ifdef USE_OPENCV
211 root.append(Outline().JsonInfo());
212 root.append(Stabilizer().JsonInfo());
213 root.append(Tracker().JsonInfo());
214 root.append(ObjectDetection().JsonInfo());
215 root.append(ObjectMask().JsonInfo());
216 #endif
217
218 // return JsonValue
219 return root;
220
221}
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:41
This class adjusts the brightness and contrast of an image, and can be animated with openshot::Keyfra...
Definition: Brightness.h:39
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
A unified beginner-friendly color grading effect.
Definition: ColorGrade.h:74
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 uses a grayscale image or video to displace frame pixels.
Definition: Displace.h:38
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:57
static Json::Value JsonValue()
Generate Json::Value for this object.
Definition: EffectInfo.cpp:164
EffectBase * CreateEffect(std::string effect_type)
Create an instance of an effect (factory style)
Definition: EffectInfo.cpp:27
This class adds a expander (or noise gate) into the audio.
Definition: Expander.h:37
Creative film-inspired grain texture effect.
Definition: FilmGrain.h:35
This class shifts the hue of an image, and can be animated with openshot::Keyframe curves over time.
Definition: Hue.h:40
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.
Display and expose a preprocessed segmentation mask for an object.
Definition: ObjectMask.h:41
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.
Definition: ParametricEQ.h:38
This class pixelates an image, and can be animated with openshot::Keyframe curves over time.
Definition: Pixelate.h:39
This class adds a robotization effect into the audio.
Definition: Robotization.h:43
This class adjusts the saturation of color on a frame's image.
Definition: Saturation.h:47
This class provides a sharpen effect for video frames.
Definition: Sharpen.h:36
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: AnimatedCurve.h:24