From b022285f1ea2d3fa1271294876f63ae24b24a9aa Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Mon, 5 Dec 2016 07:23:45 +1100 Subject: [PATCH] Cleanup --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 7 +++---- src/ImageSharp/Formats/Png/PngHeader.cs | 2 +- .../Formats/Png/{InterlaceMode.cs => PngInterlaceMode.cs} | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) rename src/ImageSharp/Formats/Png/{InterlaceMode.cs => PngInterlaceMode.cs} (79%) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 133733462..d5cb40e3f 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -344,7 +344,7 @@ namespace ImageSharp.Formats dataStream.Position = 0; using (ZlibInflateStream compressedStream = new ZlibInflateStream(dataStream)) { - if (this.header.InterlaceMethod == InterlaceMode.Adam7) + if (this.header.InterlaceMethod == PngInterlaceMode.Adam7) { this.DecodeInterlacedPixelData(compressedStream, pixels); } @@ -507,7 +507,6 @@ namespace ImageSharp.Formats Swap(ref scanline, ref previousScanline); - y += Adam7RowIncrement[pass]; } } @@ -813,7 +812,7 @@ namespace ImageSharp.Formats this.header.ColorType = data[9]; this.header.CompressionMethod = data[10]; this.header.FilterMethod = data[11]; - this.header.InterlaceMethod = (InterlaceMode)data[12]; + this.header.InterlaceMethod = (PngInterlaceMode)data[12]; } /// @@ -839,7 +838,7 @@ namespace ImageSharp.Formats throw new NotSupportedException("The png specification only defines 0 as filter method."); } - if (this.header.InterlaceMethod != InterlaceMode.None && this.header.InterlaceMethod != InterlaceMode.Adam7) + if (this.header.InterlaceMethod != PngInterlaceMode.None && this.header.InterlaceMethod != PngInterlaceMode.Adam7) { throw new NotSupportedException("The png specification only defines 'None' and 'Adam7' as interlaced methods."); } diff --git a/src/ImageSharp/Formats/Png/PngHeader.cs b/src/ImageSharp/Formats/Png/PngHeader.cs index ffad043f0..f1d332c04 100644 --- a/src/ImageSharp/Formats/Png/PngHeader.cs +++ b/src/ImageSharp/Formats/Png/PngHeader.cs @@ -57,6 +57,6 @@ namespace ImageSharp.Formats /// Indicates the transmission order of the image data. /// Two values are currently defined: 0 (no interlace) or 1 (Adam7 interlace). /// - public InterlaceMode InterlaceMethod { get; set; } + public PngInterlaceMode InterlaceMethod { get; set; } } } diff --git a/src/ImageSharp/Formats/Png/InterlaceMode.cs b/src/ImageSharp/Formats/Png/PngInterlaceMode.cs similarity index 79% rename from src/ImageSharp/Formats/Png/InterlaceMode.cs rename to src/ImageSharp/Formats/Png/PngInterlaceMode.cs index 663c9611c..e32e808c1 100644 --- a/src/ImageSharp/Formats/Png/InterlaceMode.cs +++ b/src/ImageSharp/Formats/Png/PngInterlaceMode.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // @@ -8,7 +8,7 @@ namespace ImageSharp.Formats /// /// Provides enumeration of available PNG interlace modes. /// - public enum InterlaceMode : byte + public enum PngInterlaceMode : byte { /// /// Non interlaced