Browse Source

Fixing filter madness

Former-commit-id: d1f19e35bca833e0e6a500aa76b112760e2b6a7a
af/merge-core
James South 12 years ago
parent
commit
79470454f5
  1. 4
      src/ImageProcessor.Tests/ImageProcessor.Tests.csproj
  2. 21
      src/ImageProcessor.Tests/RegularExpressionUnitTests.cs
  3. 1
      src/ImageProcessor.Web/NET45/ImageProcessor.Web_NET45.csproj
  4. 88
      src/ImageProcessor.Web/NET45/Processors/RoundedCorners.cs
  5. 1
      src/ImageProcessor/ImageProcessor.csproj
  6. 2
      src/ImageProcessor/Imaging/Convolution.cs
  7. 8
      src/ImageProcessor/Imaging/Filters/BlackWhiteMatrixFilter.cs
  8. 203
      src/ImageProcessor/Imaging/Filters/ColorMatrixes.cs
  9. 10
      src/ImageProcessor/Imaging/Filters/ComicMatrixFilter.cs
  10. 8
      src/ImageProcessor/Imaging/Filters/GothamMatrixFilter.cs
  11. 8
      src/ImageProcessor/Imaging/Filters/GreyScaleMatrixFilter.cs
  12. 10
      src/ImageProcessor/Imaging/Filters/HiSatchMatrixFilter.cs
  13. 2
      src/ImageProcessor/Imaging/Filters/IMatrixFilter.cs
  14. 10
      src/ImageProcessor/Imaging/Filters/InvertMatrixFilter.cs
  15. 8
      src/ImageProcessor/Imaging/Filters/LoSatchMatrixFilter.cs
  16. 8
      src/ImageProcessor/Imaging/Filters/LomographMatrixFilter.cs
  17. 70
      src/ImageProcessor/Imaging/Filters/MatrixFilterBase.cs
  18. 8
      src/ImageProcessor/Imaging/Filters/PolaroidMatrixFilter.cs
  19. 10
      src/ImageProcessor/Imaging/Filters/SepiaMatrixFilter.cs
  20. 33
      src/ImageProcessor/Imaging/Formats/FormatBase.cs
  21. 2
      src/ImageProcessor/Processors/Alpha.cs
  22. 2
      src/ImageProcessor/Processors/AutoRotate.cs
  23. 2
      src/ImageProcessor/Processors/BackgroundColor.cs
  24. 2
      src/ImageProcessor/Processors/Brightness.cs
  25. 2
      src/ImageProcessor/Processors/Contrast.cs
  26. 2
      src/ImageProcessor/Processors/Crop.cs
  27. 2
      src/ImageProcessor/Processors/Filter.cs
  28. 2
      src/ImageProcessor/Processors/Flip.cs
  29. 2
      src/ImageProcessor/Processors/Format.cs
  30. 2
      src/ImageProcessor/Processors/GaussianBlur.cs
  31. 2
      src/ImageProcessor/Processors/GaussianSharpen.cs
  32. 2
      src/ImageProcessor/Processors/IGraphicsProcessor.cs
  33. 2
      src/ImageProcessor/Processors/Quality.cs
  34. 4
      src/ImageProcessor/Processors/Resize.cs
  35. 2
      src/ImageProcessor/Processors/Rotate.cs
  36. 2
      src/ImageProcessor/Processors/RoundedCorners.cs
  37. 2
      src/ImageProcessor/Processors/Saturation.cs
  38. 2
      src/ImageProcessor/Processors/Tint.cs
  39. 2
      src/ImageProcessor/Processors/Vignette.cs
  40. 2
      src/ImageProcessor/Processors/Watermark.cs
  41. 8
      src/ImageProcessor/Settings.StyleCop
  42. 7
      src/TestWebsites/NET45/Test_Website_NET45/Views/Home/Png.cshtml

4
src/ImageProcessor.Tests/ImageProcessor.Tests.csproj

@ -74,6 +74,10 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ImageProcessor.Web\NET45\ImageProcessor.Web_NET45.csproj">
<Project>{d011a778-59c8-4bfa-a770-c350216bf161}</Project>
<Name>ImageProcessor.Web_NET45</Name>
</ProjectReference>
<ProjectReference Include="..\ImageProcessor\ImageProcessor.csproj">
<Project>{3b5dd734-fb7a-487d-8ce6-55e7af9aea7e}</Project>
<Name>ImageProcessor</Name>

