5 messages in net.java.dev.jna.usersRe: [jna-users] Re: Rendering a Graph...
FromSent OnAttachments
Cameron TaggartNov 26, 2007 12:03 am 
Timothy WallNov 26, 2007 6:52 am 
Cameron TaggartNov 26, 2007 9:01 am 
Timothy WallNov 26, 2007 9:37 am 
Wayne MeissnerNov 26, 2007 7:49 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Re: Rendering a Graph with GraphvizActions...
From:Wayne Meissner (wmei@gmail.com)
Date:Nov 26, 2007 7:49:45 pm
List:net.java.dev.jna.users

Some platforms have a 'memstream' type of stdio file - i.e. it provides all the stdio operations that you would expect from a FILE* (apart from fileno()), and writes to an block of memory. If your platform doesn't have that, there are some examples around on how to write a FILE* that does that. It should be possible to implement a FILE* that outputs using JNA based callbacks - it would be a bit slow, however.

On 27/11/2007, Cameron Taggart <came@gmail.com> wrote:

That gvRenderData doesn't do what I thought it would, so back to my original question...

How can I map the file pointer in this method?

int gvRender (GVC_t * gvc, graph_t * g, char * format, FILE * out);

I was thinking something like this:

public int gvRender(Pointer gvc, Pointer g, String format, ??? out);

I was hoping to be able to render the output to memory (on the heap[1]); [1] http://weblogs.java.net/blog/mlam/archive/2007/08/cvm_why_use_the.html

cheers, Cameron

On Nov 26, 2007 12:04 AM, Cameron Taggart <came@gmail.com> wrote:

The library I'm trying to map to is Graphviz. To render an graph, there are three methods[1]: gvRender, gvRenderData, and gvRenderFilename. I was able to get gvRenderFilename to work using JNA, but I'm looking for a way to not write the file to disk. May be gvRenderData would work, but my C programming abilities are failing me and I'm not sure what to pass in for the "char ** result" argument in C or Java via JNA.

[1] http://www.graphviz.org/pub/graphviz/CURRENT/doxygen/html/gvc_8c.html#c81890a1c646b7534fc23350b8d3f85f

On Nov 25, 2007 2:55 PM, Cameron Taggart <came@gmail.com>

wrote:

I want to render an image to an java.io.OutputStream. I want to use a C library to render that image and the function looks like:

render(File *out);

Any ideas how this might be accomplished? Must the image be rendered to a file system in C and then read in Java once complete? Is there any way to not write it to disk first?

cheers, Cameron