write_cols.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*****************************************************************************/
  2. /*** ***/
  3. /*** write_cols() ***/
  4. /*** Writes out colour file for morphometric features ***/
  5. /*** Jo Wood, Project ASSIST, 21st February 1995 ***/
  6. /*** ***/
  7. /*****************************************************************************/
  8. #include <grass/raster.h>
  9. #include "param.h"
  10. void write_cols(void)
  11. {
  12. struct Colors colours;
  13. Rast_init_colors(&colours);
  14. Rast_add_color_rule(FLAT, 180, 180, 180, /* White */
  15. PIT, 0, 0, 0, &colours); /* Black */
  16. Rast_add_color_rule(CHANNEL, 0, 0, 255, /* Blue */
  17. PASS, 0, 255, 0, &colours); /* Green */
  18. Rast_add_color_rule(RIDGE, 255, 255, 0, /* Yellow */
  19. PEAK, 255, 0, 0, &colours); /* Red */
  20. Rast_write_colors(rast_out_name, G_mapset(), &colours);
  21. Rast_free_colors(&colours);
  22. }