public unsafe void Can_Revert_Normalization()
        {
            int[] revertedNormalizationArray = new int[] { 4, 20, 200, 100, 10 };
            int   min = revertedNormalizationArray.Min();
            int   max = revertedNormalizationArray.Max();


            fixed(int *pointerToArray = &revertedNormalizationArray[0])
            {
                BitmapAdditionDllManager.Normalize(pointerToArray, revertedNormalizationArray.Length, min, max);
                BitmapAdditionDllManager.RevertNormalization(pointerToArray, revertedNormalizationArray.Length, min, max);
            }

            int[] originalArray = new int[] { 4, 20, 200, 100, 10 };

            Assert.IsTrue(Math.Abs(originalArray[0] - revertedNormalizationArray[0]) <= 1);
            Assert.IsTrue(Math.Abs(originalArray[1] - revertedNormalizationArray[1]) <= 1);
            Assert.IsTrue(Math.Abs(originalArray[2] - revertedNormalizationArray[2]) <= 1);
            Assert.IsTrue(Math.Abs(originalArray[3] - revertedNormalizationArray[3]) <= 1);
            Assert.IsTrue(Math.Abs(originalArray[4] - revertedNormalizationArray[4]) <= 1);
        }
        public unsafe void Can_Normalize()
        {
            int[] arrayForNormalization = new int[] { 4, 20, 200, 100, 10 };
            int   min = arrayForNormalization.Min();
            int   max = arrayForNormalization.Max();

            fixed(int *pointerToArray = &arrayForNormalization[0])
            {
                BitmapAdditionDllManager.Normalize(pointerToArray, arrayForNormalization.Length, min, max);
            }

            int[] expectedArray = new int[] { 4, 20, 200, 100, 10 };
            for (int i = 0; i < expectedArray.Length; i++)
            {
                expectedArray[i] = (expectedArray[i] - min) * 255 / (max - min);
            }

            Assert.IsTrue(Math.Abs(expectedArray[0] - arrayForNormalization[0]) <= 1);
            Assert.IsTrue(Math.Abs(expectedArray[1] - arrayForNormalization[1]) <= 1);
            Assert.IsTrue(Math.Abs(expectedArray[2] - arrayForNormalization[2]) <= 1);
            Assert.IsTrue(Math.Abs(expectedArray[3] - arrayForNormalization[3]) <= 1);
            Assert.IsTrue(Math.Abs(expectedArray[4] - arrayForNormalization[4]) <= 1);
        }