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/read.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
read_image
(
void
)
11
{
12
char
*p =
file_name
+ strlen(
file_name
) - 4;
13
14
if
(
G_strcasecmp
(p,
".ppm"
) == 0) {
15
read_ppm
();
16
if
(
has_alpha
)
17
read_pgm
();
18
}
19
else
if
(
G_strcasecmp
(p,
".bmp"
) == 0)
20
read_bmp
();
21
#ifdef HAVE_PNG_H
22
else
if
(
G_strcasecmp
(p,
".png"
) == 0)
23
read_png
();
24
#endif
25
else
26
G_fatal_error
(
"read_image: unknown file type: %s"
, p);
27
28
modified
= 0;
29
}
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
modified
int modified
Definition:
cairodriver/Graph.c:51
file_name
char * file_name
Definition:
cairodriver/Graph.c:46
read_ppm
void read_ppm(void)
Definition:
cairodriver/read_ppm.c:3
read_png
void read_png(void)
Definition:
read_png.c:31
G_fatal_error
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
Definition:
lib/gis/error.c:150
read_image
void read_image(void)
Definition:
cairodriver/read.c:3
read_bmp
void read_bmp(void)
Definition:
cairodriver/read_bmp.c:67
read_pgm
void read_pgm(void)
Definition:
pngdriver/read_ppm.c:56
lib
pngdriver
read.c
Generated on Sat Jan 2 2016 01:46:49 for GRASS Programmer's Manual by
1.8.5