You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.1 KiB
53 lines
1.1 KiB
//
|
|
// main.cpp
|
|
// AwesomeAttractorND
|
|
//
|
|
// Created by Joshua Moerman on 10/24/11.
|
|
// Copyright 2011 Vadovas. All rights reserved.
|
|
//
|
|
|
|
#include <iostream>
|
|
|
|
#include "Logging.hpp"
|
|
|
|
#include "Canvas.hpp"
|
|
#include "Tonemapper.hpp"
|
|
#include "Image.hpp"
|
|
|
|
typedef Canvas2D Canvas;
|
|
|
|
void fill(Canvas & canvas);
|
|
void fill(Canvas & canvas){
|
|
const unsigned int it = 100000000;
|
|
|
|
for (unsigned int i = 0; i < it; ++i){
|
|
double x = 2.0 * (rand() / (double) RAND_MAX - 0.5);
|
|
double y = 2.0 * (rand() / (double) RAND_MAX - 0.5);
|
|
double position[2] = {x*x*2.0 - 1.0, y};
|
|
canvas.plot(position);
|
|
}
|
|
}
|
|
|
|
void output(Canvas const & canvas);
|
|
void output(Canvas const & canvas){
|
|
Tonemappers::GammaCorrector tonemapper;
|
|
tonemapper.analyse(canvas);
|
|
|
|
ImageFormats::bmp::bitmap_stream<> image(canvas.size<0>(), canvas.size<1>(), "test.bmp");
|
|
tonemapper.process(canvas, image);
|
|
}
|
|
|
|
int main (int, const char * []){
|
|
Logger l(std::cout);
|
|
l.start("all");
|
|
|
|
l.log("creating canvas");
|
|
Canvas canvas(2048, 2048);
|
|
l.log("filling canvas");
|
|
fill(canvas);
|
|
l.log("outputting canvas");
|
|
output(canvas);
|
|
|
|
l.stop();
|
|
return 0;
|
|
}
|
|
|