OpenShot Library | libopenshot 1.1.1
Shadow.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_SHADOW_EFFECT_H
14#define OPENSHOT_SHADOW_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
25namespace openshot
26{
27 class Shadow : public EffectBase
28 {
29 private:
30 void init_effect_details();
31
32 public:
39
40 Shadow();
41 Shadow(Keyframe new_opacity, Keyframe new_blur_radius, Keyframe new_spread,
42 Keyframe new_distance, Keyframe new_angle, Color new_color);
43
44 std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
45 return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
46 }
47
48 std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame,
49 int64_t frame_number) override;
50
51 std::string Json() const override;
52 void SetJson(const std::string value) override;
53 Json::Value JsonValue() const override;
54 void SetJsonValue(const Json::Value root) override;
55
56 std::string PropertiesJSON(int64_t requested_frame) const override;
57 };
58}
59
60#endif
This class represents a color (used on the timeline and clips)
Definition: Color.h:27
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:57
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
Definition: KeyFrame.h:53
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: Shadow.cpp:293
Keyframe distance
Shadow offset distance in pixels.
Definition: Shadow.h:36
Keyframe angle
Shadow angle in degrees.
Definition: Shadow.h:37
Color color
Shadow tint color.
Definition: Shadow.h:38
Keyframe opacity
Overall shadow opacity.
Definition: Shadow.h:33
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: Shadow.cpp:331
Keyframe blur_radius
Blur radius in pixels.
Definition: Shadow.h:34
Keyframe spread
Boosts the source alpha before blur.
Definition: Shadow.h:35
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: Shadow.h:44
std::string Json() const override
Generate JSON string of this object.
Definition: Shadow.cpp:289
void SetJson(const std::string value) override
Load JSON string into this object.
Definition: Shadow.cpp:305
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition: Shadow.cpp:315
This namespace is the default namespace for all code in the openshot library.
Definition: AnimatedCurve.h:24