Skip to content

Commit 071fc8c

Browse files
committed
ImageReader/ImageWriter: std:: prefixes
1 parent b56ebf5 commit 071fc8c

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

include/ImageReader.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@ namespace openshot
7373
class ImageReader : public ReaderBase
7474
{
7575
private:
76-
string path;
76+
std::string path;
7777
std::shared_ptr<Magick::Image> image;
7878
bool is_open;
7979

8080
public:
8181

8282
/// Constructor for ImageReader. This automatically opens the media file and loads
8383
/// frame 1, or it throws one of the following exceptions.
84-
ImageReader(string path);
84+
ImageReader(std::string path);
8585

8686
/// Constructor for ImageReader. This only opens the media file to inspect its properties
8787
/// if inspect_reader=true. When not inspecting the media file, it's much faster, and useful
8888
/// when you are inflating the object using JSON after instantiating it.
89-
ImageReader(string path, bool inspect_reader);
89+
ImageReader(std::string path, bool inspect_reader);
9090

9191
/// Close File
9292
void Close();
@@ -105,11 +105,11 @@ namespace openshot
105105
bool IsOpen() { return is_open; };
106106

107107
/// Return the type name of the class
108-
string Name() { return "ImageReader"; };
108+
std::string Name() { return "ImageReader"; };
109109

110110
/// Get and Set JSON methods
111-
string Json(); ///< Generate JSON string of this object
112-
void SetJson(string value); ///< Load JSON string into this object
111+
std::string Json(); ///< Generate JSON string of this object
112+
void SetJson(std::string value); ///< Load JSON string into this object
113113
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
114114
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
115115

include/ImageWriter.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
#include "OpenMPUtilities.h"
5454
#include "MagickUtilities.h"
5555

56-
using namespace std;
57-
5856
namespace openshot
5957
{
6058

@@ -88,12 +86,12 @@ namespace openshot
8886
class ImageWriter : public WriterBase
8987
{
9088
private:
91-
string path;
89+
std::string path;
9290
int cache_size;
9391
bool is_writing;
9492
bool is_open;
9593
int64_t write_video_count;
96-
vector<Magick::Image> frames;
94+
std::vector<Magick::Image> frames;
9795
int image_quality;
9896
int number_of_loops;
9997
bool combine_frames;
@@ -104,7 +102,7 @@ namespace openshot
104102

105103
/// @brief Constructor for ImageWriter. Throws one of the following exceptions.
106104
/// @param path The path of the file you want to create
107-
ImageWriter(string path);
105+
ImageWriter(std::string path);
108106

109107
/// @brief Close the writer and encode/output final image to the disk. This is a requirement of ImageMagick,
110108
/// which writes all frames of a multi-frame image at one time.
@@ -131,7 +129,7 @@ namespace openshot
131129
/// @param quality Quality of image (0 to 100, 70 is default)
132130
/// @param loops Number of times to repeat the image (used on certain multi-frame image formats, such as GIF)
133131
/// @param combine Combine frames into a single image (if possible), or save each frame as its own image
134-
void SetVideoOptions(string format, Fraction fps, int width, int height,
132+
void SetVideoOptions(std::string format, Fraction fps, int width, int height,
135133
int quality, int loops, bool combine);
136134

137135
/// @brief Add a frame to the stack waiting to be encoded.

src/ImageReader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535

3636
using namespace openshot;
3737

38-
ImageReader::ImageReader(string path) : path(path), is_open(false)
38+
ImageReader::ImageReader(std::string path) : path(path), is_open(false)
3939
{
4040
// Open and Close the reader, to populate its attributes (such as height, width, etc...)
4141
Open();
4242
Close();
4343
}
4444

45-
ImageReader::ImageReader(string path, bool inspect_reader) : path(path), is_open(false)
45+
ImageReader::ImageReader(std::string path, bool inspect_reader) : path(path), is_open(false)
4646
{
4747
// Open and Close the reader, to populate its attributes (such as height, width, etc...)
4848
if (inspect_reader) {
@@ -136,7 +136,7 @@ std::shared_ptr<Frame> ImageReader::GetFrame(int64_t requested_frame)
136136
}
137137

138138
// Generate JSON string of this object
139-
string ImageReader::Json() {
139+
std::string ImageReader::Json() {
140140

141141
// Return formatted string
142142
return JsonValue().toStyledString();
@@ -155,14 +155,14 @@ Json::Value ImageReader::JsonValue() {
155155
}
156156

157157
// Load JSON string into this object
158-
void ImageReader::SetJson(string value) {
158+
void ImageReader::SetJson(std::string value) {
159159

160160
// Parse JSON string into JSON objects
161161
Json::Value root;
162162
Json::CharReaderBuilder rbuilder;
163163
Json::CharReader* reader(rbuilder.newCharReader());
164164

165-
string errors;
165+
std::string errors;
166166
bool success = reader->parse( value.c_str(),
167167
value.c_str() + value.size(), &root, &errors );
168168
delete reader;

src/ImageWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
using namespace openshot;
4040

41-
ImageWriter::ImageWriter(string path) :
41+
ImageWriter::ImageWriter(std::string path) :
4242
path(path), cache_size(8), is_writing(false), write_video_count(0), image_quality(75), number_of_loops(1),
4343
combine_frames(true), is_open(false)
4444
{
@@ -48,7 +48,7 @@ ImageWriter::ImageWriter(string path) :
4848
}
4949

5050
// Set video export options
51-
void ImageWriter::SetVideoOptions(string format, Fraction fps, int width, int height,
51+
void ImageWriter::SetVideoOptions(std::string format, Fraction fps, int width, int height,
5252
int quality, int loops, bool combine)
5353
{
5454
// Set frames per second (if provided)

0 commit comments

Comments
 (0)