xcb_shm_put_image(3)

πŸ“¦
version 1.17.0 Β· 5 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_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, then depth must be 1, 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 XYPixmap and ZPixmap, the depth must match the depth of the drawable, or a "BadMatch" error results.
so yeah, mismatch here = BadMatch, and BadMatch is not the cute kind of match, it's the "your request said no" kind 😭
  • send_event β€” True if the server should send an XCB_SHM_COMPLETION event 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 πŸŽ€βœ¨