Re: Using libart_lgpl directly




On Tue, 2 Feb 1999, Lyndon Drake wrote:
> 
> I'm working on a graphics device for R, so that things like plots can
> be displayed to the user.  I have a working device that displays plots
> on a GdkDrawingArea, and I also wrote an experimental device that uses
> the canvas.  Using the canvas produces very nice looking plots, but it
> also uses up lots of memory (eg 10,000 points uses up about 40MB of
> memory).  I realise that the canvas wasn't designed with this sort of
> thing in mind, but I would like to be able to have nice anti-aliased
> plots.
> 

I'm playing with this for Guppi. The reason it's using all that memory is
that you're using too many canvas objects (one for each point?) - either
that or you have a memory leak. 

The solution is to write your own canvas object to do the rendering. 
You can use libart_lgpl to do this (nice quality) or draw direct to the
RGB buffer (really fast) or some combination of the two.

guppi2/src/libguppi/canvas-scatter.c is the file that does this in Guppi.
It takes the direct-to-buffer approach right now.

> What I am considering doing is creating a widget, similar to
> GdkDrawingArea in some respects, for displaying static, 
> non-interactive graphics.  I envisage doing this by giving libart_lgpl
> a buffer or pixmap, and a command (eg. line_to).  libart could then
> render the line on the pixmap.  No information about the line would
> need to be kept, and the memory used to display the image would be the
> size of the pixmap.
> 
> Is it possible to use libart in this way?
> 

It is, sure. I'd copy the code from gnome-canvas.c. However, writing a
custom canvas item will get the same effect and is probably easier.

I'm sure Raph has more to say, I just thought I'd chime in since I'm
making plots too.

Havoc
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]