Loading...
Searching...
No Matches
Color.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_COLOR_H
#define OPENSHOT_COLOR_H
#include "KeyFrame.h"
#include <QColor>
namespace openshot {
class Color{
public:
openshot::Keyframe red;
openshot::Keyframe green;
openshot::Keyframe blue;
openshot::Keyframe alpha;
Color() {};
explicit Color(QColor);
explicit Color(std::string color_hex);
explicit Color(const char* color_hex);
Color(unsigned char Red, unsigned char Green, unsigned char Blue, unsigned char Alpha);
Color(openshot::Keyframe Red, openshot::Keyframe Green, openshot::Keyframe Blue, openshot::Keyframe Alpha);
std::string GetColorHex(int64_t frame_number);
// Get the RGBA values of a color at a specific frame
std::vector<int> GetColorRGBA(int64_t frame_number);
static long GetDistance(long R1, long G1, long B1, long R2, long G2, long B2);
// Get and Set JSON methods
std::string Json() const;
Json::Value JsonValue() const;
void SetJson(const std::string value);
void SetJsonValue(const Json::Value root);
};
} // namespace openshot
#endif
KeyFrame.h
Header file for the Keyframe class.
openshot::Color
This class represents a color (used on the timeline and clips)
Definition Color.h:27
openshot::Color::Json
std::string Json() const
Generate JSON string of this object.
Definition Color.cpp:79
openshot::Color::GetColorHex
std::string GetColorHex(int64_t frame_number)
Get the HEX value of a color at a specific frame.
Definition Color.cpp:47
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:117
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:69
openshot::Color::GetColorRGBA
std::vector< int > GetColorRGBA(int64_t frame_number)
Definition Color.cpp:58
openshot::Color::SetJson
void SetJson(const std::string value)
Load JSON string into this object.
Definition Color.cpp:100
openshot::Color::JsonValue
Json::Value JsonValue() const
Generate Json::Value for this object.
Definition Color.cpp:86
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 Compressor.h:29