Loading...
Searching...
No Matches
Sharpen.h
Go to the documentation of this file.
// Sharpen.h
// Copyright (c) 2008-2025 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_SHARPEN_EFFECT_H
#define OPENSHOT_SHARPEN_EFFECT_H
#include "EffectBase.h"
#include "KeyFrame.h"
#include "Json.h"
#include <string>
namespace openshot {
class Sharpen : public EffectBase {
private:
void init_effect_details();
public:
Keyframe amount;
Keyframe radius;
Keyframe threshold;
int mode;
int channel;
Sharpen();
Sharpen(Keyframe new_amount, Keyframe new_radius, Keyframe new_threshold);
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
std::shared_ptr<Frame> GetFrame(int64_t n) override
{ return GetFrame(std::make_shared<Frame>(), n); }
std::string Json() const override;
Json::Value JsonValue() const override;
void SetJson(const std::string value) override;
void SetJsonValue(const Json::Value root) override;
std::string PropertiesJSON(int64_t requested_frame) const override;
};
} // namespace openshot
#endif // OPENSHOT_SHARPEN_EFFECT_H
EffectBase.h
Header file for EffectBase class.
Json.h
Header file for JSON class.
KeyFrame.h
Header file for the Keyframe class.
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:54
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::mode
int mode
Sharpening mode (0 = UnsharpMask, 1 = HighPassBlend).
Definition Sharpen.h:47
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::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition Sharpen.cpp:340
openshot::Sharpen::Sharpen
Sharpen()
Default constructor.
Definition Sharpen.cpp:24
openshot::Sharpen::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition Sharpen.cpp:353
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::Sharpen::channel
int channel
Channel to apply sharpening to (0 = All, 1 = Luma, 2 = Chroma).
Definition Sharpen.h:50
openshot::Sharpen::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition Sharpen.cpp:359
openshot::Sharpen::amount
Keyframe amount
Amount of sharpening to apply (0 to 2).
Definition Sharpen.h:38
openshot::Sharpen::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition Sharpen.cpp:375
openshot::Sharpen::threshold
Keyframe threshold
Threshold for applying sharpening (0 to 1).
Definition Sharpen.h:44
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29