libwebp/swig
James Zern e4e7fcd69b swig: add basic go bindings
WebPGetDecoderVersion
WebPGetInfo

Change-Id: Icb66207c2f492c9d20642544c0b31cc92b91cdcc
2013-10-29 21:44:20 +01:00
..
libwebp_gc.c swig: add basic go bindings 2013-10-29 21:44:20 +01:00
libwebp_go_wrap.c swig: add basic go bindings 2013-10-29 21:44:20 +01:00
libwebp_java_wrap.c Merge "swig: add python encode support" 2013-05-21 14:48:36 -07:00
libwebp_python_wrap.c swig/python: add minimal documentation 2013-05-20 17:14:51 -07:00
libwebp.go swig: add basic go bindings 2013-10-29 21:44:20 +01:00
libwebp.jar libwebp.jar: build w/Java 1.6 for Android compat 2013-10-11 17:59:37 +02:00
libwebp.py swig/python: add minimal documentation 2013-05-20 17:14:51 -07:00
libwebp.swig swig: add basic go bindings 2013-10-29 21:44:20 +01:00
README swig: add python (decode) support 2013-05-09 23:29:35 -07:00
setup.py swig: add python (decode) support 2013-05-09 23:29:35 -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