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/papersampler.py


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gfx demo/fontfilter2.py util/papersampler.py
Date: Tue, 04 Mar 2003 10:23:35 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/03/04 10:23:35

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

Log message:
        conds

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fontfilter2.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/papersampler.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/fontfilter2.py
diff -u gzz/gfx/demo/fontfilter2.py:1.4 gzz/gfx/demo/fontfilter2.py:1.5
--- gzz/gfx/demo/fontfilter2.py:1.4     Tue Mar  4 04:49:22 2003
+++ gzz/gfx/demo/fontfilter2.py Tue Mar  4 10:23:35 2003
@@ -34,7 +34,7 @@
 execfile("gzz/gfx/gl/pagespanpaper.py")
 
 # Now, the output goes to alpha
-PageSpanPaper.setupOnlyPass = parseCombiner("""
+setupCode = parseCombiner("""
     PushAttrib ENABLE_BIT TEXTURE_BIT COLOR_BUFFER_BIT CURRENT_BIT
     ActiveTexture TEXTURE1
     Disable TEXTURE_2D
@@ -52,7 +52,6 @@
     alpha = SPARE1.blue
 """)
 
-print PageSpanPaper.setupOnlyPass
 
 def paperOnce(vs, into, layout, scale):
     scale *= .5
@@ -127,13 +126,19 @@
            Toggle("bg", 1, "bg", "b"),
        )
        gzz.gfx.gl.PageSpanPaper.withHalo = 0
-       gzz.gfx.gl.PageSpanPaper.paperMill = OptMill(
-                   gzz.gfx.gl.PaperMill.getInstance())
-       gzz.gfx.gl.PageSpanPaper.paperMillWindow = gfx.util.demowindow.w
+
+       if hasattr(gfx.util.demowindow, "w"):
+           gzz.gfx.gl.PageSpanPaper.paperMill = OptMill(
+                       gzz.gfx.gl.PaperMill.getInstance())
+           gzz.gfx.gl.PageSpanPaper.paperMillWindow = gfx.util.demowindow.w
+
+       self.enf = pages[0]
     def scene(self, vs):
+       PageSpanPaper.setupOnlyPass = setupCode
+
        vs.put(background((.36, .84, 1.0)))
-       self.layout = self.pageSpanCellView.getLayout(pages[0])
-       self.layoutBg = self.pageSpanCellViewBg.getLayout(pages[0])
+       self.layout = self.pageSpanCellView.getLayout(self.enf)
+       self.layoutBg = self.pageSpanCellViewBg.getLayout(self.enf)
        textPaperScene(vs, self.layout, self.layoutBg, self.scale)
 
 
Index: gzz/gfx/util/papersampler.py
diff -u gzz/gfx/util/papersampler.py:1.19 gzz/gfx/util/papersampler.py:1.20
--- gzz/gfx/util/papersampler.py:1.19   Tue Mar  4 10:16:52 2003
+++ gzz/gfx/util/papersampler.py        Tue Mar  4 10:23:35 2003
@@ -37,12 +37,13 @@
 
 from gfx.util import misc
 
+
 import traceback
 
 xs = 1280
 ys = 960
 
-zoomLevels = [1, 2, 3, 4]
+zoomLevels = [1.3, 2.4, 4]
 
 class OptMill(gzz.gfx.gl.PaperMill):
     def __init__(self, mill, opts):
@@ -63,7 +64,7 @@
 paperConds = [
     { "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80 } },
     { "halo" : 1, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0 
} },
-    { "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 
0.5 } },
+#    { "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 
0.5 } },
     { "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 1 
} },
     ]
 
@@ -133,13 +134,15 @@
 def textPaperScene(vs, layout, scale):
     scale *= .5
     into = vs.affineCS(0, "zoom", 0,
-                       0.5 * (xs - layout.w * scale),
-                       0.5 * (ys - layout.h * scale),
-                       scale, 0, 0, scale)
+                      0.5 * (xs - layout.w * scale),
+                      0.5 * (ys - layout.h * scale),
+                      scale, 0, 0, scale)
     layout.place(vs, into, 1, 1, -1)
+
     
 
 def createTextPapers():
+    from gfx.demo import fontfilter2
     trials = 32
     
     for subj in range(0,2):
@@ -166,15 +169,30 @@
             opts = conditions[trial]
            l = 0
 
-            zoom = opts["zoom"]
-            gzz.gfx.gl.PageSpanPaper.withHalo = opts["halo"]
-            print "Using halo: ",gzz.gfx.gl.PageSpanPaper.withHalo
-            gzz.gfx.gl.PageSpanPaper.paperMill = OptMill(
-                ThePaperMill(), opts["paperopts"])
-            gzz.gfx.gl.PageSpanPaper.paperMillWindow = w
-            layout = pageSpanCellView.getLayout(page)
-            file = "tmp/tmp_%s_%s_%s"%(subj, trial, l)
-            doFrame(lambda vs: textPaperScene(vs, layout, zoom), file )
+           file = "tmp/tmp_%s_%s_%s"%(subj, trial, l)
+
+
+           sc = fontfilter2.Scene()
+           sc.scale = opts["zoom"]
+           sc.halo = opts["halo"]
+           sc.enf = page
+
+           sc.pageSpanCellView.pageSpanPaperMaker = PSPMaker()
+           sc.pageSpanCellViewBg.pageSpanPaperMaker = PSPMaker()
+
+           gzz.gfx.gl.PageSpanPaper.paperMill = OptMill(
+               ThePaperMill(), opts["paperopts"])
+           gzz.gfx.gl.PageSpanPaper.paperMillWindow = w
+
+           doFrame(lambda vs: sc.scene(vs), file)
+
+           if 0:
+               zoom = opts["zoom"]
+               gzz.gfx.gl.PageSpanPaper.withHalo = opts["halo"]
+               print "Using halo: ",gzz.gfx.gl.PageSpanPaper.withHalo
+               layout = pageSpanCellView.getLayout(page)
+
+               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")




reply via email to

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