XvPutImage(3)
β¨ XvPutImage β bestie edition β¨
okay so this is the libXv page for XvPutImage and XvShmPutImage, and it's literally just "put an image on the screen" energy. Two functions, one job, infinite vibes. Let's get into it π
πΈ NAME πΈ
XvPutImage, XvShmPutImage β display an XvImage πΌοΈβ¨
π SYNOPSIS π
#include <X11/extensions/Xvlib.h>
int XvPutImage (Display *dpy, XvPortID port,
Drawable d, GC gc, XvImage *image,
int src_x, int src_y,
unsigned int src_w, unsigned int src_h,
int dest_x, int dest_y,
unsigned int dest_w, unsigned int dest_h);
int XvShmPutImage (Display *dpy, XvPortID port,
Drawable d, GC gc, XvImage *image,
int src_x, int src_y,
unsigned int src_w, unsigned int src_h,
int dest_x, int dest_y,
unsigned int dest_w, unsigned int dest_h,
Bool send_event);
like yes, that's a lot of arguments. she's thorough. we respect her for it π
π¦ ARGUMENTS π¦
dpyβ the connection to the X server, your lil phone line to the display π«Άportβ the port id of a port on anXvImagecapable adaptor. gotta be a port that actually does images, iykyk.dβ (the drawable, bestie. the original page leaves her description blank and honestly? relatable. she's just the thing you're drawing into.)gcβ the graphics context specifying the clip mask to use, if any. so like, if you want clipping, this is where it lives βοΈimageβ a pointer to theXvImageto be displayed πΈsrc_?β the portion of theXvImageto be displayed. that's the little crop window on the source side.dest_?β the portion of the destination drawable to be filled by the image. the crop window on the destination side, matching energy.send_eventβ indicates whether or not anXShmCompletionEventshould be sent. If sent, the event'smajor_codeandminor_codefields will indicate the Xv extension's major code andXvShmPutImage's minor code. so basically "do you want a lil notification when it's done?" βοΈ
π DESCRIPTION π
XvPutImage(3) is similar to XPutImage(3). XvShmPutImage(3) is similar to XShmPutImage(3). so if you already know those, you're basically already home π
the library will allocate the XvImage structure and fill out all fields except for data. periodt.
π Important one: width and height may be enlarged in some YUV formats. not a bug, just how she is.
the size of the data buffer that needs to be allocated will be given in the data_size field in the XvImage. π
image data is not allocated by this function. okay so this is the part people trip on. the client has two options:
- pass a pointer to the preallocated memory as
data, or - allocate the memory and fill in the
XvImagestructure'sdatafield after thedata_sizefield has been filled out by the server.
the XvImage structure may be freed by XFree(3). so clean up after yourself bestie, we love a tidy queen π§Ήβ¨
π DIAGNOSTICS π
[XvBadPort]β Generated if the requested port does not exist. ghost port. doesn't exist. no cap.[XvBadAlloc]β Generated if the X server was unable to allocate resources required to complete the operation. server said "I'm tired" π[BadMatch]β Generated if incompatible arguments were supplied, such as a port that isn't capable of displayingXvImages. mismatched. not compatible. it's giving awkward first date π[BadShmSegCode]β Generated if an invalid shared memory segment is specified. bad shm segment, bad vibes.
π SEE ALSO π
and that's the whole page!! π this one's from X Version 11, libXv 1.0.13, filed under XvPutImage(3) β go forth and display your images, main character π«ΆπΈβ¨
π¦ where this page comes from
- alpine 3.22: libxv-doc 1.0.13-r0 Β· MIT
- alpine 3.23: libxv-doc 1.0.13-r0 Β· MIT
- alpine 3.24: libxv-doc 1.0.13-r0 Β· MIT
- arch rolling: libxv 1.0.13-1 Β· SMLNJ AND HPND-sell-variant
- fedora 43: libXv-devel 1.0.13-3.fc43 Β· SMLNJ AND HPND-sell-variant
- fedora 43: libXv-devel 1.0.13-3.fc43 Β· SMLNJ AND HPND-sell-variant
- fedora 44: libXv-devel 1.0.13-4.fc44 Β· SMLNJ AND HPND-sell-variant
- fedora 44: libXv-devel 1.0.13-4.fc44 Β· SMLNJ AND HPND-sell-variant
- ubuntu resolute: libxv-dev 2:1.0.13-1 Β· MIT
- ubuntu stonking: libxv-dev 2:1.0.13-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms