OpenShot Library | libopenshot  0.7.0
Glow.h
Go to the documentation of this file.
1 
9 // Copyright (c) 2008-2026 OpenShot Studios, LLC
10 //
11 // SPDX-License-Identifier: LGPL-3.0-or-later
12 
13 #ifndef OPENSHOT_GLOW_EFFECT_H
14 #define OPENSHOT_GLOW_EFFECT_H
15 
16 #include "../Color.h"
17 #include "../EffectBase.h"
18 #include "../Frame.h"
19 #include "../Json.h"
20 #include "../KeyFrame.h"
21 
22 #include <memory>
23 #include <string>
24 
25 namespace openshot
26 {
27  enum GlowMode {
30  };
31 
32  class Glow : public EffectBase
33  {
34  private:
35  void init_effect_details();
36 
37  public:
38  int mode;
43 
44  Glow();
45  Glow(Keyframe new_opacity, Keyframe new_blur_radius, Keyframe new_spread, Color new_color);
46 
47  std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
48  return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
49  }
50 
51  std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame,
52  int64_t frame_number) override;
53 
54  std::string Json() const override;
55  void SetJson(const std::string value) override;
56  Json::Value JsonValue() const override;
57  void SetJsonValue(const Json::Value root) override;
58 
59  std::string PropertiesJSON(int64_t requested_frame) const override;
60  };
61 }
62 
63 #endif
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:56
openshot::GlowMode
GlowMode
Definition: Glow.h:27
openshot::Glow::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: Glow.cpp:280
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::GLOW_MODE_INNER
@ GLOW_MODE_INNER
Definition: Glow.h:29
openshot::GLOW_MODE_OUTER
@ GLOW_MODE_OUTER
Definition: Glow.h:28
openshot::Glow::GetFrame
std::shared_ptr< openshot::Frame > GetFrame(int64_t frame_number) override
This method is required for all derived classes of ClipBase, and returns a new openshot::Frame object...
Definition: Glow.h:47
openshot::Glow::color
Color color
Glow tint color.
Definition: Glow.h:42
openshot::Glow
Definition: Glow.h:32
openshot::Glow::blur_radius
Keyframe blur_radius
Blur radius in pixels.
Definition: Glow.h:40
openshot::Color
This class represents a color (used on the timeline and clips)
Definition: Color.h:27
openshot::Glow::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition: Glow.cpp:301
openshot::Glow::opacity
Keyframe opacity
Overall glow opacity.
Definition: Glow.h:39
openshot::Keyframe
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
Definition: KeyFrame.h:53
openshot::Glow::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: Glow.cpp:315
openshot::Glow::mode
int mode
Outer or inner glow mode.
Definition: Glow.h:38
openshot::Glow::Json
std::string Json() const override
Generate JSON string of this object.
Definition: Glow.cpp:276
openshot::Glow::spread
Keyframe spread
Boosts the source alpha before blur.
Definition: Glow.h:41
openshot::Glow::Glow
Glow()
Definition: Glow.cpp:164
openshot::Glow::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition: Glow.cpp:291