Re: [gtkmm] pixmap to pixbuf conversion

On Sat, Jan 18, 2003 at 06:32:37PM +0100, Ole Laursen wrote:
> > Then fiddle with the array, and finally write it back to the buffer
> > with Gdk::Pixbuf::create_from_data(...).
> Maybe I've misunderstood you, but I think this is wrong. The pointer
> you get from get_pixels is a pointer into the pixbuf datastructure. So
> you don't have to write anything back, you're changing the actual data.

Of course you are right. But I still copying the pixbuf data to its own
array, mainly because of the reason you stated below: It's much
easier to change pixel data if you have it in a proper data structure,
for instance a 2D array of tripples of guint8 values. Or in my case,
I need to feed the data to the fftw library, which wants a format of
it's own.

> The interface isn't very nice, though. I have a _much_ better one
> which uses iterators and can be used to access pixels directly - if
> you are interested, you can have a look here:
> There is test example here:

I'll certainly have a look at it! Thanks very much. Though you will
probably not get any feedback for the next time, because my current
project is just some small school work, and it's due tomorrow :)

Please make sure to let me know when you release it, either through
this mailing list or via a private mail.

greets, t.

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