OSDN Git Service

hk
[psychlops/silverlight.git] / test3 / PsychlopsMain.cs
index 829afbd..1a00e41 100644 (file)
@@ -7,6 +7,8 @@ namespace PsychlopsSilverlight3test
                Canvas cnvs;\r
                Image img;\r
                Rectangle fixation;\r
+               Shape shape;\r
+               Color col;\r
                int isize = 100;\r
                double tfreq = 1;\r
 \r
@@ -15,20 +17,28 @@ namespace PsychlopsSilverlight3test
                        cnvs = new Canvas(500, 500);\r
                        img = new Image(isize * 2, isize * 2);\r
                        fixation = new Rectangle(10, 10);\r
+                       var poly = new Letters("glkhglk");\r
+                       shape = poly;\r
                        cnvs.clear(Color.gray);\r
                }\r
 \r
                public void each_frames()\r
                {\r
-                       cnvs.clear(new Color(Mouse.left.pressed() ? 1.0 : 0.5));\r
-                       img.field(\r
-                               (x, y) => new Color(.5 + Math.gaussian(Math.radius(x - isize, y - isize), isize / 8.0) * .5 * Math.sin(cnvs.frame * 2 * Math.PI / tfreq / 60 + x / 3.0))\r
-                                       );\r
-                       img.centering(Mouse.position);\r
-                       //img.shift(1,0);\r
-                       img.draw();\r
+                       cnvs.clear(new Color(Mouse.left.pressed() ? 0.75 : 0.25));\r
+                       col.set(Math.random(1.0));\r
+\r
                        fixation.centering();\r
                        fixation.draw(Color.red);\r
+\r
+                       Figures.drawGabor(ref img, 20, 10, 1, 0, cnvs.frame * 2.0 * Math.PI / tfreq / 60);\r
+                       //Figures.drawGaussian(ref img, 20, 1);\r
+                       //Figures.drawGrating(10, 1, 2, cnvs.frame * 2.0 * Math.PI / tfreq / 60);\r
+                       img.centering(Mouse.position);\r
+                       img.draw();\r
+\r
+                       shape.centering(Mouse.position);\r
+                       shape.draw(Color.red);\r
+\r
                        cnvs.flip();\r
                }\r
        }\r