Merge branch 'develop' into clip-refactor-keyframes

# Conflicts:
#	src/CacheDisk.cpp
#	src/Clip.cpp
#	src/Frame.cpp
#	src/QtHtmlReader.cpp
#	src/QtImageReader.cpp
#	src/QtTextReader.cpp
#	src/effects/Bars.cpp
#	src/effects/Crop.cpp
This commit is contained in:
Jonathan Thomas
2020-10-16 15:32:43 -05:00
32 changed files with 521 additions and 421 deletions

View File

@@ -82,7 +82,8 @@ void QtImageReader::Open()
ResvgRenderer renderer(path);
if (renderer.isValid()) {
image = std::shared_ptr<QImage>(new QImage(renderer.defaultSize(), QImage::Format_RGBA8888_Premultiplied));
image = std::make_shared<QImage>(
renderer.defaultSize(), QImage::Format_RGBA8888_Premultiplied);
image->fill(Qt::transparent);
QPainter p(image.get());
@@ -95,7 +96,7 @@ void QtImageReader::Open()
if (!loaded) {
// Attempt to open file using Qt's build in image processing capabilities
image = std::shared_ptr<QImage>(new QImage());
image = std::make_shared<QImage>();
success = image->load(path);
}
@@ -236,7 +237,9 @@ std::shared_ptr<Frame> QtImageReader::GetFrame(int64_t requested_frame)
svg_size.scale(max_width, max_height, Qt::KeepAspectRatio);
// Create empty QImage
cached_image = std::shared_ptr<QImage>(new QImage(QSize(svg_size.width(), svg_size.height()), QImage::Format_RGBA8888_Premultiplied));
cached_image = std::make_shared<QImage>(
QSize(svg_size.width(), svg_size.height()),
QImage::Format_RGBA8888_Premultiplied);
cached_image->fill(Qt::transparent);
// Render SVG into QImage
@@ -251,7 +254,8 @@ std::shared_ptr<Frame> QtImageReader::GetFrame(int64_t requested_frame)
if (!rendered) {
// We need to resize the original image to a smaller image (for performance reasons)
// Only do this once, to prevent tons of unneeded scaling operations
cached_image = std::shared_ptr<QImage>(new QImage(image->scaled(max_width, max_height, Qt::KeepAspectRatio, Qt::SmoothTransformation)));
cached_image = std::make_shared<QImage>(image->scaled(
max_width, max_height, Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
// Set max size (to later determine if max_size is changed)
@@ -260,7 +264,10 @@ std::shared_ptr<Frame> QtImageReader::GetFrame(int64_t requested_frame)
}
// Create or get frame object
std::shared_ptr<Frame> image_frame(new Frame(requested_frame, cached_image->width(), cached_image->height(), "#000000", Frame::GetSamplesPerFrame(requested_frame, info.fps, info.sample_rate, info.channels), info.channels));
auto image_frame = std::make_shared<Frame>(
requested_frame, cached_image->width(), cached_image->height(), "#000000",
Frame::GetSamplesPerFrame(requested_frame, info.fps, info.sample_rate, info.channels),
info.channels);
// Add Image data to frame
image_frame->AddImage(cached_image);