GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
cairodriver/write.c
Go to the documentation of this file.
1
#include "
cairodriver.h
"
2
3
#if CAIRO_HAS_XLIB_SURFACE
4
#include <X11/Xlib.h>
5
#include <cairo-xlib.h>
6
#endif
7
8
void
write_image
(
void
)
9
{
10
G_debug
(1,
"write_image"
);
11
12
if
(!
modified
)
13
return
;
14
15
if
(
mapped
)
16
return
;
17
18
if
(!
cairo
|| !
surface
)
19
return
;
20
21
if
(
file_type
==
FTYPE_PPM
) {
22
G_debug
(1,
"Writing image to %s"
,
file_name
);
23
write_ppm
();
24
}
25
else
if
(
file_type
==
FTYPE_BMP
) {
26
G_debug
(1,
"Writing image to %s"
,
file_name
);
27
write_bmp
();
28
}
29
#if CAIRO_HAS_PNG_FUNCTIONS
30
else
if
(
file_type
==
FTYPE_PNG
) {
31
G_debug
(1,
"Writing image to %s"
,
file_name
);
32
cairo_surface_write_to_png(
surface
,
file_name
);
33
}
34
#endif
35
#if CAIRO_HAS_XLIB_SURFACE
36
else
if
(
file_type
==
FTYPE_X11
) {
37
XFlush(cairo_xlib_surface_get_display(
surface
));
38
}
39
#endif
40
/* vector format files are written directly to file */
41
42
modified
= 0;
43
}
lib
cairodriver
write.c
Generated on Sun Sep 9 2012 18:55:35 for GRASS Programmer's Manual by
1.8.1.2