GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
cairodriver/read.c
Go to the documentation of this file.
1
#include "
cairodriver.h
"
2
3
void
read_image
(
void
)
4
{
5
G_debug
(1,
"read_image"
);
6
7
if
(!
cairo
|| !
surface
)
8
return
;
9
10
if
(
file_type
==
FTYPE_PPM
) {
11
G_debug
(1,
"Reading image from %s"
,
file_name
);
12
read_ppm
();
13
}
14
else
if
(
file_type
==
FTYPE_BMP
) {
15
G_debug
(1,
"Reading image from %s"
,
file_name
);
16
read_bmp
();
17
}
18
#if CAIRO_HAS_PNG_FUNCTIONS
19
else
if
(
file_type
==
FTYPE_PNG
) {
20
cairo_surface_t *img_surf;
21
22
G_debug
(1,
"Reading image from %s"
,
file_name
);
23
24
img_surf = cairo_image_surface_create_from_png(
file_name
);
25
if
(!img_surf)
26
return
;
27
28
cairo_save(
cairo
);
29
cairo_set_source_surface(
cairo
, img_surf, 0, 0);
30
cairo_paint(
cairo
);
31
cairo_restore(
cairo
);
32
33
cairo_surface_destroy(img_surf);
34
}
35
#endif
36
/* vector format files are written directly to file */
37
38
modified
= 0;
39
}
lib
cairodriver
read.c
Generated on Thu Sep 26 2013 09:48:06 for GRASS Programmer's Manual by
1.8.4