aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Drawing.Skia/SkiaHelper.cs
blob: f9c79c855867a9d527e24d65fa14fec9dbd17586 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using SkiaSharp;

namespace Jellyfin.Drawing.Skia
{
    /// <summary>
    /// Class containing helper methods for working with SkiaSharp.
    /// </summary>
    public static class SkiaHelper
    {
        /// <summary>
        /// Ensures the result is a success
        /// by throwing an exception when that's not the case.
        /// </summary>
        /// <param name="result">The result returned by Skia.</param>
        public static void EnsureSuccess(SKCodecResult result)
        {
            if (result != SKCodecResult.Success)
            {
                throw new SkiaCodecException(result);
            }
        }
    }
}