MRaster examples 21.0.0.0
Image Processing Library
|
This program draws a mandelbrot set using the "distance". More...
Go to the source code of this file.
This program draws a mandelbrot set using the "distance".
Copyright (c) 1988-2022, Mitchell Jay Richling https://www.mitchr.me All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The normal Mandelbrot raster scan iteration fails to illustrate the thin filaments projecting off the Mandelbrot set – because the complex number at the center of the pixel misses the set, and thus the entire rectangular region of the complex plane covered by the pixel is marked as "escaped". In order to provide some graphical representation of these filaments, we can use a the Milnor and Thurston distance estimator as presented in 'The Science of Fractal Images' to draw pixels that have a center "close" to the Mandelbrot set. This program uses a simple color scheme to label points as described in the comment for the pixelStateEnum enumeration. All of the drawing code is confined to a switch statement at the end of the x loop to make it easy to play around with various color schemes.
Reference: Peitgen, Heinz-Otto and Saupe, Dietmar; 1988; The Science of Fractal Images; ISBN: 0-387-96608-0; pp 192-196
Definition in file mandelbrot_distance.cpp.