SkiaHelper.cs 642 B

1234567891011121314151617181920212223
  1. using SkiaSharp;
  2. namespace Jellyfin.Drawing.Skia
  3. {
  4. /// <summary>
  5. /// Class containing helper methods for working with SkiaSharp.
  6. /// </summary>
  7. public static class SkiaHelper
  8. {
  9. /// <summary>
  10. /// Ensures the result is a success
  11. /// by throwing an exception when that's not the case.
  12. /// </summary>
  13. /// <param name="result">The result returned by Skia.</param>
  14. public static void EnsureSuccess(SKCodecResult result)
  15. {
  16. if (result != SKCodecResult.Success)
  17. {
  18. throw new SkiaCodecException(result);
  19. }
  20. }
  21. }
  22. }