libwebp/swig
James Zern 6fe536f4ba swig/java: rework uint8_t typemap
reuse the declarations from arrays_java.i for signed char to make an
explicit uint8_t mapping. this avoids sign conversion build warnings.

Change-Id: Icfb5b865cf1fd404e89f2cd889111f0a94e3c604
(cherry picked from commit ad4a367dba)
2013-06-11 15:00:47 -07:00
..
libwebp_java_wrap.c swig/java: rework uint8_t typemap 2013-06-11 15:00:47 -07:00
libwebp_python_wrap.c swig: add python (decode) support 2013-06-11 15:00:45 -07:00
libwebp.i swig/java: rework uint8_t typemap 2013-06-11 15:00:47 -07:00
libwebp.jar swig: add WebPEncodeLossless* wrappers 2012-07-17 14:41:51 -07:00
libwebp.py swig: add python (decode) support 2013-06-11 15:00:45 -07:00
README swig: add python (decode) support 2013-06-11 15:00:45 -07:00
setup.py swig: add python (decode) support 2013-06-11 15:00:45 -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

Python SWIG bindings:
---------------------
 $ python setup.py build_ext
 $ python setup.py install --prefix=pylocal

-------------------------------------- BEGIN PSEUDO EXAMPLE
import glob
import sys
sys.path.append(glob.glob('pylocal/lib/python*/site-packages')[0])

from com.google.webp import libwebp
print "libwebp decoder version: %x" % libwebp.WebPGetDecoderVersion()

print "libwebp attributes:"
for attr in dir(libwebp): print attr
-------------------------------------- END PSEUDO EXAMPLE