2012-06-26 11:44, Kees Kling skrev:
Hi,

I have created a pix_buf from 8 bits data with the function
create_from_data <http://developer.gnome.org/gtkmm/stable/classGdk_1_1Pixbuf.html#a8a3b524f26acd2f9efc4abe9c294d341> (const guint8* data, Colorspace <http://developer.gnome.org/gtkmm/stable/group__gdkmmEnums.html#ga866d716154abb7f5be26bd36b3017d3f> colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride).

It displays fine, but only in greyscale, so I must attach a colortable, which maps a 8 bits value to an RGB color and preferable to an RGBA color. What the best way to do this, I can't find much documentation.


Regards

Kees Kling
The documentation of the C module gdk-pixbuf is located at http://developer.gnome.org/gdk-pixbuf/stable/. Perhaps you can find some information there, e.g. in "The GdkPixbuf Structure" section at
http://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-The-GdkPixbuf-Structure.html.

When I look at that documentation and a small part of the gdk-pixbuf source code, I get the impression that each pixel is represented by 3 or 4 bytes, called either channels or samples: one byte each for red, green, blue, and an optional byte for an alpha channel. But if that's the whole truth, I don't understand why you get only greyscale pictures.

Kjell
_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to