|
LibGd 2.4.0-dev
GD Graphics library
|
Read and write X11 bitmap images. More...

XBM Reading | |
| gdImagePtr | gdImageCreateFromXbm (FILE *in) |
| Create an image from XBM data in a stdio stream. | |
XBM Writing | |
| void | gdImageXbmCtx (gdImagePtr image, char *file_name, int fg, gdIOCtxPtr out) |
| Write an image to an IO context in X11 bitmap format. | |
Read and write X11 bitmap images.
XBM support reads X11 bitmap data from an open stdio stream and writes XBM text to a gd IO context. XBM images are 1-bit images stored as C source-style data, and gd maps them to palette images when reading. The reader returns a new image owned by the caller; the writer borrows both the image and output context for the duration of the call.
| gdImagePtr gdImageCreateFromXbm | ( | FILE * | in | ) |
Create an image from XBM data in a stdio stream.
gdImageCreateFromXbm() rewinds in before reading and does not close it. X11 XBM data with char arrays and X10 XBM data with short arrays are supported. On success, the returned image is owned by the caller and must be destroyed with gdImageDestroy.
| in | Pointer to the input FILE stream. |
| void gdImageXbmCtx | ( | gdImagePtr | image, |
| char * | file_name, | ||
| int | fg, | ||
| gdIOCtxPtr | out | ||
| ) |
Write an image to an IO context in X11 bitmap format.
gdImageXbmCtx() does not close out. The image and output context are borrowed for the duration of the call. Pixels whose color index equals fg are written as set bits; all other pixels are written as unset bits.
| image | The image to write. |
| file_name | Prefix for the generated XBM C identifiers. Path components, a trailing .xbm extension, and unsupported identifier characters are normalized before writing. |
| fg | Foreground color index to write as set bits. |
| out | The output IO context. |