[Xcb] Displaying DIBs using xcb-util/xcb

Jeetu Golani jeetu.golani at gmail.com
Thu Jul 16 13:30:20 PDT 2009


Hi Peter,

Thanks for replying. Hope you've been good.

> XCB/util does provide image conversion helpers that will change depth
> and swap byte orders as necessary. What it does not do is handle any
> sort of palette (depth 4 or depth 8 DIBs drawn onto a TrueColor
> screen, or TrueColor DIBs drawn to a PseudoColor screen).

Would appreciate if you could tell me which helper functions would help me 
change depth and swap byte orders.

Is there an example someone could point me towards using the 
xcb_create_pixmap_from_bitmap_data function?

The documentation suggests it needs the bitmap data in xbm format which I'm 
assuming it needs a basic header of width height followed by bitmap data. 
Would appreciate if someone can give me more information of this format for 
colour pixmaps say 32bpp. I also wonder that in a DIB information is stored 
in the order Blue, Green, Red intensities....is it the same for an X Pixmap 
or is it reversed?

Since I don't need any hard core conversion between different formats and 
simply want to display a DIB to X using XCB I'm averse to using ImagicMagick 
or a complex library. I'll go through the xli software though I think it 
would rely on xlib and I wonder if the format used would be different than 
what the xcb/xlib functions would use.

Thanks.

Bye for now




On Thursday 16 Jul 2009, you wrote:
> On Thu, Jul 16, 2009 at 8:17 AM, Jeetu Golani wrote:
> > I want to display a DIB onto an X server using XCB and I would
> > appreciate if someone could give me pointers. I've been toying with
> > the image libarary which is part of xcb-util though I don't mind using
> > core xcb too. From what I understand the possible issues could include
> > different depths between DIB and X Server and a need to convert
>
> XCB/util does provide image conversion helpers that will change depth
> and swap byte orders as necessary. What it does not do is handle any
> sort of palette (depth 4 or depth 8 DIBs drawn onto a TrueColor
> screen, or TrueColor DIBs drawn to a PseudoColor screen).
>
> You may wish to look into an image utility library such as ImageMagick
> if you need more flexible image format conversion. Also, looking at
> the source code for xli <http://packages.debian.org/lenny/xli> may
> provide some guidance.
>
> Peter Harris




More information about the Xcb mailing list