Accord.Tests.Imaging.MatrixToImageTest.ConvertTest C# (CSharp) Method

ConvertTest() private method

private ConvertTest ( ) : void
return void
        public void ConvertTest()
        {
            MatrixToImage target = new MatrixToImage(min: 0, max: 128);

            byte[,] input = 
            {
                {   0,   0,   0 },
                {   0, 128,   0 },
                {   0,   0, 128 },
            };

            UnmanagedImage bitmap;

            target.Convert(input, out bitmap);

            var pixels = bitmap.CollectActivePixels();

            Assert.AreEqual(2, pixels.Count);
            Assert.IsTrue(pixels.Contains(new IntPoint(1, 1)));
            Assert.IsTrue(pixels.Contains(new IntPoint(2, 2)));
        }