|
|
|
@ -15,13 +15,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="Argb32"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromArgb32(Configuration configuration, ReadOnlySpan<Argb32> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromArgb32(Configuration configuration, ReadOnlySpan<Argb32> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref Argb32 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -38,12 +38,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromArgb32Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromArgb32Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromArgb32(configuration, MemoryMarshal.Cast<byte, Argb32>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromArgb32(configuration, MemoryMarshal.Cast<byte, Argb32>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -51,13 +51,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="Argb32"/> data.</param>
|
|
|
|
internal virtual void ToArgb32(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Argb32> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="Argb32"/> data.</param>
|
|
|
|
public virtual void ToArgb32(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Argb32> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref Argb32 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref Argb32 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -77,7 +77,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToArgb32Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToArgb32Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToArgb32(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, Argb32>(destBytes)); |
|
|
|
} |
|
|
|
@ -87,13 +87,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="Bgr24"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromBgr24(Configuration configuration, ReadOnlySpan<Bgr24> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromBgr24(Configuration configuration, ReadOnlySpan<Bgr24> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref Bgr24 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -110,12 +110,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromBgr24Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromBgr24Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromBgr24(configuration, MemoryMarshal.Cast<byte, Bgr24>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromBgr24(configuration, MemoryMarshal.Cast<byte, Bgr24>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -123,13 +123,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="Bgr24"/> data.</param>
|
|
|
|
internal virtual void ToBgr24(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Bgr24> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="Bgr24"/> data.</param>
|
|
|
|
public virtual void ToBgr24(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Bgr24> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref Bgr24 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref Bgr24 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -149,7 +149,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToBgr24Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToBgr24Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToBgr24(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, Bgr24>(destBytes)); |
|
|
|
} |
|
|
|
@ -159,13 +159,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="Bgra32"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromBgra32(Configuration configuration, ReadOnlySpan<Bgra32> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromBgra32(Configuration configuration, ReadOnlySpan<Bgra32> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref Bgra32 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -182,12 +182,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromBgra32Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromBgra32Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromBgra32(configuration, MemoryMarshal.Cast<byte, Bgra32>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromBgra32(configuration, MemoryMarshal.Cast<byte, Bgra32>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -195,13 +195,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="Bgra32"/> data.</param>
|
|
|
|
internal virtual void ToBgra32(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Bgra32> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="Bgra32"/> data.</param>
|
|
|
|
public virtual void ToBgra32(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Bgra32> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref Bgra32 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref Bgra32 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -221,7 +221,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToBgra32Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToBgra32Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToBgra32(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, Bgra32>(destBytes)); |
|
|
|
} |
|
|
|
@ -231,13 +231,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="L8"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromL8(Configuration configuration, ReadOnlySpan<L8> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromL8(Configuration configuration, ReadOnlySpan<L8> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref L8 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -254,12 +254,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromL8Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromL8Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromL8(configuration, MemoryMarshal.Cast<byte, L8>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromL8(configuration, MemoryMarshal.Cast<byte, L8>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -267,13 +267,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="L8"/> data.</param>
|
|
|
|
internal virtual void ToL8(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<L8> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="L8"/> data.</param>
|
|
|
|
public virtual void ToL8(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<L8> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref L8 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref L8 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -293,7 +293,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToL8Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToL8Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToL8(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, L8>(destBytes)); |
|
|
|
} |
|
|
|
@ -303,13 +303,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="L16"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromL16(Configuration configuration, ReadOnlySpan<L16> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromL16(Configuration configuration, ReadOnlySpan<L16> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref L16 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -326,12 +326,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromL16Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromL16Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromL16(configuration, MemoryMarshal.Cast<byte, L16>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromL16(configuration, MemoryMarshal.Cast<byte, L16>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -339,13 +339,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="L16"/> data.</param>
|
|
|
|
internal virtual void ToL16(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<L16> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="L16"/> data.</param>
|
|
|
|
public virtual void ToL16(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<L16> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref L16 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref L16 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -365,7 +365,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToL16Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToL16Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToL16(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, L16>(destBytes)); |
|
|
|
} |
|
|
|
@ -375,13 +375,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="La16"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromLa16(Configuration configuration, ReadOnlySpan<La16> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromLa16(Configuration configuration, ReadOnlySpan<La16> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref La16 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -398,12 +398,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromLa16Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromLa16Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromLa16(configuration, MemoryMarshal.Cast<byte, La16>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromLa16(configuration, MemoryMarshal.Cast<byte, La16>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -411,13 +411,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="La16"/> data.</param>
|
|
|
|
internal virtual void ToLa16(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<La16> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="La16"/> data.</param>
|
|
|
|
public virtual void ToLa16(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<La16> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref La16 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref La16 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -437,7 +437,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToLa16Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToLa16Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToLa16(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, La16>(destBytes)); |
|
|
|
} |
|
|
|
@ -447,13 +447,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="La32"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromLa32(Configuration configuration, ReadOnlySpan<La32> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromLa32(Configuration configuration, ReadOnlySpan<La32> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref La32 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -470,12 +470,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromLa32Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromLa32Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromLa32(configuration, MemoryMarshal.Cast<byte, La32>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromLa32(configuration, MemoryMarshal.Cast<byte, La32>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -483,13 +483,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="La32"/> data.</param>
|
|
|
|
internal virtual void ToLa32(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<La32> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="La32"/> data.</param>
|
|
|
|
public virtual void ToLa32(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<La32> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref La32 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref La32 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -509,7 +509,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToLa32Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToLa32Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToLa32(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, La32>(destBytes)); |
|
|
|
} |
|
|
|
@ -519,13 +519,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="Rgb24"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromRgb24(Configuration configuration, ReadOnlySpan<Rgb24> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromRgb24(Configuration configuration, ReadOnlySpan<Rgb24> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref Rgb24 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -542,12 +542,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromRgb24Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromRgb24Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromRgb24(configuration, MemoryMarshal.Cast<byte, Rgb24>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromRgb24(configuration, MemoryMarshal.Cast<byte, Rgb24>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -555,13 +555,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="Rgb24"/> data.</param>
|
|
|
|
internal virtual void ToRgb24(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Rgb24> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="Rgb24"/> data.</param>
|
|
|
|
public virtual void ToRgb24(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Rgb24> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref Rgb24 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref Rgb24 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -581,7 +581,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToRgb24Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToRgb24Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToRgb24(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, Rgb24>(destBytes)); |
|
|
|
} |
|
|
|
@ -591,13 +591,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="Rgba32"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromRgba32(Configuration configuration, ReadOnlySpan<Rgba32> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromRgba32(Configuration configuration, ReadOnlySpan<Rgba32> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref Rgba32 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -614,12 +614,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromRgba32Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromRgba32Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromRgba32(configuration, MemoryMarshal.Cast<byte, Rgba32>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromRgba32(configuration, MemoryMarshal.Cast<byte, Rgba32>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -627,13 +627,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="Rgba32"/> data.</param>
|
|
|
|
internal virtual void ToRgba32(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Rgba32> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="Rgba32"/> data.</param>
|
|
|
|
public virtual void ToRgba32(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Rgba32> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref Rgba32 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref Rgba32 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -653,7 +653,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToRgba32Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToRgba32Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToRgba32(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, Rgba32>(destBytes)); |
|
|
|
} |
|
|
|
@ -663,13 +663,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="Rgb48"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromRgb48(Configuration configuration, ReadOnlySpan<Rgb48> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromRgb48(Configuration configuration, ReadOnlySpan<Rgb48> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref Rgb48 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -686,12 +686,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromRgb48Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromRgb48Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromRgb48(configuration, MemoryMarshal.Cast<byte, Rgb48>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromRgb48(configuration, MemoryMarshal.Cast<byte, Rgb48>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -699,13 +699,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="Rgb48"/> data.</param>
|
|
|
|
internal virtual void ToRgb48(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Rgb48> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="Rgb48"/> data.</param>
|
|
|
|
public virtual void ToRgb48(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Rgb48> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref Rgb48 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref Rgb48 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -725,7 +725,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToRgb48Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToRgb48Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToRgb48(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, Rgb48>(destBytes)); |
|
|
|
} |
|
|
|
@ -735,13 +735,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="Rgba64"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromRgba64(Configuration configuration, ReadOnlySpan<Rgba64> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromRgba64(Configuration configuration, ReadOnlySpan<Rgba64> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref Rgba64 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -758,12 +758,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromRgba64Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromRgba64Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromRgba64(configuration, MemoryMarshal.Cast<byte, Rgba64>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromRgba64(configuration, MemoryMarshal.Cast<byte, Rgba64>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -771,13 +771,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="Rgba64"/> data.</param>
|
|
|
|
internal virtual void ToRgba64(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Rgba64> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="Rgba64"/> data.</param>
|
|
|
|
public virtual void ToRgba64(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Rgba64> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref Rgba64 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref Rgba64 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -797,7 +797,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToRgba64Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToRgba64Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToRgba64(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, Rgba64>(destBytes)); |
|
|
|
} |
|
|
|
@ -807,13 +807,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="source">The source <see cref="Span{T}"/> of <see cref="Bgra5551"/> data.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
internal virtual void FromBgra5551(Configuration configuration, ReadOnlySpan<Bgra5551> source, Span<TPixel> destPixels) |
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
public virtual void FromBgra5551(Configuration configuration, ReadOnlySpan<Bgra5551> source, Span<TPixel> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref Bgra5551 sourceBaseRef = ref MemoryMarshal.GetReference(source); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref TPixel destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < source.Length; i++) |
|
|
|
{ |
|
|
|
@ -830,12 +830,12 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
|
|
|
|
/// <param name="sourceBytes">The <see cref="ReadOnlySpan{T}"/> to the source bytes.</param>
|
|
|
|
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="destinationPixels">The <see cref="Span{T}"/> to the destination pixels.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void FromBgra5551Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destPixels, int count) |
|
|
|
public void FromBgra5551Bytes(Configuration configuration, ReadOnlySpan<byte> sourceBytes, Span<TPixel> destinationPixels, int count) |
|
|
|
{ |
|
|
|
this.FromBgra5551(configuration, MemoryMarshal.Cast<byte, Bgra5551>(sourceBytes).Slice(0, count), destPixels); |
|
|
|
this.FromBgra5551(configuration, MemoryMarshal.Cast<byte, Bgra5551>(sourceBytes).Slice(0, count), destinationPixels); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -843,13 +843,13 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
|
|
|
|
/// <param name="sourcePixels">The span of source pixels</param>
|
|
|
|
/// <param name="destPixels">The destination span of <see cref="Bgra5551"/> data.</param>
|
|
|
|
internal virtual void ToBgra5551(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Bgra5551> destPixels) |
|
|
|
/// <param name="destinationPixels">The destination span of <see cref="Bgra5551"/> data.</param>
|
|
|
|
public virtual void ToBgra5551(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<Bgra5551> destinationPixels) |
|
|
|
{ |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels)); |
|
|
|
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels)); |
|
|
|
|
|
|
|
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels); |
|
|
|
ref Bgra5551 destBaseRef = ref MemoryMarshal.GetReference(destPixels); |
|
|
|
ref Bgra5551 destBaseRef = ref MemoryMarshal.GetReference(destinationPixels); |
|
|
|
|
|
|
|
for (int i = 0; i < sourcePixels.Length; i++) |
|
|
|
{ |
|
|
|
@ -869,7 +869,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <param name="destBytes">The <see cref="Span{T}"/> to the destination bytes.</param>
|
|
|
|
/// <param name="count">The number of pixels to convert.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
internal void ToBgra5551Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
public void ToBgra5551Bytes(Configuration configuration, ReadOnlySpan<TPixel> sourcePixels, Span<byte> destBytes, int count) |
|
|
|
{ |
|
|
|
this.ToBgra5551(configuration, sourcePixels.Slice(0, count), MemoryMarshal.Cast<byte, Bgra5551>(destBytes)); |
|
|
|
} |
|
|
|
|