Formatting in SkiaEncoder.cs

This commit is contained in:
Erwin de Haan 2020-07-31 22:12:20 +02:00
parent 526eea41f0
commit 44aca4dc6f

View File

@ -410,11 +410,12 @@ namespace Jellyfin.Drawing.Skia
{ {
using var surface = SKSurface.Create(targetInfo); using var surface = SKSurface.Create(targetInfo);
using var canvas = surface.Canvas; using var canvas = surface.Canvas;
using var paint = new SKPaint(); using var paint = new SKPaint
{
paint.FilterQuality = SKFilterQuality.High; FilterQuality = SKFilterQuality.High,
paint.IsAntialias = isAntialias; IsAntialias = isAntialias,
paint.IsDither = isDither; IsDither = isDither
};
var kernel = new float[9] var kernel = new float[9]
{ {
@ -427,9 +428,19 @@ namespace Jellyfin.Drawing.Skia
var kernelOffset = new SKPointI(1, 1); var kernelOffset = new SKPointI(1, 1);
paint.ImageFilter = SKImageFilter.CreateMatrixConvolution( paint.ImageFilter = SKImageFilter.CreateMatrixConvolution(
kernelSize, kernel, 1f, 0f, kernelOffset, SKShaderTileMode.Clamp, false); kernelSize,
kernel,
1f,
0f,
kernelOffset,
SKShaderTileMode.Clamp,
false);
canvas.DrawBitmap(source, SKRect.Create(0, 0, source.Width, source.Height), SKRect.Create(0, 0, targetInfo.Width, targetInfo.Height), paint); canvas.DrawBitmap(
source,
SKRect.Create(0, 0, source.Width, source.Height),
SKRect.Create(0, 0, targetInfo.Width, targetInfo.Height),
paint);
return surface.Snapshot(); return surface.Snapshot();
} }