gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] libvob bench/mark.py include/vob/jni/Types.hxx ...


From: Tuomas J. Lukka
Subject: [Gzz-commits] libvob bench/mark.py include/vob/jni/Types.hxx ...
Date: Tue, 15 Apr 2003 09:54:20 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Tuomas J. Lukka <address@hidden>        03/04/15 09:54:20

Modified files:
        bench          : mark.py 
        include/vob/jni: Types.hxx 
        org/nongnu/libvob/gl: GL.java 
        src/jni        : Makefile 
        vob/demo       : fpfont.py 
Added files:
        src/jni        : Image.cxx 
        vob/util       : mipzipmaker.py 

Log message:
        Mipzipping works again

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/bench/mark.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/jni/Types.hxx.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/gl/GL.java.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Image.cxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Makefile.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/fpfont.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/util/mipzipmaker.py?rev=1.1

Patches:
Index: libvob/bench/mark.py
diff -u libvob/bench/mark.py:1.5 libvob/bench/mark.py:1.6
--- libvob/bench/mark.py:1.5    Mon Apr 14 00:46:28 2003
+++ libvob/bench/mark.py        Tue Apr 15 09:54:20 2003
@@ -68,7 +68,8 @@
            ms = total / iters * 1000
            # print "Now: ",iters,total,ms
        print ou
-       print ms, "ms   with ",iters," in ",total,"\n"
+       print ms, "ms   with ",iters," in ",total
+       print 1000.0 / ms,"per second\n"
 
 if __name__ == "__main__":
     import getopt
Index: libvob/include/vob/jni/Types.hxx
diff -u libvob/include/vob/jni/Types.hxx:1.20 
libvob/include/vob/jni/Types.hxx:1.21
--- libvob/include/vob/jni/Types.hxx:1.20       Fri Apr 11 16:41:24 2003
+++ libvob/include/vob/jni/Types.hxx    Tue Apr 15 09:54:20 2003
@@ -38,6 +38,7 @@
 
 #include <vob/jni/Strings.hxx>
 #include <vob/paper/Paper.hxx>
+#include <vob/util/ImageLoader.hxx>
 
 
 
@@ -68,6 +69,8 @@
     extern ObjectStorer<Vob> vob3s;
     extern ObjectStorer<Os::RenderingSurface> windows;
     extern ObjectStorer<ByteVector> bytevectors;
+
+    extern ObjectStorer<ImageLoader::RGBARaster> images;
 
 
     typedef ::Vob::Paper::Paper P; // g++3.2 doesn't like ::... inside
Index: libvob/org/nongnu/libvob/gl/GL.java
diff -u libvob/org/nongnu/libvob/gl/GL.java:1.10 
libvob/org/nongnu/libvob/gl/GL.java:1.11
--- libvob/org/nongnu/libvob/gl/GL.java:1.10    Wed Apr  9 06:54:22 2003
+++ libvob/org/nongnu/libvob/gl/GL.java Tue Apr 15 09:54:20 2003
@@ -329,6 +329,39 @@
     static private native void impl_Window_move(int id, int x, int y);
     static private native void impl_Window_resize(int id, int w, int h);
 
+//--------- Image
+    /** A buffer on the C++ side, containing a single image.
+     */
+    static public class Image extends NonRenderableJavaObject {
+       private Image(int id) { super(id); }
+       protected void deleteObj() { deleteImage(getId()); }
+       /** Get the size of this Image.
+        * @param dimno The dimension (0=x, 1=y) to get.
+        */
+       public int getSize(int dimNo) { return getImageSize(getId(), dimNo); }
+       public Dimension getSize() {
+           return new Dimension( getSize(0), getSize(1) );
+       }
+    }
+
+    /** Create a new image from the prescribed file.
+     * THIS METHOD IS A SEVERE SECURITY HOLE AND WILL BE REMOVED OR ADJUSTED
+     * TO USE A SECURITY MANAGER OR SO.
+     * Exploit: load something that the image loader library doesn't like...
+     * Need to work out how this should properly interact with mediaserver.
+     * <p>
+     * This method is VERY special: it is NOT necessary to have
+     * an OpenGL context for the thread it uses since
+     * it is <b>guaranteed</b> not to use OpenGL.
+     */
+    static public Image createImage(String filename) {
+       return new Image(createImageImpl(filename));
+    }
+    static private native int createImageImpl(String filename);
+    static private native void deleteImage(int i);
+    static private native int getImageSize(int id, int dimNo);
+
+
 //--------- Texture
     /** A texture object. Represents a single OpenGL texture object.
      * Here, id == directly the texture id.
@@ -437,6 +470,12 @@
        public void downsampleInto(Texture into, String target, int levelFrom, 
String internalFormat, String transferformat) {
            impl_Texture_downsampleInto(getId(), into.getId(), target, 
levelFrom,
                    internalFormat, transferformat);
+       }
+
+       /** Load an image into a part of this texture.
+        */
+       public void loadSubImage(int level, Image img, int x, int y, int xoffs, 
int yoffs, int w, int h) {
+           impl_Texture_loadSubImage(getId(), level, img.getId(), x, y, xoffs, 
yoffs, w, h);
        }
 
        /** Read into this texture from screen.
Index: libvob/src/jni/Makefile
diff -u libvob/src/jni/Makefile:1.24 libvob/src/jni/Makefile:1.25
--- libvob/src/jni/Makefile:1.24        Tue Apr  8 08:55:50 2003
+++ libvob/src/jni/Makefile     Tue Apr 15 09:54:20 2003
@@ -5,7 +5,7 @@
 VOB_OBJS = $(VOBS:%=%.vobjniobj)
 TRANS_OBJS = $(TRANS:%=%.transjniobj)
 
-sources = TransFactory.cxx Main.cxx Strings.cxx Transform.cxx Render.cxx 
Font.cxx Paper.cxx
+sources = TransFactory.cxx Main.cxx Strings.cxx Transform.cxx Render.cxx 
Font.cxx Paper.cxx Image.cxx
 
 
 
Index: libvob/vob/demo/fpfont.py
diff -u libvob/vob/demo/fpfont.py:1.4 libvob/vob/demo/fpfont.py:1.5
--- libvob/vob/demo/fpfont.py:1.4       Fri Apr 11 16:41:24 2003
+++ libvob/vob/demo/fpfont.py   Tue Apr 15 09:54:20 2003
@@ -139,7 +139,7 @@
     dists *= 16;
 
 
-    fixed c = dot(dists <= maxrad, fixed4(1,1,1,1)) / 4;
+    fixed c = dot(1-smoothstep(float4(0,0,0,0), maxrad, dists), 
fixed4(1,1,1,1)) / 4;
 
     fixed rgb = (1 - c);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]