title: JNA pointer to pointer mapping
body: <p>I am working on a Java binding for the excellent <code>libvips</code> </p>
  
  <p>Using this function all is fine:</p>
  
  <pre><code>VipsImage *in;
  
  in = vips_image_new_from_file( test.jpg, NULL )
  vips_image_write_to_file( in, "out.jpg", NULL )
  </code></pre>
  
  <p>So mapped in Java:</p>
  
  <pre><code>Pointer vips_image_new_from_file(String filename,String params);
  </code></pre>
  
  <p>But I have a problem when the parameter like this:</p>
  
  <pre><code>VipsImage *in;
  VipsImage *out;
  
  vips_invert( in, &amp;out, NULL )
  vips_image_write_to_file( out, "out.jpg", NULL ) 
  </code></pre>
  
  <p>I have tried:  </p>
  
  <pre><code>int vips_resize(Pointer in, PointerByReference out, Double scale, String params);
  
  Pointer in = vips_image_new_from_file("file.png",null);
  
  PointerByReference ptr1 = new PointerByReference();
  
  vips_invert(in, ptr1, null);
  vips_image_write_to_file( ptr1.getValue(), "fileout.png", null);
  </code></pre>
  
  <p>But doesn't work. The <code>ptr1.getValue()</code> does not contains the expected result.</p>
  
  <p>How can I do it?</p>
  
  <p>Thanks</p>