< Summary - Jellyfin

Information
Class: Jellyfin.Drawing.Skia.SkiaExtensions
Assembly: Jellyfin.Drawing.Skia
File(s): /srv/git/jellyfin/src/Jellyfin.Drawing.Skia/SkiaExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 58
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
DrawBitmap(...)100%210%
DrawBitmap(...)100%210%
DrawBitmap(...)100%210%

File(s)

/srv/git/jellyfin/src/Jellyfin.Drawing.Skia/SkiaExtensions.cs

#LineLine coverage
 1using SkiaSharp;
 2
 3namespace Jellyfin.Drawing.Skia;
 4
 5/// <summary>
 6/// The SkiaSharp extensions.
 7/// </summary>
 8public static class SkiaExtensions
 9{
 10    /// <summary>
 11    /// Draws an SKBitmap on the canvas with specified SkSamplingOptions.
 12    /// </summary>
 13    /// <param name="canvas">The SKCanvas to draw on.</param>
 14    /// <param name="bitmap">The SKBitmap to draw.</param>
 15    /// <param name="dest">The destination SKRect.</param>
 16    /// <param name="options">The SKSamplingOptions to use for rendering.</param>
 17    /// <param name="paint">Optional SKPaint to apply additional effects or styles.</param>
 18    public static void DrawBitmap(this SKCanvas canvas, SKBitmap bitmap, SKRect dest, SKSamplingOptions options, SKPaint
 19    {
 020        using var image = SKImage.FromBitmap(bitmap);
 021        canvas.DrawImage(image, dest, options, paint);
 022    }
 23
 24    /// <summary>
 25    /// Draws an SKBitmap on the canvas at the specified coordinates with the given SkSamplingOptions.
 26    /// </summary>
 27    /// <param name="canvas">The SKCanvas to draw on.</param>
 28    /// <param name="bitmap">The SKBitmap to draw.</param>
 29    /// <param name="x">The x-coordinate where the bitmap will be drawn.</param>
 30    /// <param name="y">The y-coordinate where the bitmap will be drawn.</param>
 31    /// <param name="options">The SKSamplingOptions to use for rendering.</param>
 32    /// <param name="paint">Optional SKPaint to apply additional effects or styles.</param>
 33    public static void DrawBitmap(this SKCanvas canvas, SKBitmap bitmap, float x, float y, SKSamplingOptions options, SK
 34    {
 035        using var image = SKImage.FromBitmap(bitmap);
 036        canvas.DrawImage(image, x, y, options, paint);
 037    }
 38
 39    /// <summary>
 40    /// Draws an SKBitmap on the canvas using a specified source rectangle, destination rectangle,
 41    /// and optional paint, with the given SkSamplingOptions.
 42    /// </summary>
 43    /// <param name="canvas">The SKCanvas to draw on.</param>
 44    /// <param name="bitmap">The SKBitmap to draw.</param>
 45    /// <param name="source">
 46    /// The source SKRect defining the portion of the bitmap to draw.
 47    /// </param>
 48    /// <param name="dest">
 49    /// The destination SKRect defining the area on the canvas where the bitmap will be drawn.
 50    /// </param>
 51    /// <param name="options">The SKSamplingOptions to use for rendering.</param>
 52    /// <param name="paint">Optional SKPaint to apply additional effects or styles.</param>
 53    public static void DrawBitmap(this SKCanvas canvas, SKBitmap bitmap, SKRect source, SKRect dest, SKSamplingOptions o
 54    {
 055        using var image = SKImage.FromBitmap(bitmap);
 056        canvas.DrawImage(image, source, dest, options, paint);
 057    }
 58}