public void MultiplyFunction <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            TPixel actual = PorterDuffFunctions <TPixel> .MultiplyFunction(back, source, amount);

            VectorAssert.Equal(expected, actual, 2);
        }
        public void MultiplyFunctionBlender <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            TPixel actual = new DefaultPixelBlenders <TPixel> .MultiplySrcOver().Blend(back.AsPixel(), source.AsPixel(), amount);

            VectorAssert.Equal(expected.AsPixel(), actual, 2);
        }
        public void LightenFunction <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            TPixel actual = PorterDuffFunctions.LightenSrcOver((TPixel)back, source, amount);

            VectorAssert.Equal(expected, actual, 2);
        }
        public void HardLightFunctionBlender <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            TPixel actual = new DefaultPixelBlenders <TPixel> .HardLightSrcOver().Blend(back, source, amount);

            VectorAssert.Equal(expected, actual, 2);
        }
Ejemplo n.º 5
0
        public void MultiplyFunction <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : unmanaged, IPixel <TPixel>
        {
            TPixel actual = PorterDuffFunctions.MultiplySrcOver(back.AsPixel(), source.AsPixel(), amount);

            VectorAssert.Equal(expected.AsPixel(), actual, 2);
        }
Ejemplo n.º 6
0
        public void NormalBlendFunctionBlender <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : unmanaged, IPixel <TPixel>
        {
            TPixel actual = new DefaultPixelBlenders <TPixel> .NormalSrcOver().Blend(back.AsPixel(), source.AsPixel(), amount);

            VectorAssert.Equal(expected.AsPixel(), actual, 2);
        }
        public void MultiplyFunction_Blender <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            TPixel actual = new DefaultMultiplyPixelBlender <TPixel>().Blend(back, source, amount);

            VectorAssert.Equal(expected, actual, 2);
        }
        public void HardLightFunction <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            TPixel actual = PorterDuffFunctions.HardLightSrcOver(back.AsPixel(), source.AsPixel(), amount);

            VectorAssert.Equal(expected.AsPixel(), actual, 2);
        }
Ejemplo n.º 9
0
        public void NormalBlendFunction <TPixel>(TestPixel <TPixel> back, TestPixel <TPixel> source, float amount, TestPixel <TPixel> expected)
            where TPixel : struct, IPixel <TPixel>
        {
            TPixel actual = PorterDuffFunctions.Normal((TPixel)(TPixel)back, source, amount);

            VectorAssert.Equal(expected, actual, 2);
        }
        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);
        }
        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);
        }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
0
        public void HardLightFunction(TestVector4 back, TestVector4 source, float amount, TestVector4 expected)
        {
            Vector4 actual = PorterDuffFunctions.HardLightFunction(back, source, amount);

            VectorAssert.Equal(expected, actual, 5);
        }
Ejemplo n.º 16
0
        public void AddFunction(TestVector4 back, TestVector4 source, float amount, TestVector4 expected)
        {
            Vector4 actual = PorterDuffFunctions.Multiply((Vector4)back, source, amount);

            VectorAssert.Equal(expected, actual, 5);
        }
Ejemplo n.º 17
0
        public void SubstractFunction(TestVector4 back, TestVector4 source, float amount, TestVector4 expected)
        {
            Vector4 actual = PorterDuffFunctions.Subtract((Vector4)back, source, amount);

            VectorAssert.Equal(expected, actual, 5);
        }
Ejemplo n.º 18
0
        public void ScreenFunction(TestVector4 back, TestVector4 source, float amount, TestVector4 expected)
        {
            Vector4 actual = PorterDuffFunctions.ScreenSrcOver((Vector4)back, source, amount);

            VectorAssert.Equal(expected, actual, 5);
        }