21
src/ImageProcessor.Tests/RegularExpressionUnitTests.cs

@ -11,6 +11,8 @@ namespace ImageProcessor.Tests
using ImageProcessor.Configuration;
using ImageProcessor.Imaging;
using ImageProcessor.Imaging.Filters;
using ImageProcessor.Imaging.Formats;
using ImageProcessor.Processors;
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endregion
@ -99,14 +101,14 @@ namespace ImageProcessor.Tests
{
// Should really write more for the other filters.
const string Querystring = "filter=lomograph";
const string Expected = "lomograph";
IMatrixFilter expected = MatrixFilters.Lomograph;
Web.Processors.Filter filter = new Web.Processors.Filter();
filter.MatchRegexIndex(Querystring);
string actual = filter.Processor.DynamicParameter;
IMatrixFilter actual = filter.Processor.DynamicParameter;
Assert.AreEqual(Expected, actual);
Assert.AreEqual(expected, actual);
}
/// <summary>
@ -116,14 +118,14 @@ namespace ImageProcessor.Tests
public void TestFormatRegex()
{
const string Querystring = "format=gif";
const string Expected = "gif";
ISupportedImageFormat expected = new GifFormat();
Web.Processors.Format format = new Web.Processors.Format();
format.MatchRegexIndex(Querystring);
string actual = format.Processor.DynamicParameter;
ISupportedImageFormat actual = format.Processor.DynamicParameter;
Assert.AreEqual(Expected, actual);
Assert.AreEqual(expected, actual);
}
/// <summary>
@ -185,17 +187,16 @@ namespace ImageProcessor.Tests
{
const string Querystring = "roundedcorners=30";
RoundedCornerLayer expected = new RoundedCornerLayer(30, true, true, true, true);
RoundedCorners roundedCorners = new RoundedCorners();
Web.Processors.RoundedCorners roundedCorners = new Web.Processors.RoundedCorners();
roundedCorners.MatchRegexIndex(Querystring);
RoundedCornerLayer actual = roundedCorners.DynamicParameter;
RoundedCornerLayer actual = roundedCorners.Processor.DynamicParameter;
Assert.AreEqual(expected, actual);
}
/// <summary>
/// The rounded corners regex unit test.
/// The tint regex unit test.
/// </summary>
[TestMethod]
public void TestTintRegex()

1
src/ImageProcessor.Web/NET45/ImageProcessor.Web_NET45.csproj

@ -75,6 +75,7 @@
<Compile Include="Processors\Quality.cs" />
<Compile Include="Processors\Resize.cs" />
<Compile Include="Processors\Rotate.cs" />
<Compile Include="Processors\RoundedCorners.cs" />
<Compile Include="Processors\Saturation.cs" />
<Compile Include="Processors\Tint.cs" />
<Compile Include="Processors\Vignette.cs" />

88
src/ImageProcessor.Web/NET45/Processors/RoundedCorners.cs

