Browse Source

Cleanup

pull/33/head
James Jackson-South 9 years ago
parent
commit
b022285f1e
  1. 7
      src/ImageSharp/Formats/Png/PngDecoderCore.cs
  2. 2
      src/ImageSharp/Formats/Png/PngHeader.cs
  3. 4
      src/ImageSharp/Formats/Png/PngInterlaceMode.cs

7
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];
}
/// <summary>
@ -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.");
}

2
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).
/// </summary>
public InterlaceMode InterlaceMethod { get; set; }
public PngInterlaceMode InterlaceMethod { get; set; }
}
}

4
src/ImageSharp/Formats/Png/InterlaceMode.cs → src/ImageSharp/Formats/Png/PngInterlaceMode.cs

@ -1,4 +1,4 @@
// <copyright file="InterlaceMode.cs" company="James Jackson-South">
// <copyright file="PngInterlaceMode.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
@ -8,7 +8,7 @@ namespace ImageSharp.Formats
/// <summary>
/// Provides enumeration of available PNG interlace modes.
/// </summary>
public enum InterlaceMode : byte
public enum PngInterlaceMode : byte
{
/// <summary>
/// Non interlaced
Loading…
Cancel
Save