OSDN Git Service

hk
[psychlops/cpp_document.git] / Psychlops.manual / sample_cpp_file / 3�� / 3.3.1_�摜�t�@�C���̕ۑ�1.cpp
1 #include <psychlops.h>\r
2 using namespace Psychlops;\r
3 \r
4 double width=100,height=100;\r
5 double temp1;\r
6 double centerX=700,centerY=500;\r
7 Psychlops::Rectangle rect1(width,height);\r
8 Psychlops::Color col;\r
9 Psychlops::Image Noise1;\r
10 \r
11 void psychlops_main() {\r
12 \r
13         Canvas sampleA(Canvas::fullscreen);\r
14         rect1.shift(centerX,centerY);\r
15         for(int x=0; x<width; x++){\r
16                 for(int y=0; y<height; y++){\r
17                         temp1=Psychlops::random();\r
18                         col.set(temp1);\r
19                         sampleA.pix(x+centerX,y+centerY,col);\r
20                 }\r
21         }\r
22         sampleA.to(Noise1,rect1);\r
23         sampleA.flip();\r
24         while(!Input::get(Keyboard::spc));\r
25         Noise1.save("test.png");\r
26 }\r