Browse Source

clean up filter tests + smaller output images

pull/404/head
Anton Firszov 9 years ago
parent
commit
3c2e10bd14
  1. 2
      src/ImageSharp/Processing/Processors/Filters/BlackWhiteProcessor.cs
  2. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/BlackWhiteTest.cs
  3. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/BrightnessTest.cs
  4. 4
      tests/ImageSharp.Tests/Processing/Processors/Filters/ColorBlindnessTest.cs
  5. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/ContrastTest.cs
  6. 12
      tests/ImageSharp.Tests/Processing/Processors/Filters/FilterTest.cs
  7. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/GrayscaleTest.cs
  8. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/HueTest.cs
  9. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/InvertTest.cs
  10. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/KodachromeTest.cs
  11. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/LomographTest.cs
  12. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/OpacityTest.cs
  13. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/PolaroidTest.cs
  14. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/SaturateTest.cs
  15. 10
      tests/ImageSharp.Tests/Processing/Processors/Filters/SepiaTest.cs

2
src/ImageSharp/Processing/Processors/Filters/BlackWhiteProcessor.cs

@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// Applies a black and white filter matrix to the image /// Applies a black and white filter matrix to the image
/// </summary> /// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam> /// <typeparam name="TPixel">The pixel format.</typeparam>
internal class BlackWhiteProcessor<TPixel> : FilterProcessor<TPixel> internal class BlackWhiteProcessor<TPixel> : FilterProcessor<TPixel>
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
/// <summary> /// <summary>

10
tests/ImageSharp.Tests/Processing/Processors/Filters/BlackWhiteTest.cs

