31 #ifndef OPENSHOT_CAPTION_EFFECT_H 32 #define OPENSHOT_CAPTION_EFFECT_H 38 #include <QFontMetrics> 39 #include <QRegularExpression> 41 #include "../EffectBase.h" 43 #include "../KeyFrame.h" 59 std::vector<QRegularExpressionMatch> matchedCaptions;
60 std::string caption_text;
61 QFontMetrics* metrics;
66 void init_effect_details();
103 std::shared_ptr<openshot::Frame>
GetFrame(int64_t frame_number)
override {
return GetFrame(std::make_shared<openshot::Frame>(), frame_number); }
114 std::shared_ptr<openshot::Frame>
GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number)
override;
121 std::string
Json()
const override;
122 void SetJson(
const std::string value)
override;
128 std::string
PropertiesJSON(int64_t requested_frame)
const override;
133 #endif // OPENSHOT_CAPTION_EFFECT_H void SetJson(const std::string value) override
Load JSON string into this object.
This abstract class is the base class, used by all effects in libopenshot.
Keyframe font_alpha
Font color alpha.
std::string Json() const override
Generate JSON string of this object.
Keyframe left
Size of left bar.
std::string font_name
Font string.
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Keyframe background_alpha
Background color alpha.
Color color
Color of caption text.
std::string CaptionText()
Set the caption string to use (see VTT format)
Color background
Color of caption area background.
Keyframe background_corner
Background cornder radius.
Keyframe stroke_width
Width of text border / stroke.
std::string PropertiesJSON(int64_t requested_frame) const override
Keyframe font_size
Font size in points.
Keyframe fade_in
Fade in per caption (# of seconds)
This class represents a color (used on the timeline and clips)
Keyframe top
Size of top bar.
This namespace is the default namespace for all code in the openshot library.
Keyframe background_padding
Background padding.
Json::Value JsonValue() const override
Generate Json::Value for this object.
Caption()
Blank constructor, useful when using Json to load the effect properties.
Color stroke
Color of text border / stroke.
This class adds captions/text over a video, based on timestamps. You can also animate some limited as...
Keyframe right
Size of right bar.
A Keyframe is a collection of Point instances, which is used to vary a number or property over time...
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 fade_out
Fade in per caption (# of seconds)