Beispiel #1
0
        /// <summary>Renders a RenderedFractal to the Image.</summary>
        public RenderedColoredFractal RenderFractal(RenderedFractal fractal)
        {
            if (Colorizer == null)
            {
                throw new InvalidOperationException("A Colorizer must be set to render a fractal.");
            }

            var imageConvertedFractal = fractal.RawData.SelectMany(x =>
            {
                var color = Colorizer.GetColor(x, x == fractal.MaxIterations);
                return(new byte[] { color.R, color.G, color.B });
            }).ToArray();

            return(new RenderedColoredFractal(fractal, imageConvertedFractal)
            {
                ImageProvider = this
            });
        }
Beispiel #2
0
 public RenderedFractal Render(RenderedFractal renderedFractal)
 {
     LastRenderedBounds  = renderedFractal.Bounds;
     LastRenderedFractal = renderedFractal.Fractal;
     return(renderedFractal);
 }
 public RenderedFractal Render(RenderedFractal renderedFractal)
 {
     LastRenderedBounds = renderedFractal.Bounds;
     LastRenderedFractal = renderedFractal.Fractal;
     return renderedFractal;
 }
        /// <summary>Renders a RenderedFractal to the Image.</summary>
        public RenderedColoredFractal RenderFractal(RenderedFractal fractal)
        {
            if (Colorizer == null)
                throw new InvalidOperationException("A Colorizer must be set to render a fractal.");

            var imageConvertedFractal = fractal.RawData.SelectMany(x =>
                {
                    var color = Colorizer.GetColor(x, x == fractal.MaxIterations);
                    return new byte[] { color.R, color.G, color.B };
                }).ToArray();
            return new RenderedColoredFractal(fractal, imageConvertedFractal) { ImageProvider = this };
        }