Browse Source

Stylecop fixes

Former-commit-id: fc76d9c8cba162b8df67dc1f5f3d74747d72d099
Former-commit-id: 2ff5a55b83f7470e51273ddd6bb2dca7f33e01b6
Former-commit-id: 606d237e0b442997f0da2f2064882753c497daa3
pull/17/head
James Jackson-South 11 years ago
parent
commit
b3e7e35799
  1. 4
      ImageProcessor.sln.DotSettings
  2. 4
      src/ImageProcessor/Common/Extensions/ComparableExtensions.cs
  3. 28
      src/ImageProcessor/Formats/Gif/BitEncoder.cs
  4. 2
      src/ImageProcessor/Formats/Gif/GifEncoder.cs
  5. 5
      src/ImageProcessor/Formats/Gif/Sections/GifImageDescriptor.cs
  6. 27
      src/ImageProcessor/Formats/Png/Zlib/ZipConstants.cs
  7. 30
      src/ImageProcessor/ImageProperty.cs
  8. 2
      src/ImageProcessor/Samplers/Resamplers/Lanczos8Resampler.cs
  9. 2
      src/ImageProcessor/Samplers/Resamplers/MitchellNetravaliResampler.cs

4
ImageProcessor.sln.DotSettings

@ -1,2 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JPEG/@EntryIndexedValue">JPEG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PNG/@EntryIndexedValue">PNG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RGB/@EntryIndexedValue">RGB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RLE/@EntryIndexedValue">RLE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XY/@EntryIndexedValue">XY</s:String></wpf:ResourceDictionary> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XY/@EntryIndexedValue">XY</s:String></wpf:ResourceDictionary>

4
src/ImageProcessor/Common/Extensions/ComparableExtensions.cs

@ -127,7 +127,7 @@ namespace ImageProcessor
/// <returns>The <see cref="byte"/></returns> /// <returns>The <see cref="byte"/></returns>
public static byte ToByte(this float value) public static byte ToByte(this float value)
{ {
return (byte)(value.Clamp(0, 255)); return (byte)value.Clamp(0, 255);
} }
/// <summary> /// <summary>
@ -138,7 +138,7 @@ namespace ImageProcessor
/// <returns>The <see cref="byte"/></returns> /// <returns>The <see cref="byte"/></returns>
public static byte ToByte(this double value) public static byte ToByte(this double value)
{ {
return (byte)(value.Clamp(0, 255)); return (byte)value.Clamp(0, 255);
} }
} }
} }

28
src/ImageProcessor/Formats/Gif/BitEncoder.cs

@ -80,20 +80,6 @@ namespace ImageProcessor.Formats
this.list.AddRange(collection); this.list.AddRange(collection);
} }
/// <summary>
/// The end.
/// </summary>
internal void End()
{
while (this.currentBit > 0)
{
byte value = (byte)(this.currentValue & 0XFF);
this.currentValue = this.currentValue >> 8;
this.currentBit -= 8;
this.list.Add(value);
}
}
/// <summary> /// <summary>
/// Copies a range of elements from the encoder to a compatible one-dimensional array, /// Copies a range of elements from the encoder to a compatible one-dimensional array,
/// starting at the specified index of the target array. /// starting at the specified index of the target array.
@ -128,5 +114,19 @@ namespace ImageProcessor.Formats
{ {
return this.list.ToArray(); return this.list.ToArray();
} }
/// <summary>
/// The end.
/// </summary>
internal void End()
{
while (this.currentBit > 0)
{
byte value = (byte)(this.currentValue & 0XFF);
this.currentValue = this.currentValue >> 8;
this.currentBit -= 8;
this.list.Add(value);
}
}
} }
} }

2
src/ImageProcessor/Formats/Gif/GifEncoder.cs

@ -328,7 +328,7 @@ namespace ImageProcessor.Formats
/// Returns how many bits are required to store the specified number of colors. /// Returns how many bits are required to store the specified number of colors.
/// Performs a Log2() on the value. /// Performs a Log2() on the value.
/// </summary> /// </summary>
/// <para>The number of colors.</para> /// <param name="colors">The number of colors.</param>
/// <returns> /// <returns>
/// The <see cref="int"/> /// The <see cref="int"/>
/// </returns> /// </returns>

5
src/ImageProcessor/Formats/Gif/Sections/GifImageDescriptor.cs

