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
pngdriver/write.c
Go to the documentation of this file.
1
2
#include <stdio.h>
3
#include <stdlib.h>
4
#include <string.h>
5
6
#include <grass/config.h>
7
#include <grass/gis.h>
8
#include "
pngdriver.h
"
9
10
void
write_image
(
void
)
11
{
12
char
*p =
file_name
+ strlen(
file_name
) - 4;
13
14
if
(!
modified
)
15
return
;
16
17
if
(
mapped
)
18
return
;
19
20
if
(
G_strcasecmp
(p,
".ppm"
) == 0) {
21
write_ppm
();
22
if
(
has_alpha
)
23
write_pgm
();
24
}
25
else
if
(
G_strcasecmp
(p,
".bmp"
) == 0)
26
write_bmp
();
27
#ifdef HAVE_PNG_H
28
else
if
(
G_strcasecmp
(p,
".png"
) == 0)
29
write_png
();
30
#endif
31
else
32
G_fatal_error
(
"write_image: unknown file type: %s"
, p);
33
34
modified
= 0;
35
}
write_pgm
void write_pgm(void)
Definition:
pngdriver/write_ppm.c:37
G_strcasecmp
int G_strcasecmp(const char *x, const char *y)
String compare ignoring case (upper or lower)
Definition:
strings.c:192
pngdriver.h
has_alpha
int has_alpha
Definition:
pngdriver/Graph_set.c:30
write_png
void write_png(void)
Definition:
write_png.c:41
modified
int modified
Definition:
cairodriver/Graph.c:51
write_bmp
void write_bmp(void)
Definition:
cairodriver/write_bmp.c:51
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
mapped
int mapped
Definition:
cairodriver/Graph.c:53
G_fatal_error
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
Definition:
lib/gis/error.c:150
lib
pngdriver
write.c
Generated on Sat Jan 2 2016 01:46:50 for GRASS Programmer's Manual by
1.8.5