diff --git a/src/ImageSharp/Formats/Gif/LzwEncoder.cs b/src/ImageSharp/Formats/Gif/LzwEncoder.cs index 4f78daf9d..9adf48843 100644 --- a/src/ImageSharp/Formats/Gif/LzwEncoder.cs +++ b/src/ImageSharp/Formats/Gif/LzwEncoder.cs @@ -34,11 +34,6 @@ namespace SixLabors.ImageSharp.Formats.Gif /// internal sealed class LzwEncoder : IDisposable { - /// - /// The end-of-file marker - /// - private const int Eof = -1; - /// /// The maximum number of bits. /// @@ -84,7 +79,7 @@ namespace SixLabors.ImageSharp.Formats.Gif private readonly byte[] accumulators = new byte[256]; /// - /// The current pixel + /// The current position within the pixelArray. /// private int position; @@ -96,12 +91,12 @@ namespace SixLabors.ImageSharp.Formats.Gif /// /// User settable max # bits/code /// - private int maxbits = Bits; + private int maxBits = Bits; /// /// maximum code, given bitCount /// - private int maxcode; + private int maxCode; /// /// should NEVER generate this code @@ -209,7 +204,7 @@ namespace SixLabors.ImageSharp.Formats.Gif } /// - /// Gets the maximum code value + /// Gets the maximum code value. /// /// The number of bits /// See @@ -237,7 +232,7 @@ namespace SixLabors.ImageSharp.Formats.Gif } /// - /// Table clear for block compress + /// Table clear for block compress. /// /// The output stream. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -272,13 +267,13 @@ namespace SixLabors.ImageSharp.Formats.Gif int hsizeReg; int hshift; - // Set up the globals: globalInitialBits - initial number of bits + // Set up the globals: globalInitialBits - initial number of bits this.globalInitialBits = intialBits; // Set up the necessary values this.clearFlag = false; this.bitCount = this.globalInitialBits; - this.maxcode = GetMaxcode(this.bitCount); + this.maxCode = GetMaxcode(this.bitCount); this.clearCode = 1 << (intialBits - 1); this.eofCode = this.clearCode + 1; @@ -310,7 +305,7 @@ namespace SixLabors.ImageSharp.Formats.Gif { c = this.NextPixel(); - fcode = (c << this.maxbits) + ent; + fcode = (c << this.maxBits) + ent; int i = (c << hshift) ^ ent /* = 0 */; if (Unsafe.Add(ref hashTableRef, i) == fcode) @@ -369,7 +364,7 @@ namespace SixLabors.ImageSharp.Formats.Gif } /// - /// Flush the packet to disk, and reset the accumulator. + /// Flush the packet to disk and reset the accumulator. /// /// The output stream. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -381,7 +376,7 @@ namespace SixLabors.ImageSharp.Formats.Gif } /// - /// Return the next pixel from the image + /// Reads the next pixel from the image. /// /// /// The @@ -422,17 +417,17 @@ namespace SixLabors.ImageSharp.Formats.Gif // If the next entry is going to be too big for the code size, // then increase it, if possible. - if (this.freeEntry > this.maxcode || this.clearFlag) + if (this.freeEntry > this.maxCode || this.clearFlag) { if (this.clearFlag) { - this.maxcode = GetMaxcode(this.bitCount = this.globalInitialBits); + this.maxCode = GetMaxcode(this.bitCount = this.globalInitialBits); this.clearFlag = false; } else { ++this.bitCount; - this.maxcode = this.bitCount == this.maxbits + this.maxCode = this.bitCount == this.maxBits ? this.maxmaxcode : GetMaxcode(this.bitCount); }