Use file-scoped namespaces in Jellyfin.Drawing.Skia

pull/9065/head
Patrick Barron 1 year ago
parent 6c7225b943
commit cafc454cfb

@ -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);
}
}
}

Loading…
Cancel
Save