73 |
* For example, if a PS file was compiled into an image at |
* For example, if a PS file was compiled into an image at |
74 |
* 160dpi, then this number is 160. Zero or negative = unknown, |
* 160dpi, then this number is 160. Zero or negative = unknown, |
75 |
* use pixel data. |
* use pixel data. |
76 |
|
* @param statsCallback The callback to give the TexAccum |
77 |
*/ |
*/ |
78 |
public SingleImage( |
public SingleImage( |
79 |
String scrollBlock, int page, |
String scrollBlock, int page, |
80 |
String filename, |
String filename, |
81 |
float resolution) throws java.io.IOException { |
float resolution, |
82 |
|
GL.StatsCallback statsCallback |
83 |
|
) throws java.io.IOException { |
84 |
this.scrollBlock = scrollBlock; |
this.scrollBlock = scrollBlock; |
85 |
this.page = page; |
this.page = page; |
86 |
this.resolution = resolution; |
this.resolution = resolution; |
87 |
|
|
88 |
this.loader = new MipzipLoader(new File(filename)); |
this.loader = new MipzipLoader(new File(filename)); |
89 |
this.accum = GL.createTexAccum(); |
if(statsCallback != null) |
90 |
|
this.accum = GL.createTexAccum(statsCallback, this); |
91 |
|
else |
92 |
|
this.accum = GL.createTexAccum(); |
93 |
|
|
94 |
this.missingPixels = new double[this.loader.getNLevels()]; |
this.missingPixels = new double[this.loader.getNLevels()]; |
95 |
} |
} |
103 |
nnow += accum.get(i); |
nnow += accum.get(i); |
104 |
missingPixels[missingPixels.length-1 - i] += nnow; |
missingPixels[missingPixels.length-1 - i] += nnow; |
105 |
} |
} |
106 |
|
if(dbg) p("SingleImage: readTexAccum - total: "+nnow); |
107 |
accum.clear(); |
accum.clear(); |
108 |
} |
} |
109 |
|
|
115 |
double mul = Math.exp(- exponentialCoeff * msecs); |
double mul = Math.exp(- exponentialCoeff * msecs); |
116 |
for(int i=0; i<missingPixels.length; i++) |
for(int i=0; i<missingPixels.length; i++) |
117 |
missingPixels[i] *= mul; |
missingPixels[i] *= mul; |
118 |
|
if(dbg) p("SingleImage: updateTime- totalnow: "+nPixels()); |
119 |
} |
} |
120 |
|
|
121 |
} |
} |