Ver código fonte

write metadata (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39400 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 15 anos atrás
pai
commit
99e2ea7e21
1 arquivos alterados com 20 adições e 0 exclusões
  1. 20 0
      imagery/i.rgb.his/closefiles.c

+ 20 - 0
imagery/i.rgb.his/closefiles.c

@@ -13,6 +13,7 @@ int closefiles(char *h_name, char *i_name, char *s_name,
     int i;
     struct Colors colors;
     struct Range range;
+    struct History history;
     CELL min, max;
     const char *mapset;
 
@@ -23,6 +24,8 @@ int closefiles(char *h_name, char *i_name, char *s_name,
 
     mapset = G_mapset();
 
+    /* write colors */
+    /*   set to 0,max_level instead of min,max ?? */
     Rast_read_range(h_name, mapset, &range);
     Rast_get_range_min_max(&range, &min, &max);
     Rast_make_grey_scale_colors(&colors, min, max);
@@ -38,5 +41,22 @@ int closefiles(char *h_name, char *i_name, char *s_name,
     Rast_make_grey_scale_colors(&colors, min, max);
     Rast_write_colors(s_name, mapset, &colors);
 
+    /* write metadata */
+    Rast_short_history(h_name, "raster", &history);
+    Rast_command_history(&history);
+    Rast_write_history(h_name, &history);
+    Rast_put_cell_title(h_name, "Image hue");
+
+    Rast_short_history(i_name, "raster", &history);
+    Rast_command_history(&history);
+    Rast_write_history(i_name, &history);
+    Rast_put_cell_title(i_name, "Image intensity");
+
+    Rast_short_history(s_name, "raster", &history);
+    Rast_command_history(&history);
+    Rast_write_history(s_name, &history);
+    Rast_put_cell_title(s_name, "Image saturation");
+
     return 0;
 }
+