35 |
import org.nongnu.libvob.gl.*; |
import org.nongnu.libvob.gl.*; |
36 |
import org.nongnu.alph.*; |
import org.nongnu.alph.*; |
37 |
import org.fenfire.spanimages.*; |
import org.fenfire.spanimages.*; |
38 |
|
import org.fenfire.functional.Function; |
39 |
|
|
40 |
/** A single pagespan enfilade laid out on the plane. |
/** A single pagespan enfilade laid out on the plane. |
41 |
*/ |
*/ |
45 |
public static boolean dbg = false; |
public static boolean dbg = false; |
46 |
private void p(String s) { System.out.println("PageSpanLayout:: "+s); } |
private void p(String s) { System.out.println("PageSpanLayout:: "+s); } |
47 |
|
|
|
public static SpanImageFactory spanImageFactory = |
|
|
SpanImageFactory.getDefaultInstance(); |
|
|
|
|
48 |
public static Enfilade1D.Maker enfilade1DMaker = |
public static Enfilade1D.Maker enfilade1DMaker = |
49 |
org.nongnu.alph.impl.Enfilade1DImpl.theMaker; |
org.nongnu.alph.impl.Enfilade1DImpl.theMaker; |
50 |
|
|
73 |
/** (To be called with increasing p): add a page. |
/** (To be called with increasing p): add a page. |
74 |
*/ |
*/ |
75 |
private void page(int p, PageImageSpan sp, |
private void page(int p, PageImageSpan sp, |
76 |
SpanImageFactory spanImageFactory) { |
Function spanImageFactory) { |
77 |
pages[p] = sp; |
pages[p] = sp; |
78 |
|
|
79 |
spivs[p] = spanImageFactory.getSpanImageVob(sp); |
spivs[p] = (SpanImageVob)spanImageFactory.f(sp); |
80 |
|
|
81 |
xywh[4*p + 0] = 0; |
xywh[4*p + 0] = 0; |
82 |
xywh[4*p + 1] = 0; |
xywh[4*p + 1] = 0; |
95 |
h = xywh[4*p + 3]; |
h = xywh[4*p + 3]; |
96 |
} |
} |
97 |
|
|
|
public PageSpanLayout(Enfilade1D enf) { |
|
|
this(enf, spanImageFactory); |
|
|
} |
|
98 |
public PageSpanLayout(Enfilade1D enf, |
public PageSpanLayout(Enfilade1D enf, |
99 |
SpanImageFactory spanImageFactory) { |
Function spanImageFactory) { |
100 |
alloc(enf.length()); |
alloc(enf.length()); |
101 |
|
|
102 |
for(int p = 0; p < npages; p++) { |
for(int p = 0; p < npages; p++) { |
113 |
|
|
114 |
} |
} |
115 |
|
|
|
public PageSpanLayout(PageSpan sp) { |
|
|
this(sp, spanImageFactory); |
|
|
} |
|
|
|
|
116 |
public PageSpanLayout(PageSpan sp, |
public PageSpanLayout(PageSpan sp, |
117 |
SpanImageFactory spanImageFactory) { |
Function spanImageFactory) { |
118 |
alloc(sp.length()); |
alloc(sp.length()); |
119 |
|
|
120 |
for(int p = 0; p < npages; p++) { |
for(int p = 0; p < npages; p++) { |
122 |
} |
} |
123 |
} |
} |
124 |
|
|
|
public PageSpanLayout(PageImageSpan sp) { |
|
|
this(sp, spanImageFactory); |
|
|
} |
|
|
|
|
125 |
public PageSpanLayout(PageImageSpan sp, |
public PageSpanLayout(PageImageSpan sp, |
126 |
SpanImageFactory spanImageFactory) { |
Function spanImageFactory) { |
127 |
alloc(1); |
alloc(1); |
128 |
page(0, sp, spanImageFactory); |
page(0, sp, spanImageFactory); |
129 |
} |
} |