Browse Source

Optimizing native integer usage

pull/1886/head
Ynse Hoornenborg 5 years ago
parent
commit
1ce4429001
  1. 2
      src/ImageSharp/Common/Helpers/BitOperations.cs
  2. 40
      src/ImageSharp/Common/Helpers/Shuffle/IComponentShuffle.cs
  3. 28
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Abgr32.PixelOperations.Generated.cs
  4. 28
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs
  5. 28
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs
  6. 28
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs
  7. 48
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.cs
  8. 48
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.cs
  9. 48
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.cs
  10. 48
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.cs
  11. 48
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.cs
  12. 28
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.cs
  13. 48
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.cs
  14. 28
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.cs
  15. 48
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.cs
  16. 4
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude

2
src/ImageSharp/Common/Helpers/BitOperations.cs

@ -3,7 +3,7 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
#if !NETCOREAPP3_1 #if !NETCOREAPP3_1_OR_GREATER
namespace SixLabors.ImageSharp.Common.Helpers namespace SixLabors.ImageSharp.Common.Helpers
{ {
/// <summary> /// <summary>

40
src/ImageSharp/Common/Helpers/Shuffle/IComponentShuffle.cs

@ -99,15 +99,15 @@ namespace SixLabors.ImageSharp
{ {
ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source)); ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source));
ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest)); ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest));
nuint n = (nuint)(uint)source.Length / 4; nint n = (nint)source.Length / 4;
for (nuint i = 0; i < n; i++) for (nint i = 0; i < n; i++)
{ {
uint packed = Unsafe.Add(ref sBase, (int)i); uint packed = Unsafe.Add(ref sBase, i);
// packed = [W Z Y X] // packed = [W Z Y X]
// ROTL(8, packed) = [Z Y X W] // ROTL(8, packed) = [Z Y X W]
Unsafe.Add(ref dBase, (int)i) = (packed << 8) | (packed >> 24); Unsafe.Add(ref dBase, i) = (packed << 8) | (packed >> 24);
} }
} }
} }
@ -125,15 +125,15 @@ namespace SixLabors.ImageSharp
{ {
ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source)); ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source));
ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest)); ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest));
nuint n = (nuint)(uint)source.Length / 4; nint n = (nint)source.Length / 4;
for (nuint i = 0; i < n; i++) for (nint i = 0; i < n; i++)
{ {
uint packed = Unsafe.Add(ref sBase, (int)i); uint packed = Unsafe.Add(ref sBase, i);
// packed = [W Z Y X] // packed = [W Z Y X]
// REVERSE(packedArgb) = [X Y Z W] // REVERSE(packedArgb) = [X Y Z W]
Unsafe.Add(ref dBase, (int)i) = BinaryPrimitives.ReverseEndianness(packed); Unsafe.Add(ref dBase, i) = BinaryPrimitives.ReverseEndianness(packed);
} }
} }
} }
@ -151,15 +151,15 @@ namespace SixLabors.ImageSharp
{ {
ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source)); ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source));
ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest)); ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest));
nuint n = (nuint)(uint)source.Length / 4; nint n = (nint)source.Length / 4;
for (nuint i = 0; i < n; i++) for (nint i = 0; i < n; i++)
{ {
uint packed = Unsafe.Add(ref sBase, (int)i); uint packed = Unsafe.Add(ref sBase, i);
// packed = [W Z Y X] // packed = [W Z Y X]
// ROTR(8, packedArgb) = [Y Z W X] // ROTR(8, packedArgb) = [Y Z W X]
Unsafe.Add(ref dBase, (int)i) = (packed >> 8) | (packed << 24); Unsafe.Add(ref dBase, i) = (packed >> 8) | (packed << 24);
} }
} }
} }
@ -177,11 +177,11 @@ namespace SixLabors.ImageSharp
{ {
ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source)); ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source));
ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest)); ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest));
nuint n = (nuint)(uint)source.Length / 4; nint n = (nint)source.Length / 4;
for (nuint i = 0; i < n; i++) for (nint i = 0; i < n; i++)
{ {
uint packed = Unsafe.Add(ref sBase, (int)i); uint packed = Unsafe.Add(ref sBase, i);
// packed = [W Z Y X] // packed = [W Z Y X]
// tmp1 = [W 0 Y 0] // tmp1 = [W 0 Y 0]
@ -192,7 +192,7 @@ namespace SixLabors.ImageSharp
uint tmp2 = packed & 0x00FF00FF; uint tmp2 = packed & 0x00FF00FF;
uint tmp3 = BitOperations.RotateLeft(tmp2, 16); uint tmp3 = BitOperations.RotateLeft(tmp2, 16);
Unsafe.Add(ref dBase, (int)i) = tmp1 + tmp3; Unsafe.Add(ref dBase, i) = tmp1 + tmp3;
} }
} }
} }
@ -210,11 +210,11 @@ namespace SixLabors.ImageSharp
{ {
ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source)); ref uint sBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(source));
ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest)); ref uint dBase = ref Unsafe.As<byte, uint>(ref MemoryMarshal.GetReference(dest));
nuint n = (nuint)(uint)source.Length / 4; nint n = (nint)source.Length / 4;
for (nuint i = 0; i < n; i++) for (nint i = 0; i < n; i++)
{ {
uint packed = Unsafe.Add(ref sBase, (int)i); uint packed = Unsafe.Add(ref sBase, i);
// packed = [W Z Y X] // packed = [W Z Y X]
// tmp1 = [0 Z 0 X] // tmp1 = [0 Z 0 X]
@ -225,7 +225,7 @@ namespace SixLabors.ImageSharp
uint tmp2 = packed & 0xFF00FF00; uint tmp2 = packed & 0xFF00FF00;
uint tmp3 = BitOperations.RotateLeft(tmp2, 16); uint tmp3 = BitOperations.RotateLeft(tmp2, 16);
Unsafe.Add(ref dBase, (int)i) = tmp1 + tmp3; Unsafe.Add(ref dBase, i) = tmp1 + tmp3;
} }
} }
} }