@ -1,11 +1,20 @@

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RoundedCorners.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// <summary>
// Encapsulates methods to add rounded corners to an image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Web.Processors
{
using System.Drawing;
using System.Globalization;
using System.Text.RegularExpressions;
using ImageProcessor.Imaging;
using ImageProcessor.Processors;
using ImageProcessor.Web.Helpers;
/// <summary>
/// Encapsulates methods to add rounded corners to an image.
@ -15,37 +24,40 @@ namespace ImageProcessor.Web.Processors
/// <summary>
/// The regular expression to search strings for.
/// </summary>
private static readonly Regex QueryRegex = new Regex(@"roundedcorners=(\d+|[^&]*)", RegexOptions.Compiled);
private static readonly Regex QueryRegex = new Regex(@"roundedcorners=[^&]+", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the angle attribute.
/// </summary>
private static readonly Regex RadiusRegex = new Regex(@"radius-(\d+)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the color attribute.
/// </summary>
private static readonly Regex ColorRegex = new Regex(@"bgcolor-([0-9a-fA-F]{3}){1,2}", RegexOptions.Compiled);
private static readonly Regex RadiusRegex = new Regex(@"(roundedcorners|radius)(=|-)(\d+)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the top left attribute.
/// </summary>
private static readonly Regex TopLeftRegex = new Regex(@"tl-(true|false)", RegexOptions.Compiled);
private static readonly Regex TopLeftRegex = new Regex(@"tl(=|-)(true|false)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the top right attribute.
/// </summary>
private static readonly Regex TopRightRegex = new Regex(@"tr-(true|false)", RegexOptions.Compiled);
private static readonly Regex TopRightRegex = new Regex(@"tr(=|-)(true|false)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the bottom left attribute.
/// </summary>
private static readonly Regex BottomLeftRegex = new Regex(@"bl-(true|false)", RegexOptions.Compiled);
private static readonly Regex BottomLeftRegex = new Regex(@"bl(=|-)(true|false)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the bottom right attribute.
/// </summary>
private static readonly Regex BottomRightRegex = new Regex(@"br-(true|false)", RegexOptions.Compiled);
private static readonly Regex BottomRightRegex = new Regex(@"br(=|-)(true|false)", RegexOptions.Compiled);
/// <summary>
/// Initializes a new instance of the <see cref="RoundedCorners"/> class.
/// </summary>
public RoundedCorners()
{
this.Processor = new ImageProcessor.Processors.RoundedCorners();
}
/// <summary>
/// Gets the regular expression to search strings for.
@ -91,21 +103,13 @@ namespace ImageProcessor.Web.Processors
// Set the index on the first instance only.
this.SortOrder = match.Index;
RoundedCornerLayer roundedCornerLayer;
string toParse = match.Value;
if (toParse.Contains("bgcolor"))
{
roundedCornerLayer = new RoundedCornerLayer(this.ParseRadius(toParse), this.ParseColor(toParse), this.ParseCorner(TopLeftRegex, toParse), this.ParseCorner(TopRightRegex, toParse), this.ParseCorner(BottomLeftRegex, toParse), this.ParseCorner(BottomRightRegex, toParse));
}
else
{
int radius;
int.TryParse(match.Value.Split('=')[1], NumberStyles.Any, CultureInfo.InvariantCulture, out radius);
roundedCornerLayer = new RoundedCornerLayer(radius, this.ParseCorner(TopLeftRegex, toParse), this.ParseCorner(TopRightRegex, toParse), this.ParseCorner(BottomLeftRegex, toParse), this.ParseCorner(BottomRightRegex, toParse));
}
RoundedCornerLayer roundedCornerLayer = new RoundedCornerLayer(
this.ParseRadius(queryString),
CommonParameterParserUtility.ParseColor(queryString),
this.ParseCorner(TopLeftRegex, queryString),
this.ParseCorner(TopRightRegex, queryString),
this.ParseCorner(BottomLeftRegex, queryString),
this.ParseCorner(BottomRightRegex, queryString));
this.Processor.DynamicParameter = roundedCornerLayer;
}
@ -133,34 +137,14 @@ namespace ImageProcessor.Web.Processors
{
// Split on radius-
int radius;
int.TryParse(match.Value.Split('-')[1], NumberStyles.Any, CultureInfo.InvariantCulture, out radius);
int.TryParse(match.Value.Split(new[] { '=', '-' })[1], NumberStyles.Any, CultureInfo.InvariantCulture, out radius);
return radius;
}
// No rotate - matches the RotateLayer default.
// No corners - matches the RoundedCorner default.
return 0;
}
/// <summary>
/// Returns the correct <see cref="T:System.Drawing.Color"/> for the given string.
/// </summary>
/// <param name="input">
/// The input string containing the value to parse.
/// </param>
/// <returns>
/// The correct <see cref="T:System.Drawing.Color"/>
/// </returns>
private Color ParseColor(string input)
{
foreach (Match match in ColorRegex.Matches(input))
{
// split on color-hex
return ColorTranslator.FromHtml("#" + match.Value.Split('-')[1]);
}
return Color.Transparent;
}
/// <summary>
/// Returns a <see cref="T:System.Boolean"/> either true or false.
/// </summary>
@ -179,11 +163,11 @@ namespace ImageProcessor.Web.Processors
{
// Split on corner-
bool cornerRound;
bool.TryParse(match.Value.Split('-')[1], out cornerRound);
bool.TryParse(match.Value.Split(new[] { '=', '-' })[1], out cornerRound);
return cornerRound;
}
// No rotate - matches the RotateLayer default.
// No corners - matches the RoundedCorner default.
return true;
}
#endregion

1
src/ImageProcessor/ImageProcessor.csproj

@ -76,6 +76,7 @@
<Compile Include="Imaging\CropLayer.cs" />
<Compile Include="Imaging\CropMode.cs" />
<Compile Include="Imaging\ExifPropertyTag.cs" />
<Compile Include="Imaging\Filters\MatrixFilterBase.cs" />
<Compile Include="Imaging\Filters\MatrixFilters.cs" />
<Compile Include="Imaging\Formats\BitmapFormat.cs" />
<Compile Include="Imaging\Formats\TiffFormat.cs" />

2
src/ImageProcessor/Imaging/Convolution.cs

@ -257,7 +257,7 @@ namespace ImageProcessor.Imaging
/// <summary>
/// Processes the given kernel to produce an array of pixels representing a bitmap.
/// </summary>
/// <param name="sourceBitmap">The the image to process.</param>
/// <param name="sourceBitmap">The image to process.</param>
/// <param name="kernel">The Gaussian kernel to use when performing the method</param>
/// <returns>A processed bitmap.</returns>
public Bitmap ProcessKernel(Bitmap sourceBitmap, double[,] kernel)

8
src/ImageProcessor/Imaging/Filters/BlackWhiteMatrixFilter.cs

@ -18,12 +18,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a black and white filter to an image.
/// </summary>
internal class BlackWhiteMatrixFilter : IMatrixFilter
internal class BlackWhiteMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.BlackWhite; }
}
@ -32,7 +32,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -40,7 +40,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{

203
src/ImageProcessor/Imaging/Filters/ColorMatrixes.cs

@ -10,10 +10,7 @@
namespace ImageProcessor.Imaging.Filters
{
#region Using
using System.Diagnostics.CodeAnalysis;
using System.Drawing.Imaging;
#endregion
/// <summary>
/// A list of available color matrices to apply to an image.
@ -21,24 +18,56 @@ namespace ImageProcessor.Imaging.Filters
internal static class ColorMatrixes
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the sepia filter.
/// The <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the black and white filter.
/// </summary>
internal static ColorMatrix Sepia
{
get
{
return
new ColorMatrix(
new[]
{
new[] { .393f, .349f, .272f, 0, 0 },
new[] { .769f, .686f, .534f, 0, 0 },
new[] { .189f, .168f, .131f, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new float[] { 0, 0, 0, 0, 1 }
});
}
}
private static ColorMatrix blackWhite;
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the high pass
/// on the comic book filter.
/// </summary>
private static ColorMatrix comicHigh;
/// <summary>
/// Gets <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the low pass
/// on the comic book filter.
/// </summary>
private static ColorMatrix comicLow;
/// <summary>
/// The <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the greyscale filter.
/// </summary>
private static ColorMatrix greyScale;
/// <summary>
/// The <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the high saturation filter.
/// </summary>
private static ColorMatrix hiSatch;
/// <summary>
/// The <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the invert filter.
/// </summary>
private static ColorMatrix invert;
/// <summary>
/// The <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the lomograph filter.
/// </summary>
private static ColorMatrix lomograph;
/// <summary>
/// The <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the low saturation filter.
/// </summary>
private static ColorMatrix loSatch;
/// <summary>
/// The <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the polaroid filter.
/// </summary>
private static ColorMatrix polaroid;
/// <summary>
/// The <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the sepia filter.
/// </summary>
private static ColorMatrix sepia;
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the black and white filter.
@ -47,7 +76,7 @@ namespace ImageProcessor.Imaging.Filters
{
get
{
return new ColorMatrix(
return blackWhite ?? (blackWhite = new ColorMatrix(
new[]
{
new[] { 1.5f, 1.5f, 1.5f, 0, 0 },
@ -55,45 +84,47 @@ namespace ImageProcessor.Imaging.Filters
new[] { 1.5f, 1.5f, 1.5f, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new float[] { -1, -1, -1, 0, 1 }
});
}));
}
}
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the polaroid filter.
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the high pass
/// on the comic book filter.
/// </summary>
internal static ColorMatrix Polaroid
internal static ColorMatrix ComicHigh
{
get
{
return new ColorMatrix(
return comicHigh ?? (comicHigh = new ColorMatrix(
new[]
{
new[] { 1.638f, -0.062f, -0.262f, 0, 0 },
new[] { -0.122f, 1.378f, -0.122f, 0, 0 },
new[] { 1.016f, -0.016f, 1.383f, 0, 0 },
new[] { 2, -0.5f, -0.5f, 0, 0 },
new[] { -0.5f, 2, -0.5f, 0, 0 },
new[] { -0.5f, -0.5f, 2, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new[] { 0.06f, -0.05f, -0.05f, 0, 1 }
});
new float[] { 0, 0, 0, 0, 1 }
}));
}
}
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the lomograph filter.
/// Gets <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the low pass
/// on the comic book filter.
/// </summary>
internal static ColorMatrix Lomograph
internal static ColorMatrix ComicLow
{
get
{
return new ColorMatrix(
new[]
return comicLow ?? (comicLow = new ColorMatrix(
new[]
{
new[] { 1.50f, 0, 0, 0, 0 },
new[] { 0, 1.45f, 0, 0, 0 },
new[] { 0, 0, 1.09f, 0, 0 },
new float[] { 1, 0, 0, 0, 0 },
new float[] { 0, 1, 0, 0, 0 },
new float[] { 0, 0, 1, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new[] { -0.10f, 0.05f, -0.08f, 0, 1 }
});
new[] { .075f, .075f, .075f, 0, 1 }
}));
}
}
@ -104,7 +135,7 @@ namespace ImageProcessor.Imaging.Filters
{
get
{
return new ColorMatrix(
return greyScale ?? (greyScale = new ColorMatrix(
new[]
{
new[] { .33f, .33f, .33f, 0, 0 },
@ -112,7 +143,26 @@ namespace ImageProcessor.Imaging.Filters
new[] { .11f, .11f, .11f, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new float[] { 0, 0, 0, 0, 1 }
});
}));
}
}
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the high saturation filter.
/// </summary>
internal static ColorMatrix HiSatch
{
get
{
return hiSatch ?? (hiSatch = new ColorMatrix(
new[]
{
new float[] { 3, -1, -1, 0, 0 },
new float[] { -1, 3, -1, 0, 0 },
new float[] { -1, -1, 3, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new float[] { 0, 0, 0, 0, 1 }
}));
}
}
@ -123,7 +173,7 @@ namespace ImageProcessor.Imaging.Filters
{
get
{
return new ColorMatrix(
return invert ?? (invert = new ColorMatrix(
new[]
{
new float[] { -1, 0, 0, 0, 0 },
@ -131,39 +181,38 @@ namespace ImageProcessor.Imaging.Filters
new float[] { 0, 0, -1, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new float[] { 1, 1, 1, 0, 1 }
});
}));
}
}
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the high saturation filter.
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the lomograph filter.
/// </summary>
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed. Suppression is OK here.")]
internal static ColorMatrix HiSatch
internal static ColorMatrix Lomograph
{
get
{
return new ColorMatrix(
new[]
{
new float[] { 3, -1, -1, 0, 0 },
new float[] { -1, 3, -1, 0, 0 },
new float[] { -1, -1, 3, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new float[] { 0, 0, 0, 0, 1 }
});
return lomograph
?? (lomograph = new ColorMatrix(
new[]
{
new[] { 1.50f, 0, 0, 0, 0 },
new[] { 0, 1.45f, 0, 0, 0 },
new[] { 0, 0, 1.09f, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new[] { -0.10f, 0.05f, -0.08f, 0, 1 }
}));
}
}
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the low saturation filter.
/// </summary>
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed. Suppression is OK here.")]
internal static ColorMatrix LoSatch
{
get
{
return new ColorMatrix(
return loSatch ?? (loSatch = new ColorMatrix(
new[]
{
new float[] { 1, 0, 0, 0, 0 },
@ -171,48 +220,46 @@ namespace ImageProcessor.Imaging.Filters
new float[] { 0, 0, 1, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new[] { .25f, .25f, .25f, 0, 1 }
});
}));
}
}
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the high pass
/// on the comic book filter.
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the polaroid filter.
/// </summary>
internal static ColorMatrix ComicHigh
internal static ColorMatrix Polaroid
{
get
{
return new ColorMatrix(
return polaroid ?? (polaroid = new ColorMatrix(
new[]
{
new[] { 2, -0.5f, -0.5f, 0, 0 },
new[] { -0.5f, 2, -0.5f, 0, 0 },
new[] { -0.5f, -0.5f, 2, 0, 0 },
new[] { 1.638f, -0.062f, -0.262f, 0, 0 },
new[] { -0.122f, 1.378f, -0.122f, 0, 0 },
new[] { 1.016f, -0.016f, 1.383f, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new float[] { 0, 0, 0, 0, 1 }
});
new[] { 0.06f, -0.05f, -0.05f, 0, 1 }
}));
}
}
/// <summary>
/// Gets <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the low pass
/// on the comic book filter.
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for generating the sepia filter.
/// </summary>
internal static ColorMatrix ComicLow
internal static ColorMatrix Sepia
{
get
{
return new ColorMatrix(
new[]
return sepia ?? (sepia = new ColorMatrix(
new[]
{
new float[] { 1, 0, 0, 0, 0 },
new float[] { 0, 1, 0, 0, 0 },
new float[] { 0, 0, 1, 0, 0 },
new[] { .393f, .349f, .272f, 0, 0 },
new[] { .769f, .686f, .534f, 0, 0 },
new[] { .189f, .168f, .131f, 0, 0 },
new float[] { 0, 0, 0, 1, 0 },
new[] { .075f, .075f, .075f, 0, 1 }
});
new float[] { 0, 0, 0, 0, 1 }
}));
}
}
}
}
}

10
src/ImageProcessor/Imaging/Filters/ComicMatrixFilter.cs

@ -23,7 +23,7 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a comic filter to an image.
/// </summary>
internal class ComicMatrixFilter : IMatrixFilter
internal class ComicMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Enumerates Argb color channels.
@ -45,7 +45,7 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.ComicLow; }
}
@ -54,7 +54,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -62,7 +62,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
// Bitmaps for comic pattern
Bitmap highBitmap = null;
@ -135,7 +135,7 @@ namespace ImageProcessor.Imaging.Filters
graphics.DrawImage(highBitmap, 0, 0);
graphics.DrawImage(lowBitmap, 0, 0);
graphics.DrawImage(edgeBitmap, 0, 0);
// Draw an edge around the image.
using (Pen blackPen = new Pen(Color.Black))
{

8
src/ImageProcessor/Imaging/Filters/GothamMatrixFilter.cs

@ -22,12 +22,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a gotham filter to an image.
/// </summary>
internal class GothamMatrixFilter : IMatrixFilter
internal class GothamMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.GreyScale; }
}
@ -36,7 +36,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -44,7 +44,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{

8
src/ImageProcessor/Imaging/Filters/GreyScaleMatrixFilter.cs

@ -18,12 +18,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a greyscale filter to an image.
/// </summary>
internal class GreyScaleMatrixFilter : IMatrixFilter
internal class GreyScaleMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.GreyScale; }
}
@ -32,7 +32,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -40,7 +40,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{

10
src/ImageProcessor/Imaging/Filters/HiSatchMatrixFilter.cs

@ -18,12 +18,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a high saturated filter to an image.
/// </summary>
internal class HiSatchMatrixFilter : IMatrixFilter
internal class HiSatchMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.HiSatch; }
}
@ -32,7 +32,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -40,7 +40,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{
@ -61,4 +61,4 @@ namespace ImageProcessor.Imaging.Filters
return image;
}
}
}
}

