From 272761f2cfdf310e800d78012b6edf31cff6d222 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sun, 13 Nov 2016 16:41:52 +1100 Subject: [PATCH] Change filter method signature --- src/ImageSharp/Formats/Png/Filters/AverageFilter.cs | 8 +------- src/ImageSharp/Formats/Png/Filters/PaethFilter.cs | 6 +----- src/ImageSharp/Formats/Png/Filters/SubFilter.cs | 4 +--- src/ImageSharp/Formats/Png/Filters/UpFilter.cs | 6 +----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs b/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs index f6e445e918..3855b289da 100644 --- a/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs @@ -20,13 +20,9 @@ namespace ImageSharp.Formats /// The scanline to decode /// The previous scanline. /// The bytes per pixel. - /// - /// The - /// - public static byte[] Decode(byte[] scanline, byte[] previousScanline, int bytesPerPixel) + public static void Decode(byte[] scanline, byte[] previousScanline, int bytesPerPixel) { // Average(x) + floor((Raw(x-bpp)+Prior(x))/2) - fixed (byte* scan = scanline) fixed (byte* prev = previousScanline) { @@ -38,8 +34,6 @@ namespace ImageSharp.Formats scan[x] = (byte)((scan[x] + Average(left, above)) % 256); } } - - return scanline; } /// diff --git a/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs b/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs index fbb0f027e7..692ccfed8e 100644 --- a/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs @@ -21,11 +21,9 @@ namespace ImageSharp.Formats /// The scanline to decode /// The previous scanline. /// The bytes per pixel. - /// The - public static byte[] Decode(byte[] scanline, byte[] previousScanline, int bytesPerPixel) + public static void Decode(byte[] scanline, byte[] previousScanline, int bytesPerPixel) { // Paeth(x) + PaethPredictor(Raw(x-bpp), Prior(x), Prior(x-bpp)) - fixed (byte* scan = scanline) fixed (byte* prev = previousScanline) { @@ -38,8 +36,6 @@ namespace ImageSharp.Formats scan[x] = (byte)((scan[x] + PaethPredicator(left, above, upperLeft)) % 256); } } - - return scanline; } /// diff --git a/src/ImageSharp/Formats/Png/Filters/SubFilter.cs b/src/ImageSharp/Formats/Png/Filters/SubFilter.cs index 222828884f..ddcce0b4d0 100644 --- a/src/ImageSharp/Formats/Png/Filters/SubFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/SubFilter.cs @@ -18,7 +18,7 @@ namespace ImageSharp.Formats /// The scanline to decode /// The bytes per pixel. /// The - public static byte[] Decode(byte[] scanline, int bytesPerPixel) + public static void Decode(byte[] scanline, int bytesPerPixel) { // Sub(x) + Raw(x-bpp) fixed (byte* scan = scanline) @@ -29,8 +29,6 @@ namespace ImageSharp.Formats scan[x] = (byte)((scan[x] + priorRawByte) % 256); } } - - return scanline; } /// diff --git a/src/ImageSharp/Formats/Png/Filters/UpFilter.cs b/src/ImageSharp/Formats/Png/Filters/UpFilter.cs index 90a2f7ff75..e4281fb736 100644 --- a/src/ImageSharp/Formats/Png/Filters/UpFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/UpFilter.cs @@ -17,8 +17,7 @@ namespace ImageSharp.Formats /// /// The scanline to decode /// The previous scanline. - /// The - public static byte[] Decode(byte[] scanline, byte[] previousScanline) + public static void Decode(byte[] scanline, byte[] previousScanline) { // Up(x) + Prior(x) fixed (byte* scan = scanline) @@ -31,8 +30,6 @@ namespace ImageSharp.Formats scan[x] = (byte)((scan[x] + above) % 256); } } - - return scanline; } /// @@ -42,7 +39,6 @@ namespace ImageSharp.Formats /// The previous scanline. /// The filtered scanline result. /// The number of bytes per scanline - /// The public static void Encode(byte[] scanline, byte[] previousScanline, byte[] result, int bytesPerScanline) { // Up(x) = Raw(x) - Prior(x)