[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./genimages.pl Documentation/Manuscripts/Pa...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz ./genimages.pl Documentation/Manuscripts/Pa... |
Date: |
Sat, 23 Nov 2002 14:03:35 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/11/23 14:03:35
Modified files:
. : genimages.pl
Documentation/Manuscripts/Paper: paper.tex
gfx/demo : gldemo.py paperbasis.py papertest.py
gfx/demo/opengl: texperf.py
gfx/libpaper : textures.py
gzz/gfx/gl : GL.java GLSpans.java
gzz/media/impl : PageImageScroll.java
gzz/view : pagespanview.py xubuoy.py
Log message:
Improve text in xupdf by doubling texture size.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/genimages.pl.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Documentation/Manuscripts/Paper/paper.tex.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/gldemo.py.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/paperbasis.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/papertest.py.diff?tr1=1.52&tr2=1.53&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/opengl/texperf.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/textures.py.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GL.java.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLSpans.java.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/media/impl/PageImageScroll.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/pagespanview.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/xubuoy.py.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
Patches:
Index: gzz/Documentation/Manuscripts/Paper/paper.tex
diff -u gzz/Documentation/Manuscripts/Paper/paper.tex:1.63
gzz/Documentation/Manuscripts/Paper/paper.tex:1.64
--- gzz/Documentation/Manuscripts/Paper/paper.tex:1.63 Fri Nov 22 11:03:44 2002
+++ gzz/Documentation/Manuscripts/Paper/paper.tex Sat Nov 23 14:03:35 2002
@@ -500,7 +500,8 @@
\caption{
\label{fig-basis}
The complete set of 2D basis textures used by our implementation.
-3D?!?!
+All textures shown in this article are built from these textures and
+the corresponding HILO textures for offsetting.
}
\end{figure}
Index: gzz/genimages.pl
diff -u gzz/genimages.pl:1.6 gzz/genimages.pl:1.7
--- gzz/genimages.pl:1.6 Fri Nov 22 10:23:11 2002
+++ gzz/genimages.pl Sat Nov 23 14:03:35 2002
@@ -1,6 +1,6 @@
#!/usr/bin/perl
address@hidden = (300, 50);
address@hidden = (300, 170, 50);
@not = qw/
0000000008000000E951C69F2500047B509B19C36307791FF5813EE8F1C5DF461505ED93327A9F
Index: gzz/gfx/demo/gldemo.py
diff -u gzz/gfx/demo/gldemo.py:1.48 gzz/gfx/demo/gldemo.py:1.49
--- gzz/gfx/demo/gldemo.py:1.48 Sun Nov 17 15:56:37 2002
+++ gzz/gfx/demo/gldemo.py Sat Nov 23 14:03:35 2002
@@ -252,7 +252,8 @@
for modname in mods:
mod = sys.modules[modname]
if not hasattr(mod, "__do_not_delete__"):
- if modname[:4] == "gfx." and hasattr(mod, "__file__"):
+ # if modname[:4] == "gfx." and hasattr(mod, "__file__"):
+ if hasattr(mod, "__file__"):
print "Deleting", modname
del sys.modules[modname]
Index: gzz/gfx/demo/opengl/texperf.py
diff -u gzz/gfx/demo/opengl/texperf.py:1.6 gzz/gfx/demo/opengl/texperf.py:1.7
--- gzz/gfx/demo/opengl/texperf.py:1.6 Mon Sep 23 10:38:31 2002
+++ gzz/gfx/demo/opengl/texperf.py Sat Nov 23 14:03:35 2002
@@ -13,15 +13,15 @@
# - BASE_LEVEL *does* have an effect - I falsely concluded earlier that it
didn't.
# Therefore, we'll be using that for quite a lot of things...
-forms = ("R3_G3_B2",)
-# forms = ("COMPRESSED_RGB_S3TC_DXT1_EXT",)
+# forms = ("R3_G3_B2",)
+forms = ("COMPRESSED_RGB_S3TC_DXT1_EXT",)
# sizes = (512,1024,)
baselevels =(0,1,2,3,4,5)
downsamples = (0,1,2,3)
ntex = 25
-sizes = (1024,)
+sizes = (2048,)
size = sizes[0]
form = forms[0]
@@ -67,7 +67,9 @@
if not globals().has_key("texes"):
maketex()
for downsample in downsamples:
+ print "Downsample: ",downsample
for baselevel in baselevels:
+ print "baselevel: ",baselevel
for t in texes:
tex.downsampleInto(t, "TEXTURE_2D", downsample, form, "RGB")
GL.call("""
@@ -95,7 +97,7 @@
putnoc(vs, getDListNocoords("""
BindTexture TEXTURE_2D %s
""" % (texes[i].getTexId())))
- vs.put(quad(), "T"+str(i), 50-i, 100+2*i, 100+2*i, 100, 100)
+ vs.put(quad(), "T"+str(i), 50-i, 100+2*i, 100+2*i, 1200,
1200)
niters = 30
t = w.timeRender(vs, niters) / niters
print "Time: ", nt, t
Index: gzz/gfx/demo/paperbasis.py
diff -u gzz/gfx/demo/paperbasis.py:1.13 gzz/gfx/demo/paperbasis.py:1.14
--- gzz/gfx/demo/paperbasis.py:1.13 Mon Oct 14 13:49:29 2002
+++ gzz/gfx/demo/paperbasis.py Sat Nov 23 14:03:35 2002
@@ -10,7 +10,7 @@
execfile("gfx/libcolor/spaces.py")
import gfx.libpaper.textures
-gfx.libpaper.textures.init()
+gfx.libpaper.textures.init(3, "RGB")
# execfile("gfx/libpaper/textures.py")
execfile("gfx/libpaper/texcoords.py")
execfile("gfx/libpaper/colors.py")
@@ -261,7 +261,7 @@
ActiveTexture TEXTURE0
""")
- texid = gfx.libpaper.textures.ptextures["RGB2"][9].getTexId();
+ texid = gfx.libpaper.textures.ptextures["RGB2"][1].getTexId();
constcode = """
ActiveTexture TEXTURE0
Index: gzz/gfx/demo/papertest.py
diff -u gzz/gfx/demo/papertest.py:1.52 gzz/gfx/demo/papertest.py:1.53
--- gzz/gfx/demo/papertest.py:1.52 Fri Nov 22 10:57:31 2002
+++ gzz/gfx/demo/papertest.py Sat Nov 23 14:03:35 2002
@@ -381,15 +381,31 @@
cs1 = vs.coords.affineCoordsys(0, 10, 600, 500, 450, 0, 0, 450)
vs.matcher.add(cs1, "1")
- putText(vs, cs1, "F1, F2", color=(0,0,0), h=.25)
+ putText(vs, cs1, "F1, F2, F3", color=(0,0,0), h=.25)
class BasisScene:
"""A scene showing all basis textures."""
- gfx.libpaper.
+ def __init__(self):
+ self.tex = gfx.libpaper.textures.init(3, "RGB")["RGB2"]
+ def key(self, k):
+ pass
+ def scene(self, vs):
+ vs.map.put(background((.7,.8,.7)))
+ print self.tex
+ (x,y) = (0,0)
+ (w,h) = (150,150)
+ sp = 10
+ for t in self.tex:
+ vs.put(quad((t.getTexId())), 0, sp + x*(w+sp), sp + y*(h+sp), w, h)
+ x += 1
+ if x>3:
+ x = 0
+ y += 1
scenebindings = {
"F1": PaperScene,
"F2": MultiPaperScene,
+ "F3": BasisScene,
"F12": DummyScene,
}
@@ -417,14 +433,20 @@
window_resized = 1
w.setLocation(0,0,1200,900)
+def r(sc, filename):
+ vs = w.createVobScene()
+ sc.scene(vs)
+ w.renderStill(vs, 0)
+ saveanim.saveframe(filename, w)
+
def makeScreenshots():
ps = MultiPaperScene()
ps.seed = 199871850
ps.initpaper()
- vs = w.createVobScene()
- ps.scene(vs)
- w.renderStill(vs, 0)
- saveanim.saveframe("shots/multipaper.png", w)
+ r(ps, "shots/multipaper.png")
+
+ ps = BasisScene()
+ r(ps, "shots/paperbasistex.png")
Index: gzz/gfx/libpaper/textures.py
diff -u gzz/gfx/libpaper/textures.py:1.37 gzz/gfx/libpaper/textures.py:1.38
--- gzz/gfx/libpaper/textures.py:1.37 Thu Nov 14 09:59:16 2002
+++ gzz/gfx/libpaper/textures.py Sat Nov 23 14:03:35 2002
@@ -42,6 +42,8 @@
if not hasattr(self, "texture"):
print "Generating texture: ", self.name, self.args
self.texture = getCachedTexture(self.args)
+ self.texture.setTexParameter("TEXTURE_2D", "TEXTURE_MIN_FILTER",
self.minfilter)
+ self.texture.setTexParameter("TEXTURE_2D", "TEXTURE_MAG_FILTER",
self.magfilter)
return self.texture.getTexId()
def getName(self):
@@ -202,7 +204,7 @@
{"name" : "rnd0n",
"args" : [2, 2, 0, texture_components, texture_format,
- texture_format, "geometric", ["type", "7", "seed", "10"]],
+ texture_format, "geometric", ["type", "7", "seed", "13"]],
"continuous" : 0,
"scale" : 1./2,
"featurescale" : 1./2,
@@ -212,7 +214,7 @@
{"name" : "rnd1n",
"args" : [2, 4, 0, texture_components, texture_format,
- texture_format, "geometric", ["type", "7", "seed", "11"]],
+ texture_format, "geometric", ["type", "7", "seed", "14"]],
"continuous" : 0,
"scale" : 1./4,
"featurescale" : 1./4,
@@ -222,7 +224,7 @@
{"name" : "rnd2n",
"args" : [4, 4, 0, texture_components, texture_format,
- texture_format, "geometric", ["type", "7", "seed", "12"]],
+ texture_format, "geometric", ["type", "7", "seed", "15"]],
"continuous" : 0,
"scale" : 1./4,
"featurescale" : 1./4,
@@ -394,15 +396,3 @@
def getPaperTextures(self, types, gen):
return [ self.getPaperTexture(type, gen) for type in types ]
-
-if 0:
- rgb3DTextures = [
- ("rgbw", [64, 64, 64, 1,
- "LUMINANCE", "LUMINANCE",
- "filereader", ["file", "lava/gfx/c.dat", "bias",
"-.2", "scale", ".005" ]]),
- #("rgbw", [64, 64, 64, 3,
- # "RGB", "RGB",
- # "filereader", ["file", "lava/gfx/map3d.dat",
"scale", "10", "bias", "-3" ]]),
-
- ]
-
Index: gzz/gzz/gfx/gl/GL.java
diff -u gzz/gzz/gfx/gl/GL.java:1.21 gzz/gzz/gfx/gl/GL.java:1.22
--- gzz/gzz/gfx/gl/GL.java:1.21 Sat Nov 9 15:19:26 2002
+++ gzz/gzz/gfx/gl/GL.java Sat Nov 23 14:03:35 2002
@@ -420,6 +420,12 @@
*/
public int getTexId() { return getId(); }
+ public void setTexParameter(String target, String param, String value) {
+ call("BindTexture "+target+" "+getTexId()+"\n"+
+ "TexParameter "+target+" "+param+" "+value+"\n"+
+ "BindTexture "+target+" 0\n");
+ }
+
/** Call libtexture to create the image into this texture object.
*/
public int shade(int w, int h, int d, int comps,
Index: gzz/gzz/gfx/gl/GLSpans.java
diff -u gzz/gzz/gfx/gl/GLSpans.java:1.8 gzz/gzz/gfx/gl/GLSpans.java:1.9
--- gzz/gzz/gfx/gl/GLSpans.java:1.8 Mon Nov 4 13:40:59 2002
+++ gzz/gzz/gfx/gl/GLSpans.java Sat Nov 23 14:03:35 2002
@@ -24,7 +24,7 @@
* since adjusting TEXTURE_BASE_LEVEL does not have enough effect.
*
*/
- public static int LODscale = 2;
+ public static int LODscale = 3;
/** Determine which texture formats are supported.
*/
Index: gzz/gzz/media/impl/PageImageScroll.java
diff -u gzz/gzz/media/impl/PageImageScroll.java:1.12
gzz/gzz/media/impl/PageImageScroll.java:1.13
--- gzz/gzz/media/impl/PageImageScroll.java:1.12 Fri Oct 11 09:35:02 2002
+++ gzz/gzz/media/impl/PageImageScroll.java Sat Nov 23 14:03:35 2002
@@ -38,7 +38,7 @@
public class PageImageScroll
implements ScrollBlockManager.MediaserverScrollBlock {
-String rcsid = "$Id: PageImageScroll.java,v 1.12 2002/10/11 13:35:02 tjl Exp
$";
+String rcsid = "$Id: PageImageScroll.java,v 1.13 2002/11/23 19:03:35 tjl Exp
$";
public static boolean dbg = true;
final static void p(String s) { if(dbg) System.out.println(s); }
final static void pa(String s) { System.out.println(s); }
@@ -48,7 +48,7 @@
/** Resolution of the images to use.
*/
- int RESOLUTION=85; // sigh
+ int RESOLUTION=170; // sigh
String DIR="../mstmpimg/"; // XXX Non-platform-independent!
Index: gzz/gzz/view/pagespanview.py
diff -u gzz/gzz/view/pagespanview.py:1.19 gzz/gzz/view/pagespanview.py:1.20
--- gzz/gzz/view/pagespanview.py:1.19 Fri Nov 8 06:14:21 2002
+++ gzz/gzz/view/pagespanview.py Sat Nov 23 14:03:35 2002
@@ -12,7 +12,7 @@
# Module pagespanview
-globalseedoffs = -9
+globalseedoffs = -8
globalLOD = 0
@@ -50,6 +50,15 @@
ret.append( pdfpaper(rect, scrollblockPaper) )
return ret
+filters = """
+ TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_NEAREST
+ TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
+ TexParameter TEXTURE_2D TEXTURE_MAX_ANISOTROPY_EXT 1
+"""
+
+def setFilters(filt):
+ global filters
+ filters = filt
def pdfpaper(pdfrect, background):
"""Get the papers for the pages.
@@ -64,6 +73,22 @@
ph = pdfrect.h / 72.0 / 6
wm = (pdfrect.x1-pdfrect.x0) / pw
hm = (pdfrect.y1-pdfrect.y0) / ph
+ texid = pdfrect.texId
+
+ filt = filters
+
+ texcode = """
+
+ BindTexture TEXTURE_2D %(texid)s
+ TexParameter TEXTURE_2D TEXTURE_WRAP_S REPEAT
+ TexParameter TEXTURE_2D TEXTURE_WRAP_T REPEAT
+
+ %(filt)s
+
+ """ % locals()
+
+ print "Texcode: ",texcode
+
def mpap_general(blend, pap = None):
if pap == None:
pap = Paper()
@@ -74,7 +99,7 @@
pap.setNPasses(p+1)
ppass = pap.getPass(p)
- texid = pdfrect.texId
+ tc = texcode
ppass.setSetupcode("""
PushAttrib ENABLE_BIT TEXTURE_BIT COLOR_BUFFER_BIT
ActiveTexture TEXTURE1
@@ -89,13 +114,8 @@
Enable TEXTURE_2D
Disable ALPHA_TEST
- BindTexture TEXTURE_2D %(texid)s
- TexParameter TEXTURE_2D TEXTURE_WRAP_S REPEAT
- TexParameter TEXTURE_2D TEXTURE_WRAP_T REPEAT
- TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
- TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
- TexParameter TEXTURE_2D TEXTURE_MAX_ANISOTROPY_EXT 10
-
+ %(tc)s
+
""" % locals())
ppass.setTeardowncode("""PopAttrib""")
@@ -115,15 +135,14 @@
ppass = pap.getPass(0)
texid = pdfrect.texId
+
+ tc = texcode
ppass.setSetupcode(ppass.getSetupcode() + nvcode.combinercode("""
ActiveTexture TEXTURE1
Enable TEXTURE_2D
- BindTexture TEXTURE_2D %(texid)s
- TexParameter TEXTURE_2D TEXTURE_WRAP_S REPEAT
- TexParameter TEXTURE_2D TEXTURE_WRAP_T REPEAT
- TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
- TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
- TexParameter TEXTURE_2D TEXTURE_MAX_ANISOTROPY_EXT 10
+
+ %(tc)s
+
ActiveTexture TEXTURE0
Disable BLEND
@@ -187,7 +206,7 @@
class CellPDFView:
- dicefactor = 3.0
+ dicefactor = 2
"""A view of a PDF file in a cell, spread out in space.
"""
def __init__(self, cell):
Index: gzz/gzz/view/xubuoy.py
diff -u gzz/gzz/view/xubuoy.py:1.32 gzz/gzz/view/xubuoy.py:1.33
--- gzz/gzz/view/xubuoy.py:1.32 Mon Nov 18 05:28:16 2002
+++ gzz/gzz/view/xubuoy.py Sat Nov 23 14:03:35 2002
@@ -11,6 +11,9 @@
# import gzz.view.pagespanview
# import gfx.libutil.effects
from gzz.view import pagespanview
+reload(pagespanview)
+
+
from gfx.libutil import effects
from java.lang import System,Runnable
@@ -53,6 +56,21 @@
globalx = 0
globaly = 0
+filters = ["""
+ TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
+ TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
+ TexParameter TEXTURE_2D TEXTURE_MAX_ANISOTROPY_EXT 10
+""",
+"""
+ TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_NEAREST
+ TexParameter TEXTURE_2D TEXTURE_MAG_FILTER NEAREST
+ TexParameter TEXTURE_2D TEXTURE_MAX_ANISOTROPY_EXT 1
+""",
+]
+
+pagespanview.setFilters(filters[0])
+
+
def getCellPDFView(cell):
return pagespanview.CellPDFView(cell)
@@ -77,11 +95,11 @@
End
Enable TEXTURE_2D
""" % { "w": screensize[0], "h": screensize[1] } ) )
- fps = vs.coords.ortho(0, 10, 10, 20, 1.5, 1.5)
+ fps = vs.coords.ortho(0, 10, 10, 20, 30.5, 30.5)
vs.matcher.add(fps, "FPS")
vs.map.put(fps_text, fps, 0)
-style = GraphicsAPI.getInstance().getTextStyle("SansSerif",
java.awt.Font.PLAIN, 10)
+style = gzz.client.GraphicsAPI.getInstance().getTextStyle("SansSerif",
java.awt.Font.PLAIN, 10)
contview = gzz.view.LinebrokenCellContentView(style)
cellview = gzz.view.BoxCellView(contview)
@@ -288,12 +306,30 @@
eye = 0.2,
),
Mode(
+ mag=(screensize[1]/4,screensize[1]/4), # full-screen
+ context=0,
+ movefocus=1,
+ eye = 0.2,
+ ),
+ Mode(
+ mag=(screensize[1]/2,screensize[1]/2), # full-screen
+ context=0,
+ movefocus=1,
+ eye = 0.2,
+ ),
+ Mode(
mag=(screensize[1],screensize[1]), # full-screen
context=0,
movefocus=1,
eye = 0.2,
),
Mode(
+ mag=(screensize[1]*4,screensize[1]*4), # full-screen
+ context=0,
+ movefocus=1,
+ eye = 0.2,
+ ),
+ Mode(
mag=(screensize[1]*2,screensize[1]/2), # full-screen
context=0,
movefocus=1,
@@ -393,6 +429,7 @@
print "Lod: ",pagespanview.globalLOD
AbstractUpdateManager.setNoAnimation()
AbstractUpdateManager.chg()
+ self.moveToCell(self.cursor)
elif key == 'p':
self.usefancypaper = not self.usefancypaper
AbstractUpdateManager.setNoAnimation()
@@ -423,6 +460,12 @@
self.corner2 = (pagex + random() * maxx, random() * maxy)
self.select()
print "Random selection: %s; %s" % (self.corner1, self.corner2)
+ elif key == 'f': # Change filter
+ rotatelist(filters)
+ pagespanview.setFilters(filters[0])
+ AbstractUpdateManager.setNoAnimation()
+ AbstractUpdateManager.chg()
+ self.moveToCell(self.cursor)
else:
return 1 # not handled