Browse Source

no png for mac atm, tabs <> spaces, other defines for testing

master
Joshua Moerman 15 years ago
parent
commit
dcd8229010
  1. 14
      Canvas.cpp
  2. 2
      Projector.cpp
  3. 6
      defines.hpp

14
Canvas.cpp

@ -3,10 +3,10 @@
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <cstdint>
//#include <cstdint>
using namespace std;
#include "pngwriter/pngwriter.h"
//#include "pngwriter/pngwriter.h"
#include "Canvas.hpp"
@ -148,9 +148,9 @@ void Canvas::output_file(const char * filename){
power[i] = vibrancy*power[i] + (1.0 - vibrancy)*averagePower;
}
pngwriter * pngFile = new pngwriter(width, height, 0.0, filename);
pngFile->setcompressionlevel(9);
pngFile->settext("Attractor", "Joshua Moerman", "A awesome attractor", "AwesomeAttractor");
//pngwriter * pngFile = new pngwriter(width, height, 0.0, filename);
//pngFile->setcompressionlevel(9);
//pngFile->settext("Attractor", "Joshua Moerman", "A awesome attractor", "AwesomeAttractor");
for ( unsigned int x = 0; x < width; x++ ) {
for ( unsigned int y = 0; y < height; y++ ) {
@ -177,7 +177,7 @@ void Canvas::output_file(const char * filename){
}
}
//pngwriter clips values for me
pngFile->plot(x, y, r, g, b);
//pngFile->plot(x, y, r, g, b);
}
}
@ -194,7 +194,7 @@ void Canvas::output_file(const char * filename){
cout << filename << endl;
pngFile->close();
//pngFile->close();
}

2
Projector.cpp

@ -93,7 +93,7 @@ void Projector::plot(const double * point) {
//cout << x << ", " << y << endl;
canvas->plot(x+0.01*rand()/(double)RAND_MAX-0.005, y+0.01*rand()/(double)RAND_MAX-0.005);
canvas->plot(x, y);
if ( even(point[2]*17) )
canvas->plot(x, y, 1);
if ( even(point[2]*17+0.6) )

6
defines.hpp

@ -1,15 +1,15 @@
//TODO: do this with files
#define ATTRACTOR_FILE "attractors/testPolynomial.stf"
#define ATTRACTOR_FILE "attractors/testLorenz.stf"
#ifdef UNI_BUILD
#warning Building for the RU, are you sure?
#define WIDTH 8000
#define HEIGHT 8000
#define ITERATIONS 800000000
#define ITERATIONS 4200000000
#else
#define WIDTH 800
#define HEIGHT 800
#define ITERATIONS 200000
#define ITERATIONS 20000000
#endif