OpenShot Library | libopenshot 1.1.1
Loading...
Searching...
No Matches
ChromaKey.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_CHROMAKEY_EFFECT_H
14#define OPENSHOT_CHROMAKEY_EFFECT_H
15
16#include "../EffectBase.h"
17
18#include "../Color.h"
19#include "../Frame.h"
20#include "../Exceptions.h"
21#include "../KeyFrame.h"
22#include "../Enums.h"
23
24#include <memory>
25#include <string>
26
27namespace openshot
28{
29
36 class ChromaKey : public EffectBase
37 {
38 private:
39 Color color;
40 Keyframe fuzz;
41 Keyframe halo;
42 ChromaKeyMethod method;
43
45 void init_effect_details();
46
47 public:
48
50 ChromaKey();
51
80 ChromaKey(Color color, Keyframe fuzz, Keyframe halo = 0.0, ChromaKeyMethod method = CHROMAKEY_BASIC_SOFT);
81
88 std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared<openshot::Frame>(), frame_number); }
89
99 std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
100
101 // Get and Set JSON methods
102 std::string Json() const override;
103 void SetJson(const std::string value) override;
104 Json::Value JsonValue() const override;
105 void SetJsonValue(const Json::Value root) override;
106
107 // Get all properties for a specific frame
108 std::string PropertiesJSON(int64_t requested_frame) const override;
109 };
110
111}
112
113#endif
Header file for Color class.
Header file for EffectBase class.
Header file for TextReader class.
Header file for all Exception classes.
Header file for Frame class.
Header file for the Keyframe class.
void SetJson(const std::string value) override
Load JSON string into this object.
ChromaKey()
Blank constructor, useful when using Json to load the effect properties.
Definition ChromaKey.cpp:27
std::string Json() const override
Generate JSON string of this object.
std::string PropertiesJSON(int64_t requested_frame) const override
Json::Value JsonValue() const override
Generate Json::Value for this object.
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 ChromaKey.h:88
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
This class represents a color (used on the timeline and clips).
Definition Color.h:27
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:57
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.
ChromaKeyMethod
This enumeration determines the algorithm used by the ChromaKey filter.
Definition Enums.h:159
@ CHROMAKEY_BASIC_SOFT
BASIC metric + optional halo feathering.
Definition Enums.h:171