10 |
public static boolean dbg = false; |
public static boolean dbg = false; |
11 |
private static void pa(String s) { System.out.println(s); } |
private static void pa(String s) { System.out.println(s); } |
12 |
|
|
13 |
|
public static gzz.gfx.gl.PaperMill paperMill; |
14 |
|
public static gzz.client.GraphicsAPI.RenderingSurface paperMillWindow; |
15 |
|
|
16 |
/** The page is in the range (0,0)..(w,h) in paper coordinates. |
/** The page is in the range (0,0)..(w,h) in paper coordinates. |
17 |
*/ |
*/ |
18 |
public final float w, h; |
public final float w, h; |
26 |
return h * p.getY(fullPageY) / p.y1; |
return h * p.getY(fullPageY) / p.y1; |
27 |
} |
} |
28 |
|
|
|
Object identity; |
|
29 |
GLSpanner.SpanPage p; |
GLSpanner.SpanPage p; |
30 |
|
|
31 |
Paper bg; |
Paper bg; |
77 |
|
|
78 |
public static String teardown = null; |
public static String teardown = null; |
79 |
|
|
80 |
|
int paperSeed; |
81 |
|
|
82 |
/** Add a pass where the current page image is the only thing. |
/** Add a pass where the current page image is the only thing. |
83 |
*/ |
*/ |
84 |
private void addPaperPass(Paper p, String setup) { |
private void addPaperPass(Paper p, String setup) { |
93 |
} |
} |
94 |
|
|
95 |
public Paper getPaper(boolean withBackground) { |
public Paper getPaper(boolean withBackground) { |
96 |
if(withBackground && bg != null) { |
if(withBackground) { |
97 |
|
if(bg == null) { |
98 |
|
if(paperMill == null) |
99 |
|
throw new Error("Trying to use bg without papermill"); |
100 |
|
bg = paperMill.getOptimizedPaper(paperSeed, paperMillWindow); |
101 |
|
} |
102 |
if(bgPaper == null) { |
if(bgPaper == null) { |
103 |
bgPaper = (Paper)bg.clone(); |
bgPaper = (Paper)bg.clone(); |
104 |
// Check if we have a single pass and single texture |
// Check if we have a single pass and single texture |
137 |
p.getTexture(importance, pixels); |
p.getTexture(importance, pixels); |
138 |
} |
} |
139 |
|
|
140 |
public PageSpanPaper(Paper background, GLSpanner.SpanPage p) { |
public PageSpanPaper(GLSpanner.SpanPage p, int paperSeed) { |
141 |
if(filter == null) { |
if(filter == null) { |
142 |
PythonInterpreter jython = new PythonInterpreter(); |
PythonInterpreter jython = new PythonInterpreter(); |
143 |
jython.execfile("gzz/gfx/gl/pagespanpaper.py"); |
jython.execfile("gzz/gfx/gl/pagespanpaper.py"); |
144 |
jython.cleanup(); |
jython.cleanup(); |
145 |
} |
} |
|
this.bg = background; |
|
|
this.identity = identity; |
|
146 |
this.p = p; |
this.p = p; |
147 |
|
this.paperSeed = paperSeed; |
148 |
|
|
149 |
this.w = p.w / 72.0f / 6; |
this.w = p.w / 72.0f / 6; |
150 |
this.h = p.h / 72.0f / 6; |
this.h = p.h / 72.0f / 6; |