[gs-devel] ghostscript output devices

Russell Lang gsview at ghostgum.com.au
Thu Apr 3 02:56:27 PST 2003


Andreas,

> I need to have an output from ghostscript to some of the following
> devices:
> 
> - Linux-Framebuffer
> - DirectFB [1]
> - OpenGL
> - SDL
> 
> I looked at the availavle devices (gs -h) , but I've seen no device that
> fits my requirements. Are there patches or newer versions of ghostscript
> which support one of these devices?
> 
> If not, what could I do it? Is it a good solution to get images from gs
> and display them on the desired device? Other ideas...?

To make ghostscript write directly to an external framebuffer 
would require writing a new ghostscript device.

Something that is not quite as fast is to use the display 
device, then do a memcpy to copy that to the external 
framebuffer.  With appropriate parameters for the format and 
width, you should be able to make the memcpy reasonably 
efficient.  If you need progressive updates, then you can be 
told the bounding box of most drawing operations, and so copy to 
the frame buffer periodically.  See the file src/dxmain.c for an 
example of how the display device is used with gtk+.

If the framebuffer has each line padded out to a word length, 
and the lines are contiguous, and you can put up with some extra 
memory being needed at the end for row pointers, you might be 
able to make the display device use the external framebuffer.  
This is very messy and has lots of scope for things going wrong.

Contact me if you want to discuss how to use the display device.

Russell Lang                   gsview at ghostgum.com.au
Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/





More information about the gs-devel mailing list