2
src/ImageProcessor/Imaging/Filters/IMatrixFilter.cs

@ -30,7 +30,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>

10
src/ImageProcessor/Imaging/Filters/InvertMatrixFilter.cs

@ -18,12 +18,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add an inverted filter to an image.
/// </summary>
internal class InvertMatrixFilter : IMatrixFilter
internal class InvertMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.Invert; }
}
@ -32,7 +32,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -40,7 +40,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{
@ -61,4 +61,4 @@ namespace ImageProcessor.Imaging.Filters
return image;
}
}
}
}

8
src/ImageProcessor/Imaging/Filters/LoSatchMatrixFilter.cs

@ -18,12 +18,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a low saturated filter to an image.
/// </summary>
internal class LoSatchMatrixFilter : IMatrixFilter
internal class LoSatchMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.LoSatch; }
}
@ -32,7 +32,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -40,7 +40,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{

8
src/ImageProcessor/Imaging/Filters/LomographMatrixFilter.cs

@ -19,12 +19,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a lomograph filter to an image.
/// </summary>
internal class LomographMatrixFilter : IMatrixFilter
internal class LomographMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.Lomograph; }
}
@ -33,7 +33,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -41,7 +41,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{

70
src/ImageProcessor/Imaging/Filters/MatrixFilterBase.cs

@ -0,0 +1,70 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MatrixFilterBase.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// <summary>
// The matrix filter base contains equality methods.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Imaging.Filters
{
using System.Drawing;
using System.Drawing.Imaging;
/// <summary>
/// The matrix filter base contains equality methods.
/// </summary>
public abstract class MatrixFilterBase : IMatrixFilter
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix" /> for this filter instance.
/// </summary>
public abstract ColorMatrix Matrix { get; }
/// <summary>
/// Processes the image.
/// </summary>
/// <param name="factory">The current instance of the
/// <see cref="T:ImageProcessor.ImageFactory" /> class containing
/// the image to process.</param>
/// <param name="image">The current image to process</param>
/// <param name="newImage">The new Image to return</param>
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class.
/// </returns>
public abstract Image TransformImage(ImageFactory factory, Image image, Image newImage);
/// <summary>
/// Determines whether the specified <see cref="IMatrixFilter" />, is equal to this instance.
/// </summary>
/// <param name="obj">The <see cref="IMatrixFilter" /> to compare with this instance.</param>
/// <returns>
/// <c>true</c> if the specified <see cref="IMatrixFilter" /> is equal to this instance; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj)
{
IMatrixFilter filter = obj as IMatrixFilter;
if (filter == null)
{
return false;
}
return this.GetType().Name == filter.GetType().Name
&& this.Matrix.Equals(filter.Matrix);
}
/// <summary>
/// Returns a hash code for this instance.
/// </summary>
/// <returns>
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
/// </returns>
public override int GetHashCode()
{
return this.GetType().Name.GetHashCode() + this.Matrix.GetHashCode();
}
}
}

