mirror of https://github.com/jellyfin/jellyfin.git
Merge pull request #9065 from barronpm/drawing-use-file-namespaces
This commit is contained in:
commit
515e69dcf7
|
@ -2,13 +2,13 @@ using System;
|
|||
using MediaBrowser.Model.Drawing;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Static helper class used to draw percentage-played indicators on images.
|
||||
/// </summary>
|
||||
public static class PercentPlayedDrawer
|
||||
{
|
||||
/// <summary>
|
||||
/// Static helper class used to draw percentage-played indicators on images.
|
||||
/// </summary>
|
||||
public static class PercentPlayedDrawer
|
||||
{
|
||||
private const int IndicatorHeight = 8;
|
||||
|
||||
/// <summary>
|
||||
|
@ -32,5 +32,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
paint.Color = SKColor.Parse("#FF00A4DC");
|
||||
canvas.DrawRect(SKRect.Create(0, (float)endY - IndicatorHeight, Convert.ToInt32(foregroundWidth), endY), paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
using MediaBrowser.Model.Drawing;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Static helper class for drawing 'played' indicators.
|
||||
/// </summary>
|
||||
public static class PlayedIndicatorDrawer
|
||||
{
|
||||
/// <summary>
|
||||
/// Static helper class for drawing 'played' indicators.
|
||||
/// </summary>
|
||||
public static class PlayedIndicatorDrawer
|
||||
{
|
||||
private const int OffsetFromTopRightCorner = 38;
|
||||
|
||||
/// <summary>
|
||||
|
@ -44,5 +44,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
|
||||
canvas.DrawText(Text, (float)x - 12, OffsetFromTopRightCorner + 12, paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
using System.Globalization;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Represents errors that occur during interaction with Skia codecs.
|
||||
/// </summary>
|
||||
public class SkiaCodecException : SkiaException
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents errors that occur during interaction with Skia codecs.
|
||||
/// </summary>
|
||||
public class SkiaCodecException : SkiaException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SkiaCodecException" /> class.
|
||||
/// </summary>
|
||||
|
@ -41,5 +41,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
"Non-success codec result: {0}\n{1}",
|
||||
CodecResult,
|
||||
base.ToString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,13 +12,13 @@ using Microsoft.Extensions.Logging;
|
|||
using SkiaSharp;
|
||||
using SKSvg = SkiaSharp.Extended.Svg.SKSvg;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Image encoder that uses <see cref="SkiaSharp"/> to manipulate images.
|
||||
/// </summary>
|
||||
public class SkiaEncoder : IImageEncoder
|
||||
{
|
||||
/// <summary>
|
||||
/// Image encoder that uses <see cref="SkiaSharp"/> to manipulate images.
|
||||
/// </summary>
|
||||
public class SkiaEncoder : IImageEncoder
|
||||
{
|
||||
private static readonly HashSet<string> _transparentImageTypes = new(StringComparer.OrdinalIgnoreCase) { ".png", ".gif", ".webp" };
|
||||
|
||||
private readonly ILogger<SkiaEncoder> _logger;
|
||||
|
@ -541,5 +541,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
_logger.LogError(ex, "Error drawing indicator overlay");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Represents errors that occur during interaction with Skia.
|
||||
/// </summary>
|
||||
public class SkiaException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents errors that occur during interaction with Skia.
|
||||
/// </summary>
|
||||
public class SkiaException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SkiaException"/> class.
|
||||
/// </summary>
|
||||
|
@ -35,5 +35,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
using System.Collections.Generic;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Class containing helper methods for working with SkiaSharp.
|
||||
/// </summary>
|
||||
public static class SkiaHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Class containing helper methods for working with SkiaSharp.
|
||||
/// </summary>
|
||||
public static class SkiaHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the next valid image as a bitmap.
|
||||
/// </summary>
|
||||
|
@ -43,5 +43,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
newIndex = currentIndex;
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Used to build the splashscreen.
|
||||
/// </summary>
|
||||
public class SplashscreenBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to build the splashscreen.
|
||||
/// </summary>
|
||||
public class SplashscreenBuilder
|
||||
{
|
||||
private const int FinalWidth = 1920;
|
||||
private const int FinalHeight = 1080;
|
||||
// generated collage resolution should be higher than the final resolution
|
||||
|
@ -144,5 +144,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,13 +4,13 @@ using System.IO;
|
|||
using System.Text.RegularExpressions;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Used to build collages of multiple images arranged in vertical strips.
|
||||
/// </summary>
|
||||
public class StripCollageBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to build collages of multiple images arranged in vertical strips.
|
||||
/// </summary>
|
||||
public class StripCollageBuilder
|
||||
{
|
||||
private readonly SkiaEncoder _skiaEncoder;
|
||||
|
||||
/// <summary>
|
||||
|
@ -182,5 +182,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@ using System.Globalization;
|
|||
using MediaBrowser.Model.Drawing;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Jellyfin.Drawing.Skia
|
||||
namespace Jellyfin.Drawing.Skia;
|
||||
|
||||
/// <summary>
|
||||
/// Static helper class for drawing unplayed count indicators.
|
||||
/// </summary>
|
||||
public static class UnplayedCountIndicator
|
||||
{
|
||||
/// <summary>
|
||||
/// Static helper class for drawing unplayed count indicators.
|
||||
/// </summary>
|
||||
public static class UnplayedCountIndicator
|
||||
{
|
||||
/// <summary>
|
||||
/// The x-offset used when drawing an unplayed count indicator.
|
||||
/// </summary>
|
||||
|
@ -60,5 +60,4 @@ namespace Jellyfin.Drawing.Skia
|
|||
|
||||
canvas.DrawText(text, x, y, paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ using MediaBrowser.Model.Net;
|
|||
using Microsoft.Extensions.Logging;
|
||||
using Photo = MediaBrowser.Controller.Entities.Photo;
|
||||
|
||||
namespace Jellyfin.Drawing
|
||||
namespace Jellyfin.Drawing;
|
||||
|
||||
/// <summary>
|
||||
/// Class ImageProcessor.
|
||||
/// </summary>
|
||||
public sealed class ImageProcessor : IImageProcessor, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Class ImageProcessor.
|
||||
/// </summary>
|
||||
public sealed class ImageProcessor : IImageProcessor, IDisposable
|
||||
{
|
||||
// Increment this when there's a change requiring caches to be invalidated
|
||||
private const char Version = '3';
|
||||
|
||||
|
@ -565,5 +565,4 @@ namespace Jellyfin.Drawing
|
|||
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,13 +3,13 @@ using System.Collections.Generic;
|
|||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
|
||||
namespace Jellyfin.Drawing
|
||||
namespace Jellyfin.Drawing;
|
||||
|
||||
/// <summary>
|
||||
/// A fallback implementation of <see cref="IImageEncoder" />.
|
||||
/// </summary>
|
||||
public class NullImageEncoder : IImageEncoder
|
||||
{
|
||||
/// <summary>
|
||||
/// A fallback implementation of <see cref="IImageEncoder" />.
|
||||
/// </summary>
|
||||
public class NullImageEncoder : IImageEncoder
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyCollection<string> SupportedInputFormats
|
||||
=> new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "png", "jpeg", "jpg" };
|
||||
|
@ -54,5 +54,4 @@ namespace Jellyfin.Drawing
|
|||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue