00001 #include <grass/gis.h>
00002
00003
00004
00028 int G_set_color (
00029 CELL cat,int r,int g, int b,
00030 struct Colors *colors)
00031 {
00032 CELL tmp=cat;
00033
00034 if(G_is_c_null_value(&tmp))
00035 return G_set_null_value_color(r, g, b, colors);
00036 return G_add_color_rule (cat, r,g,b, cat, r,g,b, colors);
00037 }
00038
00039 int G_set_d_color (DCELL val, int r, int g, int b, struct Colors *colors)
00040
00041 {
00042 DCELL tmp=val;
00043 if(G_is_d_null_value(&tmp))
00044 return G_set_null_value_color(r, g, b, colors);
00045 return G_add_d_raster_color_rule (&val, r,g,b,
00046 &val, r,g,b, colors);
00047 }
00048
00049
00062 int G_set_null_value_color (int red, int grn, int blu, struct Colors *colors)
00063
00064 {
00065 colors->null_red = red;
00066 colors->null_grn = grn;
00067 colors->null_blu = blu;
00068 colors->null_set = 1;
00069 return 1;
00070 }
00071
00072
00086 int G_set_default_color (int red, int grn, int blu, struct Colors *colors)
00087
00088 {
00089 colors->undef_red = red;
00090 colors->undef_grn = grn;
00091 colors->undef_blu = blu;
00092 colors->undef_set = 1;
00093 return 1;
00094 }
00095