28
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Abgr32.PixelOperations.Generated.cs

@ -206,8 +206,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromAbgr32(sp); dp.FromAbgr32(sp);
} }
@ -226,8 +226,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromAbgr32(sp); dp.FromAbgr32(sp);
} }
@ -246,8 +246,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromAbgr32(sp); dp.FromAbgr32(sp);
} }
@ -266,8 +266,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromAbgr32(sp); dp.FromAbgr32(sp);
} }
@ -286,8 +286,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromAbgr32(sp); dp.FromAbgr32(sp);
} }
@ -306,8 +306,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromAbgr32(sp); dp.FromAbgr32(sp);
} }
@ -326,8 +326,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Abgr32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromAbgr32(sp); dp.FromAbgr32(sp);
} }

28
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs

@ -206,8 +206,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Argb32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Argb32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromArgb32(sp); dp.FromArgb32(sp);
} }
@ -226,8 +226,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Argb32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Argb32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromArgb32(sp); dp.FromArgb32(sp);
} }
@ -246,8 +246,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Argb32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Argb32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromArgb32(sp); dp.FromArgb32(sp);
} }
@ -266,8 +266,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Argb32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Argb32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromArgb32(sp); dp.FromArgb32(sp);
} }
@ -286,8 +286,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Argb32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Argb32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromArgb32(sp); dp.FromArgb32(sp);
} }
@ -306,8 +306,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Argb32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Argb32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromArgb32(sp); dp.FromArgb32(sp);
} }
@ -326,8 +326,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Argb32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Argb32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromArgb32(sp); dp.FromArgb32(sp);
} }

28
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs

@ -206,8 +206,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgr24(sp); dp.FromBgr24(sp);
} }
@ -226,8 +226,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgr24(sp); dp.FromBgr24(sp);
} }
@ -246,8 +246,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgr24(sp); dp.FromBgr24(sp);
} }
@ -266,8 +266,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgr24(sp); dp.FromBgr24(sp);
} }
@ -286,8 +286,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgr24(sp); dp.FromBgr24(sp);
} }
@ -306,8 +306,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgr24(sp); dp.FromBgr24(sp);
} }
@ -326,8 +326,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgr24 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgr24(sp); dp.FromBgr24(sp);
} }

28
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs

@ -206,8 +206,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra32(sp); dp.FromBgra32(sp);
} }
@ -226,8 +226,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra32(sp); dp.FromBgra32(sp);
} }
@ -246,8 +246,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra32(sp); dp.FromBgra32(sp);
} }
@ -266,8 +266,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra32(sp); dp.FromBgra32(sp);
} }
@ -286,8 +286,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra32(sp); dp.FromBgra32(sp);
} }
@ -306,8 +306,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra32(sp); dp.FromBgra32(sp);
} }
@ -326,8 +326,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra32(sp); dp.FromBgra32(sp);
} }

48
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.cs

@ -52,8 +52,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref Argb32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Argb32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -72,8 +72,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref Abgr32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Abgr32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -92,8 +92,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgr24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgr24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -112,8 +112,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -132,8 +132,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -152,8 +152,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -172,8 +172,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -192,8 +192,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -212,8 +212,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -232,8 +232,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -252,8 +252,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }
@ -272,8 +272,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Bgra5551 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromBgra5551(sp); dp.FromBgra5551(sp);
} }

48
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.cs

@ -52,8 +52,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Argb32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Argb32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -72,8 +72,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Abgr32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Abgr32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -92,8 +92,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgr24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgr24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -112,8 +112,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -132,8 +132,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -152,8 +152,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -172,8 +172,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -192,8 +192,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -212,8 +212,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -232,8 +232,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -252,8 +252,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }
@ -272,8 +272,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL16(sp); dp.FromL16(sp);
} }

48
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.cs

