OpenShot Library | libopenshot  0.4.0
Sharpen.h
Go to the documentation of this file.
1 // Sharpen.h
10 // Copyright (c) 2008-2025 OpenShot Studios, LLC
11 //
12 // SPDX-License-Identifier: LGPL-3.0-or-later
13 
14 #ifndef OPENSHOT_SHARPEN_EFFECT_H
15 #define OPENSHOT_SHARPEN_EFFECT_H
16 
17 #include "EffectBase.h"
18 #include "KeyFrame.h"
19 #include "Json.h"
20 
21 #include <string>
22 
23 namespace openshot {
24 
31 class Sharpen : public EffectBase {
32 private:
34  void init_effect_details();
35 
36 public:
39 
42 
45 
47  int mode;
48 
50  int channel;
51 
53  Sharpen();
54 
56  Sharpen(Keyframe new_amount, Keyframe new_radius, Keyframe new_threshold);
57 
67  std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
68  std::shared_ptr<Frame> GetFrame(int64_t n) override
69  { return GetFrame(std::make_shared<Frame>(), n); }
70 
72  std::string Json() const override;
73  Json::Value JsonValue() const override;
74  void SetJson(const std::string value) override;
75  void SetJsonValue(const Json::Value root) override;
76 
79  std::string PropertiesJSON(int64_t requested_frame) const override;
80 };
81 
82 } // namespace openshot
83 
84 #endif // OPENSHOT_SHARPEN_EFFECT_H
openshot::Sharpen::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition: Sharpen.cpp:353
openshot::Sharpen::mode
int mode
Sharpening mode (0 = UnsharpMask, 1 = HighPassBlend)
Definition: Sharpen.h:47
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:53
openshot::Sharpen::GetFrame
std::shared_ptr< Frame > GetFrame(int64_t n) override
This method is required for all derived classes of ClipBase, and returns a new openshot::Frame object...
Definition: Sharpen.h:68
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::Sharpen::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: Sharpen.cpp:375
openshot::Sharpen::Json
std::string Json() const override
Get and Set JSON methods.
Definition: Sharpen.cpp:335
openshot::Sharpen::radius
Keyframe radius
Radius of the blur used in sharpening (0 to 10 pixels for 1080p)
Definition: Sharpen.h:41
openshot::Sharpen::GetFrame
std::shared_ptr< Frame > GetFrame(std::shared_ptr< Frame > frame, int64_t frame_number) override
This method is required for all derived classes of EffectBase, and returns a modified openshot::Frame...
Definition: Sharpen.cpp:194
openshot::Sharpen::channel
int channel
Channel to apply sharpening to (0 = All, 1 = Luma, 2 = Chroma)
Definition: Sharpen.h:50
EffectBase.h
Header file for EffectBase class.
openshot::Sharpen
This class provides a sharpen effect for video frames.
Definition: Sharpen.h:31
KeyFrame.h
Header file for the Keyframe class.
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::Sharpen::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: Sharpen.cpp:340
openshot::Sharpen::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition: Sharpen.cpp:359
openshot::Sharpen::Sharpen
Sharpen()
Default constructor.
Definition: Sharpen.cpp:24
openshot::Sharpen::threshold
Keyframe threshold
Threshold for applying sharpening (0 to 1)
Definition: Sharpen.h:44
Json.h
Header file for JSON class.
openshot::Sharpen::amount
Keyframe amount
Amount of sharpening to apply (0 to 2)
Definition: Sharpen.h:38