1
0

MandelUtil.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef MANDEL_MANDELUTIL_H
  2. #define MANDEL_MANDELUTIL_H
  3. namespace mnd
  4. {
  5. struct MandelViewport;
  6. struct MandelInfo;
  7. }
  8. struct mnd::MandelViewport
  9. {
  10. /// real part of the top left corner
  11. double x = -2.1;
  12. /// imaginary part of the top left corner
  13. double y = -1.5;
  14. /// real-part span of the picture to be generated
  15. double width = 3;
  16. /// imaginary-part span of the picture to be generated
  17. double height = 3;
  18. /*!
  19. * \brief adjusts the aspect ratio of the viewport, making sure
  20. * the updated viewport contains all of the original one.
  21. */
  22. void adjustAspectRatio(double nwidth, double nheight);
  23. /*!
  24. * \brief make sure width and height are positive
  25. */
  26. void normalize(void);
  27. };
  28. struct mnd::MandelInfo
  29. {
  30. /// viewport
  31. MandelViewport view;
  32. /// width of the bitmap to be generated
  33. long bWidth;
  34. /// height of the bitmap to be generated
  35. long bHeight;
  36. /// maximum iterations
  37. int maxIter;
  38. };
  39. #endif // MANDEL_MANDELUTIL_H