aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-05-11 10:53:31 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-05-11 10:53:31 -0400
commitbdf27b81c15810c09e6db688e8d9ac446790caad (patch)
tree68c66931ab1e91982202fbb6932814947364d08b
parent5d027aabd91131afb53ce530c5c7cc9f23274258 (diff)
update collage builder
-rw-r--r--Emby.Drawing.Skia/StripCollageBuilder.cs28
-rw-r--r--MediaBrowser.Server.Mac/Emby.Server.Mac.csproj4
2 files changed, 23 insertions, 9 deletions
diff --git a/Emby.Drawing.Skia/StripCollageBuilder.cs b/Emby.Drawing.Skia/StripCollageBuilder.cs
index 7f3700769..0ffc6df10 100644
--- a/Emby.Drawing.Skia/StripCollageBuilder.cs
+++ b/Emby.Drawing.Skia/StripCollageBuilder.cs
@@ -96,16 +96,30 @@ namespace Emby.Drawing.Skia
using (var croppedBitmap = SKBitmap.FromImage(subset))
{
- using (var flipped = new SKBitmap(croppedBitmap.Width, croppedBitmap.Height / 2, croppedBitmap.ColorType, croppedBitmap.AlphaType))
+ using (var reflectionBitmap = new SKBitmap(croppedBitmap.Width, croppedBitmap.Height / 2, croppedBitmap.ColorType, croppedBitmap.AlphaType))
{
- croppedBitmap.Resize(flipped, SKBitmapResizeMethod.Lanczos3);
+ croppedBitmap.Resize(reflectionBitmap, SKBitmapResizeMethod.Lanczos3);
- using (var gradient = new SKPaint())
+ using (var flippedBitmap = new SKBitmap(reflectionBitmap.Width, reflectionBitmap.Height))
{
- var matrix = SKMatrix.MakeScale(1, -1);
- matrix.SetScaleTranslate(1, -1, 0, flipped.Height);
- gradient.Shader = SKShader.CreateLinearGradient(new SKPoint(0, 0), new SKPoint(0, flipped.Height), new[] { new SKColor(0, 0, 0, 0), SKColors.Black }, null, SKShaderTileMode.Clamp, matrix);
- canvas.DrawBitmap(flipped, (horizontalImagePadding * (i + 1)) + (iSlice * i), iHeight + verticalSpacing, gradient);
+ using (var flippedCanvas = new SKCanvas(flippedBitmap))
+ {
+ var matrix = SKMatrix.MakeScale(1, -1);
+ matrix.SetScaleTranslate(1, -1, 0, flippedBitmap.Height);
+ flippedCanvas.SetMatrix(matrix);
+ flippedCanvas.DrawBitmap(reflectionBitmap, 0, 0);
+ flippedCanvas.ResetMatrix();
+
+ using (var gradient = new SKPaint())
+ {
+ gradient.IsAntialias = true;
+ gradient.BlendMode = SKBlendMode.SrcATop;
+ gradient.Shader = SKShader.CreateLinearGradient(new SKPoint(0, 0), new SKPoint(0, flippedBitmap.Height), new[] { new SKColor(0, 0, 0, 0), new SKColor(0, 0, 0, 255) }, null, SKShaderTileMode.Clamp);
+ flippedCanvas.DrawPaint(gradient);
+ }
+
+ canvas.DrawBitmap(flippedBitmap, (horizontalImagePadding * (i + 1)) + (iSlice * i), iHeight + verticalSpacing);
+ }
}
}
}
diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj
index 8133efafb..73626328a 100644
--- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj
+++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj
@@ -122,10 +122,10 @@
<HintPath>..\ThirdParty\taglib\TagLib.Portable.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.core">
- <HintPath>..\packages\SQLitePCLRaw.core.1.1.2\lib\net45\SQLitePCLRaw.core.dll</HintPath>
+ <HintPath>..\packages\SQLitePCLRaw.core.1.1.5\lib\net45\SQLitePCLRaw.core.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.provider.sqlite3">
- <HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.2\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath>
+ <HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.5\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath>
</Reference>
<Reference Include="Emby.Server.Connect">
<HintPath>..\ThirdParty\emby\Emby.Server.Connect.dll</HintPath>