ftp://ftp.linux.ncsu.edu/mirror/ftp.redhat.com/pub/redhat/linux/enterprise/4/en/os...
[xscreensaver] / hacks / glx / grab-ximage.h
1 /* grab-ximage.c --- grab the screen to an XImage for use with OpenGL.
2  * xscreensaver, Copyright (c) 2001, 2003, 2004 Jamie Zawinski <jwz@jwz.org>
3  *
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 
10  * implied warranty.
11  */
12
13 #ifndef __GRAB_XIMAGE_H__
14 #define __GRAB_XIMAGE_H__
15
16 /* Returns an XImage structure containing an image of the desktop.
17    (As a side-effect, that image *may* be painted onto the given Window.)
18    This XImage will be 32 bits per pixel, 8 each per R, G, and B, with the
19    extra byte set to 0xFF.
20  */
21 XImage * screen_to_ximage (Screen *screen, Window window,
22                            char **filename_return);
23
24 /* Like the above, but loads the image in the background and runs the
25    given callback once it has been loaded.
26  */
27 void fork_screen_to_ximage (Screen *screen, Window window,
28                             void (*callback) (Screen *, Window, XImage *,
29                                               const char *filename,
30                                               void *closure,
31                                               double cvt_time),
32                             void *closure);
33
34 #endif /* __GRAB_XIMAGE_H__ */