XpmCreateBuffer(3)

πŸ“¦
version 3.5.17 Β· 3 versions
, in centos-stream 10, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute

πŸ’– XpmCreateBuffer(3) πŸ’–

okay bestie, welcome to the libXpm functions page for XpmCreateBuffer β€” she's the one who hands you a buffer instead of a whole file, and honestly? she ate. πŸŽ€


✨ NAME ✨

XpmCreateBuffer β€” create an XPM Buffer πŸ¦‹

πŸŽ€ SYNOPSIS πŸŽ€

int XpmCreateBufferFromImage(Display *display , char **buffer_return,
       XImage *image, XImage *shapeimage, XpmAttributes *attributes);

int XpmCreateBufferFromPixmap(Display *display, char **buffer_return,
       Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes);

int XpmCreateBufferFromXpmImage(char **buffer_return, XpmImage *image,
       XpmInfo *info);

three little functions, all giving buffer energy. πŸ’…

🌸 ARGUMENTS 🌸

  • display β€” specifies the connection to the X server. your lil hotline to X, fr fr.
  • buffer_return β€” returns the buffer which is created. this is where the magic gets dropped off, no cap.
  • image β€” specifies the image.
  • shapeimage β€” specifies the shape mask image.
  • attributes β€” specifies the location of a structure containing information (or NULL). like, info optional, queen behavior.
  • info β€” specifies the location of a structure to get possible information (or NULL).

πŸ’œ DESCRIPTION πŸ’œ

🌈 XpmCreateBufferFromPixmap

XpmCreateBufferFromPixmap() creates an XPM buffer from a Pixmap. lowkey the same energy as XpmWriteFileFromPixmap(3) β€” it just calls XpmCreateBufferFromImage() instead of XpmWriteFileFromImage(3). and once again, bestie, the caller should free the buffer using XpmFree(3) when finished. don't leave her hanging 😭

As a convenience, the XpmReadFileToBuffer(3) and XpmWriteFileFromBuffer(3) functions are provided to copy a file to a buffer and to write a file from a buffer. so like, for instance, one may decide to use XpmCreateBufferFromPixmap(), XpmWriteFileFromBuffer(3), and XpmFree(3) instead of XpmWriteFileFromPixmap(3). On some systems this may lead to a performance improvement, since the processing will be performed in memory β€” but it uses more memory. trade-offs, babes, it's giving "choose your fighter". βš–οΈ

πŸ¦‹ XpmCreateBufferFromImage

The XpmCreateBufferFromImage() function works as XpmWriteFileFromImage(3), it just writes to a malloc'ed buffer instead of to a file. The caller should free the buffer using XpmFree(3) when finished. yes, again. free your buffer. it's self-care. πŸ’†β€β™€οΈ

⭐ XpmCreateBufferFromXpmImage.

To create an XPM buffer from an XpmImage, use XpmCreateBufferFromXpmImage(). The XpmCreateBufferFromXpmImage() function writes out the given image to a single block malloc'ed buffer in XPM format. If insufficient working storage is allocated, it returns XpmNoMemory, and returns XpmSuccess on success. ✨

If the passed XpmInfo structure pointer is not NULL, XpmCreateBufferFromXpmImage() looks for the following attributes: XpmComments, XpmExtensions, and XpmHotspot, and writes the related information out as well. so extra lore gets included, periodt. πŸ‘‘

The caller should free the buffer using XpmFree(3) when finished. (third time's the charm, bestie β€” free it.)

πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, gorgeous 🌈 this one came from X Version 11, and the version of libXpm is 3.5.17 β€” yeah, she's been around and she still slays. go free your buffers, mwah πŸ’…πŸ’–