Re: gdk pixbufs, rgbbufs, efficiency, painting onto them



I've tried this, it is fine but the problem is the availability of
primatives for drawing directly onto the buffer; especially stuff like text, splines and stuff. Unless I am mistaken, are such primatives available that
write directly to a gchar buffer?

Ah, sorry, I hadn't understood. There are a number of graphics
libraries which will render to a gchar buffer for you, for example
libart:

OK, I took a look at GnomeCanvas, looks pretty cool. However, I want to be perverse and still write directly to the buffer. I seem to be going round in circles, somebody please help me, I'm going mad.

The reason I wanted to draw directly to a buffer is because when drawing a CA, or a fractal for that matter, I set the color of each pixel individually. Calling gdk_draw_point on a pixbuf and using graphics contexts is going to be pretty slow to do this?

So intially I started using a gchar buffer (side note, I didn't realise I should have used a guchar buffer), and I was using the gdk_draw_image to draw this onto a drawing area. This was fine until I started wanting to zoom in and render different areas of the screen, I didn't want to waste time writing that code if it was available elsewhere.

So I looked at libart after suggestions for this list, but then noticed that gnomecanvas had cool features like the set pixel width and the scrollable area and so on, so I wanted to use that instead.

I have no idea what is going on with a gnomecanvas though. I am using gnome_canvas_new_aa(), because I wanted the buffer.

Now can someone tell me, can I still access the underlying buffer? or is this a completely ridiculous suggestion? Do I have to call a draw_point function instead? what is this function for the gnome-canvas?

Does the gnome canvas buffer automatically resize itself? Because presumably I should be allowed to access the buffer as long as it is not in the middle of being resized? Is access to the buffer thread safe? If I change the pixel width, does this alter the size of the underlying buffer, i.e and mess up any potential direct writing to the buffer, or is the pixel expansion done at the rendering stage?

As you can see, I've gone slightly mad, please help.

cali






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