public void MatOfUShortFromArray() { var array = new ushort[] { 7, 8, 9 }; var m = MatOfUShort.FromArray(array); for (int i = 0; i < array.Length; i++) { Assert.That(m.Get <ushort>(i), Is.EqualTo(array[i])); } }
public void MatOfUShortFromArray() { var array = new ushort[] { 7, 8, 9 }; var m = MatOfUShort.FromArray(array); var indexer = m.GetIndexer(); for (int i = 0; i < array.Length; i++) { Assert.Equal(array[i], m.Get <ushort>(i)); Assert.Equal(array[i], indexer[i]); } }
public void MatOfUShortFromRectangularArray() { var array = new ushort[, ] { { 1, 2 }, { 3, 4 } }; var m = MatOfUShort.FromArray(array); var indexer = m.GetIndexer(); for (int i = 0; i < array.GetLength(0); i++) { for (int j = 0; j < array.GetLength(1); j++) { Assert.Equal(array[i, j], m.Get <ushort>(i, j)); Assert.Equal(array[i, j], indexer[i, j]); } } }