OSDN Git Service

hk
[psychlops/cpp_document.git] / Psychlops.manual / sample_cpp_file / 2�� / 2.2.7_�Ȃ̕`��(point)1.cpp
1 #include <psychlops.h>\r
2 using namespace Psychlops;\r
3 \r
4 Psychlops::Point p1;\r
5 Psychlops::Color col1;\r
6 double width=200;\r
7 double height=100;\r
8 double lambda=60;\r
9 double lmean=0.5, contrast=1.0, theta=0;\r
10 \r
11 void psychlops_main() {\r
12 \r
13         Canvas sampleA(Canvas::fullscreen);\r
14         for(int i=0;i<width;i++){\r
15                 for(int j=0;j<height;j++){\r
16                         col1.set(lmean*((contrast*sin((2*PI*i/lambda)+theta))+1));\r
17                         p1.centering().shift((double)-1/2*width+i,(double)-1/2*height+j);\r
18                         sampleA.pix(p1,col1);\r
19                 }\r
20         }\r
21         sampleA.flip();\r
22         while(!Input::get(Keyboard::spc));\r
23 }