#include <psychlops.h>
using namespace Psychlops;

Psychlops::Point p1;
Psychlops::Color col1;
double width=200;
double height=100;
double lambda=60;
double lmean=0.5, contrast=1.0, theta=0;

void psychlops_main() {

	Canvas sampleA(Canvas::fullscreen);
	for(int i=0;i<width;i++){
		for(int j=0;j<height;j++){
			col1.set(lmean*((contrast*sin((2*PI*i/lambda)+theta))+1));
			p1.centering().shift((double)-1/2*width+i,(double)-1/2*height+j);
			sampleA.pix(p1,col1);
		}
	}
	sampleA.flip();
	while(!Input::get(Keyboard::spc));
}