From 70cdb1984c17ba1a4270e5440d8f01e2477dead8 Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Wed, 21 Mar 2018 09:28:29 -0700 Subject: [PATCH] Update source generators to use ReadOnlySpan --- .../PixelOperations{TPixel}.Generated.cs | 42 +++++++++---------- .../Rgba32.PixelOperations.Generated.tt | 4 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs b/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs index 904e27c7f2..632455a0e9 100644 --- a/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs +++ b/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs @@ -33,9 +33,9 @@ namespace SixLabors.ImageSharp.PixelFormats dp.PackFromRgba32(rgba); } } - - /// - /// A helper for that expects a byte span. + + /// + /// A helper for that expects a byte span. /// The layout of the data in 'sourceBytes' must be compatible with layout. /// /// The to the source bytes. @@ -69,14 +69,14 @@ namespace SixLabors.ImageSharp.PixelFormats } } - /// - /// A helper for that expects a byte span as destination. + /// + /// A helper for that expects a byte span as destination. /// The layout of the data in 'destBytes' must be compatible with layout. /// /// The to the source colors. /// The to the destination bytes. /// The number of pixels to convert. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void ToRgba32Bytes(ReadOnlySpan sourceColors, Span destBytes, int count) { this.ToRgba32(sourceColors, destBytes.NonPortableCast(), count); @@ -104,9 +104,9 @@ namespace SixLabors.ImageSharp.PixelFormats dp.PackFromRgba32(rgba); } } - - /// - /// A helper for that expects a byte span. + + /// + /// A helper for that expects a byte span. /// The layout of the data in 'sourceBytes' must be compatible with layout. /// /// The to the source bytes. @@ -140,14 +140,14 @@ namespace SixLabors.ImageSharp.PixelFormats } } - /// - /// A helper for that expects a byte span as destination. + /// + /// A helper for that expects a byte span as destination. /// The layout of the data in 'destBytes' must be compatible with layout. /// /// The to the source colors. /// The to the destination bytes. /// The number of pixels to convert. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void ToBgra32Bytes(ReadOnlySpan sourceColors, Span destBytes, int count) { this.ToBgra32(sourceColors, destBytes.NonPortableCast(), count); @@ -175,9 +175,9 @@ namespace SixLabors.ImageSharp.PixelFormats dp.PackFromRgba32(rgba); } } - - /// - /// A helper for that expects a byte span. + + /// + /// A helper for that expects a byte span. /// The layout of the data in 'sourceBytes' must be compatible with layout. /// /// The to the source bytes. @@ -211,14 +211,14 @@ namespace SixLabors.ImageSharp.PixelFormats } } - /// - /// A helper for that expects a byte span as destination. + /// + /// A helper for that expects a byte span as destination. /// The layout of the data in 'destBytes' must be compatible with layout. /// /// The to the source colors. /// The to the destination bytes. /// The number of pixels to convert. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void ToRgb24Bytes(ReadOnlySpan sourceColors, Span destBytes, int count) { this.ToRgb24(sourceColors, destBytes.NonPortableCast(), count); @@ -282,14 +282,14 @@ namespace SixLabors.ImageSharp.PixelFormats } } - /// - /// A helper for that expects a byte span as destination. + /// + /// A helper for that expects a byte span as destination. /// The layout of the data in 'destBytes' must be compatible with layout. /// /// The to the source colors. /// The to the destination bytes. /// The number of pixels to convert. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void ToBgr24Bytes(ReadOnlySpan sourceColors, Span destBytes, int count) { this.ToBgr24(sourceColors, destBytes.NonPortableCast(), count); diff --git a/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt index 9dfec2cf90..4a88bbad7a 100644 --- a/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt @@ -14,7 +14,7 @@ #> /// - internal override void PackFrom<#=pixelType#>(Span<<#=pixelType#>> source, Span destPixels, int count) + internal override void PackFrom<#=pixelType#>(ReadOnlySpan<<#=pixelType#>> source, Span destPixels, int count) { GuardSpans(source, nameof(source), destPixels, nameof(destPixels), count); @@ -36,7 +36,7 @@ #> /// - internal override void To<#=pixelType#>(Span sourcePixels, Span<<#=pixelType#>> dest, int count) + internal override void To<#=pixelType#>(ReadOnlySpan sourcePixels, Span<<#=pixelType#>> dest, int count) { GuardSpans(sourcePixels, nameof(sourcePixels), dest, nameof(dest), count);