Re: colromaps/visuals



The idea of gdkrgb is that you do not have to worry about
visuals/colormaps when rendering RGB data.  To use gdkrgb, make sure that
your widget is using the gdkrgb colormap and visual.  To do this, put the
following commands just before creating the widget:
    gtk_widget_push_colormap(gdk_rgb_get_cmap());
    gtk_widget_push_visual(gdk_rgb_get_visual());

and after creating the widget, use:
    gtk_widget_pop_colormap();
    gtk_widget_pop_visual();

Now you can use gdk_draw_rgb_image on the widget's GdkWindow.

The gdk_draw_rgb_32_image function does not handle alpha transparency.  It
just assumes that the image data is aligned on 32 bit boundaries (as it
may be after performing your own alpha composition (such as with libart)).

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Tue, 17 Aug 1999 Mlacage@aol.com wrote:

> hi,
> 
> my question of the day: today, i went down to gdk_rgb/gdk/xlib stuff (after 
> libart...)
> 
> Well, it seems that i lack some background informtion on graphics systems:
> first, what is a PSEUDO COLOR STATIC visual ?
> 
> Second, what is a colorcube (from gdkrgb) ? i more or less understand what a 
> colormap is but a colorcube ?? Is it only used for dithering ?
>  btw: how should i use gdk_rgb ? 
> gdk_rgb_init, then a call to one of gdk_draw_*_image ?
> If so: stop me when i am wrong: 32_rgb buffers are simple arrays each entry 
> beeing  4 bytes : r, g, b and alpha. but indexed buffers are just arrays 
> where each entry a a byte beeing the offset in our colormap lookup table 
> (which we build with gdk_rgb_colormap_new).
> 
> third, if i understood well the various answers i had from people here (thank 
> you everyone for bearing my answers and answering them), libart may rander in 
> an rgb buffer its pixbuf buffer. so: 
> image-file -> gdk-pixbuf : pixbuf buffer . transforms -> gdk-rgb : GdkImage 
> drawn in a GdkDrawable with a call to gdk_draw_image
> mm... this is a lot of work: it is really fast ?
> 
> Thanks for any answers.
> Mathieu
> 
> BTW: i downloaded gdk-pixbuf... VERY nice architecture miguel. I suppose this 
> thing will a transformed into a bonobo component someday. I would nicer to 
> use it than the sample bonobo img/x-png component...
> 
> 
> -- 
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
> 



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