xcb_shm_get_image(3)
π xcb_shm_get_image π
okay so bestie, we're doing xcb_shm_get_image from the XCB Requests crew, and ngl this one is a whole vibe: it β¨copies data from the specified drawable to the shared memory segmentβ¨. that's it. that's the girl. let's get into it π«Ά
πΈ NAME πΈ
xcb_shm_get_image β copies data from the specified drawable to the shared memory segment. no cap, that is literally the entire job description π
β¨ SYNOPSIS β¨
#include <xcb/shm.h>
π Request function π
xcb_shm_get_image_cookie_t xcb_shm_get_image(xcb_connection_t *conn,
xcb_drawable_t drawable, int16_t x, int16_t y, uint16_t width,
uint16_t height, uint32_t plane_mask, uint8_t format,
xcb_shm_seg_t shmseg, uint32_t offset);
π¦ Reply datastructure π¦
typedef struct xcb_shm_get_image_reply_t {
uint8_t response_type;
uint8_t depth;
uint16_t sequence;
uint32_t length;
xcb_visualid_t visual;
uint32_t size;
} xcb_shm_get_image_reply_t;
π Reply function π
xcb_shm_get_image_reply_t
*xcb_shm_get_image_reply(xcb_connection_t *conn,
xcb_shm_get_image_cookie_t cookie, xcb_generic_error_t **e);
π REQUEST ARGUMENTS π
connβ the XCB connection to X11. your link to the mothership, the whole reason any of this works πdrawableβ the drawable we're copying the image OUT of. source material, main character energy β¨xβ the X coordinate in the drawable to begin copying at. where the snip starts, horizontally πyβ the Y coordinate in the drawable to begin copying at. same deal but vertical, bestie πwidthβ the width of the image to copy. how wide we're going πheightβ the height of the image to copy. how tall we're going πplane_maskβ a mask that determines which planes are used. lowkey just: which planes get invited to the party ποΈformatβ the format to use for the copy (???). yeah bestie the docs themselves are like "???" here, so I'm not gonna pretend to know better than the manpage πshmsegβ the destination shared memory segment. where the pixels are moving TO π‘offsetβ the offset in the shared memory segment to copy data to. not at the very start? say less, here's your offset β¨
π REPLY FIELDS π
response_typeβ the type of this reply, and in this case it'sXCB_SHM_GET_IMAGE. this field also lives in thexcb_generic_reply_t, and it's the whole trick for telling your replies apart from each other. iykyk πsequenceβ the sequence number of the last request processed by the X11 server. receipts, basically π§Ύlengthβ the length of the reply, in words (and a word is 4 bytes, periodt) πdepthβ the depth of the source drawable. how deep the source runs πvisualβ the visual ID of the source drawable. its little ID card πͺͺsizeβ the number of bytes copied. the final count, and she ate π₯
π DESCRIPTION π
Copy data from the specified drawable to the shared memory segment.
and here's the detail that makes people go "wait, what": the amount of bytes written to the destination image is always equal to the number of bytes read from the shared memory segment. like, that's the rule. no notes. symmetric queen π
β RETURN VALUE β
Returns an xcb_shm_get_image_cookie_t. errors have to be handled when you call the reply function, xcb_shm_get_image_reply.
if you'd rather handle errors in the event loop instead, use xcb_shm_get_image_unchecked. see xcb-requests(3) for details. pick your fighter, both are valid π«Ά
π ERRORS π
this request does never generate any errors. not one. zero. a clean slate, a flawless record, an icon who has never been in drama πβ¨
π₯ SEE ALSO π₯
πΈ AUTHOR πΈ
Generated from shm.xml. contact xcb@lists.freedesktop.org for corrections and improvements. (yes bestie, if something's off, email the list, they're lovely π«Ά)
and that's the whole page!! xcb_shm_get_image(3), straight out of libxcb 1.17.0, X Version 11 energy, delivered to you with love πβ¨ no cap, you're gonna slay this one π
π¦ where this page comes from
- alpine 3.22: libxcb-doc 1.17.0-r0 Β· MIT
- alpine 3.23: libxcb-doc 1.17.0-r1 Β· MIT
- alpine 3.24: libxcb-doc 1.17.0-r2 Β· MIT
- arch rolling: libxcb 1.17.0-1 Β· X11
- centos-stream 10: libxcb-devel 1.17.0-3.el10 Β· X11
- debian trixie: libxcb-doc 1.17.0-2
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- nixpkgs unstable: libxcb 1.17.0
- opensuse-leap 16.0: libxcb-devel-doc 1.17.0-160000.2.2 Β· MIT
- ubuntu questing: libxcb-doc 1.17.0-2build1
- ubuntu resolute: libxcb-doc 1.17.0-2ubuntu1
- ubuntu stonking: libxcb-doc 1.17.0-2ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms