QueueManager.cpp 751 B

123456789101112131415161718192021222324252627282930
  1. #include "QueueManager.h"
  2. void MandelViewport::adjustAspectRatio(double nwidth, double nheight)
  3. {
  4. double otherRatio = nwidth / nheight;
  5. if (width < height * otherRatio)
  6. width = height * otherRatio;
  7. else if (height < width / otherRatio)
  8. height = width / otherRatio;
  9. }
  10. MandelGenerator::~MandelGenerator(void)
  11. {
  12. }
  13. Bitmap<RGBColor> MandelGenerator::generate(const MandelInfo& mandelInfo)
  14. {
  15. auto converter = [](float i) { return i < 0 ? RGBColor{ 0,0,0 } : RGBColor{ uint8_t(cos(i * 0.15f) * 127 + 127), uint8_t(sin(i * 0.01f) * 127 + 127), uint8_t(sin(i * 0.04f) * 127 + 127) }; };
  16. return generateRaw(mandelInfo).map<RGBColor>(converter);
  17. }
  18. QueueManager::QueueManager()
  19. {
  20. }
  21. QueueManager::~QueueManager()
  22. {
  23. }