From c01001fddb1eee22d316ce8648db295a37a7f26c Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Wed, 23 Feb 2022 20:07:09 +0100 Subject: [PATCH] Add comment about pixel layout --- src/ImageSharp/Formats/Png/Filters/AverageFilter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs b/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs index 7747d14ea2..a99b93adb5 100644 --- a/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs @@ -32,6 +32,9 @@ namespace SixLabors.ImageSharp.Formats.Png.Filters // The Avg filter predicts each pixel as the (truncated) average of a and b: // Average(x) + floor((Raw(x-bpp)+Prior(x))/2) + // With pixels positioned like this: + // prev: c b + // row: a d #if SUPPORTS_RUNTIME_INTRINSICS if (Sse2.IsSupported && bytesPerPixel is 4) {