OpenShot Library | libopenshot  0.3.3
ColorShift.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_SHIFT_EFFECT_H
14 #define OPENSHOT_COLOR_SHIFT_EFFECT_H
15 
16 #include "../EffectBase.h"
17 
18 #include <cmath>
19 #include <stdio.h>
20 #include <memory>
21 #include "../Json.h"
22 #include "../KeyFrame.h"
23 
24 
25 namespace openshot
26 {
27 
35  class ColorShift : public EffectBase
36  {
37  private:
39  void init_effect_details();
40 
41  public:
50 
52  ColorShift();
53 
65 
72  std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared<openshot::Frame>(), frame_number); }
73 
83  std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
84 
85  // Get and Set JSON methods
86  std::string Json() const override;
87  void SetJson(const std::string value) override;
88  Json::Value JsonValue() const override;
89  void SetJsonValue(const Json::Value root) override;
90 
93  std::string PropertiesJSON(int64_t requested_frame) const override;
94  };
95 
96 }
97 
98 #endif
openshot::ColorShift::alpha_y
Keyframe alpha_y
Shift the Alpha Y coordinates (up or down)
Definition: ColorShift.h:49
openshot::ColorShift::red_x
Keyframe red_x
Shift the Red X coordinates (left or right)
Definition: ColorShift.h:42
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:53
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::ColorShift::ColorShift
ColorShift()
Blank constructor, useful when using Json to load the effect properties.
Definition: ColorShift.cpp:19
openshot::ColorShift::green_x
Keyframe green_x
Shift the Green X coordinates (left or right)
Definition: ColorShift.h:44
openshot::ColorShift::blue_x
Keyframe blue_x
Shift the Blue X coordinates (left or right)
Definition: ColorShift.h:46
openshot::ColorShift::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition: ColorShift.cpp:204
openshot::ColorShift::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: ColorShift.cpp:246
openshot::ColorShift::alpha_x
Keyframe alpha_x
Shift the Alpha X coordinates (left or right)
Definition: ColorShift.h:48
openshot::ColorShift::red_y
Keyframe red_y
Shift the Red Y coordinates (up or down)
Definition: ColorShift.h:43
openshot::ColorShift::green_y
Keyframe green_y
Shift the Green Y coordinates (up or down)
Definition: ColorShift.h:45
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::ColorShift::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition: ColorShift.cpp:221
openshot::ColorShift::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: ColorShift.cpp:185
openshot::ColorShift::Json
std::string Json() const override
Generate JSON string of this object.
Definition: ColorShift.cpp:178
openshot::ColorShift
This class shifts the pixels of an image up, down, left, or right, and can be animated with openshot:...
Definition: ColorShift.h:35
openshot::ColorShift::blue_y
Keyframe blue_y
Shift the Blue Y coordinates (up or down)
Definition: ColorShift.h:47
openshot::ColorShift::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: ColorShift.h:72