@ -27,26 +27,22 @@ namespace ImageProcessor.Formats
/// </summary> /// </summary>
public short Top { get; set; } public short Top { get; set; }
/// <summary> /// <summary>
/// Gets or sets the width of the image in pixels. /// Gets or sets the width of the image in pixels.
/// </summary> /// </summary>
public short Width { get; set; } public short Width { get; set; }
/// <summary> /// <summary>
/// Gets or sets the height of the image in pixels. /// Gets or sets the height of the image in pixels.
/// </summary> /// </summary>
public short Height { get; set; } public short Height { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the presence of a Local Color Table immediately /// Gets or sets a value indicating whether the presence of a Local Color Table immediately
/// follows this Image Descriptor. /// follows this Image Descriptor.
/// </summary> /// </summary>
public bool LocalColorTableFlag { get; set; } public bool LocalColorTableFlag { get; set; }
/// <summary> /// <summary>
/// Gets or sets the local color table size. /// Gets or sets the local color table size.
/// If the Local Color Table Flag is set to 1, the value in this field /// If the Local Color Table Flag is set to 1, the value in this field
@ -54,7 +50,6 @@ namespace ImageProcessor.Formats
/// </summary> /// </summary>
public int LocalColorTableSize { get; set; } public int LocalColorTableSize { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the image is to be interlaced. /// Gets or sets a value indicating whether the image is to be interlaced.
/// An image is interlaced in a four-pass interlace pattern. /// An image is interlaced in a four-pass interlace pattern.

27
src/ImageProcessor/Formats/Png/Zlib/ZipConstants.cs

@ -1,4 +1,9 @@
namespace ImageProcessor.Formats // <copyright file="ZipConstants.cs" company="James South">
// Copyright (c) James South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageProcessor.Formats
{ {
using System.Text; using System.Text;
@ -60,7 +65,6 @@
/// </summary> /// </summary>
public const int CryptoHeaderSize = 12; public const int CryptoHeaderSize = 12;
/// <summary> /// <summary>
/// Signature for local entry header /// Signature for local entry header
/// </summary> /// </summary>
@ -116,23 +120,11 @@
/// End of central directory record signature /// End of central directory record signature
/// </summary> /// </summary>
public const int EndOfCentralDirectorySignature = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); public const int EndOfCentralDirectorySignature = 'P' | ('K' << 8) | (5 << 16) | (6 << 24);
static Encoding defaultEncoding = Encoding.UTF8;
/// <summary> /// <summary>
/// PCL don't support CodePage so we used Encoding instead of /// PCL don't support CodePage so we used Encoding instead of
/// </summary> /// </summary>
public static Encoding DefaultEncoding public static Encoding DefaultEncoding { get; set; } = Encoding.UTF8;
{
get
{
return defaultEncoding;
}
set
{
defaultEncoding = value;
}
}
/// <summary> /// <summary>
/// Convert a portion of a byte array to a string. /// Convert a portion of a byte array to a string.
@ -171,6 +163,7 @@
{ {
return string.Empty; return string.Empty;
} }
return ConvertToString(data, data.Length); return ConvertToString(data, data.Length);
} }
@ -205,10 +198,8 @@
/// <summary> /// <summary>
/// Convert a byte array to string /// Convert a byte array to string
/// </summary> /// </summary>
/// <param name="data">
/// Byte array to convert
/// </param>
/// <param name="flags">The applicable general purpose bits flags</param> /// <param name="flags">The applicable general purpose bits flags</param>
/// <param name="data">Byte array to convert</param>
/// <returns> /// <returns>
/// <paramref name="data">data</paramref>converted to a string /// <paramref name="data">data</paramref>converted to a string
/// </returns> /// </returns>

30
src/ImageProcessor/ImageProperty.cs

@ -21,21 +21,6 @@ namespace ImageProcessor
/// </summary> /// </summary>
public struct ImageProperty : IEquatable<ImageProperty> public struct ImageProperty : IEquatable<ImageProperty>
{ {
/// <summary>
/// Gets the name of this <see cref="ImageProperty"/> indicating which kind of
/// information this property stores.
/// </summary>
/// <example>
/// Typical properties are the author, copyright
/// information or other meta information.
/// </example>
public string Name { get; }
/// <summary>
/// The value of this <see cref="ImageProperty"/>.
/// </summary>
public string Value { get; }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ImageProperty"/> struct. /// Initializes a new instance of the <see cref="ImageProperty"/> struct.
/// </summary> /// </summary>
@ -51,6 +36,21 @@ namespace ImageProcessor
this.Value = value; this.Value = value;
} }
/// <summary>
/// Gets the name of this <see cref="ImageProperty"/> indicating which kind of
/// information this property stores.
/// </summary>
/// <example>
/// Typical properties are the author, copyright
/// information or other meta information.
/// </example>
public string Name { get; }
/// <summary>
/// The value of this <see cref="ImageProperty"/>.
/// </summary>
public string Value { get; }
/// <summary> /// <summary>
/// Compares two <see cref="ImageProperty"/> objects. The result specifies whether the values /// Compares two <see cref="ImageProperty"/> objects. The result specifies whether the values
/// of the <see cref="ImageProperty.Name"/> or <see cref="ImageProperty.Value"/> properties of the two /// of the <see cref="ImageProperty.Name"/> or <see cref="ImageProperty.Value"/> properties of the two

2
src/ImageProcessor/Samplers/Resamplers/Lanczos8Resampler.cs

@ -1,4 +1,4 @@
// <copyright file="Lanczos3Resampler.cs" company="James South"> // <copyright file="Lanczos8Resampler.cs" company="James South">
// Copyright (c) James South and contributors. // Copyright (c) James South and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
// </copyright> // </copyright>

2
src/ImageProcessor/Samplers/Resamplers/MitchellNetravaliResampler.cs

@ -1,4 +1,4 @@
// <copyright file="MitchellResampler.cs" company="James South"> // <copyright file="MitchellNetravaliResampler.cs" company="James South">
// Copyright (c) James South and contributors. // Copyright (c) James South and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
// </copyright> // </copyright>

Loading…
Cancel
Save