60 |
{ "numcolors" : 1, "minlum" : 80 }, |
{ "numcolors" : 1, "minlum" : 80 }, |
61 |
] |
] |
62 |
|
|
63 |
textConds = [ |
paperConds = [ |
64 |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80 } }, |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80 } }, |
65 |
{ "halo" : 1, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0 } }, |
{ "halo" : 1, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0 } }, |
66 |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 } }, |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 } }, |
67 |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 1 } }, |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 1 } }, |
68 |
] |
] |
69 |
|
|
70 |
|
textConds = [] |
71 |
|
for z in zoomLevels: |
72 |
|
for pc in paperConds: |
73 |
|
c = {} |
74 |
|
c.update(pc) |
75 |
|
c["zoom"] = z |
76 |
|
textConds.append(c) |
77 |
|
|
78 |
aspect = float(xs)/ys |
aspect = float(xs)/ys |
79 |
|
|
80 |
enfMaker = gzz.media.impl.Enfilade1DImpl.Enfilade1DImplMaker() |
enfMaker = gzz.media.impl.Enfilade1DImpl.Enfilade1DImplMaker() |
85 |
|
|
86 |
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())] |
87 |
|
|
88 |
pages = pages[:12] # XXX: |
pages = pages[:16] # XXX: |
89 |
|
|
90 |
textureSeeds = [i for i in range(523, 523+current.length())] |
textureSeeds = [i for i in range(523, 523+current.length())] |
91 |
|
|
115 |
vs.put(background((.36, .84, 1.0))) |
vs.put(background((.36, .84, 1.0))) |
116 |
scene(vs) |
scene(vs) |
117 |
w.renderStill(vs, 0) |
w.renderStill(vs, 0) |
118 |
# saveanim.saveframe(filename, w) |
saveanim.saveframe(filename, w) |
119 |
java.lang.System.gc() |
java.lang.System.gc() |
120 |
GL.freeQueue() |
GL.freeQueue() |
121 |
|
|
140 |
|
|
141 |
|
|
142 |
def createTextPapers(): |
def createTextPapers(): |
143 |
|
trials = 32 |
144 |
|
|
145 |
for subj in range(0,2): |
for subj in range(0,2): |
|
zooms = zoomLevels + zoomLevels + zoomLevels |
|
|
rng.shuffle(zooms) |
|
|
|
|
146 |
global textureSeeds |
global textureSeeds |
147 |
rng.shuffle(textureSeeds) |
rng.shuffle(textureSeeds) |
148 |
|
|
149 |
|
pagenums = range(0, len(pages)) |
150 |
|
rng.shuffle(pagenums) |
151 |
|
pagenums = pagenums * 2 |
152 |
|
|
153 |
|
conditions1 = [ cond for cond in textConds ] |
154 |
|
conditions2 = [ cond for cond in textConds ] |
155 |
|
rng.shuffle(conditions1) |
156 |
|
rng.shuffle(conditions2) |
157 |
|
conditions = conditions1 + conditions2 |
158 |
|
|
159 |
pageSpanCellView = gzz.view.PageSpanCellView() |
pageSpanCellView = gzz.view.PageSpanCellView() |
160 |
pageSpanCellView.pageSpanPaperMaker = PSPMaker() |
pageSpanCellView.pageSpanPaperMaker = PSPMaker() |
161 |
|
|
162 |
for p in range(0, len(pages)): |
for trial in range(0, trials): |
163 |
page = pages[p] |
page = pages[pagenums[trial]] |
164 |
zoom = zooms.pop() |
opts = conditions[trial] |
165 |
l = 0 |
l = 0 |
166 |
for opts in textConds: |
|
167 |
gzz.gfx.gl.PageSpanPaper.withHalo = opts["halo"] |
zoom = opts["zoom"] |
168 |
print "Using halo: ",gzz.gfx.gl.PageSpanPaper.withHalo |
gzz.gfx.gl.PageSpanPaper.withHalo = opts["halo"] |
169 |
gzz.gfx.gl.PageSpanPaper.paperMill = OptMill( |
print "Using halo: ",gzz.gfx.gl.PageSpanPaper.withHalo |
170 |
ThePaperMill(), opts["paperopts"]) |
gzz.gfx.gl.PageSpanPaper.paperMill = OptMill( |
171 |
gzz.gfx.gl.PageSpanPaper.paperMillWindow = w |
ThePaperMill(), opts["paperopts"]) |
172 |
layout = pageSpanCellView.getLayout(page) |
gzz.gfx.gl.PageSpanPaper.paperMillWindow = w |
173 |
doFrame(lambda vs: textPaperScene(vs, layout, zoom), |
layout = pageSpanCellView.getLayout(page) |
174 |
"tmp/tmp_%s_%s_%s"%(subj, p, l)) |
doFrame(lambda vs: textPaperScene(vs, layout, zoom), |
175 |
l += 1 |
"tmp/tmp_%s_%s_%s"%(subj, trial, l)) |
176 |
|
l += 1 |
177 |
|
|
178 |
|
|
179 |
|
|