swig: add libwebp.jar/libwebp_java_wrap.c
for the swig-impaired Change-Id: I10711c057c11bd9e59bc382fe3c6337883f5c4a6
This commit is contained in:
parent
f6fb3877ed
commit
d041efae00
34
swig/README
Normal file
34
swig/README
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
Building:
|
||||||
|
=========
|
||||||
|
|
||||||
|
JNI SWIG bindings:
|
||||||
|
------------------
|
||||||
|
$ gcc -shared -fPIC -fno-strict-aliasing -O2 \
|
||||||
|
-I/path/to/your/jdk/includes \
|
||||||
|
libwebp_java_wrap.c \
|
||||||
|
-lwebp \
|
||||||
|
-o libwebp_jni.so
|
||||||
|
|
||||||
|
-------------------------------------- BEGIN PSEUDO EXAMPLE
|
||||||
|
import com.google.webp.*;
|
||||||
|
import java.io.*;
|
||||||
|
|
||||||
|
public class libwebp_jni_example {
|
||||||
|
static {
|
||||||
|
System.loadLibrary("webp_jni");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* usage: java -cp libwebp.jar:.
|
||||||
|
* libwebp_jni_example <input.webp> <output.ppm>
|
||||||
|
*/
|
||||||
|
public static void main(String argv[]) {
|
||||||
|
final int version = libwebp.WebPGetDecoderVersion();
|
||||||
|
|
||||||
|
System.out.println("libwebp version: " + Integer.toHexString(version));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-------------------------------------- END PSEUDO EXAMPLE
|
||||||
|
|
||||||
|
$ javac -cp libwebp.jar libwebp_jni_example.java
|
||||||
|
$ java -Djava.library.path=. -cp libwebp.jar:. libwebp_jni_example
|
BIN
swig/libwebp.jar
Normal file
BIN
swig/libwebp.jar
Normal file
Binary file not shown.
1256
swig/libwebp_java_wrap.c
Normal file
1256
swig/libwebp_java_wrap.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user