diff options
author | Pacho Ramos <pacho@gentoo.org> | 2018-10-13 19:32:36 +0200 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2018-10-13 19:35:28 +0200 |
commit | 29cab30f7f561478237caca8337d0ef7c2f69120 (patch) | |
tree | d2df04f8e4af9f34efc119d4c0f846832a436cf3 /media-libs/libopenshot | |
parent | Revert "media-libs/libopenshot: Commit the patch, drop old" (diff) | |
download | gentoo-29cab30f7f561478237caca8337d0ef7c2f69120.tar.gz gentoo-29cab30f7f561478237caca8337d0ef7c2f69120.tar.bz2 gentoo-29cab30f7f561478237caca8337d0ef7c2f69120.zip |
media-libs/libopenshot: Commit the patch
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Diffstat (limited to 'media-libs/libopenshot')
-rw-r--r-- | media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch b/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch new file mode 100644 index 000000000000..bc5f738d7f63 --- /dev/null +++ b/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch @@ -0,0 +1,78 @@ +diff -Nru a/include/TextReader.h b/include/TextReader.h +--- a/include/TextReader.h 2018-09-22 21:47:46.000000000 +0200 ++++ b/include/TextReader.h 2018-09-23 16:17:21.212888285 +0200 +@@ -91,7 +91,7 @@ + string text_color; + string background_color; + std::shared_ptr<Magick::Image> image; +- list<Magick::Drawable> lines; ++ vector<Magick::Drawable> lines; + bool is_open; + GravityType gravity; + +diff -Nru a/src/Frame.cpp b/src/Frame.cpp +--- a/src/Frame.cpp 2018-09-22 21:47:46.000000000 +0200 ++++ b/src/Frame.cpp 2018-09-23 16:21:44.921563711 +0200 +@@ -29,6 +29,9 @@ + + using namespace std; + using namespace openshot; ++#ifdef USE_IMAGEMAGICK ++using namespace Magick; ++#endif + + // Constructor - blank frame (300x200 blank image, 48kHz audio silence) + Frame::Frame() : number(1), pixel_ratio(1,1), channels(2), width(1), height(1), color("#000000"), +@@ -904,7 +907,7 @@ + // Give image a transparent background color + magick_image->backgroundColor(Magick::Color("none")); + magick_image->virtualPixelMethod(Magick::TransparentVirtualPixelMethod); +- magick_image->matte(true); ++ magick_image->alpha(true); + + return magick_image; + } +@@ -926,13 +929,14 @@ + // Iterate through the pixel packets, and load our own buffer + // Each color needs to be scaled to 8 bit (using the ImageMagick built-in ScaleQuantumToChar function) + int numcopied = 0; +- Magick::PixelPacket *pixels = new_image->getPixels(0,0, new_image->columns(), new_image->rows()); ++ const Quantum *pixels = new_image->getConstPixels(0,0, new_image->columns(), new_image->rows()); + for (int n = 0, i = 0; n < new_image->columns() * new_image->rows(); n += 1, i += 4) { +- buffer[i+0] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].red); +- buffer[i+1] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].green); +- buffer[i+2] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].blue); +- buffer[i+3] = 255 - MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].opacity); ++ buffer[i+0] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelRed(new_image->image(), pixels)); ++ buffer[i+1] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelGreen(new_image->image(), pixels)); ++ buffer[i+2] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelBlue(new_image->image(), pixels)); ++ buffer[i+3] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelAlpha(new_image->image(), pixels)); + numcopied+=4; ++ pixels += MagickCore::GetPixelChannels(new_image->image()); + } + + // Create QImage of frame data +diff -Nru a/src/ImageReader.cpp b/src/ImageReader.cpp +--- a/src/ImageReader.cpp 2018-09-22 21:47:46.000000000 +0200 ++++ b/src/ImageReader.cpp 2018-09-23 16:22:32.330865516 +0200 +@@ -59,7 +59,7 @@ + + // Give image a transparent background color + image->backgroundColor(Magick::Color("none")); +- image->matte(true); ++ image->alpha(true); + } + catch (Magick::Exception e) { + // raise exception +diff -Nru a/src/ImageWriter.cpp b/src/ImageWriter.cpp +--- a/src/ImageWriter.cpp 2018-09-22 21:47:46.000000000 +0200 ++++ b/src/ImageWriter.cpp 2018-09-23 16:22:58.380031419 +0200 +@@ -97,7 +97,7 @@ + std::shared_ptr<Magick::Image> frame_image = frame->GetMagickImage(); + frame_image->magick( info.vcodec ); + frame_image->backgroundColor(Magick::Color("none")); +- frame_image->matte(true); ++ frame_image->alpha(true); + frame_image->quality(image_quality); + frame_image->animationDelay(info.video_timebase.ToFloat() * 100); + frame_image->animationIterations(number_of_loops); |