15#ifndef OPENSHOT_QT_TEXT_READER_H
16#define OPENSHOT_QT_TEXT_READER_H
82 Json::Value text_animation;
83 Json::Value rendered_style;
84 int64_t render_frame = 1;
85 double render_scale = 1.0;
86 std::atomic<double> detail_scale{1.0};
87 double RasterScale(
double& detail);
90 std::list<std::pair<std::string, std::shared_ptr<QImage>>> render_cache;
91 std::shared_ptr<QImage> Render(
const Json::Value& style);
92 void UseStyle(
const Json::Value& style);
94 Json::Value EvaluateStyle(int64_t frame)
const;
95 bool document_layout =
false;
96 double background_padding = 12.0;
97 double stroke_width = 0.0;
98 std::string stroke =
"#000000";
99 double border_width = 0.0;
100 std::string border =
"#ffffff";
101 double letter_spacing = 0.0;
102 double line_spacing = 1.0;
103 double background_corner = 0.0;
110 std::string text_color;
111 std::string background_color;
112 std::string text_background_color;
113 std::shared_ptr<QImage> image;
132 QtTextReader(
int width,
int height,
int x_offset,
int y_offset,
GravityType gravity, std::string text, QFont font, std::string text_color, std::string background_color);
143 void Close()
override;
153 std::shared_ptr<openshot::Frame>
GetFrame(int64_t requested_frame)
override;
156 bool IsOpen()
override {
return is_open; };
159 std::string
Name()
override {
return "QtTextReader"; };
162 std::string
Json()
const override;
163 void SetJson(
const std::string value)
override;
168 void Open()
override;
Header file for TextReader class.
Header file for ReaderBase class.
All cache managers in libopenshot are based on this CacheBase class.
This class represents a fraction.
This class uses Qt libraries, to create frames with "Text", and return openshot::Frame objects.
void SetJson(const std::string value) override
Load JSON string into this object.
void SetTextBackgroundColor(std::string color)
void Close() override
Close Reader.
std::string Json() const override
Generate JSON string of this object.
CacheBase * GetCache() override
Get the cache object used by this reader (always returns NULL for this object)
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
QtTextReader()
Default constructor (blank text)
std::string Name() override
Return the type name of the class.
std::shared_ptr< openshot::Frame > GetFrame(int64_t requested_frame) override
Json::Value JsonValue() const override
Generate Json::Value for this object.
double DetailScale() const
void Open() override
Open Reader - which is called by the constructor automatically.
bool IsOpen() override
Determine if reader is open or closed.
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.
GravityType
This enumeration determines how clips are aligned to their parent container.