summaryrefslogtreecommitdiff
path: root/src/gd_xbm.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2017-01-21 16:56:12 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2017-01-21 16:56:12 +0100
commitbffad4da3c6e445799394d279d811848102be62e (patch)
treebcf61b65df806bd76531f8d8e3e3c9e376a91f80 /src/gd_xbm.c
parent082c5444838ea0d84f9fb6441aefdb44d78d9bba (diff)
downloadlibgd-bffad4da3c6e445799394d279d811848102be62e.tar.gz
Add a test for reading X10 bitmap files
We also improve the related documentation, which didn't mention yet which X bitmap formats are supported.
Diffstat (limited to 'src/gd_xbm.c')
-rw-r--r--src/gd_xbm.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gd_xbm.c b/src/gd_xbm.c
index c2ba2ad..29bc5c2 100644
--- a/src/gd_xbm.c
+++ b/src/gd_xbm.c
@@ -40,6 +40,9 @@
its size. The image must eventually be destroyed using
<gdImageDestroy>.
+ X11 X bitmaps (which define a char[]) as well as X10 X bitmaps (which define
+ a short[]) are supported.
+
Parameters:
fd - The input FILE pointer
@@ -203,10 +206,22 @@ static void gdCtxPrintf(gdIOCtx * out, const char *format, ...)
/* The compiler will optimize strlen(constant) to a constant number. */
#define gdCtxPuts(out, s) out->putBuf(out, s, strlen(s))
-/* {{{ gdImageXbmCtx */
-/*
- Function: gdImageXbmCtx
-*/
+
+/**
+ * Function: gdImageXbmCtx
+ *
+ * Writes an image to an IO context in X11 bitmap format.
+ *
+ * Parameters:
+ *
+ * image - The <gdImagePtr> to write.
+ * file_name - The prefix of the XBM's identifiers. Illegal characters are
+ * automatically stripped.
+ * gd - Which color to use as forground color. All pixels with another
+ * color are unset.
+ * out - The <gdIOCtx> to write the image file to.
+ *
+ */
BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out)
{
int x, y, c, b, sx, sy, p;
@@ -282,4 +297,3 @@ BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOC
}
gdCtxPuts(out, "};\n");
}
-/* }}} */