OpenShot Library | libopenshot 0.3.3
Loading...
Searching...
No Matches
Shift.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_SHIFT_EFFECT_H
14#define OPENSHOT_SHIFT_EFFECT_H
15
16#include "../EffectBase.h"
17
18#include "../Frame.h"
19#include "../Json.h"
20#include "../KeyFrame.h"
21
22#include <string>
23#include <memory>
24
25
26namespace openshot
27{
28
36 class Shift : public EffectBase
37 {
38 private:
40 void init_effect_details();
41
42
43 public:
46
48 Shift();
49
55
62 std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared<openshot::Frame>(), frame_number); }
63
73 std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
74
75 // Get and Set JSON methods
76 std::string Json() const override;
77 void SetJson(const std::string value) override;
78 Json::Value JsonValue() const override;
79 void SetJsonValue(const Json::Value root) override;
80
83 std::string PropertiesJSON(int64_t requested_frame) const override;
84 };
85
86}
87
88#endif
Header file for EffectBase class.
Header file for Frame class.
Header file for JSON class.
Header file for the Keyframe class.
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:54
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
Definition KeyFrame.h:53
This class shifts the pixels of an image up, down, left, or right, and can be animated with openshot:...
Definition Shift.h:37
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 Shift.h:62
Keyframe y
Shift the Y coordinates (up or down)
Definition Shift.h:45
std::string Json() const override
Generate JSON string of this object.
Definition Shift.cpp:119
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition Shift.cpp:126
Keyframe x
Shift the X coordinates (left or right)
Definition Shift.h:44
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition Shift.cpp:156
std::string PropertiesJSON(int64_t requested_frame) const override
Definition Shift.cpp:169
Shift()
Blank constructor, useful when using Json to load the effect properties.
Definition Shift.cpp:19
void SetJson(const std::string value) override
Load JSON string into this object.
Definition Shift.cpp:139
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29