/[gzz]/gzz/gfx/util/papersampler.py
ViewVC logotype

Diff of /gzz/gfx/util/papersampler.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jvk, Sun Mar 2 17:11:14 2003 UTC revision 1.2 by tjl, Mon Mar 3 08:27:06 2003 UTC
# Line 15  ys = 768 Line 15  ys = 768
15    
16  aspect = float(xs)/ys  aspect = float(xs)/ys
17    
18    textblock = "011D75251F04C8BF89A44C88D875886B2B5172522A"
19    
20  def getpaper(seed, opts):  def getpaper(seed, opts):
21      pap = ThePaperMill().getPaper(seed, **opts)      pap = ThePaperMill().getPaper(seed, **opts)
22      return GLRen.createPaperQuad(pap, -aspect/2, -.5, aspect/2, .5, 0)      return GLRen.createPaperQuad(pap, -aspect/2, -.5, aspect/2, .5, 0)
# Line 30  def paperscene(vs, seed, opts): Line 32  def paperscene(vs, seed, opts):
32      pq = getpaper(seed, opts)      pq = getpaper(seed, opts)
33      vs.map.put(pq, cs1, cs2)      vs.map.put(pq, cs1, cs2)
34      return vs      return vs
35        
36    def createPurePapers():
37        seed = 100
38        for opts in [
39            { "numcolors" : 8, "minlum" : 80 },
40            { "numcolors" : 8, "minlum" : 94 },
41            { "numcolors" : 1, "minlum" : 80 },
42            ]:
43            for i in range(0,30):
44                vs = w.createVobScene()
45                paperscene(vs, seed, opts)
46                w.renderStill(vs, 0)
47                saveanim.saveframe("/tmp/tmp%s.png" % seed, w)
48                java.lang.System.gc()
49                GL.freeQueue()
50    
51                seed += 1
52    
53      
54  class Main(Runnable):  class Main(Runnable):
55    
56      def run(self):      def run(self):
57          global ThePaperMill          global ThePaperMill, w
58          from gfx.libpaper.papermill import ThePaperMill          from gfx.libpaper.papermill import ThePaperMill
59                    
60          w = gfxapi.createWindow()          w = gfxapi.createWindow()
61          w.setLocation(0,0,xs,ys)          w.setLocation(0,0,xs,ys)
62    
63          seed = 100          createPurePapers()
         for opts in [  
             { "numcolors" : 8, "minlum" : 80 },  
             { "numcolors" : 8, "minlum" : 94 },  
             { "numcolors" : 1, "minlum" : 80 },  
             ]:  
             for i in range(0,30):  
                 vs = w.createVobScene()  
                 paperscene(vs, seed, opts)  
                 w.renderStill(vs, 0)  
                 saveanim.saveframe("/tmp/tmp%s.png" % seed, w)  
                 java.lang.System.gc()  
                 GL.freeQueue()  
   
                 seed += 1  
   
   
64    
65    
66  gfxapi = GraphicsAPI.getInstance()  gfxapi = GraphicsAPI.getInstance()

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26