|
OpenShot Library | libopenshot
0.4.0
|
This class uses Qt libraries, to create frames with "Text", and return openshot::Frame objects. More...
#include <QtTextReader.h>
Public Member Functions | |
| void | Close () override |
| Close Reader. More... | |
| CacheBase * | GetCache () override |
| Get the cache object used by this reader (always returns NULL for this object) More... | |
| std::shared_ptr< openshot::Frame > | GetFrame (int64_t requested_frame) override |
| bool | IsOpen () override |
| Determine if reader is open or closed. More... | |
| std::string | Json () const override |
| Generate JSON string of this object. More... | |
| Json::Value | JsonValue () const override |
| Generate Json::Value for this object. More... | |
| std::string | Name () override |
| Return the type name of the class. More... | |
| void | Open () override |
| Open Reader - which is called by the constructor automatically. More... | |
| QtTextReader () | |
| Default constructor (blank text) More... | |
| 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) | |
| Constructor for QtTextReader with all parameters. More... | |
| void | SetJson (const std::string value) override |
| Load JSON string into this object. More... | |
| void | SetJsonValue (const Json::Value root) override |
| Load Json::Value into this object. More... | |
| void | SetTextBackgroundColor (std::string color) |
Public Member Functions inherited from openshot::ReaderBase | |
| void | DisplayInfo (std::ostream *out=&std::cout) |
| Display file information in the standard output stream (stdout) More... | |
| openshot::ClipBase * | ParentClip () |
| Parent clip object of this reader (which can be unparented and NULL) More... | |
| void | ParentClip (openshot::ClipBase *new_clip) |
| Set parent clip object of this reader. More... | |
| ReaderBase () | |
| Constructor for the base reader, where many things are initialized. More... | |
| virtual | ~ReaderBase ()=default |
Additional Inherited Members | |
Public Attributes inherited from openshot::ReaderBase | |
| openshot::ReaderInfo | info |
| Information about the current media file. More... | |
Protected Attributes inherited from openshot::ReaderBase | |
| openshot::ClipBase * | clip |
| Pointer to the parent clip instance (if any) More... | |
| std::recursive_mutex | getFrameMutex |
| Mutex for multiple threads. More... | |
This class uses Qt libraries, to create frames with "Text", and return openshot::Frame objects.
All system fonts are supported, including many different font properties, such as size, color, alignment, padding, etc...
Definition at line 69 of file QtTextReader.h.
| QtTextReader::QtTextReader | ( | ) |
Default constructor (blank text)
Definition at line 26 of file QtTextReader.cpp.
| QtTextReader::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 | ||
| ) |
Constructor for QtTextReader with all parameters.
| width | The width of the requested openshot::Frame (not the size of the text) |
| height | The height of the requested openshot::Frame (not the size of the text) |
| x_offset | The number of pixels to offset the text on the X axis (horizontal) |
| y_offset | The number of pixels to offset the text on the Y axis (vertical) |
| gravity | The alignment / gravity of the text |
| text | The text you want to generate / display |
| font | The font of the text |
| text_color | The color of the text (valid values are a color string in #RRGGBB or #AARRGGBB notation or a CSS color name) |
| background_color | The background color of the frame image (valid values are a color string in #RRGGBB or #AARRGGBB notation, a CSS color name, or 'transparent') |
Definition at line 33 of file QtTextReader.cpp.
|
overridevirtual |
Close Reader.
Implements openshot::ReaderBase.
Definition at line 147 of file QtTextReader.cpp.
Referenced by QtTextReader(), SetJsonValue(), and SetTextBackgroundColor().
|
inlineoverridevirtual |
Get the cache object used by this reader (always returns NULL for this object)
Implements openshot::ReaderBase.
Definition at line 110 of file QtTextReader.h.
|
overridevirtual |
Get an openshot::Frame object for a specific frame number of this reader. All numbers return the same Frame, since they all share the same image data.
| requested_frame | The frame number that is requested. |
Implements openshot::ReaderBase.
Definition at line 164 of file QtTextReader.cpp.
|
inlineoverridevirtual |
Determine if reader is open or closed.
Implements openshot::ReaderBase.
Definition at line 120 of file QtTextReader.h.
|
overridevirtual |
Generate JSON string of this object.
Implements openshot::ReaderBase.
Definition at line 193 of file QtTextReader.cpp.
|
overridevirtual |
Generate Json::Value for this object.
Implements openshot::ReaderBase.
Definition at line 200 of file QtTextReader.cpp.
Referenced by Json().
|
inlineoverridevirtual |
Return the type name of the class.
Implements openshot::ReaderBase.
Definition at line 123 of file QtTextReader.h.
|
overridevirtual |
Open Reader - which is called by the constructor automatically.
Implements openshot::ReaderBase.
Definition at line 50 of file QtTextReader.cpp.
Referenced by QtTextReader(), SetJsonValue(), and SetTextBackgroundColor().
|
overridevirtual |
Load JSON string into this object.
Implements openshot::ReaderBase.
Definition at line 221 of file QtTextReader.cpp.
|
overridevirtual |
Load Json::Value into this object.
Implements openshot::ReaderBase.
Definition at line 238 of file QtTextReader.cpp.
Referenced by SetJson().
| void QtTextReader::SetTextBackgroundColor | ( | std::string | color | ) |
Draw a box under rendered text using the specified color.
| color | The background color behind the text (valid values are a color string in #RRGGBB or #AARRGGBB notation or a CSS color name) |
Definition at line 41 of file QtTextReader.cpp.
1.8.17