ImageByteOrder(3)
π
ImageByteOrder β the Xlib functions & macros page (yes bestie, another libX11 classic)
okay so this is ImageByteOrder(3) from XLIB FUNCTIONS, and it's basically the group chat where all the image-format questions live: ImageByteOrder, BitmapBitOrder, BitmapPad, BitmapUnit, DisplayHeight, DisplayHeightMM, DisplayWidth, DisplayWidthMM, XListPixmapFormats, and XPixmapFormatValues. Not me covering ten whole things in one page π but fr they're all lowkey related, so slay.
πΈ NAME πΈ
ImageByteOrder, BitmapBitOrder, BitmapPad, BitmapUnit, DisplayHeight, DisplayHeightMM, DisplayWidth, DisplayWidthMM, XListPixmapFormats, XPixmapFormatValues β image format functions and macros. iconic behavior, no notes β¨
π SYNTAX π
okay bestie here's how you actually call them, verbatim, don't @ me:
XPixmapFormatValues *XListPixmapFormats(Display *display, int
*count_return);
int ImageByteOrder(Display *display);
int BitmapBitOrder(Display *display);
int BitmapPad(Display *display);
int BitmapUnit(Display *display);
int DisplayHeight(Display *display, int screen_number);
int DisplayHeightMM(Display *display, int screen_number);
int DisplayWidth(Display *display, int screen_number);
int DisplayWidthMM(Display *display, int screen_number);
π¦ ARGUMENTS π¦
displayβ the connection to the X server. your whole link to the server, your main character connection, the one that has to be there. πcount_returnβ returns the number of pixmap formats that are supported by the display. so this is an out-param, it gives you back a count, it's giving very generous. π«Άscreen_numberβ specifies the appropriate screen number on the host server. yes like multiple screens, pick your fave (but like, the correct one). π
β¨ DESCRIPTION β¨
okay the big one:
The XListPixmapFormats function returns an array of XPixmapFormatValues structures that describe the types of Z format images supported by the specified display. If insufficient memory is available, XListPixmapFormats returns NULL. And to free the allocated storage for the XPixmapFormatValues structures, use XFree. yes bestie there's cleanup, we don't leak memory here, XFree is the responsible queen of this story π
The ImageByteOrder macro specifies the required byte order for images for each scanline unit in XY format (bitmap) or for each pixel value in Z format. so it's literally telling you what order the bytes need to be in, respect it. π
The BitmapBitOrder macro returns LSBFirst or MSBFirst to indicate whether the leftmost bit in the bitmap as displayed on the screen is the least or most significant bit in the unit. literally just "which end is the important end" energy and honestly relatable. π§
The BitmapPad macro returns the number of bits that each scanline must be padded. padding! even bitmaps need their personal space π
The BitmapUnit macro returns the size of a bitmap's scanline unit in bits. it's the unit. of the scanline. of the bitmap. slay. β¨
The DisplayHeight macro returns the height of the specified screen in pixels. π
The DisplayHeightMM macro returns the height of the specified screen in millimeters. metric icon π¦
The DisplayWidth macro returns the width of the screen in pixels.
The DisplayWidthMM macro returns the width of the specified screen in millimeters. and yeah this one says "the specified screen" too, keep the wording, it's the vibe π
π STRUCTURES π
The XPixmapFormatValues structure provides an interface to the pixmap format information that is returned at the time of a connection setup. It contains:
typedef struct {
int depth;
int bits_per_pixel;
int scanline_pad;
} XPixmapFormatValues;
three ints, no drama, exactly like that. do not add fields bestie I am begging π
π₯ SEE ALSO π₯
AllPlanes(3)BlackPixelOfScreen(3)IsCursorKey(3)XFree(3)Xlib - C Language X Interface
go read those too, iykyk π«Ά
β οΈ tiny note bestie:XListPixmapFormatscan returnNULLif there's not enough memory, and you gottaXFreethat array. no cap, don't forget. π
petition to make every manpage this cute, honestly. this one's from X Version 11, libX11 1.8.14, and it was serving on the ImageByteOrder(3) page β mwah, periodt π
ππ
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms