13#ifndef OPENSHOT_CAPTION_EFFECT_H
14#define OPENSHOT_CAPTION_EFFECT_H
20#include <QFontMetrics>
21#include <QRegularExpression>
23#include "../EffectBase.h"
25#include "../KeyFrame.h"
41 std::vector<QRegularExpressionMatch> matchedCaptions;
42 std::string caption_text;
43 QFontMetrics* metrics;
48 void init_effect_details();
86 std::shared_ptr<openshot::Frame>
GetFrame(int64_t frame_number)
override {
return GetFrame(std::make_shared<openshot::Frame>(), frame_number); }
97 std::shared_ptr<openshot::Frame>
GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number)
override;
104 std::string
Json()
const override;
105 void SetJson(
const std::string value)
override;
111 std::string
PropertiesJSON(int64_t requested_frame)
const override;
This class adds captions/text over a video, based on timestamps. You can also animate some limited as...
std::string PropertiesJSON(int64_t requested_frame) const override
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...
Keyframe background_padding
Background padding.
Caption()
Blank constructor, useful when using Json to load the effect properties.
Keyframe stroke_width
Width of text border / stroke.
Json::Value JsonValue() const override
Generate Json::Value for this object.
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
std::string Json() const override
Generate JSON string of this object.
void SetJson(const std::string value) override
Load JSON string into this object.
std::string font_name
Font string.
Color background
Color of caption area background.
Keyframe font_size
Font size in points.
Keyframe font_alpha
Font color alpha.
Keyframe background_alpha
Background color alpha.
Keyframe fade_out
Fade in per caption (# of seconds)
Keyframe background_corner
Background cornder radius.
Keyframe fade_in
Fade in per caption (# of seconds)
Keyframe line_spacing
Distance between lines (1.0 default / 100%)
Keyframe top
Size of top bar.
Color stroke
Color of text border / stroke.
std::string CaptionText()
Set the caption string to use (see VTT format)
Keyframe right
Size of right bar.
Color color
Color of caption text.
Keyframe left
Size of left bar.
This class represents a color (used on the timeline and clips)
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 namespace is the default namespace for all code in the openshot library.