public void MultiplyFunction_Blender_Bulk <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            BufferSpan <TPixel> dest = new BufferSpan <TPixel>(new TPixel[1]);

            new DefaultMultiplyPixelBlender <TPixel>().Blend(dest, back.AsSpan(), source.AsSpan(), AsSpan(amount));
            VectorAssert.Equal(expected, dest[0], 2);
        }
Ejemplo n.º 2
0
        public void HardLightFunction_Blender_Bulk <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            Span <TPixel> dest = new Span <TPixel>(new TPixel[1]);

            new DefaultPixelBlenders <TPixel> .HardLight().Blend(dest, back.AsSpan(), source.AsSpan(), AsSpan(amount));

            VectorAssert.Equal(expected, dest[0], 2);
        }
        public void MultiplyFunctionBlenderBulk <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            var dest = new Span <TPixel>(new TPixel[1]);

            new DefaultPixelBlenders <TPixel> .MultiplySrcOver().Blend(this.Configuration, dest, back.AsSpan(), source.AsSpan(), AsSpan(amount));

            VectorAssert.Equal(expected.AsPixel(), dest[0], 2);
        }
        public void NormalBlendFunctionBlenderBulk <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            var dest = new Span <TPixel>(new TPixel[1]);

            new DefaultPixelBlenders <TPixel> .NormalSrcOver().Blend(this.MemoryAllocator, dest, back.AsSpan(), source.AsSpan(), AsSpan(amount));

            VectorAssert.Equal(expected, dest[0], 2);
        }
        public void OverlayFunction_Blender_Bulk <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            Span <TPixel> dest = new Span <TPixel>(new TPixel[1]);

            new DefaultPixelBlenders <TPixel> .Overlay().Blend(this.MemoryManager, dest, back.AsSpan(), source.AsSpan(), AsSpan(amount));

            VectorAssert.Equal(expected, dest[0], 2);
        }