X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fximage-loader.h;fp=hacks%2Fximage-loader.h;h=f5b714ae7451887ce1b3ebfa8f17b6cfd916ee29;hp=0000000000000000000000000000000000000000;hb=78add6e627ee5f10e1fa6f3852602ea5066eee5a;hpb=39809ded547bdbb08207d3e514950425215b4410 diff --git a/hacks/ximage-loader.h b/hacks/ximage-loader.h new file mode 100644 index 00000000..f5b714ae --- /dev/null +++ b/hacks/ximage-loader.h @@ -0,0 +1,36 @@ +/* ximage-loader.h --- converts XPM data to Pixmaps. + * xscreensaver, Copyright (c) 1998-2018 Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +#ifndef _XIMAGE_LOADER_H_ +#define _XIMAGE_LOADER_H_ + +extern Pixmap file_to_pixmap (Display *, Window, const char *filename, + int *width_ret, int *height_ret, + Pixmap *mask_ret); + +extern Pixmap image_data_to_pixmap (Display *, Window, + const unsigned char *image_data, + unsigned long data_size, + int *width_ret, int *height_ret, + Pixmap *mask_ret); + +extern XImage *image_data_to_ximage (Display *, Visual *, + const unsigned char *image_data, + unsigned long data_size); + +/* This XImage has RGBA data, which is what OpenGL code typically expects. + X11 typically expects 0RGB as it has no notion of alpha, only 1-bit masks. + With X11 code, you should probably use the _pixmap routines instead. + */ +extern XImage *file_to_ximage (Display *, Visual *, const char *filename); + +#endif /* _XIMAGE_LOADER_H_ */