gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx demo/fontfilter2.py util/disp.py util/p...


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx demo/fontfilter2.py util/disp.py util/p...
Date: Wed, 05 Mar 2003 02:52:49 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        03/03/05 02:52:47

Modified files:
        gfx/demo       : fontfilter2.py 
        gfx/util       : disp.py papersampler.py 

Log message:
        paper exper stuff

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fontfilter2.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/disp.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/papersampler.py.diff?tr1=1.22&tr2=1.23&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/fontfilter2.py
diff -u gzz/gfx/demo/fontfilter2.py:1.5 gzz/gfx/demo/fontfilter2.py:1.6
--- gzz/gfx/demo/fontfilter2.py:1.5     Tue Mar  4 10:23:35 2003
+++ gzz/gfx/demo/fontfilter2.py Wed Mar  5 02:52:47 2003
@@ -19,8 +19,10 @@
 
 from gfx.util import misc
 
-xs = 1024
-ys = 768
+#xs = 1024
+#ys = 768
+xs = 1280
+ys = 960
     
 
 enfMaker = gzz.media.impl.Enfilade1DImpl.Enfilade1DImplMaker()
Index: gzz/gfx/util/disp.py
diff -u gzz/gfx/util/disp.py:1.8 gzz/gfx/util/disp.py:1.9
--- gzz/gfx/util/disp.py:1.8    Tue Mar  4 08:49:06 2003
+++ gzz/gfx/util/disp.py        Wed Mar  5 02:52:47 2003
@@ -127,6 +127,7 @@
     def keystroke(self, key):
         time = System.currentTimeMillis()
         if time - starttime >= mintime:
+            if key == " ": key = "Space"
             if key in keys:
                 endTrial(time - starttime, key)
                 
@@ -210,7 +211,7 @@
             if line == "": break
             fields = line.split()
             desc = f.readline()
-            
+
             trials.append( { "desc" : desc,
                              "file" : fields[0],
                              "min" : int(fields[1]),
Index: gzz/gfx/util/papersampler.py
diff -u gzz/gfx/util/papersampler.py:1.22 gzz/gfx/util/papersampler.py:1.23
--- gzz/gfx/util/papersampler.py:1.22   Tue Mar  4 10:44:38 2003
+++ gzz/gfx/util/papersampler.py        Wed Mar  5 02:52:47 2003
@@ -43,7 +43,7 @@
 xs = 1280
 ys = 960
 
-zoomLevels = [1.3, 2.4, 4]
+zoomLevels = [1.6, 2.4, 4]
 
 class OptMill(gzz.gfx.gl.PaperMill):
     def __init__(self, mill, opts):
@@ -57,7 +57,7 @@
 
 pureConds = [
     { "numcolors" : 8, "minlum" : 80 },
-    { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 },
+#    { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 },
     { "numcolors" : 1, "minlum" : 80 },
     ]
 
@@ -125,12 +125,45 @@
 def createPurePapers():
     # Create 90 textures for each condition
     # Each 30 are assigned to different conditions for different subjects
+    old = 15
+    new = 15
+    
+    test = 1
     for cond in range(0, len(pureConds)):
         opts = pureConds[cond]
-       for i in range(0,90):
+       for i in range(0,old + new):
             seed = 12345 + i
            doFrame(lambda vs: paperscene(vs, seed, opts), 
-                       "tmp/tmp%s_%s.png" % (cond, i))
+                    "tmp/tmp_%s_%s" % (test, i))
+
+        for subj in range(0, 10):
+            f = open("tmp/trials_%s_%s.txt" % (test, subj), "w")
+
+            oldset = range(0, old)
+            rng.shuffle(oldset)
+
+            newset = range(0, old + new)
+            rng.shuffle(newset)
+
+            f.write("tmp/space.mipzip 0 0 Space\n"
+                    "Wait for space\n")
+            for i in range(0, len(oldset)):
+                t = oldset[i]
+                file = "tmp/tmp_%s_%02d.mipzip" % (test, t)
+                f.write("%s 0 5000\nTexture %s\n" % (file, t))
+
+            f.write("tmp/space.mipzip 0 0 Space\n"
+                    "Wait for space\n")
+
+            for i in range(0, len(newset)):
+                t = newset[i]
+                file = "tmp/tmp_%s_%02d.mipzip" % (test, t)
+                f.write("%s 100 0 0 Control_L Control_R\n"
+                        "Texture %s %s\n" % (file, t, t < old))
+
+            f.close()
+
+        test += 1
 
 def textPaperScene(vs, layout, scale):
     scale *= .5
@@ -167,14 +200,16 @@
        pageSpanCellView = gzz.view.PageSpanCellView()
        pageSpanCellView.pageSpanPaperMaker = PSPMaker()
 
-        f = open("tmp/trials%s_0.txt" % subj, "w")
+        test = 0
+        f = open("tmp/trials_%s_%s.txt" % (test, subj), "w")
+        f.write("tmp/space.mipzip 0 0 Space\n"
+                "Wait for space\n")
 
        for trial in range(0, trials):
            page = pages[pagenums[trial]]
             opts = conditions[trial]
-           l = 0
 
-           file = "tmp/tmp_%s_%s_%s"%(subj, trial, l)
+           file = "tmp/tmp_%s_%s_%02d" % (test, subj, trial)
 
 
            sc = fontfilter2.Scene()
@@ -200,10 +235,9 @@
                doFrame(lambda vs: textPaperScene(vs, layout, zoom), file )
 
             f.write("tmp/star.mipzip 0 1000\n\n")
-            f.write(file + ".mipzip 1000 60000 Control_R Control_L\n")
+            f.write(file + ".mipzip 1000 60000 Space\n")
             f.write("page=%s conds=%s\n" % (pagenums[trial], str(opts)))
             f.flush()
-            l += 1
 
         f.close()
 
@@ -219,10 +253,16 @@
         w = gfxapi.createWindow()
         w.setLocation(0,0,xs,ys)
 
-        def nop(vs): pass
-        doFrame(nop, "tmp/star")
+        def star(vs):
+            putText(vs, 0, "*", x=xs*.5-10, y=ys*.6, h = 100)
+
+        def space(vs):
+            putText(vs, 0, "Press space to start", x=xs*.5-350, y=ys*.6, h = 
100)
+        
+        doFrame(star, "tmp/star")
+        doFrame(space, "tmp/space")
 
-       # createPurePapers()
+       createPurePapers()
        createTextPapers()
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]