OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
ColorGrade.h
Go to the documentation of this file.
1
8
9
// Copyright (c) 2008-2026 OpenShot Studios, LLC
10
//
11
// SPDX-License-Identifier: LGPL-3.0-or-later
12
13
#ifndef OPENSHOT_COLOR_GRADE_EFFECT_H
14
#define OPENSHOT_COLOR_GRADE_EFFECT_H
15
16
#include "
../AnimatedCurve.h
"
17
#include "
../EffectBase.h
"
18
#include "
../Color.h
"
19
#include "
../Frame.h
"
20
#include "
../Json.h
"
21
#include "
../KeyFrame.h
"
22
#include "
ColorMap.h
"
23
24
#include <QColor>
25
26
#include <array>
27
#include <string>
28
#include <utility>
29
#include <vector>
30
31
namespace
openshot
32
{
36
struct
ColorGradeWheelEntry
{
37
Color
color
;
38
Keyframe
amount
;
39
Keyframe
luma
;
40
41
ColorGradeWheelEntry
();
42
Json::Value
JsonValue
()
const
;
43
void
SetJsonValue
(
const
Json::Value& root);
44
QColor
GetColor
(int64_t frame_number)
const
;
45
float
GetAmount
(int64_t frame_number)
const
;
46
float
GetLuma
(int64_t frame_number)
const
;
47
};
48
52
struct
ColorGradeWheelsData
{
53
Keyframe
enabled
;
54
ColorGradeWheelEntry
global
;
55
ColorGradeWheelEntry
shadows
;
56
ColorGradeWheelEntry
midtones
;
57
ColorGradeWheelEntry
highlights
;
58
59
ColorGradeWheelsData
();
60
Json::Value
JsonValue
()
const
;
61
void
SetJsonValue
(
const
Json::Value& root);
62
std::string
Summary
(int64_t frame_number)
const
;
63
bool
IsEnabled
(int64_t frame_number)
const
;
64
};
65
73
class
ColorGrade
:
public
EffectBase
74
{
75
private
:
76
ColorMap
lut_effect;
77
std::string lut_path;
78
bool
lut_dirty;
79
80
void
init_effect_details();
81
void
sync_lut_effect();
82
83
static
float
Clamp01(
float
value);
84
85
public
:
86
Keyframe
temperature
;
87
Keyframe
tint
;
88
Keyframe
exposure
;
89
Keyframe
contrast
;
90
Keyframe
highlights
;
91
Keyframe
shadows
;
92
Keyframe
saturation
;
93
Keyframe
vibrance
;
94
Keyframe
mix
;
95
Keyframe
lut_intensity
;
96
97
ColorGradeWheelsData
wheels
;
98
AnimatedCurve
curve_all
;
99
AnimatedCurve
curve_red
;
100
AnimatedCurve
curve_green
;
101
AnimatedCurve
curve_blue
;
102
103
ColorGrade
();
104
105
std::shared_ptr<openshot::Frame>
GetFrame
(int64_t frame_number)
override
{
106
return
GetFrame
(std::make_shared<openshot::Frame>(), frame_number);
107
}
108
std::shared_ptr<openshot::Frame>
GetFrame
(std::shared_ptr<openshot::Frame> frame, int64_t frame_number)
override
;
109
110
std::string
Json
()
const override
;
111
Json::Value
JsonValue
()
const override
;
112
void
SetJson
(
const
std::string value)
override
;
113
void
SetJsonValue
(
const
Json::Value root)
override
;
114
std::string
PropertiesJSON
(int64_t requested_frame)
const override
;
115
};
116
}
117
118
#endif
AnimatedCurve.h
Header file for AnimatedCurve classes.
ColorMap.h
Header file for ColorMap (LUT) effect.
Color.h
Header file for Color class.
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::AnimatedCurve
Definition
AnimatedCurve.h:49
openshot::ColorGrade::lut_intensity
Keyframe lut_intensity
Definition
ColorGrade.h:95
openshot::ColorGrade::temperature
Keyframe temperature
Definition
ColorGrade.h:86
openshot::ColorGrade::curve_green
AnimatedCurve curve_green
Definition
ColorGrade.h:100
openshot::ColorGrade::contrast
Keyframe contrast
Definition
ColorGrade.h:89
openshot::ColorGrade::ColorGrade
ColorGrade()
Definition
ColorGrade.cpp:178
openshot::ColorGrade::curve_blue
AnimatedCurve curve_blue
Definition
ColorGrade.h:101
openshot::ColorGrade::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition
ColorGrade.cpp:399
openshot::ColorGrade::highlights
Keyframe highlights
Definition
ColorGrade.h:90
openshot::ColorGrade::saturation
Keyframe saturation
Definition
ColorGrade.h:92
openshot::ColorGrade::tint
Keyframe tint
Definition
ColorGrade.h:87
openshot::ColorGrade::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition
ColorGrade.cpp:421
openshot::ColorGrade::curve_red
AnimatedCurve curve_red
Definition
ColorGrade.h:99
openshot::ColorGrade::curve_all
AnimatedCurve curve_all
Definition
ColorGrade.h:98
openshot::ColorGrade::shadows
Keyframe shadows
Definition
ColorGrade.h:91
openshot::ColorGrade::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
ColorGrade.h:105
openshot::ColorGrade::Json
std::string Json() const override
Generate JSON string of this object.
Definition
ColorGrade.cpp:395
openshot::ColorGrade::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition
ColorGrade.cpp:471
openshot::ColorGrade::mix
Keyframe mix
Definition
ColorGrade.h:94
openshot::ColorGrade::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition
ColorGrade.cpp:430
openshot::ColorGrade::exposure
Keyframe exposure
Definition
ColorGrade.h:88
openshot::ColorGrade::wheels
ColorGradeWheelsData wheels
Definition
ColorGrade.h:97
openshot::ColorGrade::vibrance
Keyframe vibrance
Definition
ColorGrade.h:93
openshot::ColorMap
Applies a 1D or 3D LUT (.cube) color transform to each frame.
Definition
ColorMap.h:36
openshot::Color
This class represents a color (used on the timeline and clips).
Definition
Color.h:27
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::ColorGradeWheelEntry
Wheel payload for a tonal region using native animated primitives.
Definition
ColorGrade.h:36
openshot::ColorGradeWheelEntry::amount
Keyframe amount
Definition
ColorGrade.h:38
openshot::ColorGradeWheelEntry::GetColor
QColor GetColor(int64_t frame_number) const
Definition
ColorGrade.cpp:124
openshot::ColorGradeWheelEntry::GetLuma
float GetLuma(int64_t frame_number) const
Definition
ColorGrade.cpp:136
openshot::ColorGradeWheelEntry::SetJsonValue
void SetJsonValue(const Json::Value &root)
Definition
ColorGrade.cpp:106
openshot::ColorGradeWheelEntry::GetAmount
float GetAmount(int64_t frame_number) const
Definition
ColorGrade.cpp:132
openshot::ColorGradeWheelEntry::ColorGradeWheelEntry
ColorGradeWheelEntry()
Definition
ColorGrade.cpp:88
openshot::ColorGradeWheelEntry::luma
Keyframe luma
Definition
ColorGrade.h:39
openshot::ColorGradeWheelEntry::color
Color color
Definition
ColorGrade.h:37
openshot::ColorGradeWheelEntry::JsonValue
Json::Value JsonValue() const
Definition
ColorGrade.cpp:91
openshot::ColorGradeWheelsData
All wheel controls for ColorGrade.
Definition
ColorGrade.h:52
openshot::ColorGradeWheelsData::Summary
std::string Summary(int64_t frame_number) const
Definition
ColorGrade.cpp:169
openshot::ColorGradeWheelsData::ColorGradeWheelsData
ColorGradeWheelsData()
Definition
ColorGrade.cpp:140
openshot::ColorGradeWheelsData::highlights
ColorGradeWheelEntry highlights
Definition
ColorGrade.h:57
openshot::ColorGradeWheelsData::global
ColorGradeWheelEntry global
Definition
ColorGrade.h:54
openshot::ColorGradeWheelsData::IsEnabled
bool IsEnabled(int64_t frame_number) const
Definition
ColorGrade.cpp:174
openshot::ColorGradeWheelsData::enabled
Keyframe enabled
Definition
ColorGrade.h:53
openshot::ColorGradeWheelsData::SetJsonValue
void SetJsonValue(const Json::Value &root)
Definition
ColorGrade.cpp:154
openshot::ColorGradeWheelsData::midtones
ColorGradeWheelEntry midtones
Definition
ColorGrade.h:56
openshot::ColorGradeWheelsData::JsonValue
Json::Value JsonValue() const
Definition
ColorGrade.cpp:143
openshot::ColorGradeWheelsData::shadows
ColorGradeWheelEntry shadows
Definition
ColorGrade.h:55
effects
ColorGrade.h
Generated by
1.17.0