diff --git a/include/ImageReader.h b/include/ImageReader.h index b02d2f04..a081b03d 100644 --- a/include/ImageReader.h +++ b/include/ImageReader.h @@ -73,7 +73,7 @@ namespace openshot class ImageReader : public ReaderBase { private: - string path; + std::string path; std::shared_ptr image; bool is_open; @@ -81,12 +81,12 @@ namespace openshot /// Constructor for ImageReader. This automatically opens the media file and loads /// frame 1, or it throws one of the following exceptions. - ImageReader(string path); + ImageReader(std::string path); /// Constructor for ImageReader. This only opens the media file to inspect its properties /// if inspect_reader=true. When not inspecting the media file, it's much faster, and useful /// when you are inflating the object using JSON after instantiating it. - ImageReader(string path, bool inspect_reader); + ImageReader(std::string path, bool inspect_reader); /// Close File void Close(); @@ -105,11 +105,11 @@ namespace openshot bool IsOpen() { return is_open; }; /// Return the type name of the class - string Name() { return "ImageReader"; }; + std::string Name() { return "ImageReader"; }; /// 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 diff --git a/include/ImageWriter.h b/include/ImageWriter.h index c1d2726a..87e8a9a9 100644 --- a/include/ImageWriter.h +++ b/include/ImageWriter.h @@ -53,8 +53,6 @@ #include "OpenMPUtilities.h" #include "MagickUtilities.h" -using namespace std; - namespace openshot { @@ -88,12 +86,12 @@ namespace openshot class ImageWriter : public WriterBase { private: - string path; + std::string path; int cache_size; bool is_writing; bool is_open; int64_t write_video_count; - vector frames; + std::vector frames; int image_quality; int number_of_loops; bool combine_frames; @@ -104,7 +102,7 @@ namespace openshot /// @brief Constructor for ImageWriter. Throws one of the following exceptions. /// @param path The path of the file you want to create - ImageWriter(string path); + ImageWriter(std::string path); /// @brief Close the writer and encode/output final image to the disk. This is a requirement of ImageMagick, /// which writes all frames of a multi-frame image at one time. @@ -131,7 +129,7 @@ namespace openshot /// @param quality Quality of image (0 to 100, 70 is default) /// @param loops Number of times to repeat the image (used on certain multi-frame image formats, such as GIF) /// @param combine Combine frames into a single image (if possible), or save each frame as its own image - void SetVideoOptions(string format, Fraction fps, int width, int height, + void SetVideoOptions(std::string format, Fraction fps, int width, int height, int quality, int loops, bool combine); /// @brief Add a frame to the stack waiting to be encoded. diff --git a/src/ImageReader.cpp b/src/ImageReader.cpp index a0b7e8f3..42dd58d6 100644 --- a/src/ImageReader.cpp +++ b/src/ImageReader.cpp @@ -35,14 +35,14 @@ using namespace openshot; -ImageReader::ImageReader(string path) : path(path), is_open(false) +ImageReader::ImageReader(std::string path) : path(path), is_open(false) { // Open and Close the reader, to populate its attributes (such as height, width, etc...) Open(); Close(); } -ImageReader::ImageReader(string path, bool inspect_reader) : path(path), is_open(false) +ImageReader::ImageReader(std::string path, bool inspect_reader) : path(path), is_open(false) { // Open and Close the reader, to populate its attributes (such as height, width, etc...) if (inspect_reader) { @@ -136,7 +136,7 @@ std::shared_ptr ImageReader::GetFrame(int64_t requested_frame) } // Generate JSON string of this object -string ImageReader::Json() { +std::string ImageReader::Json() { // Return formatted string return JsonValue().toStyledString(); @@ -155,14 +155,14 @@ Json::Value ImageReader::JsonValue() { } // Load JSON string into this object -void ImageReader::SetJson(string value) { +void ImageReader::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; diff --git a/src/ImageWriter.cpp b/src/ImageWriter.cpp index 2b1e3fc0..376feb62 100644 --- a/src/ImageWriter.cpp +++ b/src/ImageWriter.cpp @@ -38,7 +38,7 @@ using namespace openshot; -ImageWriter::ImageWriter(string path) : +ImageWriter::ImageWriter(std::string path) : path(path), cache_size(8), is_writing(false), write_video_count(0), image_quality(75), number_of_loops(1), combine_frames(true), is_open(false) { @@ -48,7 +48,7 @@ ImageWriter::ImageWriter(string path) : } // Set video export options -void ImageWriter::SetVideoOptions(string format, Fraction fps, int width, int height, +void ImageWriter::SetVideoOptions(std::string format, Fraction fps, int width, int height, int quality, int loops, bool combine) { // Set frames per second (if provided)