private void GenerateDecLevelsAndFragments(Bitmap image,
                                                   out LevelImage origLevelImage, out LevelImage[] decLevelImages)
        {
            decLevelImages = new LevelImage[DecLevelsCount];

            origLevelImage = new LevelImage(image, Blur, BlurKernelSize, BlurSigma);
            double blockIncX = BlockIncRatioX * BlockWidth;

            if (blockIncX < 1)
            {
                blockIncX = 1;
            }
            double blockIncY = BlockIncRatioY * BlockHeight;

            if (blockIncY < 1)
            {
                blockIncY = 1;
            }
            origLevelImage.PrepareFragments(Blur, blockIncX, blockIncY, BlockWidth, BlockHeight);

            double decBlockIncX = DecBlockIncXRatio * BlockWidth;

            if (decBlockIncX < 1)
            {
                decBlockIncX = 1;
            }
            double decBlockIncY = DecBlockIncYRatio * BlockHeight;

            if (decBlockIncY < 1)
            {
                decBlockIncY = 1;
            }

            for (int i = 0; i < DecLevelsCount; i++)
            {
                double coef      = 1 / (Math.Pow(DecZoomCoef, (i + 1)));
                int    newWidth  = (int)Math.Round(image.Width * coef);
                int    newHeight = (int)Math.Round(image.Height * coef);
                image             = Utils.ChangeSize(image, newWidth, newHeight);
                decLevelImages[i] = new LevelImage(image, Blur, BlurKernelSize, BlurSigma);
                decLevelImages[i].PrepareFragments(Blur, decBlockIncX, decBlockIncY, BlockWidth, BlockHeight);
            }
        }
        private void GenerateLevelsAndFragments(out LevelImage origLevelImage, out LevelImage[] decLevelImages, out LevelImage[] incLevelImages)
        {
            decLevelImages = new LevelImage[DecLevelsCount];
            incLevelImages = new LevelImage[IncLevelsCount];
            origLevelImage = new LevelImage(_inputBitmap);

            for (int i = 0; i < DecLevelsCount; i++)
            {
                double coef = 1 / (Math.Pow(DecZoomCoef, (i + 1)));
                int newWidth = (int)Math.Round(_inputBitmap.Width * coef);
                int newHeight = (int)Math.Round(_inputBitmap.Height * coef);
                decLevelImages[i] = new LevelImage(_inputBitmap, newWidth, newHeight);
                decLevelImages[i].PrepareFragments(DecBlockIncX, DecBlockIncY, BlockWidth, BlockHeight);
            }

            for (int i = 0; i < IncLevelsCount; i++)
            {
                double coef = ZoomCoef * (i + 1) / IncLevelsCount;
                int newWidth = (int)Math.Round(_inputBitmap.Width * coef);
                int newHeight = (int)Math.Round(_inputBitmap.Height * coef);
                incLevelImages[i] = new LevelImage(_inputBitmap, newWidth, newHeight);
            }

            origLevelImage.PrepareFragments(BlockWidth, BlockHeight, BlockWidth, BlockHeight);
        }