Loading...
Searching...
No Matches
ColorShift.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_SHIFT_EFFECT_H
#define OPENSHOT_COLOR_SHIFT_EFFECT_H
#include "../EffectBase.h"
#include <cmath>
#include <stdio.h>
#include <memory>
#include "../Json.h"
#include "../KeyFrame.h"
namespace openshot
{
class ColorShift : public EffectBase
{
private:
void init_effect_details();
public:
Keyframe red_x;
Keyframe red_y;
Keyframe green_x;
Keyframe green_y;
Keyframe blue_x;
Keyframe blue_y;
Keyframe alpha_x;
Keyframe alpha_y;
ColorShift();
ColorShift(Keyframe red_x, Keyframe red_y, Keyframe green_x, Keyframe green_y, Keyframe blue_x, Keyframe blue_y, Keyframe alpha_x, Keyframe alpha_y);
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared<openshot::Frame>(), frame_number); }
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
// Get and Set JSON methods
std::string Json() const override;
void SetJson(const std::string value) override;
Json::Value JsonValue() const override;
void SetJsonValue(const Json::Value root) override;
std::string PropertiesJSON(int64_t requested_frame) const override;
};
}
#endif
openshot::ColorShift
This class shifts the pixels of an image up, down, left, or right, and can be animated with openshot:...
Definition ColorShift.h:36
openshot::ColorShift::blue_x
Keyframe blue_x
Shift the Blue X coordinates (left or right)
Definition ColorShift.h:46
openshot::ColorShift::Json
std::string Json() const override
Generate JSON string of this object.
Definition ColorShift.cpp:178
openshot::ColorShift::red_y
Keyframe red_y
Shift the Red Y coordinates (up or down)
Definition ColorShift.h:43
openshot::ColorShift::alpha_y
Keyframe alpha_y
Shift the Alpha Y coordinates (up or down)
Definition ColorShift.h:49
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
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::green_y
Keyframe green_y
Shift the Green Y coordinates (up or down)
Definition ColorShift.h:45
openshot::ColorShift::alpha_x
Keyframe alpha_x
Shift the Alpha X coordinates (left or right)
Definition ColorShift.h:48
openshot::ColorShift::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition ColorShift.cpp:185
openshot::ColorShift::red_x
Keyframe red_x
Shift the Red X coordinates (left or right)
Definition ColorShift.h:42
openshot::ColorShift::green_x
Keyframe green_x
Shift the Green X coordinates (left or right)
Definition ColorShift.h:44
openshot::ColorShift::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition ColorShift.cpp:221
openshot::ColorShift::blue_y
Keyframe blue_y
Shift the Blue Y coordinates (up or down)
Definition ColorShift.h:47
openshot::ColorShift::ColorShift
ColorShift()
Blank constructor, useful when using Json to load the effect properties.
Definition ColorShift.cpp:19
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:54
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