@ -9,11 +9,11 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class BlackWhiteTest : FileTestBase public class BlackWhiteTest
{ {
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyBlackWhiteFilter<TPixel>(TestImageProvider<TPixel> provider) public void ApplyBlackWhiteFilter<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -24,8 +24,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyBlackWhiteFilterInBox<TPixel>(TestImageProvider<TPixel> provider) public void ApplyBlackWhiteFilterInBox<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/BrightnessTest.cs

@ -9,7 +9,7 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
{ {
public class BrightnessTest : FileTestBase public class BrightnessTest
{ {
public static readonly TheoryData<float> BrightnessValues public static readonly TheoryData<float> BrightnessValues
= new TheoryData<float> = new TheoryData<float>
@ -19,8 +19,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
}; };
[Theory] [Theory]
[WithTestPatternImages(nameof(BrightnessValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(BrightnessValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyBrightnessFilter<TPixel>(TestImageProvider<TPixel> provider, float value) public void ApplyBrightnessFilter<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -31,8 +31,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
} }
[Theory] [Theory]
[WithTestPatternImages(nameof(BrightnessValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(BrightnessValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyBrightnessFilterInBox<TPixel>(TestImageProvider<TPixel> provider, float value) public void ApplyBrightnessFilterInBox<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

4
tests/ImageSharp.Tests/Processing/Processors/Filters/ColorBlindnessTest.cs

@ -27,7 +27,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
[Theory] [Theory]
[WithTestPatternImages(nameof(ColorBlindnessFilters), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(ColorBlindnessFilters), 100, 100, DefaultPixelType)]
public void ImageShouldApplyColorBlindnessFilter<TPixel>(TestImageProvider<TPixel> provider, ColorBlindness colorBlindness) public void ApplyColorBlindnessFilter<TPixel>(TestImageProvider<TPixel> provider, ColorBlindness colorBlindness)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -39,7 +39,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
[Theory] [Theory]
[WithTestPatternImages(nameof(ColorBlindnessFilters), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(ColorBlindnessFilters), 100, 100, DefaultPixelType)]
public void ImageShouldApplyColorBlindnessFilterInBox<TPixel>(TestImageProvider<TPixel> provider, ColorBlindness colorBlindness) public void ApplyColorBlindnessFilterInBox<TPixel>(TestImageProvider<TPixel> provider, ColorBlindness colorBlindness)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/ContrastTest.cs

@ -9,7 +9,7 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
{ {
public class ContrastTest : FileTestBase public class ContrastTest
{ {
public static readonly TheoryData<float> ContrastValues public static readonly TheoryData<float> ContrastValues
= new TheoryData<float> = new TheoryData<float>
@ -19,8 +19,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
}; };
[Theory] [Theory]
[WithTestPatternImages(nameof(ContrastValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(ContrastValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyContrastFilter<TPixel>(TestImageProvider<TPixel> provider, float value) public void ApplyContrastFilter<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -31,8 +31,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
} }
[Theory] [Theory]
[WithTestPatternImages(nameof(ContrastValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(ContrastValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyContrastFilterInBox<TPixel>(TestImageProvider<TPixel> provider, float value) public void ApplyContrastFilterInBox<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

12
tests/ImageSharp.Tests/Processing/Processors/Filters/FilterTest.cs

@ -11,11 +11,13 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class FilterTest : FileTestBase public class FilterTest
{ {
// Testing the generic FilterProcessor with more than one pixel type intentionally.
// There is no need to do this with the specialized ones.
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32 | PixelTypes.Bgra32)]
public void ImageShouldApplyFilter<TPixel>(TestImageProvider<TPixel> provider) public void ApplyFilter<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -29,8 +31,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyFilterInBox<TPixel>(TestImageProvider<TPixel> provider) public void ApplyFilterInBox<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/GrayscaleTest.cs

@ -11,7 +11,7 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class GrayscaleTest : FileTestBase public class GrayscaleTest
{ {
public static readonly TheoryData<GrayscaleMode> GrayscaleModeTypes public static readonly TheoryData<GrayscaleMode> GrayscaleModeTypes
= new TheoryData<GrayscaleMode> = new TheoryData<GrayscaleMode>
@ -24,8 +24,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
/// Use test patterns over loaded images to save decode time. /// Use test patterns over loaded images to save decode time.
/// </summary> /// </summary>
[Theory] [Theory]
[WithTestPatternImages(nameof(GrayscaleModeTypes), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(GrayscaleModeTypes), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyGrayscaleFilter<TPixel>(TestImageProvider<TPixel> provider, GrayscaleMode value) public void ApplyGrayscaleFilter<TPixel>(TestImageProvider<TPixel> provider, GrayscaleMode value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -45,8 +45,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(nameof(GrayscaleModeTypes), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(GrayscaleModeTypes), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyGrayscaleFilterInBox<TPixel>(TestImageProvider<TPixel> provider, GrayscaleMode value) public void ApplyGrayscaleFilterInBox<TPixel>(TestImageProvider<TPixel> provider, GrayscaleMode value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/HueTest.cs

@ -9,7 +9,7 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class HueTest : FileTestBase public class HueTest
{ {
public static readonly TheoryData<int> HueValues public static readonly TheoryData<int> HueValues
= new TheoryData<int> = new TheoryData<int>
@ -19,8 +19,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
}; };
[Theory] [Theory]
[WithTestPatternImages(nameof(HueValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(HueValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyHueFilter<TPixel>(TestImageProvider<TPixel> provider, int value) public void ApplyHueFilter<TPixel>(TestImageProvider<TPixel> provider, int value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -31,8 +31,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(nameof(HueValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(HueValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyHueFilterInBox<TPixel>(TestImageProvider<TPixel> provider, int value) public void ApplyHueFilterInBox<TPixel>(TestImageProvider<TPixel> provider, int value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/InvertTest.cs

@ -9,11 +9,11 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
{ {
public class InvertTest : FileTestBase public class InvertTest
{ {
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyInvertFilter<TPixel>(TestImageProvider<TPixel> provider) public void ApplyInvertFilter<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -24,8 +24,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
} }
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyInvertFilterInBox<TPixel>(TestImageProvider<TPixel> provider) public void ApplyInvertFilterInBox<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/KodachromeTest.cs

@ -9,11 +9,11 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class KodachromeTest : FileTestBase public class KodachromeTest
{ {
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyKodachromeFilter<TPixel>(TestImageProvider<TPixel> provider) public void ApplyKodachromeFilter<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -24,8 +24,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyKodachromeFilterInBox<TPixel>(TestImageProvider<TPixel> provider) public void ApplyKodachromeFilterInBox<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/LomographTest.cs

@ -9,11 +9,11 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class LomographTest : FileTestBase public class LomographTest
{ {
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyLomographFilter<TPixel>(TestImageProvider<TPixel> provider) public void ApplyLomographFilter<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -24,8 +24,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyLomographFilterInBox<TPixel>(TestImageProvider<TPixel> provider) public void ApplyLomographFilterInBox<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/OpacityTest.cs

@ -9,7 +9,7 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
{ {
public class OpacityTest : FileTestBase public class OpacityTest
{ {
public static readonly TheoryData<float> AlphaValues public static readonly TheoryData<float> AlphaValues
= new TheoryData<float> = new TheoryData<float>
@ -19,8 +19,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
}; };
[Theory] [Theory]
[WithTestPatternImages(nameof(AlphaValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(AlphaValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyAlphaFilter<TPixel>(TestImageProvider<TPixel> provider, float value) public void ApplyAlphaFilter<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -31,8 +31,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects
} }
[Theory] [Theory]
[WithTestPatternImages(nameof(AlphaValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(AlphaValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyAlphaFilterInBox<TPixel>(TestImageProvider<TPixel> provider, float value) public void ApplyAlphaFilterInBox<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/PolaroidTest.cs

@ -9,11 +9,11 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class PolaroidTest : FileTestBase public class PolaroidTest
{ {
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyPolaroidFilter<TPixel>(TestImageProvider<TPixel> provider) public void ApplyPolaroidFilter<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -24,8 +24,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplyPolaroidFilterInBox<TPixel>(TestImageProvider<TPixel> provider) public void ApplyPolaroidFilterInBox<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/SaturateTest.cs

@ -9,7 +9,7 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class SaturateTest : FileTestBase public class SaturateTest
{ {
public static readonly TheoryData<float> SaturationValues public static readonly TheoryData<float> SaturationValues
= new TheoryData<float> = new TheoryData<float>
@ -19,8 +19,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
}; };
[Theory] [Theory]
[WithTestPatternImages(nameof(SaturationValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(SaturationValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplySaturationFilter<TPixel>(TestImageProvider<TPixel> provider, float value) public void ApplySaturationFilter<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -31,8 +31,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(nameof(SaturationValues), 100, 100, DefaultPixelType)] [WithTestPatternImages(nameof(SaturationValues), 48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplySaturationFilterInBox<TPixel>(TestImageProvider<TPixel> provider, float value) public void ApplySaturationFilterInBox<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

10
tests/ImageSharp.Tests/Processing/Processors/Filters/SepiaTest.cs

@ -9,11 +9,11 @@ using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
{ {
public class SepiaTest : FileTestBase public class SepiaTest
{ {
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplySepiaFilter<TPixel>(TestImageProvider<TPixel> provider) public void ApplySepiaFilter<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
@ -24,8 +24,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters
} }
[Theory] [Theory]
[WithTestPatternImages(100, 100, DefaultPixelType)] [WithTestPatternImages(48, 48, PixelTypes.Rgba32)]
public void ImageShouldApplySepiaFilterInBox<TPixel>(TestImageProvider<TPixel> provider) public void ApplySepiaFilterInBox<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
using (Image<TPixel> source = provider.GetImage()) using (Image<TPixel> source = provider.GetImage())

Loading…
Cancel
Save