Re: [gtkmm] Indexed image on Gdk::Pixbuf



"Find All" <find_all hotmail com> writes:

> I have the image as a buffer in memory of 8 bits per color with the palette
> also in memory on another buffer of 3 bytes per color (256 colors).
> The problem is : How do I put this image into a Gdk::Pixbuf without
> converting it
> to a 24 or 32 bits format?
> If I do the conversion I waste a lot of time.

I don't know how to solve this inside X, but are you sure it isn't
best to just to the conversion yourself? If you are displaying the
image on an ordinary screen anyway, someplace in X something is likely
to have to convert it to the higher bit depth anyway. So you won't
save anything at all.

Also, unless you're converting lots of images, you will have plenty of
time. Without having timed it, I would bet that you could easily
convert 100 images with the resolution 1024x768 in a second. That's
plenty of time for most purposes. Premature optimisation is the root
of all evil, and all that... :-)

> If it is imposible to put directly a 8 bits indexed image into a
> pixbuf, can I put the image to a Gtk::Image or Gdk::Image in 8 bits
> and then transfer it to the Gdk::Pixbuf? How?

I think you are misunderstanding something. As far as I know, the data
in Gdk::Pixbufs are always 24 bpp. But I may be wrong.

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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