13 #ifndef OPENSHOT_DISPLACE_EFFECT_H
14 #define OPENSHOT_DISPLACE_EFFECT_H
16 #include "../EffectBase.h"
20 #include "../KeyFrame.h"
41 std::shared_ptr<QImage> cached_single_map_image;
42 int cached_single_map_width = 0;
43 int cached_single_map_height = 0;
46 void init_effect_details();
49 std::shared_ptr<QImage> GetMapImage(std::shared_ptr<QImage> target_image, int64_t frame_number);
80 std::shared_ptr<openshot::Frame>
GetFrame(int64_t frame_number)
override {
return GetFrame(std::make_shared<openshot::Frame>(), frame_number); }
91 std::shared_ptr<openshot::Frame>
GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number)
override;
94 std::string
Json()
const override;
95 void SetJson(
const std::string value)
override;
101 std::string
PropertiesJSON(int64_t requested_frame)
const override;
This class uses a grayscale image or video to displace frame pixels.
Keyframe contrast
Contrast adjustment for the displacement map.
Displace()
Blank constructor, useful when using Json to load the effect properties.
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...
bool invert
Invert the displacement map before converting it to offsets.
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Keyframe vertical
Vertical displacement amount as a percentage of image height.
Keyframe brightness
Brightness adjustment for the displacement map.
std::string Json() const override
Generate JSON string of this object.
void SetJson(const std::string value) override
Load JSON string into this object.
Keyframe horizontal
Horizontal displacement amount as a percentage of image width.
std::string PropertiesJSON(int64_t requested_frame) const override
bool replace_image
Replace the frame image with the processed displacement map for debugging.
Keyframe strength
Overall strength multiplier for the displacement effect.
ReaderBase * Reader()
Get the reader object of the displacement map.
This abstract class is the base class, used by all effects in libopenshot.
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
This abstract class is the base class, used by all readers in libopenshot.
This namespace is the default namespace for all code in the openshot library.