OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
Brightness.h
Go to the documentation of this file.
1
8
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
25
namespace
openshot
26
{
27
enum
BrightnessMaskMode
{
28
BRIGHTNESS_MASK_LIMIT_TO_AREA
= 0,
29
BRIGHTNESS_MASK_VARY_STRENGTH
= 1
30
};
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
:
50
Keyframe
brightness
;
51
Keyframe
contrast
;
52
int
mask_mode
;
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
EffectBase.h
Header file for EffectBase class.
Frame.h
Header file for Frame class.
Json.h
Header file for JSON class.
KeyFrame.h
Header file for the Keyframe class.
openshot::Brightness::brightness
Keyframe brightness
Brightness keyframe. A constant value here will prevent animation.
Definition
Brightness.h:50
openshot::Brightness::Json
std::string Json() const override
Generate JSON string of this object.
Definition
Brightness.cpp:186
openshot::Brightness::ApplyCustomMaskBlend
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.
Definition
Brightness.cpp:136
openshot::Brightness::contrast
Keyframe contrast
Contrast keyframe.
Definition
Brightness.h:51
openshot::Brightness::mask_mode
int mask_mode
Mask behavior mode for this effect.
Definition
Brightness.h:52
openshot::Brightness::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
Brightness.h:70
openshot::Brightness::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition
Brightness.cpp:224
openshot::Brightness::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition
Brightness.cpp:193
openshot::Brightness::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition
Brightness.cpp:239
openshot::Brightness::UseCustomMaskBlend
bool UseCustomMaskBlend(int64_t frame_number) const override
Optional override for effects that need custom mask behavior.
Definition
Brightness.cpp:131
openshot::Brightness::Brightness
Brightness()
Blank constructor, useful when using Json to load the effect properties.
Definition
Brightness.cpp:20
openshot::Brightness::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition
Brightness.cpp:207
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition
EffectBase.h:57
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
This namespace is the default namespace for all code in the openshot library.
Definition
AnimatedCurve.h:24
openshot::BrightnessMaskMode
BrightnessMaskMode
Definition
Brightness.h:27
openshot::BRIGHTNESS_MASK_LIMIT_TO_AREA
@ BRIGHTNESS_MASK_LIMIT_TO_AREA
Definition
Brightness.h:28
openshot::BRIGHTNESS_MASK_VARY_STRENGTH
@ BRIGHTNESS_MASK_VARY_STRENGTH
Definition
Brightness.h:29
effects
Brightness.h
Generated by
1.17.0