Exemplo n.º 1
0
        public unsafe void CopyColorsTo()
        {
            var       data  = Create8x8FloatData();
            Block8x8F block = new Block8x8F();

            block.LoadFrom(data);
            block.MultiplyAllInplace(new Vector4(5, 5, 5, 5));

            int stride = 256;
            int height = 42;
            int offset = height * 10 + 20;

            byte[] colorsExpected = new byte[stride * height];
            byte[] colorsActual   = new byte[stride * height];

            Block8x8F temp = new Block8x8F();

            ReferenceImplementations.CopyColorsTo(ref block, new MutableSpan <byte>(colorsExpected, offset), stride);

            block.CopyColorsTo(new MutableSpan <byte>(colorsActual, offset), stride, &temp);

            // Output.WriteLine("******* EXPECTED: *********");
            // PrintLinearData(colorsExpected);
            // Output.WriteLine("******** ACTUAL: **********");
            Assert.Equal(colorsExpected, colorsActual);
        }