/[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.8 by jvk, Mon Mar 3 14:09:54 2003 UTC revision 1.9 by jvk, Mon Mar 3 14:28:54 2003 UTC
# Line 33  class OptMill(gzz.gfx.gl.PaperMill): Line 33  class OptMill(gzz.gfx.gl.PaperMill):
33      def getOptimizedPaper(self, seed, w):      def getOptimizedPaper(self, seed, w):
34          return self.mill.getOptimizedPaper(seed, w, **self.opts)          return self.mill.getOptimizedPaper(seed, w, **self.opts)
35    
36  lightnesses = [  pureConds = [
37          { "numcolors" : 8, "minlum" : 80 },      { "numcolors" : 8, "minlum" : 80 },
38          { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 },      { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 },
39          { "numcolors" : 1, "minlum" : 80 },      { "numcolors" : 1, "minlum" : 80 },
40          ]      ]
41    
42    textConds = [
43        { "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80 } },
44        { "halo" : 1, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0 } },
45        { "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 } },
46        { "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 1 } },
47        ]
48    
49  aspect = float(xs)/ys  aspect = float(xs)/ys
50    
# Line 49  current = scroll.getCurrent() Line 56  current = scroll.getCurrent()
56    
57  pages = [enfMaker.makeEnfilade(current.subSpan(i, i+1)) for i in range(0, current.length())]  pages = [enfMaker.makeEnfilade(current.subSpan(i, i+1)) for i in range(0, current.length())]
58    
59    pages = pages[:12] # XXX:
60    
61  textureSeeds = [i for i in range(523, 523+current.length())]  textureSeeds = [i for i in range(523, 523+current.length())]
62    
63  class PSPMaker(gzz.view.PageSpanCellView.PageSpanPaperMaker):  class PSPMaker(gzz.view.PageSpanCellView.PageSpanPaperMaker):
# Line 82  def doFrame(scene, filename): Line 91  def doFrame(scene, filename):
91    
92  def createPurePapers():  def createPurePapers():
93      seed = 100      seed = 100
94      for opts in lightnesses:      for opts in pureConds:
95          for i in range(0,30):          for i in range(0,30):
96              doFrame(lambda vs: paperscene(vs, seed, opts),              doFrame(lambda vs: paperscene(vs, seed, opts),
97                          "tmp/tmp%s.png" % seed)                          "tmp/tmp%s.png" % seed)
# Line 106  def createTextPapers(): Line 115  def createTextPapers():
115              page = pages[p]              page = pages[p]
116              zoom = zooms.pop()              zoom = zooms.pop()
117              l = 0              l = 0
118              for opts in lightnesses:              for opts in textConds:
119                    gzz.gfx.gl.PageSpanPaper.withHalo = opts["halo"]
120                  gzz.gfx.gl.PageSpanPaper.paperMill = OptMill(                  gzz.gfx.gl.PageSpanPaper.paperMill = OptMill(
121                                              ThePaperMill(), opts)                                              ThePaperMill(), opts["paperopts"])
122                  gzz.gfx.gl.PageSpanPaper.paperMillWindow = w                  gzz.gfx.gl.PageSpanPaper.paperMillWindow = w
123                  layout = pageSpanCellView.getLayout(page)                  layout = pageSpanCellView.getLayout(page)
124                  doFrame(lambda vs: textPaperScene(vs, layout, zoom),                  doFrame(lambda vs: textPaperScene(vs, layout, zoom),

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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