Browse Source

Merge branch 'af/disco-buffers' into js/faster-transforms

af/octree-no-pixelmap
James Jackson-South 6 years ago
parent
commit
2c33c5c538
  1. 10
      src/ImageSharp/Formats/Jpeg/Components/RowOctet.cs

10
src/ImageSharp/Formats/Jpeg/Components/RowOctet.cs

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Memory;
@ -39,6 +40,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
public Span<T> this[int y]
{
[MethodImpl(InliningOptions.ShortMethod)]
get
{
// No unsafe tricks, since Span<T> can't be used as a generic argument
@ -52,9 +54,15 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
5 => this.row5,
6 => this.row6,
7 => this.row7,
_ => throw new IndexOutOfRangeException()
_ => ThrowIndexOutOfRangeException()
};
}
}
[MethodImpl(InliningOptions.ColdPath)]
private static Span<T> ThrowIndexOutOfRangeException()
{
throw new IndexOutOfRangeException();
}
}
}

Loading…
Cancel
Save