8
src/ImageProcessor/Imaging/Filters/PolaroidMatrixFilter.cs

@ -20,12 +20,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a Polaroid filter to an image.
/// </summary>
internal class PolaroidMatrixFilter : IMatrixFilter
internal class PolaroidMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.Polaroid; }
}
@ -34,7 +34,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -42,7 +42,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{

10
src/ImageProcessor/Imaging/Filters/SepiaMatrixFilter.cs

@ -18,12 +18,12 @@ namespace ImageProcessor.Imaging.Filters
/// <summary>
/// Encapsulates methods with which to add a sepia filter to an image.
/// </summary>
internal class SepiaMatrixFilter : IMatrixFilter
internal class SepiaMatrixFilter : MatrixFilterBase
{
/// <summary>
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
/// </summary>
public ColorMatrix Matrix
public override ColorMatrix Matrix
{
get { return ColorMatrixes.Sepia; }
}
@ -32,7 +32,7 @@ namespace ImageProcessor.Imaging.Filters
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
@ -40,7 +40,7 @@ namespace ImageProcessor.Imaging.Filters
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
public override Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{
@ -61,4 +61,4 @@ namespace ImageProcessor.Imaging.Filters
return image;
}
}
}
}

33
src/ImageProcessor/Imaging/Formats/FormatBase.cs

