using Psychlops; namespace PsychlopsSilverlightApp { public class PsychlopsMain { public void psychlops_main() { Psychlops.ColorSpaces.CIERGB rgb = new Psychlops.ColorSpaces.CIERGB { R = 1, G = 1, B = 1 }; var xyz = rgb.convertToCIEXYZ(); Canvas window = new Canvas(300,300); Rectangle figure = new Rectangle(); figure.set(100, 100); figure.fill = new Color(1, 1, 1); figure.centering().shift(0, 0); int frame = 0; int looming_direction = 1, motion_dir = 1; while (!Keyboard.esc.pushed()) { window.clear(0); if (frame % 30 == 0) { looming_direction = looming_direction * -1; } if (frame % 90 == 0) { motion_dir *= -1; } figure.resize(figure.getWidth() + looming_direction * 1, figure.getHeight() + looming_direction * 1); figure.shift(motion_dir * 1, motion_dir * 0); figure.draw(); window.msg(xyz.Y.ToString(), 100, 100); window.flip(); frame++; } } } } /* using Psychlops; //Position Bias Program namespace PsychlopsSilverlightApp { public class PsychlopsMain { Canvas cnvs; Image img, img2, img3; int isize = 80; int frames; Psychlops.Widgets.Slider tfreq; Psychlops.Widgets.Slider contrast; Psychlops.Widgets.Slider lambda; public void psychlops_main() { cnvs = new Canvas(300, 600); Interval rng = new Interval(); tfreq = new Psychlops.Widgets.Slider("Temporal Frequency(Hz)", -5 <= rng <= 5, 3.0); contrast = new Psychlops.Widgets.Slider("Contrast", 0.0 <= rng <= 1.0, 0.25); lambda = new Psychlops.Widgets.Slider("Wave Length", 10.0 <= rng <= 120.0, 30); img = new Image(isize * 2, isize * 2); img2 = new Image(isize * 2, isize * 2); img3 = new Image(isize * 2, isize * 2); while (true) { cnvs.clear(new Color(0.5)); Figures.drawGabor(ref img, isize / 6, 1/lambda, contrast, 0.5 * Math.PI, (double)frames * 2.0 * Math.PI * tfreq / 60); Figures.drawGabor(ref img2, isize / 6, 1 / lambda, contrast, 0.5 * Math.PI, (double)frames * 2.0 * Math.PI * -tfreq / 60); Figures.drawGabor(ref img3, isize / 6, 1 / lambda, contrast, 0.5 * Math.PI, (double)frames * 2.0 * Math.PI * tfreq / 60); img.centering().shift(0, -isize * 1.5).draw(); img2.centering().draw(); img3.centering().shift(0, isize * 1.5).draw(); if (!Mouse.left.pressed()) frames++; cnvs.flip(); } } } } */