OpenShot Library | libopenshot 0.3.3
Loading...
Searching...
No Matches
Color.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_COLOR_H
14#define OPENSHOT_COLOR_H
15
16#include "KeyFrame.h"
17#include <QColor>
18
19namespace openshot {
20
27class Color{
28
29public:
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
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
Header file for the Keyframe class.
This class represents a color (used on the timeline and clips)
Definition Color.h:27
std::string Json() const
Generate JSON string of this object.
Definition Color.cpp:79
std::string GetColorHex(int64_t frame_number)
Get the HEX value of a color at a specific frame.
Definition Color.cpp:47
openshot::Keyframe blue
Curve representing the red value (0 - 255)
Definition Color.h:32
openshot::Keyframe red
Curve representing the red value (0 - 255)
Definition Color.h:30
openshot::Keyframe green
Curve representing the green value (0 - 255)
Definition Color.h:31
Color()
Default constructor.
Definition Color.h:36
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
Definition Color.cpp:117
openshot::Keyframe alpha
Curve representing the alpha value (0 - 255)
Definition Color.h:33
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:69
std::vector< int > GetColorRGBA(int64_t frame_number)
Definition Color.cpp:58
void SetJson(const std::string value)
Load JSON string into this object.
Definition Color.cpp:100
Json::Value JsonValue() const
Generate Json::Value for this object.
Definition Color.cpp:86
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