public void RenderVideo(FractalImageConfig fractalImageConfig, FractalVideoConfig fractalVideoConfig)
        {
            Directory.CreateDirectory(IMAGE_OUT_DIR);

            LoopFrames(_fractal, fractalImageConfig, fractalVideoConfig);

            FfmpegRenderVideo();

            //Directory.Delete(IMAGE_OUT_DIR, true);
        }
        private void RenderSingleFrame(IFractal fractal, FractalImageConfig fractalImageConfig)
        {
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            fractal.InitFrame(fractalImageConfig.Width, fractalImageConfig.Height, fractalImageConfig.MaxItr);
            fractal.RenderFrame(fractalImageConfig.MinRe, fractalImageConfig.MaxRe, fractalImageConfig.MinIm);
            fractal.SaveFrame(fractalImageConfig.Name);

            stopWatch.Stop();
            _logger.LogInformation($"Frame generation took {stopWatch.ElapsedMilliseconds / 1000} sec ({stopWatch.ElapsedMilliseconds} ms)");
        }
        private void LoopFrames(IFractal fractal, FractalImageConfig fractalImageConfig, FractalVideoConfig fractalVideoConfig)
        {
            var myFractalImageConfig = fractalImageConfig.Clone() as FractalImageConfig;

            var nameSplit = fractalImageConfig.Name.Split('.');
            var prefix    = nameSplit[0];
            var ext       = nameSplit[1];

            for (int frame = 0; frame < fractalVideoConfig.Frames; frame++)
            {
                myFractalImageConfig.Name = $"{prefix}_{frame}.{ext}";

                RenderSingleFrame(fractal, myFractalImageConfig);

                //myFractalImageConfig.MinRe += fractalVideoConfig.ResChange;
                //myFractalImageConfig.MaxRe -= fractalVideoConfig.ResChange;
                //myFractalImageConfig.MinIm += fractalVideoConfig.ResChange;
                myFractalImageConfig.MaxItr += 1;
            }
        }
 public void RenderImage(FractalImageConfig fractalImageConfig)
 {
     RenderSingleFrame(_fractal, fractalImageConfig);
 }