[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] libvob org/nongnu/libvob/AbstractBinder.java or...
From: |
Tuomas J. Lukka |
Subject: |
[ff-cvs] libvob org/nongnu/libvob/AbstractBinder.java or... |
Date: |
Mon, 18 Aug 2003 03:46:15 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/08/18 03:46:15
Modified files:
org/nongnu/libvob: AbstractBinder.java Binder.java Screen.java
org/nongnu/libvob/impl/gl: GLScreen.java
vob/putil : mipzipmaker.py
Log message:
Repainting, start working on anisotropic pdfimages
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/AbstractBinder.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/Binder.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/Screen.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/gl/GLScreen.java.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/putil/mipzipmaker.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: libvob/org/nongnu/libvob/AbstractBinder.java
diff -u libvob/org/nongnu/libvob/AbstractBinder.java:1.3
libvob/org/nongnu/libvob/AbstractBinder.java:1.4
--- libvob/org/nongnu/libvob/AbstractBinder.java:1.3 Fri Mar 7 06:38:19 2003
+++ libvob/org/nongnu/libvob/AbstractBinder.java Mon Aug 18 03:46:15 2003
@@ -33,6 +33,9 @@
this.screen = s;
}
public void mouse(MouseEvent e) { }
+ public void repaint() {
+ this.screen.repaint();
+ }
public void windowClosed() { }
public void timeout(Object id) { }
}
Index: libvob/org/nongnu/libvob/Binder.java
diff -u libvob/org/nongnu/libvob/Binder.java:1.3
libvob/org/nongnu/libvob/Binder.java:1.4
--- libvob/org/nongnu/libvob/Binder.java:1.3 Sat Aug 2 03:42:44 2003
+++ libvob/org/nongnu/libvob/Binder.java Mon Aug 18 03:46:15 2003
@@ -48,6 +48,12 @@
*/
void timeout(Object id);
+ /** A repaint event was received.
+ * The window should be repainted at the earliest opportunity
+ * (during this call is fine).
+ */
+ void repaint();
+
/** A window has been closed by the user.
*/
void windowClosed();
Index: libvob/org/nongnu/libvob/Screen.java
diff -u libvob/org/nongnu/libvob/Screen.java:1.3
libvob/org/nongnu/libvob/Screen.java:1.4
--- libvob/org/nongnu/libvob/Screen.java:1.3 Fri Apr 25 07:17:54 2003
+++ libvob/org/nongnu/libvob/Screen.java Mon Aug 18 03:46:15 2003
@@ -37,7 +37,7 @@
*/
public class Screen implements AbstractUpdateManager.Window {
- public static final String rcsid = "$Id: Screen.java,v 1.3 2003/04/25
11:17:54 tjl Exp $";
+ public static final String rcsid = "$Id: Screen.java,v 1.4 2003/08/18
07:46:15 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
@@ -60,8 +60,9 @@
protected VobScene prev, next;
- protected float latestFract = 0;
+ protected float latestFract = -2;
protected float latestLod = 0;
+ protected boolean latestShowFinal = false;
public Screen(GraphicsAPI.Window window, Binder binder, Shower shower) {
this.window = window;
@@ -119,14 +120,25 @@
/** Renders and display current view state on screen
*/
public void renderStill(float lod) {
+ latestFract = -1;
+ latestLod = lod;
window.renderStill(prev, lod);
}
public void renderAnim(float fract, float lod, boolean showFinal) {
latestFract = fract;
latestLod = lod;
+ latestShowFinal = showFinal;
window.renderAnim(prev, next, fract, lod, showFinal);
}
public VobScene getVobSceneForEvents() { return next != null ? next :
prev; }
+
+ public void repaint() {
+ if(latestFract == -2) return;
+ if(latestFract == -1)
+ window.renderStill(prev, latestLod);
+ else
+ window.renderAnim(prev, next, latestFract, latestLod,
latestShowFinal);
+ }
}
Index: libvob/org/nongnu/libvob/impl/gl/GLScreen.java
diff -u libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.8
libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.9
--- libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.8 Sat Aug 2 05:07:11 2003
+++ libvob/org/nongnu/libvob/impl/gl/GLScreen.java Mon Aug 18 03:46:15 2003
@@ -37,17 +37,16 @@
import org.nongnu.libvob.gl.*;
public class GLScreen extends GLRenderingSurface implements GraphicsAPI.Window
{
-public static final String rcsid = "$Id: GLScreen.java,v 1.8 2003/08/02
09:07:11 tjl Exp $";
+public static final String rcsid = "$Id: GLScreen.java,v 1.9 2003/08/18
07:46:15 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.out.println("GLScreen:: " + s); }
- java.awt.Canvas fakeSource = new java.awt.Canvas();
-
HashMap timeouts = new HashMap();
class GLEventHandler implements GL.EventHandler {
public void repaint() {
if(dbg) pa("GLScreen repaint ");
+ binder.repaint();
}
public void keystroke(String s) {
if(dbg) pa("GLScreen keyevent "+s);
Index: libvob/vob/putil/mipzipmaker.py
diff -u libvob/vob/putil/mipzipmaker.py:1.3 libvob/vob/putil/mipzipmaker.py:1.4
--- libvob/vob/putil/mipzipmaker.py:1.3 Mon Jun 30 08:21:49 2003
+++ libvob/vob/putil/mipzipmaker.py Mon Aug 18 03:46:15 2003
@@ -34,7 +34,6 @@
import getopt
from java.lang import Runnable, System
from java.util import zip
-from java import io
import java
import vob
import vob.putil.dbg
@@ -70,13 +69,32 @@
format = "COMPRESSED_RGB_S3TC_DXT1_EXT"
suffix = ".mipzip"
-def makeMipzip(image, mipzip):
+def _clipmax(x, max):
+ if max < 0: return x
+ if max > x: return x
+ return max
+
+def makeMipzip(image, mipzip, maxwidth=-1, maxheight=-1):
+ """Convert the given image file into a mipzip file.
+
+ image -- the image file name
+ mipzip -- the mipzip file name
+ maxwidth -- if image is wider than maxwidth, cut off edge
+ maxheight -- if image is taller than maxheight, cut off edge
+ """
+
_init()
GL.freeQueue()
im = GL.createImage(image)
- d = im.getSize();
- print d
+ d0 = im.getSize();
+ print d0
+ d = java.awt.Dimension(
+ _clipmax(d0.width, maxwidth),
+ _clipmax(d0.height, maxheight),
+ )
+
+
w = roundup2(d.width)
h = roundup2(d.height)
tex = GL.createTexture()
@@ -86,7 +104,7 @@
print "Write ",mipzip
- out = zip.ZipOutputStream(io.FileOutputStream(mipzip))
+ out = zip.ZipOutputStream(java.io.FileOutputStream(mipzip))
entry = zip.ZipEntry("texformat")
entry.setComment(format)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ff-cvs] libvob org/nongnu/libvob/AbstractBinder.java or...,
Tuomas J. Lukka <=