xcb_shm_put_image(3)
β¨ xcb_shm_put_image β¨
okay bestie so this is xcb_shm_put_image(3), a lil request function from the XCB Requests fam, and it's basically the moment where your shared memory data finally gets to shine on screen π
π« NAME π«
xcb_shm_put_image β copy data from the shared memory to the specified drawable. that's it, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
#include <xcb/shm.h>
π Request function π
xcb_void_cookie_t xcb_shm_put_image(xcb_connection_t *conn,
xcb_drawable_t drawable, xcb_gcontext_t gc, uint16_t total_width,
uint16_t total_height, uint16_t src_x, uint16_t src_y,
uint16_t src_width, uint16_t src_height, int16_t dst_x,
int16_t dst_y, uint8_t depth, uint8_t format, uint8_t send_event,
xcb_shm_seg_t shmseg, uint32_t offset);
like yes she's got a LOT of parameters but every single one is pulling her weight, no dead weight in this function fr fr π
π REQUEST ARGUMENTS π
connβ the XCB connection to X11. your link to the mothership, no cap.drawableβ the drawable to draw to. this is where the art goes π¨gcβ the graphics context to use. the whole styling kit, lowkey essential.total_widthβ the total width of the source image.total_heightβ the total height of the source image.src_xβ the source X coordinate of the sub-image to copy.src_yβ the source Y coordinate of the sub-image to copy.src_widthβ the width, in source image coordinates, of the data to copy from the source. the X server uses this to figure out the amount of data to copy. and here's the slay part: the amount of the destination image that gets overwritten is determined automatically β¨src_heightβ the height, in source image coordinates, of the data to copy from the source. same deal: the X server uses this to determine the amount of data to copy, and the amount of the destination image that gets overwritten is determined automatically πdst_xβ the X coordinate on the destination drawable to copy to.dst_yβ the Y coordinate on the destination drawable to copy to.depthβ the depth to use.formatβ the format of the image being drawn. now listen closely bestie because this one has β RULES β:- if it's
XYBitmap, thendepthmust be1, or a"BadMatch"error results. the foreground pixel in the GC determines the source for the one bits in the image, and the background pixel determines the source for the zero bits. - for
XYPixmapandZPixmap, thedepthmust match the depth of the drawable, or a"BadMatch"error results.
- if it's
so yeah, mismatch here = BadMatch, and BadMatch is not the cute kind of match, it's the "your request said no" kind π
send_eventβTrueif the server should send anXCB_SHM_COMPLETIONevent when the blit completes. so like, tell me when you're done bestie π«Άshmsegβ TODO: NOT YET DOCUMENTED. (yes really, the docs said "we'll get to it", iconic honestly π)offsetβ the offset that the source image starts at.
π DESCRIPTION π
Copy data from the shared memory to the specified drawable. and the receipts on the byte math: the amount of bytes written to the destination image is always equal to the number of bytes read from the shared memory segment. perfectly balanced, as all things should be β
π¦ RETURN VALUE π¦
Returns an xcb_void_cookie_t. errors (if any) have to be handled in the event loop β so don't just stand there, go check your events babes π
If you want to handle errors directly with xcb_request_check instead, use xcb_shm_put_image_checked. See xcb-requests(3) for details.
π ERRORS π
This request does never generate any errors. she's a good girl, no drama, no chaos, just vibes πΈ
π SEE ALSO π
π AUTHOR π
Generated from shm.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
ok that's the whole page bestie, go forth and blit responsibly π
X Version 11 Β· libxcb 1.17.0 Β· xcb_shm_put_image(3) β mwah, that's the version and date sign-off, no cap, love u, bye πβ¨
π¦ 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