diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /vendor/x11iraf/ximtool/logo.c | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'vendor/x11iraf/ximtool/logo.c')
-rw-r--r-- | vendor/x11iraf/ximtool/logo.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/x11iraf/ximtool/logo.c b/vendor/x11iraf/ximtool/logo.c new file mode 100644 index 00000000..92d4bb8e --- /dev/null +++ b/vendor/x11iraf/ximtool/logo.c @@ -0,0 +1,36 @@ +#include <sys/types.h> +#include <dirent.h> +#include <sys/stat.h> +#include <stdio.h> +#include <unistd.h> +#include <fcntl.h> +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> + +#include "ximtool.h" +#include "logo.h" + + +xim_displayLogo (xim) +register XimDataPtr xim; +{ + register int i; + unsigned char r[256], g[256], b[256]; + + + if (!xim || !xim->gt) + return; + + /* Create the default colormap. + */ + for (i=0; i < 200; i++) + r[i] = g[i] = b[i] = (float)i / (float)(LOGO_NCOLORS) * 255; + + /* Set the logical resolution of the display. + */ + GtSetLogRes (xim->gt, LOGO_XDIM, LOGO_YDIM); + + if (xim_writeDisplay (xim, 1, "logo", logo_data, + LOGO_XDIM, LOGO_YDIM, r, g, b, LOGO_NCOLORS) < 0) + return; +} |