GRASS Programmer's Manual
6.5.svn(2014)-r66266
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
}
FTYPE_BMP
#define FTYPE_BMP
Definition:
cairodriver.h:26
modified
int modified
Definition:
cairodriver/Graph.c:51
write_bmp
void write_bmp(void)
Definition:
cairodriver/write_bmp.c:51
FTYPE_PPM
#define FTYPE_PPM
Definition:
cairodriver.h:25
FTYPE_X11
#define FTYPE_X11
Definition:
cairodriver.h:31
write_image
void write_image(void)
Definition:
cairodriver/write.c:8
write_ppm
void write_ppm(void)
Definition:
cairodriver/write_ppm.c:3
file_name
char * file_name
Definition:
cairodriver/Graph.c:46
cairo
cairo_t * cairo
Definition:
cairodriver/Graph.c:60
tools.surface
tuple surface
Definition:
tools.py:1397
FTYPE_PNG
#define FTYPE_PNG
Definition:
cairodriver.h:27
cairodriver.h
mapped
int mapped
Definition:
cairodriver/Graph.c:53
G_debug
int G_debug(int level, const char *msg,...)
Print debugging message.
Definition:
gis/debug.c:51
file_type
int file_type
Definition:
cairodriver/Graph.c:47
lib
cairodriver
write.c
Generated on Sat Jan 2 2016 01:46:50 for GRASS Programmer's Manual by
1.8.5