color_init.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**********************************************************************
  2. *
  3. * G_init_colors (colors)
  4. * struct Colors *colors structure to hold color info
  5. *
  6. * Initializes the color structure for subsequent calls to G_add_color_rule()
  7. *********************************************************************/
  8. #include <grass/gis.h>
  9. /*!
  10. * \brief initialize color structure
  11. *
  12. * The <b>colors</b> structure is initialized for subsequent calls
  13. * to <i>G_add_color_rule</i> and<i>G_set_color.</i>
  14. *
  15. * \param colors
  16. * \return int
  17. */
  18. int G_init_colors(struct Colors *colors)
  19. {
  20. colors->version = 0;
  21. colors->null_set = 0;
  22. colors->undef_set = 0;
  23. colors->shift = 0.0;
  24. colors->invert = 0;
  25. colors->cmin = 0;
  26. colors->is_float = 0;
  27. colors->cmax = -1;
  28. colors->fixed.min = 0;
  29. colors->fixed.max = -1;
  30. colors->fixed.rules = NULL;
  31. colors->fixed.n_rules = 0;
  32. colors->fixed.lookup.active = 0;
  33. colors->fixed.fp_lookup.active = 0;
  34. colors->fixed.fp_lookup.nalloc = 0;
  35. colors->modular.min = 0;
  36. colors->modular.max = -1;
  37. colors->modular.rules = NULL;
  38. colors->modular.n_rules = 0;
  39. colors->modular.lookup.active = 0;
  40. colors->modular.fp_lookup.active = 0;
  41. colors->modular.fp_lookup.nalloc = 0;
  42. colors->organizing = 0;
  43. return 0;
  44. }