|
@@ -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;
|
|
|
}
|
|
|
+
|