Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
README | D | 12-May-2024 | 1.5 KiB | 57 | 45 | |
libwebp.go | D | 12-May-2024 | 1.2 KiB | 46 | 20 | |
libwebp.py | D | 12-May-2024 | 8 KiB | 236 | 181 | |
libwebp.swig | D | 12-May-2024 | 14 KiB | 439 | 375 | |
libwebp_gc.c | D | 12-May-2024 | 1.4 KiB | 53 | 28 | |
libwebp_go_wrap.c | D | 12-May-2024 | 6.4 KiB | 275 | 195 | |
libwebp_java_wrap.c | D | 12-May-2024 | 52.4 KiB | 1,766 | 1,490 | |
libwebp_python_wrap.c | D | 12-May-2024 | 169.5 KiB | 5,629 | 4,682 | |
setup.py | D | 12-May-2024 | 1.2 KiB | 41 | 32 |
README
1Building: 2========= 3 4JNI SWIG bindings: 5------------------ 6 $ gcc -shared -fPIC -fno-strict-aliasing -O2 \ 7 -I/path/to/your/jdk/includes \ 8 libwebp_java_wrap.c \ 9 -lwebp \ 10 -o libwebp_jni.so 11 12-------------------------------------- BEGIN PSEUDO EXAMPLE 13import com.google.webp.libwebp; 14 15import java.lang.reflect.Method; 16 17public class libwebp_jni_example { 18 static { 19 System.loadLibrary("webp_jni"); 20 } 21 22 /** 23 * usage: java -cp libwebp.jar:. libwebp_jni_example 24 */ 25 public static void main(String argv[]) { 26 final int version = libwebp.WebPGetDecoderVersion(); 27 System.out.println("libwebp version: " + Integer.toHexString(version)); 28 29 System.out.println("libwebp methods:"); 30 final Method[] libwebpMethods = libwebp.class.getDeclaredMethods(); 31 for (int i = 0; i < libwebpMethods.length; i++) { 32 System.out.println(libwebpMethods[i]); 33 } 34 } 35} 36-------------------------------------- END PSEUDO EXAMPLE 37 38 $ javac -cp libwebp.jar libwebp_jni_example.java 39 $ java -Djava.library.path=. -cp libwebp.jar:. libwebp_jni_example 40 41Python SWIG bindings: 42--------------------- 43 $ python setup.py build_ext 44 $ python setup.py install --prefix=pylocal 45 46-------------------------------------- BEGIN PSEUDO EXAMPLE 47import glob 48import sys 49sys.path.append(glob.glob('pylocal/lib/python*/site-packages')[0]) 50 51from com.google.webp import libwebp 52print "libwebp decoder version: %x" % libwebp.WebPGetDecoderVersion() 53 54print "libwebp attributes:" 55for attr in dir(libwebp): print attr 56-------------------------------------- END PSEUDO EXAMPLE 57