OpenShot Library | libopenshot 0.6.0
Loading...
Searching...
No Matches
Brightness.h
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#ifndef OPENSHOT_BRIGHTNESS_EFFECT_H
14#define OPENSHOT_BRIGHTNESS_EFFECT_H
15
16#include "../EffectBase.h"
17
18#include "../Frame.h"
19#include "../Json.h"
20#include "../KeyFrame.h"
21
22#include <memory>
23#include <string>
24
25namespace openshot
26{
31
38 class Brightness : public EffectBase
39 {
40 private:
42 void init_effect_details();
43
44 protected:
45 bool UseCustomMaskBlend(int64_t frame_number) const override;
46 void ApplyCustomMaskBlend(std::shared_ptr<QImage> original_image, std::shared_ptr<QImage> effected_image,
47 std::shared_ptr<QImage> mask_image, int64_t frame_number) const override;
48
49 public:
53
55 Brightness();
56
58 // contrast of a frame's image.
62 Brightness(Keyframe new_brightness, Keyframe new_contrast);
63
70 std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared<openshot::Frame>(), frame_number); }
71
81 std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
82
83 // Get and Set JSON methods
84 std::string Json() const override;
85 void SetJson(const std::string value) override;
86 Json::Value JsonValue() const override;
87 void SetJsonValue(const Json::Value root) override;
88
91 std::string PropertiesJSON(int64_t requested_frame) const override;
92 };
93
94}
95
96#endif
This class adjusts the brightness and contrast of an image, and can be animated with openshot::Keyfra...
Definition Brightness.h:39
Keyframe brightness
Brightness keyframe. A constant value here will prevent animation.
Definition Brightness.h:50
std::string Json() const override
Generate JSON string of this object.
void ApplyCustomMaskBlend(std::shared_ptr< QImage > original_image, std::shared_ptr< QImage > effected_image, std::shared_ptr< QImage > mask_image, int64_t frame_number) const override
Optional override for effects with custom mask implementation.
Keyframe contrast
Contrast keyframe.
Definition Brightness.h:51
int mask_mode
Mask behavior mode for this effect.
Definition Brightness.h:52
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 Brightness.h:70
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Json::Value JsonValue() const override
Generate Json::Value for this object.
std::string PropertiesJSON(int64_t requested_frame) const override
bool UseCustomMaskBlend(int64_t frame_number) const override
Optional override for effects that need custom mask behavior.
Brightness()
Blank constructor, useful when using Json to load the effect properties.
void SetJson(const std::string value) override
Load JSON string into this object.
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
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29
BrightnessMaskMode
Definition Brightness.h:27
@ BRIGHTNESS_MASK_LIMIT_TO_AREA
Definition Brightness.h:28
@ BRIGHTNESS_MASK_VARY_STRENGTH
Definition Brightness.h:29