jaewonjoo / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

webp version 0.4 swig jar no doc #197

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
all param  is no terrible  to understand
  where  i can  find  the doc?i don't know  how  to use this jar ,who can  help me  thank you.

  private static final int UNUSED = 1;
  private static int[] outputSize = { 0 };

  public static int WebPGetDecoderVersion()
  {
    return libwebpJNI.WebPGetDecoderVersion();
  }

  public static int WebPGetInfo(byte[] paramArrayOfByte, long paramLong, int[] paramArrayOfInt1, int[] paramArrayOfInt2) {
    return libwebpJNI.WebPGetInfo(paramArrayOfByte, paramLong, paramArrayOfInt1, paramArrayOfInt2);
  }

Original issue reported on code.google.com by thinkabu...@gmail.com on 19 Apr 2014 at 10:07

GoogleCodeExporter commented 9 years ago
Yes these are pretty raw and undocumented. A sample beyond what's in 
swig/README would help for all of these. They do attempt to wrap the simple 
encoding/decoding interfaces with minimal changes so the docs from 
webp/decode.h and webp/encode.h may help. Regenerating the source from the 
.swig would give you the java to look at.

Decoding can be done with something like:
    byte[] data = new byte[(int) inputFile.length()];
    int[] width = new int[1];
    int[] height = new int[1];
    byte[] rgb = libwebp.WebPDecodeRGB(data, data.length, width, height);

Note there's an image I/O plugin [1] that may serve you better.

[1] https://bitbucket.org/luciad/webp-imageio

Original comment by jz...@google.com on 20 Apr 2014 at 2:58