@ -52,8 +52,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Argb32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Argb32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -72,8 +72,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Abgr32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Abgr32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -92,8 +92,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgr24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgr24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -112,8 +112,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -132,8 +132,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -152,8 +152,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -172,8 +172,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -192,8 +192,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -212,8 +212,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -232,8 +232,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -252,8 +252,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }
@ -272,8 +272,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref L8 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref L8 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromL8(sp); dp.FromL8(sp);
} }

48
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.cs

@ -52,8 +52,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Argb32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Argb32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -72,8 +72,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Abgr32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Abgr32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -92,8 +92,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgr24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgr24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -112,8 +112,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -132,8 +132,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -152,8 +152,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -172,8 +172,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -192,8 +192,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -212,8 +212,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -232,8 +232,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -252,8 +252,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }
@ -272,8 +272,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La16 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La16 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa16(sp); dp.FromLa16(sp);
} }

48
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.cs

@ -52,8 +52,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Argb32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Argb32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -72,8 +72,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Abgr32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Abgr32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -92,8 +92,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgr24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgr24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -112,8 +112,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -132,8 +132,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -152,8 +152,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -172,8 +172,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -192,8 +192,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -212,8 +212,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -232,8 +232,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -252,8 +252,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }
@ -272,8 +272,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref La32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref La32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromLa32(sp); dp.FromLa32(sp);
} }

28
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.cs

@ -206,8 +206,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb24(sp); dp.FromRgb24(sp);
} }
@ -226,8 +226,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb24(sp); dp.FromRgb24(sp);
} }
@ -246,8 +246,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb24(sp); dp.FromRgb24(sp);
} }
@ -266,8 +266,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb24(sp); dp.FromRgb24(sp);
} }
@ -286,8 +286,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb24(sp); dp.FromRgb24(sp);
} }
@ -306,8 +306,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb24(sp); dp.FromRgb24(sp);
} }
@ -326,8 +326,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb24 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb24(sp); dp.FromRgb24(sp);
} }

48
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.cs

@ -52,8 +52,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref Argb32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Argb32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -72,8 +72,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref Abgr32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Abgr32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -92,8 +92,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgr24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgr24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -112,8 +112,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -132,8 +132,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -152,8 +152,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -172,8 +172,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -192,8 +192,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -212,8 +212,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -232,8 +232,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -252,8 +252,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }
@ -272,8 +272,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgb48 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgb48(sp); dp.FromRgb48(sp);
} }

28
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.cs

@ -187,8 +187,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba32(sp); dp.FromRgba32(sp);
} }
@ -207,8 +207,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba32(sp); dp.FromRgba32(sp);
} }
@ -227,8 +227,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba32(sp); dp.FromRgba32(sp);
} }
@ -247,8 +247,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba32(sp); dp.FromRgba32(sp);
} }
@ -267,8 +267,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba32(sp); dp.FromRgba32(sp);
} }
@ -287,8 +287,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba64 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba64 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba32(sp); dp.FromRgba32(sp);
} }
@ -307,8 +307,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba32 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba32(sp); dp.FromRgba32(sp);
} }

48
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.cs

@ -52,8 +52,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref Argb32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Argb32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -72,8 +72,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref Abgr32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Abgr32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -92,8 +92,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgr24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgr24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -112,8 +112,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -132,8 +132,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref L8 dp = ref Unsafe.Add(ref destRef, (int)i); ref L8 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -152,8 +152,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref L16 dp = ref Unsafe.Add(ref destRef, (int)i); ref L16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -172,8 +172,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref La16 dp = ref Unsafe.Add(ref destRef, (int)i); ref La16 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -192,8 +192,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref La32 dp = ref Unsafe.Add(ref destRef, (int)i); ref La32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -212,8 +212,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb24 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb24 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -232,8 +232,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgba32 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgba32 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -252,8 +252,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref Rgb48 dp = ref Unsafe.Add(ref destRef, (int)i); ref Rgb48 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }
@ -272,8 +272,8 @@ namespace SixLabors.ImageSharp.PixelFormats
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, (int)i); ref Rgba64 sp = ref Unsafe.Add(ref sourceRef, i);
ref Bgra5551 dp = ref Unsafe.Add(ref destRef, (int)i); ref Bgra5551 dp = ref Unsafe.Add(ref destRef, i);
dp.FromRgba64(sp); dp.FromRgba64(sp);
} }

4
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude

@ -106,8 +106,8 @@ using SixLabors.ImageSharp.PixelFormats.Utils;
for (nint i = 0; i < sourcePixels.Length; i++) for (nint i = 0; i < sourcePixels.Length; i++)
{ {
ref <#=fromPixelType#> sp = ref Unsafe.Add(ref sourceRef, (int)i); ref <#=fromPixelType#> sp = ref Unsafe.Add(ref sourceRef, i);
ref <#=toPixelType#> dp = ref Unsafe.Add(ref destRef, (int)i); ref <#=toPixelType#> dp = ref Unsafe.Add(ref destRef, i);
dp.From<#=fromPixelType#>(sp); dp.From<#=fromPixelType#>(sp);
} }

Loading…
Cancel
Save