@ -14,6 +14,7 @@ namespace ImageProcessor.Imaging.Formats
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
/// <summary>
/// The supported format base. Implement this class when building a supported format.
@ -83,7 +84,7 @@ namespace ImageProcessor.Imaging.Formats
/// The <see cref="T:System.IO.stream" /> containing the image information.
/// </param>
/// <returns>
/// The the <see cref="T:System.Drawing.Image" />.
/// The <see cref="T:System.Drawing.Image" />.
/// </returns>
public virtual Image Load(Stream stream)
{
@ -119,5 +120,35 @@ namespace ImageProcessor.Imaging.Formats
image.Save(path, this.ImageFormat);
return image;
}
/// <summary>
/// Determines whether the specified <see cref="System.Object" />, is equal to this instance.
/// </summary>
/// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj)
{
ISupportedImageFormat format = obj as ISupportedImageFormat;
if (format == null)
{
return false;
}
return this.MimeType.Equals(format.MimeType);
}
/// <summary>
/// Returns a hash code for this instance.
/// </summary>
/// <returns>
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
/// </returns>
public override int GetHashCode()
{
return this.MimeType.GetHashCode();
}
}
}

2
src/ImageProcessor/Processors/Alpha.cs

@ -41,7 +41,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/AutoRotate.cs

