Re: pix buf and colormaps



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 (const guint8* data, Colorspace 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


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