OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
Color.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_COLOR_H
14
#define OPENSHOT_COLOR_H
15
16
#include "
KeyFrame.h
"
17
#include <QColor>
18
19
namespace
openshot
{
20
27
class
Color
{
28
29
public
:
30
openshot::Keyframe
red
;
31
openshot::Keyframe
green
;
32
openshot::Keyframe
blue
;
33
openshot::Keyframe
alpha
;
34
36
Color
() {};
37
39
explicit
Color
(QColor);
40
42
explicit
Color
(std::string color_hex);
43
explicit
Color
(
const
char
* color_hex);
44
46
Color
(
unsigned
char
Red,
unsigned
char
Green,
unsigned
char
Blue,
unsigned
char
Alpha);
47
49
Color
(
openshot::Keyframe
Red,
openshot::Keyframe
Green,
openshot::Keyframe
Blue,
openshot::Keyframe
Alpha);
50
52
std::string
GetColorHex
(int64_t frame_number);
53
54
// Get the RGBA values of a color at a specific frame
55
std::vector<int>
GetColorRGBA
(int64_t frame_number);
56
58
static
long
GetDistance
(
long
R1,
long
G1,
long
B1,
long
R2,
long
G2,
long
B2);
59
60
// Get and Set JSON methods
61
std::string
Json
()
const
;
62
Json::Value
JsonValue
()
const
;
63
void
SetJson
(
const
std::string value);
64
void
SetJsonValue
(
const
Json::Value root);
65
};
66
67
}
// namespace openshot
68
69
#endif
KeyFrame.h
Header file for the Keyframe class.
openshot::Color::Json
std::string Json() const
Generate JSON string of this object.
Definition
Color.cpp:80
openshot::Color::GetColorHex
std::string GetColorHex(int64_t frame_number)
Get the HEX value of a color at a specific frame.
Definition
Color.cpp:48
openshot::Color::blue
openshot::Keyframe blue
Curve representing the red value (0 - 255).
Definition
Color.h:32
openshot::Color::red
openshot::Keyframe red
Curve representing the red value (0 - 255).
Definition
Color.h:30
openshot::Color::green
openshot::Keyframe green
Curve representing the green value (0 - 255).
Definition
Color.h:31
openshot::Color::Color
Color()
Default constructor.
Definition
Color.h:36
openshot::Color::SetJsonValue
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
Definition
Color.cpp:118
openshot::Color::alpha
openshot::Keyframe alpha
Curve representing the alpha value (0 - 255).
Definition
Color.h:33
openshot::Color::GetDistance
static long GetDistance(long R1, long G1, long B1, long R2, long G2, long B2)
Get the distance between 2 RGB pairs. (0=identical colors, 10=very close colors, 760=very different c...
Definition
Color.cpp:70
openshot::Color::GetColorRGBA
std::vector< int > GetColorRGBA(int64_t frame_number)
Definition
Color.cpp:59
openshot::Color::SetJson
void SetJson(const std::string value)
Load JSON string into this object.
Definition
Color.cpp:101
openshot::Color::JsonValue
Json::Value JsonValue() const
Generate Json::Value for this object.
Definition
Color.cpp:87
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
Color.h
Generated by
1.17.0