diff --git a/src/ImageSharp/PixelAccessor.cs b/src/ImageSharp/PixelAccessor.cs index 28cdff54a..484173844 100644 --- a/src/ImageSharp/PixelAccessor.cs +++ b/src/ImageSharp/PixelAccessor.cs @@ -5,7 +5,6 @@ namespace ImageSharp { - using System; using System.Runtime.CompilerServices; /// @@ -22,6 +21,30 @@ namespace ImageSharp { } + /// + protected override void CopyFromXYZW(PixelRow row, int targetY, int targetX, int width) + { + byte* source = row.PixelBase; + byte* destination = this.GetRowPointer(targetY) + targetX; + + Unsafe.CopyBlock(destination, source, (uint) width * 4); + } + + /// + protected override void CopyFromXYZ(PixelRow row, int targetY, int targetX, int width) + { + byte* source = row.PixelBase; + byte* destination = this.GetRowPointer(targetY) + targetX; + + for (int x = 0; x < width; x++) + { + Unsafe.Write(destination, (uint)(*(source) << 0 | *(source + 1) << 8 | *(source + 2) << 16 | 255 << 24)); + + source += 3; + destination += 4; + } + } + /// protected override void CopyFromZYX(PixelRow row, int targetY, int targetX, int width) {