#include <psychlops.h>
using namespace Psychlops;

Psychlops::Rectangle rect1,rect2;
Psychlops::Color col1,col2;
double width=200;
double height=100;
double lambda=60;
double lmean=0.5, contrast=1.0, theta1=0, theta2=90;

void psychlops_main() {

	Canvas sampleA(Canvas::fullscreen);
	rect1.set(1,height);
	rect2.set(rect1);
	for(int i=0;i<width;i++){
		//位相=0の縞
		col1.set(lmean*((contrast*sin((2*PI*i/lambda)+theta1))+1));
		rect1.centering().shift((double)-1/2*width+i,0);
		rect1.draw(col1);
		//位相=90の縞
		col2.set(lmean*((contrast*sin((2*PI*i/lambda)+theta2))+1));
		rect2.centering().shift((double)-1/2*width+i,150);
		rect2.draw(col2);
	}
	sampleA.flip();
	while(!Input::get(Keyboard::spc));
} 