Browse Source

Tidy up comments

pull/536/head
Jason Nelson 8 years ago
parent
commit
d008e10ef8
  1. 13
      src/ImageSharp/Formats/Gif/DisposalMethod.cs
  2. 8
      src/ImageSharp/Formats/Gif/GifEncoderCore.cs
  3. 8
      src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs
  4. 2
      src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs
  5. 4
      src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs
  6. 6
      src/ImageSharp/Formats/Gif/ImageExtensions.cs

13
src/ImageSharp/Formats/Gif/DisposalMethod.cs

@ -11,23 +11,26 @@ namespace SixLabors.ImageSharp.Formats.Gif
public enum DisposalMethod
{
/// <summary>
/// No disposal specified. The decoder is not required to take any action.
/// No disposal specified.
/// The decoder is not required to take any action.
/// </summary>
Unspecified = 0,
/// <summary>
/// Do not dispose. The graphic is to be left in place.
/// Do not dispose.
/// The graphic is to be left in place.
/// </summary>
NotDispose = 1,
/// <summary>
/// Restore to background color. The area used by the graphic must be restored to
/// the background color.
/// Restore to background color.
/// The area used by the graphic must be restored to the background color.
/// </summary>
RestoreToBackground = 2,
/// <summary>
/// Restore to previous. The decoder is required to restore the area overwritten by the
/// Restore to previous.
/// The decoder is required to restore the area overwritten by the
/// graphic with what was there prior to rendering the graphic.
/// </summary>
RestoreToPrevious = 3

8
src/ImageSharp/Formats/Gif/GifEncoderCore.cs

@ -27,22 +27,22 @@ namespace SixLabors.ImageSharp.Formats.Gif
private readonly byte[] buffer = new byte[20];
/// <summary>
/// Gets the TextEncoding
/// Gets the text encoding used to write comments.
/// </summary>
private readonly Encoding textEncoding;
/// <summary>
/// Gets or sets the quantizer for reducing the color count.
/// Gets or sets the quantizer used to generate the color palette.
/// </summary>
private readonly IQuantizer quantizer;
/// <summary>
/// Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded.
/// A flag indicating whether to ingore the metadata when writing the image.
/// </summary>
private readonly bool ignoreMetadata;
/// <summary>
/// The number of bits requires to store the image palette.
/// The number of bits requires to store the color palette.
/// </summary>
private int bitDepth;

8
src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs

@ -16,17 +16,11 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <inheritdoc/>
public IImageFormat DetectFormat(ReadOnlySpan<byte> header)
{
if (this.IsSupportedFileFormat(header))
{
return ImageFormats.Gif;
}
return null;
return this.IsSupportedFileFormat(header) ? ImageFormats.Gif : null;
}
private bool IsSupportedFileFormat(ReadOnlySpan<byte> header)
{
// TODO: This should be in constants
return header.Length >= this.HeaderSize &&
header[0] == 0x47 && // G
header[1] == 0x49 && // I

2
src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs

@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
bool IgnoreMetadata { get; }
/// <summary>
/// Gets the encoding that should be used when reading comments.
/// Gets the text encoding that should be used when reading comments.
/// </summary>
Encoding TextEncoding { get; }

4
src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs

@ -17,12 +17,12 @@ namespace SixLabors.ImageSharp.Formats.Gif
bool IgnoreMetadata { get; }
/// <summary>
/// Gets the encoding that should be used when writing comments.
/// Gets the text encoding used to write comments.
/// </summary>
Encoding TextEncoding { get; }
/// <summary>
/// Gets the quantizer for reducing the color count.
/// Gets the quantizer used to generate the color palette.
/// </summary>
IQuantizer Quantizer { get; }
}

6
src/ImageSharp/Formats/Gif/ImageExtensions.cs

@ -1,10 +1,8 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.IO;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Gif;
using SixLabors.ImageSharp.PixelFormats;
@ -16,7 +14,7 @@ namespace SixLabors.ImageSharp
public static partial class ImageExtensions
{
/// <summary>
/// Saves the image to the given stream with the gif format.
/// Saves the image to the given stream in the gif format.
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
@ -27,7 +25,7 @@ namespace SixLabors.ImageSharp
=> source.SaveAsGif(stream, null);
/// <summary>
/// Saves the image to the given stream with the gif format.
/// Saves the image to the given stream in the gif format.
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>

Loading…
Cancel
Save