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


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx demo/fontfilter2.py util/showmipzip.py
Date: Sun, 30 Mar 2003 08:01:10 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        03/03/30 08:01:10

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

Log message:
        press "Print" in fontfilter2 to shoot bleaching pics

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fontfilter2.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/showmipzip.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/fontfilter2.py
diff -u gzz/gfx/demo/fontfilter2.py:1.6 gzz/gfx/demo/fontfilter2.py:1.7
--- gzz/gfx/demo/fontfilter2.py:1.6     Wed Mar  5 02:52:47 2003
+++ gzz/gfx/demo/fontfilter2.py Sun Mar 30 08:01:10 2003
@@ -94,15 +94,16 @@
                """ % locals()))
                paperOnce(vs, into, layout, scale)
 
-    vs.put(getDListNocoords("""
-       Enable BLEND
-       Disable DEPTH_TEST
-       BlendFunc SRC_ALPHA ONE
-       BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA
-       TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
-       Color 0 0 0
-    """ % locals()))
-    paperOnce(vs, 0, layout, scale)
+    if currentScene.text:
+        vs.put(getDListNocoords("""
+           Enable BLEND
+            Disable DEPTH_TEST
+            BlendFunc SRC_ALPHA ONE
+            BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA
+            TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
+            Color 0 0 0
+        """ % locals()))
+        paperOnce(vs, 0, layout, scale)
 
 class OptMill(gzz.gfx.gl.PaperMill):
     def __init__(self, mill):
@@ -113,6 +114,62 @@
     def getOptimizedPaper(self, seed, w):
        return self.mill.getOptimizedPaper(currentScene.seed, w)
 
+def paperOnce2(vs, into, layout, scale):
+    scale *= .5
+    into = vs.affineCS(into, "zoom", 0,
+                       pap_x,
+                       pap_y,
+                       pap_s, 0, 0, pap_s)
+    layout.place(vs, into, 1, 1, -1)
+
+def doFrame(s,width,height):
+    global frame
+    global paperOnce
+    tmp = paperOnce
+    paperOnce = paperOnce2
+    vs = w.createVobScene()
+    s.scene(vs)
+    w.renderStill(vs, 0);
+    saveanim.saveframe("/tmp/bleaching%i.png" % frame, w, w=width,h=height)
+    frame += 1
+    paperOnce = tmp
+
+def makeScreenshots(scene, key):
+    enfMaker = gzz.media.impl.Enfilade1DImpl.Enfilade1DImplMaker()
+    textblock = "011CA01BE52823106ED33F2C086FF8E7CCF9921A8D"
+    scroll = gzz.media.impl.PageImageScroll(None, 
+                                            
gzz.mediaserver.Mediaserver.Id(textblock))
+    current = scroll.getCurrent()
+
+    global pages
+    pages = [enfMaker.makeEnfilade(current.subSpan(i, i+1)) for i in range(0, 
current.length())]
+
+    s = Scene()
+    gzz.gfx.gl.PageSpanPaper.paperMill = gzz.gfx.gl.PaperMill.getInstance()    
+    global frame,pap_x,pap_y,pap_s
+    frame = 0
+
+    pap_x,pap_y,pap_s = -46,-180,1
+    currentScene.text = 1
+    currentScene.halo = 0
+    doFrame(s,270,300)
+
+    pap_x,pap_y,pap_s = -92,-360,2
+    currentScene.text = 1
+    currentScene.halo = 0
+    doFrame(s,540,300)
+
+    pap_x,pap_y,pap_s = -46,-180,1
+    currentScene.text = 1
+    currentScene.halo = 1
+    doFrame(s,270,300)
+
+    pap_x,pap_y,pap_s = -46,-180,1
+    currentScene.text = 0
+    currentScene.halo = 1
+    doFrame(s,270,300)
+
+
 class Scene:
     def __init__(self):
        GLSpanner.dangerouslyOverrideMemoryPartitioner()
@@ -126,6 +183,8 @@
            SlideLin("seed", -3900, 300, "paperseed", "P", "p"),
            Toggle("halo", 1, "halo", "h"),
            Toggle("bg", 1, "bg", "b"),
+           Toggle("text", 1, "t", "t"),
+            Action("screenshots", "Print", makeScreenshots)
        )
        gzz.gfx.gl.PageSpanPaper.withHalo = 0
 
Index: gzz/gfx/util/showmipzip.py
diff -u gzz/gfx/util/showmipzip.py:1.1 gzz/gfx/util/showmipzip.py:1.2
--- gzz/gfx/util/showmipzip.py:1.1      Tue Mar 25 12:20:34 2003
+++ gzz/gfx/util/showmipzip.py  Sun Mar 30 08:01:10 2003
@@ -56,6 +56,11 @@
 
 xs,ys = 1280, 960
 
+# Kluge:
+if args[0] == "size":
+    xs, ys = tuple(map(int, args[1].split("x")))
+    args = args[2:]
+
 xt, yt = xs, ys
 while xt > 1: xt *= .5
 while yt > 1: yt *= .5




reply via email to

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