Added a new optimized constructor to some readers (FFmpegReader, QtImageReader, ImageReader) to not Open() in the constructor, which dramatically speeds up creating hundreds of Readers (i.e. when opening a project). This is really only useful when inflating the reader with Json right after you instantiate it...

This commit is contained in:
Jonathan Thomas
2016-09-16 17:43:26 -05:00
parent 33bba65cfd
commit 183b0714e2
9 changed files with 62 additions and 22 deletions

View File

@@ -36,6 +36,15 @@ ImageReader::ImageReader(string path) throw(InvalidFile) : path(path), is_open(f
Close();
}
ImageReader::ImageReader(string path, bool inspect_reader) throw(InvalidFile) : path(path), is_open(false)
{
// Open and Close the reader, to populate it's attributes (such as height, width, etc...)
if (inspect_reader) {
Open();
Close();
}
}
// Open image file
void ImageReader::Open() throw(InvalidFile)
{