XpmCreateData(3)
π XpmCreateData(3) π
okay bestie, welcome to the libXpm functions corner of the manual, this one is literally called XpmCreateData and it's all about creating a Data structure β¨ buckle up π
β¨ NAME β¨
XpmCreateData β create an Data structure π
(yes, "an Data", she said what she said, we don't edit the queen π«Ά)
πΈ SYNOPSIS πΈ
int XpmCreateDataFromImage(Display *display, char ***data_return,
XImage *image, XImage *shapeimage, XpmAttributes *attributes);
int XpmCreateDataFromPixmap(Display *display, char ***data_return,
Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes);
int XpmCreateDataFromXpmImage(char ***data_return, XpmImage *image,
XpmInfo *info);
three whole entry points, we love a trio π no cap
π¦ ARGUMENTS π¦
displayβ the connection to the X server, like your group chat connection but for X πdata_returnβ this one returns the data that gets created, it's giving output parameter energy π«pixmapβ the pixmap, that's it, that's the whole vibe πΌοΈshapemaskβ the shape mask pixmap πattributesβ where a structure lives that's holding information (orNULL, she's flexible like that) πinfoβ where a structure lives that you're getting information from πimageβ the image β¨
π DESCRIPTION π
π XpmCreateDataFromImage
so sometimes you're just sitting there and you're like "bestie I need to create an XPM data from an XImage" β and for that, you use XpmCreateDataFromImage() π
XpmCreateDataFromImage() works exactly the way XpmWriteFileFromImage(3) does, and it returns the same way too. the only glow-up difference? it writes to a single block of malloc'ed data instead of to a file. main character behavior fr fr π₯
okay and this part matters: it is the caller's responsibility to free that data, using XpmFree(3) when you're finished. not optional, not cute to forget, don't leave it hanging π
π XpmCreateDataFromPixmap
XpmCreateDataFromPixmap() creates an XPM data from a Pixmap π
the way it does this is very "I'll delegate": XpmCreateDataFromPixmap() uses XGetImage(3) to get the related X images from the given pixmaps, and those images get passed straight to XpmCreateDataFromImage(). then it destroys the created images using XDestroyImage(3) β clean up after yourself, iconic π§
and it returns the same errors as XpmCreateDataFromImage(). periodt.
π XpmCreateDataFromXpmImage
XpmCreateDataFromXpmImage() creates an XPM data from an XpmImage πΈ
it writes out the given image to a single block of malloc'ed data in XPM format βοΈ and if there isn't enough working storage allocated, it returns XpmNoMemory π, and returns XpmSuccess on success π
if the XpmInfo structure pointer you passed is not NULL, then XpmCreateDataFromXpmImage() goes looking for these attributes:
XpmExtensionsXpmHotspot
and it writes out the related information as well π
and again, bestie, listen: it is the caller's responsibility to free the data, using XpmFree(3) when finished π«Ά
β SEE ALSO β
and that's the whole page, no crumbs left π
go forth and free your malloc'ed data, bestie, your future self will thank you πβ¨
this has been X Version 11, libXpm 3.5.17, brought to you with love and zero memory leaks πππ¦
π¦ where this page comes from
- centos-stream 10: libXpm-devel 3.5.17-5.el10 Β· MIT AND X11-distribute-modifications-variant
- debian trixie: libxpm-dev 1:3.5.17-1+deb13u1
- fedora 43: libXpm-devel 3.5.17-6.fc43 Β· MIT AND X11-distribute-modifications-variant
- fedora 43: libXpm-devel 3.5.17-6.fc43 Β· MIT AND X11-distribute-modifications-variant
- fedora 44: libXpm-devel 3.5.17-7.fc44 Β· MIT AND X11-distribute-modifications-variant
- fedora 44: libXpm-devel 3.5.17-7.fc44 Β· MIT AND X11-distribute-modifications-variant
- opensuse-leap 16.0: libXpm-devel 3.5.17-160000.4.1 Β· MIT
- opensuse-leap 16.0: libXpm-devel 3.5.17-160000.4.1 Β· MIT
- opensuse-leap 16.0: libXpm-devel 3.5.17-160000.4.1 Β· MIT
- opensuse-leap 16.0: libXpm-devel 3.5.17-160000.4.1 Β· MIT
- ubuntu noble: libxpm-dev 1:3.5.17-1build2
- ubuntu noble: libxpm-dev 1:3.5.17-1ubuntu0.24.04.2
- ubuntu questing: libxpm-dev 1:3.5.17-1build2
- ubuntu resolute: libxpm-dev 1:3.5.17-1build3
- ubuntu resolute: libxpm-dev 1:3.5.17-1ubuntu0.26.04.2
- Copyright (C) 1989-95 GROUPE BULL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms