libwebp/swig
James Zern b4f5bb6ca3 swig: cosmetics
normalize formatting
- update decode prototypes
- match project function name style

Change-Id: Ib481b5602171b72dbb1a5d462e6d5166e9b8566e
(cherry picked from commit 7f5f42bb36)
2013-06-11 15:00:45 -07:00
..
libwebp_java_wrap.c swig: cosmetics 2013-06-11 15:00:45 -07:00
libwebp.i swig: cosmetics 2013-06-11 15:00:45 -07:00
libwebp.jar swig: add WebPEncodeLossless* wrappers 2012-07-17 14:41:51 -07:00
README swig/java: basic encode support 2011-06-15 10:37:53 -07:00

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.libwebp;

import java.lang.reflect.Method;

public class libwebp_jni_example {
  static {
    System.loadLibrary("webp_jni");
  }

  /**
   * usage: java -cp libwebp.jar:. libwebp_jni_example
   */
  public static void main(String argv[]) {
    final int version = libwebp.WebPGetDecoderVersion();
    System.out.println("libwebp version: " + Integer.toHexString(version));

    System.out.println("libwebp methods:");
    final Method[] libwebpMethods = libwebp.class.getDeclaredMethods();
    for (int i = 0; i < libwebpMethods.length; i++) {
      System.out.println(libwebpMethods[i]);
    }
  }
}
-------------------------------------- END PSEUDO EXAMPLE

 $ javac -cp libwebp.jar libwebp_jni_example.java
 $ java -Djava.library.path=. -cp libwebp.jar:. libwebp_jni_example