summaryrefslogtreecommitdiff
path: root/src/gd_xbm.c
diff options
context:
space:
mode:
authorChris Reuter <chris@blit.ca>2014-01-07 15:29:06 -0500
committerChris Reuter <chris@blit.ca>2014-01-07 15:29:06 -0500
commit275ac17bcc837721cf2621ef72c0ba80d4e05570 (patch)
tree9b40cc4d95025510b9a2bdedf43646c43bc53ed2 /src/gd_xbm.c
parent3b2caf62b9fc76b93e1b427c4eea0afccf8b881e (diff)
downloadlibgd-275ac17bcc837721cf2621ef72c0ba80d4e05570.tar.gz
Started importing the old manual into Naturaldocs comments.
This changeset imports documention for gdImage to gdImagePng*() into Natural Docs. Documention is based on the text of the original manual, version 2.0.36 but adapted to better suit the format. Subsequent changesets will introduce docs for subsequent manual entries. naturaldocs, when present, is invoked by bootstrap.sh. The completed manual will be in docs/naturaldocs/html/index.html. It can also be explicitly invoked by running docs/naturaldocs/run_docs.sh. This change also removed docs/naturaldocs/project/Menu.txt, since it currently contains no non-generated content and is prone to introduce noise into the changeset.
Diffstat (limited to 'src/gd_xbm.c')
-rw-r--r--src/gd_xbm.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/gd_xbm.c b/src/gd_xbm.c
index 612be47..74d839b 100644
--- a/src/gd_xbm.c
+++ b/src/gd_xbm.c
@@ -18,7 +18,40 @@
#define MAX_XBM_LINE_SIZE 255
-/* {{{ gdImagePtr gdImageCreateFromXbm */
+
+/*
+ Function: gdImageCreateFromXbm
+
+ <gdImageCreateFromXbm> is called to load images from X bitmap
+ format files. Invoke <gdImageCreateFromXbm> with an already opened
+ pointer to a file containing the desired
+ image. <gdImageCreateFromXbm> returns a <gdImagePtr> to the new
+ image, or NULL if unable to load the image (most often because the
+ file is corrupt or does not contain an X bitmap format
+ image). <gdImageCreateFromXbm> does not close the file.
+
+ You can inspect the sx and sy members of the image to determine
+ its size. The image must eventually be destroyed using
+ <gdImageDestroy>.
+
+ Parameters:
+
+ fd - The input FILE pointer
+
+ Returns:
+
+ A pointer to the new image or NULL if an error occurred.
+
+ Example:
+
+ > gdImagePtr im;
+ > FILE *in;
+ > in = fopen("myxbm.xbm", "rb");
+ > im = gdImageCreateFromXbm(in);
+ > fclose(in);
+ > // ... Use the image ...
+ > gdImageDestroy(im);
+*/
BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd)
{
char fline[MAX_XBM_LINE_SIZE];
@@ -142,7 +175,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd)
gdImageDestroy(im);
return 0;
}
-/* }}} */
+
/* {{{ gdCtxPrintf */
static void gdCtxPrintf(gdIOCtx * out, const char *format, ...)