std:: prefixes for TextReader.h/.cpp

This commit is contained in:
FeRD (Frank Dana)
2019-08-04 22:39:13 -04:00
parent cb567e44d0
commit 5746cd7b8b
2 changed files with 15 additions and 17 deletions

View File

@@ -47,8 +47,6 @@
#include "Exceptions.h"
#include "MagickUtilities.h"
using namespace std;
namespace openshot
{
@@ -91,12 +89,12 @@ namespace openshot
int height;
int x_offset;
int y_offset;
string text;
string font;
std::string text;
std::string font;
double size;
string text_color;
string background_color;
string text_background_color;
std::string text_color;
std::string background_color;
std::string text_background_color;
std::shared_ptr<Magick::Image> image;
MAGICK_DRAWABLE lines;
bool is_open;
@@ -118,11 +116,11 @@ namespace openshot
/// @param size The size of the text
/// @param text_color The color of the text
/// @param background_color The background color of the text frame image (also supports Transparent)
TextReader(int width, int height, int x_offset, int y_offset, GravityType gravity, string text, string font, double size, string text_color, string background_color);
TextReader(int width, int height, int x_offset, int y_offset, GravityType gravity, std::string text, std::string font, double size, std::string text_color, std::string background_color);
/// Draw a box under rendered text using the specified color.
/// @param text_background_color The background color behind the text
void SetTextBackgroundColor(string color);
void SetTextBackgroundColor(std::string color);
/// Close Reader
void Close();
@@ -141,11 +139,11 @@ namespace openshot
bool IsOpen() { return is_open; };
/// Return the type name of the class
string Name() { return "TextReader"; };
std::string Name() { return "TextReader"; };
/// Get and Set JSON methods
string Json(); ///< Generate JSON string of this object
void SetJson(string value); ///< Load JSON string into this object
std::string Json(); ///< Generate JSON string of this object
void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object

View File

@@ -43,7 +43,7 @@ TextReader::TextReader() : width(1024), height(768), x_offset(0), y_offset(0), t
Close();
}
TextReader::TextReader(int width, int height, int x_offset, int y_offset, GravityType gravity, string text, string font, double size, string text_color, string background_color)
TextReader::TextReader(int width, int height, int x_offset, int y_offset, GravityType gravity, std::string text, std::string font, double size, std::string text_color, std::string background_color)
: width(width), height(height), x_offset(x_offset), y_offset(y_offset), text(text), font(font), size(size), text_color(text_color), background_color(background_color), is_open(false), gravity(gravity)
{
// Open and Close the reader, to populate its attributes (such as height, width, etc...)
@@ -51,7 +51,7 @@ TextReader::TextReader(int width, int height, int x_offset, int y_offset, Gravit
Close();
}
void TextReader::SetTextBackgroundColor(string color) {
void TextReader::SetTextBackgroundColor(std::string color) {
text_background_color = color;
// Open and Close the reader, to populate it's attributes (such as height, width, etc...) plus the text background color
@@ -187,7 +187,7 @@ std::shared_ptr<Frame> TextReader::GetFrame(int64_t requested_frame)
}
// Generate JSON string of this object
string TextReader::Json() {
std::string TextReader::Json() {
// Return formatted string
return JsonValue().toStyledString();
@@ -216,14 +216,14 @@ Json::Value TextReader::JsonValue() {
}
// Load JSON string into this object
void TextReader::SetJson(string value) {
void TextReader::SetJson(std::string value) {
// Parse JSON string into JSON objects
Json::Value root;
Json::CharReaderBuilder rbuilder;
Json::CharReader* reader(rbuilder.newCharReader());
string errors;
std::string errors;
bool success = reader->parse( value.c_str(),
value.c_str() + value.size(), &root, &errors );
delete reader;