mirror of https://github.com/SixLabors/ImageSharp
20 changed files with 17 additions and 432 deletions
@ -1,27 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Filters |
|||
{ |
|||
public class BlackWhiteTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void BlackWhite_CorrectProcessor() |
|||
{ |
|||
this.operations.BlackWhite(); |
|||
BlackWhiteProcessor<Rgba32> p = this.Verify<BlackWhiteProcessor<Rgba32>>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public void BlackWhite_rect_CorrectProcessor() |
|||
{ |
|||
this.operations.BlackWhite(this.rect); |
|||
BlackWhiteProcessor<Rgba32> p = this.Verify<BlackWhiteProcessor<Rgba32>>(this.rect); |
|||
} |
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Effects |
|||
{ |
|||
public class BrightnessTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Brightness_amount_BrightnessProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Brightness(1.5F); |
|||
BrightnessProcessor<Rgba32> processor = this.Verify<BrightnessProcessor<Rgba32>>(); |
|||
|
|||
Assert.Equal(1.5F, processor.Amount); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Brightness_amount_rect_BrightnessProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Brightness(1.5F, this.rect); |
|||
BrightnessProcessor<Rgba32> processor = this.Verify<BrightnessProcessor<Rgba32>>(this.rect); |
|||
|
|||
Assert.Equal(1.5F, processor.Amount); |
|||
} |
|||
} |
|||
} |
|||
@ -1,46 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using SixLabors.ImageSharp.Processing.Processors; |
|||
using SixLabors.ImageSharp.Tests.TestUtilities; |
|||
|
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Filters |
|||
{ |
|||
public class ColorBlindnessTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
public static IEnumerable<object[]> TheoryData = new[] { |
|||
new object[]{ new TestType<AchromatomalyProcessor<Rgba32>>(), ColorBlindnessMode.Achromatomaly }, |
|||
new object[]{ new TestType<AchromatopsiaProcessor<Rgba32>>(), ColorBlindnessMode.Achromatopsia }, |
|||
new object[]{ new TestType<DeuteranomalyProcessor<Rgba32>>(), ColorBlindnessMode.Deuteranomaly }, |
|||
new object[]{ new TestType<DeuteranopiaProcessor<Rgba32>>(), ColorBlindnessMode.Deuteranopia }, |
|||
new object[]{ new TestType<ProtanomalyProcessor<Rgba32>>(), ColorBlindnessMode.Protanomaly }, |
|||
new object[]{ new TestType<ProtanopiaProcessor<Rgba32>>(), ColorBlindnessMode.Protanopia }, |
|||
new object[]{ new TestType<TritanomalyProcessor<Rgba32>>(), ColorBlindnessMode.Tritanomaly }, |
|||
new object[]{ new TestType<TritanopiaProcessor<Rgba32>>(), ColorBlindnessMode.Tritanopia } |
|||
}; |
|||
|
|||
[Theory] |
|||
[MemberData(nameof(TheoryData))] |
|||
public void ColorBlindness_CorrectProcessor<T>(TestType<T> testType, ColorBlindnessMode colorBlindness) |
|||
where T : IImageProcessor<Rgba32> |
|||
{ |
|||
this.operations.ColorBlindness(colorBlindness); |
|||
T p = this.Verify<T>(); |
|||
} |
|||
[Theory] |
|||
[MemberData(nameof(TheoryData))] |
|||
public void ColorBlindness_rect_CorrectProcessor<T>(TestType<T> testType, ColorBlindnessMode colorBlindness) |
|||
where T : IImageProcessor<Rgba32> |
|||
{ |
|||
this.operations.ColorBlindness(colorBlindness, this.rect); |
|||
T p = this.Verify<T>(this.rect); |
|||
} |
|||
} |
|||
} |
|||
@ -1,33 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing.Processors; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Effects |
|||
{ |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
|
|||
public class ContrastTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Contrast_amount_ContrastProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Contrast(1.5F); |
|||
ContrastProcessor<Rgba32> processor = this.Verify<ContrastProcessor<Rgba32>>(); |
|||
|
|||
Assert.Equal(1.5F, processor.Amount); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Contrast_amount_rect_ContrastProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Contrast(1.5F, this.rect); |
|||
ContrastProcessor<Rgba32> processor = this.Verify<ContrastProcessor<Rgba32>>(this.rect); |
|||
|
|||
Assert.Equal(1.5F, processor.Amount); |
|||
} |
|||
} |
|||
} |
|||
@ -1,47 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using SixLabors.ImageSharp.Processing.Processors; |
|||
using SixLabors.ImageSharp.Tests.TestUtilities; |
|||
|
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Filters |
|||
{ |
|||
public class GrayscaleTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
public static IEnumerable<object[]> ModeTheoryData = new[] { |
|||
new object[]{ new TestType<GrayscaleBt709Processor<Rgba32>>(), GrayscaleMode.Bt709 } |
|||
}; |
|||
|
|||
[Theory] |
|||
[MemberData(nameof(ModeTheoryData))] |
|||
public void Grayscale_mode_CorrectProcessor<T>(TestType<T> testType, GrayscaleMode mode) |
|||
where T : IImageProcessor<Rgba32> |
|||
{ |
|||
this.operations.Grayscale(mode); |
|||
var p = this.Verify<T>(); |
|||
} |
|||
|
|||
[Theory] |
|||
[MemberData(nameof(ModeTheoryData))] |
|||
public void Grayscale_mode_rect_CorrectProcessor<T>(TestType<T> testType, GrayscaleMode mode) |
|||
where T : IImageProcessor<Rgba32> |
|||
{ |
|||
this.operations.Grayscale(mode, this.rect); |
|||
this.Verify<T>(this.rect); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Grayscale_rect_CorrectProcessor() |
|||
{ |
|||
this.operations.Grayscale(this.rect); |
|||
this.Verify<GrayscaleBt709Processor<Rgba32>>(this.rect); |
|||
} |
|||
} |
|||
} |
|||
@ -1,32 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
|
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Filters |
|||
{ |
|||
public class HueTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Hue_amount_HueProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Hue(34f); |
|||
var processor = this.Verify<HueProcessor<Rgba32>>(); |
|||
|
|||
Assert.Equal(34f, processor.Degrees); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Hue_amount_rect_HueProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Hue(5f, this.rect); |
|||
var processor = this.Verify<HueProcessor<Rgba32>>(this.rect); |
|||
|
|||
Assert.Equal(5f, processor.Degrees); |
|||
} |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Effects |
|||
{ |
|||
public class InvertTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Invert_InvertProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Invert(); |
|||
var processor = this.Verify<InvertProcessor<Rgba32>>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Pixelate_rect_PixelateProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Invert(this.rect); |
|||
var processor = this.Verify<InvertProcessor<Rgba32>>(this.rect); |
|||
} |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Filters |
|||
{ |
|||
public class KodachromeTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Kodachrome_amount_KodachromeProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Kodachrome(); |
|||
var processor = this.Verify<KodachromeProcessor<Rgba32>>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Kodachrome_amount_rect_KodachromeProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Kodachrome(this.rect); |
|||
var processor = this.Verify<KodachromeProcessor<Rgba32>>(this.rect); |
|||
} |
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System.IO; |
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing.Processors; |
|||
using SixLabors.Primitives; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests |
|||
{ |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
|
|||
public class LomographTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Lomograph_amount_LomographProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Lomograph(); |
|||
var processor = this.Verify<LomographProcessor<Rgba32>>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Lomograph_amount_rect_LomographProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Lomograph(this.rect); |
|||
var processor = this.Verify<LomographProcessor<Rgba32>>(this.rect); |
|||
} |
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Effects |
|||
{ |
|||
public class OpacityTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Alpha_amount_AlphaProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Opacity(0.2f); |
|||
OpacityProcessor<Rgba32> processor = this.Verify<OpacityProcessor<Rgba32>>(); |
|||
|
|||
Assert.Equal(.2f, processor.Amount); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Alpha_amount_rect_AlphaProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Opacity(0.6f, this.rect); |
|||
OpacityProcessor<Rgba32> processor = this.Verify<OpacityProcessor<Rgba32>>(this.rect); |
|||
|
|||
Assert.Equal(.6f, processor.Amount); |
|||
} |
|||
} |
|||
} |
|||
@ -1,28 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
|
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Filters |
|||
{ |
|||
public class PolaroidTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Polaroid_amount_PolaroidProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Polaroid(); |
|||
var processor = this.Verify<PolaroidProcessor<Rgba32>>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Polaroid_amount_rect_PolaroidProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Polaroid(this.rect); |
|||
var processor = this.Verify<PolaroidProcessor<Rgba32>>(this.rect); |
|||
} |
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Filters |
|||
{ |
|||
public class SaturateTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Saturation_amount_SaturationProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Saturate(34); |
|||
SaturateProcessor<Rgba32> processor = this.Verify<SaturateProcessor<Rgba32>>(); |
|||
|
|||
Assert.Equal(34, processor.Amount); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Saturation_amount_rect_SaturationProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Saturate(5, this.rect); |
|||
SaturateProcessor<Rgba32> processor = this.Verify<SaturateProcessor<Rgba32>>(this.rect); |
|||
|
|||
Assert.Equal(5, processor.Amount); |
|||
} |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.ImageSharp.Processing; |
|||
using SixLabors.ImageSharp.Processing.Processors.Filters; |
|||
using Xunit; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Processing.Filters |
|||
{ |
|||
public class SepiaTest : BaseImageOperationsExtensionTest |
|||
{ |
|||
[Fact] |
|||
public void Sepia_amount_SepiaProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Sepia(); |
|||
var processor = this.Verify<SepiaProcessor<Rgba32>>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Sepia_amount_rect_SepiaProcessorDefaultsSet() |
|||
{ |
|||
this.operations.Sepia(this.rect); |
|||
var processor = this.Verify<SepiaProcessor<Rgba32>>(this.rect); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue