37 |
|
|
38 |
from gfx.util import misc |
from gfx.util import misc |
39 |
|
|
40 |
|
|
41 |
import traceback |
import traceback |
42 |
|
|
43 |
xs = 1280 |
xs = 1280 |
44 |
ys = 960 |
ys = 960 |
45 |
|
|
46 |
zoomLevels = [1, 2, 3, 4] |
zoomLevels = [1.3, 2.4, 4] |
47 |
|
|
48 |
class OptMill(gzz.gfx.gl.PaperMill): |
class OptMill(gzz.gfx.gl.PaperMill): |
49 |
def __init__(self, mill, opts): |
def __init__(self, mill, opts): |
64 |
paperConds = [ |
paperConds = [ |
65 |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80 } }, |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80 } }, |
66 |
{ "halo" : 1, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0 } }, |
{ "halo" : 1, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0 } }, |
67 |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 } }, |
# { "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 } }, |
68 |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 1 } }, |
{ "halo" : 0, "paperopts" : { "numcolors" : 8, "minlum" : 80, "blend" : 1 } }, |
69 |
] |
] |
70 |
|
|
134 |
def textPaperScene(vs, layout, scale): |
def textPaperScene(vs, layout, scale): |
135 |
scale *= .5 |
scale *= .5 |
136 |
into = vs.affineCS(0, "zoom", 0, |
into = vs.affineCS(0, "zoom", 0, |
137 |
0.5 * (xs - layout.w * scale), |
0.5 * (xs - layout.w * scale), |
138 |
0.5 * (ys - layout.h * scale), |
0.5 * (ys - layout.h * scale), |
139 |
scale, 0, 0, scale) |
scale, 0, 0, scale) |
140 |
layout.place(vs, into, 1, 1, -1) |
layout.place(vs, into, 1, 1, -1) |
141 |
|
|
142 |
|
|
143 |
|
|
144 |
def createTextPapers(): |
def createTextPapers(): |
145 |
|
from gfx.demo import fontfilter2 |
146 |
trials = 32 |
trials = 32 |
147 |
|
|
148 |
for subj in range(0,2): |
for subj in range(0,2): |
169 |
opts = conditions[trial] |
opts = conditions[trial] |
170 |
l = 0 |
l = 0 |
171 |
|
|
172 |
zoom = opts["zoom"] |
file = "tmp/tmp_%s_%s_%s"%(subj, trial, l) |
173 |
gzz.gfx.gl.PageSpanPaper.withHalo = opts["halo"] |
|
174 |
print "Using halo: ",gzz.gfx.gl.PageSpanPaper.withHalo |
|
175 |
gzz.gfx.gl.PageSpanPaper.paperMill = OptMill( |
sc = fontfilter2.Scene() |
176 |
ThePaperMill(), opts["paperopts"]) |
sc.scale = opts["zoom"] |
177 |
gzz.gfx.gl.PageSpanPaper.paperMillWindow = w |
sc.halo = opts["halo"] |
178 |
layout = pageSpanCellView.getLayout(page) |
sc.enf = page |
179 |
file = "tmp/tmp_%s_%s_%s"%(subj, trial, l) |
|
180 |
doFrame(lambda vs: textPaperScene(vs, layout, zoom), file ) |
sc.pageSpanCellView.pageSpanPaperMaker = PSPMaker() |
181 |
|
sc.pageSpanCellViewBg.pageSpanPaperMaker = PSPMaker() |
182 |
|
|
183 |
|
gzz.gfx.gl.PageSpanPaper.paperMill = OptMill( |
184 |
|
ThePaperMill(), opts["paperopts"]) |
185 |
|
gzz.gfx.gl.PageSpanPaper.paperMillWindow = w |
186 |
|
|
187 |
|
doFrame(lambda vs: sc.scene(vs), file) |
188 |
|
|
189 |
|
if 0: |
190 |
|
zoom = opts["zoom"] |
191 |
|
gzz.gfx.gl.PageSpanPaper.withHalo = opts["halo"] |
192 |
|
print "Using halo: ",gzz.gfx.gl.PageSpanPaper.withHalo |
193 |
|
layout = pageSpanCellView.getLayout(page) |
194 |
|
|
195 |
|
doFrame(lambda vs: textPaperScene(vs, layout, zoom), file ) |
196 |
|
|
197 |
f.write("tmp/star.mipzip 0 1000\n\n") |
f.write("tmp/star.mipzip 0 1000\n\n") |
198 |
f.write(file + ".mipzip 1000 60000 Control_R Control_L\n") |
f.write(file + ".mipzip 1000 60000 Control_R Control_L\n") |