Re: How to store Gdk::Pixbuf pixels into std::string objects



On Mon, 2015-02-23 at 22:21 +0100, Markus Kolb wrote:
I'm trying to temporary store (because I need so) the image data
into a
std::string object. It seems that get_pixels() could solve the
problem,
getting a pointer of type guint8.

Seems that gdkmm is not up-to-date here.
gdk uses a guchar*. But this shouldn't be a problem.

Yes, you are right:
https://developer.gnome.org/gdk-pixbuf/unstable/gdk-pixbuf-The-GdkPixbuf-Structure.html#gdk-pixbuf-get-pixels

I don't think the function's return value ever changed in gdk-pixbuf and
I can't find any reason why we used guint8* in
Gdk::Pixbuf::get_pixels(). Maybe way back in 2003 we made some kind of
decision to do so - if we did then we didn't add a comment about it.

By the way, gdk_pixbuf_read_pixels(), which we don't wrap yet, does
return guint8*.

They are the same, so we could change it in gdkmm without breaking API
or ABI:
https://developer.gnome.org/glib/stable/glib-Basic-Types.html#guint8
https://developer.gnome.org/glib/stable/glib-Basic-Types.html#guchar

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com




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