Exemple #1
0
        public void ApplyQuantization <TPixel>(TestImageProvider <TPixel> provider, IQuantizer quantizer)
            where TPixel : unmanaged, IPixel <TPixel>
        {
            if (SkipAllQuantizerTests)
            {
                return;
            }

            string quantizerName     = quantizer.GetType().Name;
            string ditherName        = quantizer.Options.Dither?.GetType()?.Name ?? "NoDither";
            string testOutputDetails = $"{quantizerName}_{ditherName}";

            provider.RunValidatingProcessorTest(
                x => x.Quantize(quantizer),
                comparer: ValidatorComparer,
                testOutputDetails: testOutputDetails,
                appendPixelTypeToFileName: false);
        }
Exemple #2
0
        public void ApplyQuantizationWithDitheringScale <TPixel>(TestImageProvider <TPixel> provider, IQuantizer quantizer)
            where TPixel : unmanaged, IPixel <TPixel>
        {
            if (SkipAllQuantizerTests)
            {
                return;
            }

            string quantizerName     = quantizer.GetType().Name;
            string ditherName        = quantizer.Options.Dither.GetType().Name;
            float  ditherScale       = quantizer.Options.DitherScale;
            string testOutputDetails = FormattableString.Invariant($"{quantizerName}_{ditherName}_{ditherScale}");

            provider.RunValidatingProcessorTest(
                x => x.Quantize(quantizer),
                comparer: ValidatorComparer,
                testOutputDetails: testOutputDetails,
                appendPixelTypeToFileName: false);
        }