diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /vendor/x11iraf/xpm/XpmRdFToP.c | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'vendor/x11iraf/xpm/XpmRdFToP.c')
-rw-r--r-- | vendor/x11iraf/xpm/XpmRdFToP.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/vendor/x11iraf/xpm/XpmRdFToP.c b/vendor/x11iraf/xpm/XpmRdFToP.c new file mode 100644 index 00000000..296f2dc4 --- /dev/null +++ b/vendor/x11iraf/xpm/XpmRdFToP.c @@ -0,0 +1,46 @@ +/* Copyright 1990-93 GROUPE BULL -- See license conditions in file COPYRIGHT */ +/*****************************************************************************\ +* XpmRdFToP.c: * +* * +* XPM library * +* Parse an XPM file and create the pixmap and possibly its mask * +* * +* Developed by Arnaud Le Hors * +\*****************************************************************************/ + +#include "xpmP.h" + +int +XpmReadFileToPixmap(display, d, filename, pixmap_return, + shapemask_return, attributes) + Display *display; + Drawable d; + char *filename; + Pixmap *pixmap_return; + Pixmap *shapemask_return; + XpmAttributes *attributes; +{ + int ErrorStatus; + XpmImage image; + + /* + * get the XpmImage + */ + ErrorStatus = XpmReadFileToXpmImage(filename, &image, attributes, NULL); + + if (ErrorStatus < 0) + return (ErrorStatus); + + /* + * then create the pixmaps from it + */ + ErrorStatus = XpmCreatePixmapFromXpmImage(display, d, &image, + pixmap_return, shapemask_return, + attributes); + if (ErrorStatus != XpmSuccess) + XpmFreeAttributes(attributes); + + XpmFreeXpmImage(&image); + + return (ErrorStatus); +} |