GRASS Programmer's Manual
6.4.2(2012)
|
00001 00002 #include <stdio.h> 00003 #include <stdlib.h> 00004 #include <string.h> 00005 00006 #include <grass/config.h> 00007 #include <grass/gis.h> 00008 #include "pngdriver.h" 00009 00010 void read_image(void) 00011 { 00012 char *p = file_name + strlen(file_name) - 4; 00013 00014 if (G_strcasecmp(p, ".ppm") == 0) { 00015 read_ppm(); 00016 if (has_alpha) 00017 read_pgm(); 00018 } 00019 else if (G_strcasecmp(p, ".bmp") == 0) 00020 read_bmp(); 00021 #ifdef HAVE_PNG_H 00022 else if (G_strcasecmp(p, ".png") == 0) 00023 read_png(); 00024 #endif 00025 else 00026 G_fatal_error("read_image: unknown file type: %s", p); 00027 00028 modified = 0; 00029 }