Пример #1
0
        public void MustBeSameSized_Span_LengthIsLess_ThrowsException()
        {
            var exception = Assert.Throws <ArgumentException>(() =>
            {
                DebugGuard.MustBeSameSized(new Span <int>(new int[2]), new Span <int>(new int[3]), "myParamName");
            });

            Assert.Equal("myParamName", exception.ParamName);
            Assert.Contains($"Span-s must be the same size.", exception.Message);
        }
Пример #2
0
        public static void Decode(Span <byte> scanline, Span <byte> previousScanline, int bytesPerPixel)
        {
            DebugGuard.MustBeSameSized(scanline, previousScanline, nameof(scanline));

            ref byte scanBaseRef = ref MemoryMarshal.GetReference(scanline);
Пример #3
0
        public static void Decode(Span <byte> scanline, Span <byte> previousScanline, int bytesPerPixel)
        {
            DebugGuard.MustBeSameSized(scanline, previousScanline, nameof(scanline));

            ref byte scanBaseRef = ref scanline.DangerousGetPinnableReference();
Пример #4
0
 public void MustBeSameSized_Span_LengthIsEqual_DoesNotThrowException()
 {
     DebugGuard.MustBeSameSized(new Span <int>(new int[2]), new Span <int>(new int[2]), "myParamName");
 }
Пример #5
0
        public static void EncodePaethFilter(ReadOnlySpan <byte> scanline, Span <byte> previousScanline, Span <byte> result, int bytesPerPixel, out int sum)
        {
            DebugGuard.MustBeSameSized <byte>(scanline, previousScanline, nameof(scanline));
            DebugGuard.MustBeSizedAtLeast(result, scanline, nameof(result));

            ref byte scanBaseRef   = ref MemoryMarshal.GetReference(scanline);