@ -42,7 +42,7 @@ namespace ImageProcessor.Processors
/// <summary>
/// Processes the image.
/// </summary>
/// <param name="factory">The the current instance of the
/// <param name="factory">The current instance of the
/// <see cref="T:ImageProcessor.ImageFactory" /> class containing
/// the image to process.</param>
/// <returns>

2
src/ImageProcessor/Processors/BackgroundColor.cs

@ -31,7 +31,7 @@ namespace ImageProcessor.Processors
/// <summary>
/// Processes the image.
/// </summary>
/// <param name="factory">The the current instance of the
/// <param name="factory">The current instance of the
/// <see cref="T:ImageProcessor.ImageFactory" /> class containing
/// the image to process.</param>
/// <returns>

2
src/ImageProcessor/Processors/Brightness.cs

@ -41,7 +41,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Contrast.cs

@ -41,7 +41,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Crop.cs

@ -45,7 +45,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Filter.cs

@ -44,7 +44,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Flip.cs

@ -43,7 +43,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Format.cs

@ -47,7 +47,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/GaussianBlur.cs

@ -32,7 +32,7 @@ namespace ImageProcessor.Processors
/// <summary>
/// Processes the image.
/// </summary>
/// <param name="factory">The the current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class containing
/// <param name="factory">The current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class containing
/// the image to process.</param>
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class.

