xcb_glx_read_pixels(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ xcb_glx_read_pixels πŸ’…

okay bestie, so this is a page from the XCB Requests corner of the manual, and the whole vibe is literally called xcb_glx_read_pixels β€” yes the manual name is right there in the title, we're being efficient today πŸ’–


🌸 NAME 🌸

xcb_glx_read_pixels -

(yeah. that's it. that's the whole name section. the description slot is empty, no cap β€” the manpage authors left it blank like a group chat message that got sent too early 😭)


πŸŽ€ SYNOPSIS πŸŽ€

First things first, you gotta pull in the header:

#include <xcb/glx.h>

Request function

xcb_glx_read_pixels_cookie_t xcb_glx_read_pixels(xcb_connection_t *conn,
       xcb_glx_context_tag_t context_tag, int32_t x, int32_t y,
       int32_t width, int32_t height, uint32_t format, uint32_t type,
       uint8_t swap_bytes, uint8_t lsb_first);

Reply datastructure

typedef struct xcb_glx_read_pixels_reply_t {
    uint8_t  response_type;
    uint8_t  pad0;
    uint16_t sequence;
    uint32_t length;
    uint8_t  pad1[24];
} xcb_glx_read_pixels_reply_t;

Reply function

xcb_glx_read_pixels_reply_t
       *xcb_glx_read_pixels_reply(xcb_connection_t *conn,
       xcb_glx_read_pixels_cookie_t cookie, xcb_generic_error_t **e);

Reply accessors

uint8_t *xcb_glx_read_pixels_data(const xcb_glx_read_pixels_request_t
       *reply);

int xcb_glx_read_pixels_data_length(const xcb_glx_read_pixels_reply_t
       *reply);

xcb_generic_iterator_t xcb_glx_read_pixels_data_end(const
       xcb_glx_read_pixels_reply_t *reply);

(and yes, xcb_glx_read_pixels_data really does take an xcb_glx_read_pixels_request_t while its little sisters take the reply type. that's not me being sloppy, that's canon, we respect the lore 🫢)


✨ REQUEST ARGUMENTS ✨

  • conn β€” your XCB connection to X11. the whole reason we're here πŸ’«
  • context_tag β€” TODO: NOT YET DOCUMENTED. 🫠
  • x β€” TODO: NOT YET DOCUMENTED. 🫠
  • y β€” TODO: NOT YET DOCUMENTED. 🫠
  • width β€” TODO: NOT YET DOCUMENTED. 🫠
  • height β€” TODO: NOT YET DOCUMENTED. 🫠
  • format β€” TODO: NOT YET DOCUMENTED. 🫠
  • type β€” TODO: NOT YET DOCUMENTED. 🫠
  • swap_bytes β€” TODO: NOT YET DOCUMENTED. 🫠
  • lsb_first β€” TODO: NOT YET DOCUMENTED. 🫠
not me reading nine consecutive "TODO: NOT YET DOCUMENTED." like okay mystery behavior, we see you πŸ’€ fr the docs are just out here leaving us on read. i'm not gonna invent what they do because that would be lying and lying is not the vibe 🌸

πŸ’– REPLY FIELDS πŸ’–

  • response_type β€” the type of this reply, and in this case it's literally XCB_GLX_READ_PIXELS. this field also lives in the xcb_generic_reply_t, which is how you tell one reply apart from another, so it's giving main character energy in the generic struct too πŸ‘‘
  • sequence β€” the sequence number of the last request processed by the X11 server. the lil receipt number bestie 🧾
  • length β€” the length of the reply, in words. and a word here is 4 bytes, just so we're clear πŸ¦‹

🌈 DESCRIPTION 🌈

...it's empty. the section exists, the words do not. iconic of it honestly. nothing to report, no notes, the silence is the statement πŸ’…


⭐ RETURN VALUE ⭐

It returns an xcb_glx_read_pixels_cookie_t πŸͺ β€” that's your lil ticket, your lil promise that a reply is coming.

Errors? They have to be handled when you call the reply function xcb_glx_read_pixels_reply. That's the deal.

If you'd rather deal with errors in the event loop instead, then use xcb_glx_read_pixels_unchecked β€” that's the unchecked one, and it exists for exactly this. Peep xcb-requests(3) for the details on how all that works πŸ“–


πŸ”₯ ERRORS πŸ”₯

This request does never generate any errors.

Zero errors. Not one. Flawless. Untouchable. Ate and left no crumbs 😌✨ (ok but genuinely, that's what the manpage says, so don't go error-checking this one expecting drama)


πŸ¦‹ SEE ALSO πŸ¦‹

(blank! nothing linked. a lonely lil section, but we still show up for it 🫢)


πŸŽ€ AUTHOR πŸŽ€

Generated from glx.xml. If you've got corrections or improvements, hit up xcb@lists.freedesktop.org β€” they're literally asking, so don't be shy πŸ’Œ


and that's the whole page bestie!! πŸ₯³ this one came to you straight outta X Version 11, running libxcb 1.17.0, and yes it's xcb_glx_read_pixels(3) through and through 🌸✨ mwah, go read some pixels responsibly πŸ’…πŸ’–