Paul Heidmann Fractal Example  1.0
mkFractal.cpp
Go to the documentation of this file.
1 // Copyright (C) 2014 Paul S. Heidmann
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // For a copy of the GNU General Public License see
14 // <http://www.gnu.org/licenses/>.
15 //
16 // Author contact info:
17 // Paul Heidmann
18 // paul@heidmann.com
19 
20 #include <tuple>
21 #include <memory>
22 #include <vector>
23 #include <cstdint>
24 #include <complex>
25 #include <iostream>
26 #include <stdexcept>
27 #include <pngFactory.hpp>
28 #include <newtonsMethod.hpp>
29 #include <fractalParams.hpp>
31 
32 #define FRACTAL_TWO
33 
34 #ifdef FRACTAL_ONE
35 #include <fractalOne.hpp>
36 #endif
37 
38 #ifdef FRACTAL_TWO
39 #include <fractalTwo.hpp>
40 #endif
41 
42 /// \brief This is the main (top level) method for the mkFractal program.
43 ///
44 /// This program generates fractals, using Newton's method in the complex
45 /// plane. The colors indicate which zero of the generating function the
46 /// given point in the complex plane (as an initial guess for Newton's
47 /// method) converged to. The shading is derived from the number of
48 /// iterations required to reach the zero.
49 /// \author Paul S. Heidmann
50 int main( void )
51 {
52  const std::shared_ptr<png::pngFactory> pngFact{
53  std::make_shared<png::pngFactory>(
54  2000,
55  2000,
56  "fractal.png" ) };
57 
58  const std::shared_ptr<fractal::fractalParams<double>> fParams{
59 #ifdef FRACTAL_ONE
61 #endif
62 #ifdef FRACTAL_TWO
64 #endif
65  };
66 
68  fParams,
69  pngFact };
70 
71  fEng.doFractal();
72 
73  return( 0 );
74 }
void doFractal(void)
This method is called to compute the given fractal.
This class splits the work of computing a given fractal amoung several threads.
int main(void)
This is the main (top level) method for the mkFractal program.
Definition: mkFractal.cpp:50
std::shared_ptr< fractalParamsType > getFractalParams(void)
Definition: fractalOne.cpp:78
std::shared_ptr< fractalParamsType > getFractalParams(void)
Definition: fractalTwo.cpp:75