From: <sw...@di...> - 2009-08-26 08:04:21
|
Hi, I'm new to SWIG. I've looked through the documentation and done some searching on-line but I'm rather baffled as to how to return an array of int to Java. It's probably easy to do but I'm not sure how to go about it and I haven't so far found any nice, simple examples. The C++ function I have is: int* blurImage(int* buff, int w, int h) and my blur.i file contains: %module blur %include <arrays_java.i> %{ /* Put header files here or function declarations like below */ extern int *blurImage(int buff[], int w, int h); %} extern int *blurImage(int buff[], int w, int h); However, this isn't really what I want. I don't want a pointer to an int, I want to be able to assign to a Java array: int[] buffer = <some array of ints> int[] buffer1 = blur.blurImage(buffer, 10, 10); How do I wrap the array and return it as a Java array? Thanks. |