2
src/ImageProcessor/Processors/GaussianSharpen.cs

@ -32,7 +32,7 @@ namespace ImageProcessor.Processors
/// <summary>
/// Processes the image.
/// </summary>
/// <param name="factory">The the current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class containing
/// <param name="factory">The current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class containing
/// the image to process.</param>
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class.

2
src/ImageProcessor/Processors/IGraphicsProcessor.cs

@ -38,7 +38,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Quality.cs

@ -42,7 +42,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

4
src/ImageProcessor/Processors/Resize.cs

@ -54,7 +54,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>
@ -83,7 +83,7 @@ namespace ImageProcessor.Processors
/// The resize image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="width">

2
src/ImageProcessor/Processors/Rotate.cs

@ -45,7 +45,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/RoundedCorners.cs

@ -46,7 +46,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Saturation.cs

@ -47,7 +47,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Tint.cs

@ -34,7 +34,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Vignette.cs

@ -53,7 +53,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

2
src/ImageProcessor/Processors/Watermark.cs

@ -43,7 +43,7 @@ namespace ImageProcessor.Processors
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>

8
src/ImageProcessor/Settings.StyleCop

@ -23,5 +23,13 @@
Licensed under the Apache License, Version 2.0.</StringProperty>
</AnalyzerSettings>
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
<AnalyzerSettings>
<CollectionProperty Name="Hungarian">
<Value>hi</Value>
<Value>lo</Value>
</CollectionProperty>
</AnalyzerSettings>
</Analyzer>
</Analyzers>
</StyleCopSettings>

7
src/TestWebsites/NET45/Test_Website_NET45/Views/Home/Png.cshtml

@ -94,6 +94,13 @@
<h2>Alpha</h2>
<img src="/images/Penguins.png?width=300&alpha=50" />
</div>
<div class="col-s-6">
<h2>Rounded Corners</h2>
<h4>Old Syntax</h4>
<img src="/images/Penguins.png?width=300&roundedcorners=radius-26|tl-true|tr-false|bl-true|br-false" />
<h4>New Syntax</h4>
<img src="/images/Penguins.png?width=300&roundedcorners=26&tl=true&tr=false&bl=true&br=false" />
</div>
</div>
</section>
</article>

Loading…
Cancel
Save