1 /* ximage-loader.h --- converts XPM data to Pixmaps.
2 * xscreensaver, Copyright (c) 1998-2018 Jamie Zawinski <jwz@jwz.org>
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation. No representations are made about the suitability of this
9 * software for any purpose. It is provided "as is" without express or
13 #ifndef _XIMAGE_LOADER_H_
14 #define _XIMAGE_LOADER_H_
16 extern Pixmap file_to_pixmap (Display *, Window, const char *filename,
17 int *width_ret, int *height_ret,
20 extern Pixmap image_data_to_pixmap (Display *, Window,
21 const unsigned char *image_data,
22 unsigned long data_size,
23 int *width_ret, int *height_ret,
26 extern XImage *image_data_to_ximage (Display *, Visual *,
27 const unsigned char *image_data,
28 unsigned long data_size);
30 /* This XImage has RGBA data, which is what OpenGL code typically expects.
31 X11 typically expects 0RGB as it has no notion of alpha, only 1-bit masks.
32 With X11 code, you should probably use the _pixmap routines instead.
34 extern XImage *file_to_ximage (Display *, Visual *, const char *filename);
36 #endif /* _XIMAGE_LOADER_H_ */