GRASS 8 Programmer's Manual 8.6.0dev(2026)-8843f13794
Loading...
Searching...
No Matches
color_compat.c
Go to the documentation of this file.
1/*!
2 * \file lib/raster/color_compat.c
3 *
4 * \brief Raster Library - Predefined color tables
5 *
6 * SPDX-FileCopyrightText: 2007-2009 Glynn Clements
7 * SPDX-FileCopyrightText: GRASS Development Team
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 *
10 * \author Glynn Clements <glynn@gclements.plus.com>
11 */
12
13#include <grass/gis.h>
14#include <grass/raster.h>
15
16/*!
17 * \brief Make color wave (integer)
18 *
19 * Generates a color table with 3 sections: red only, green only, and
20 * blue only, each increasing from none to full intensity and back
21 * down to none. This table is good for continuous data like
22 * elevation.
23 *
24 * \param colors pointer to Colors structure which holds color info
25 * \param min minimum value
26 * \param max maximum value
27 */
29{
30 Rast_make_colors(colors, "wave", min, max);
31}
32
33/*!
34 * \brief Make color wave (floating-point)
35 *
36 * Generates a color table with 3 sections: red only, green only, and
37 * blue only, each increasing from none to full intensity and back
38 * down to none. This table is good for continuous data like
39 * elevation.
40 *
41 * \param colors pointer to Colors structure which holds color info
42 * \param min minimum value
43 * \param max maximum value
44 */
46{
47 Rast_make_fp_colors(colors, "wave", min, max);
48}
49
50/*!
51 * \brief Create RYG color table (integer)
52 *
53 * Generates a color table red-yellow-green.
54 *
55 * \param colors pointer to Colors structure which holds color info
56 * \param min minimum value
57 * \param max maximum value
58 */
60{
61 Rast_make_colors(colors, "ryg", min, max);
62}
63
64/*!
65 * \brief Create RYG color table (floating-point)
66 *
67 * Generates a color table red-yellow-green.
68 *
69 * \param colors pointer to Colors structure which holds color info
70 * \param min minimum value
71 * \param max maximum value
72 */
74{
75 Rast_make_fp_colors(colors, "ryg", min, max);
76}
77
78/*!
79 * \brief Make color ramp (integer)
80 *
81 * Generates a color table with 3 sections: red only, green only, and
82 * blue only, each increasing from none to full intensity. This table
83 * is good for continuous data, such as elevation.
84 *
85 * \param colors pointer to Colors structure which holds color info
86 * \param min minimum value
87 * \param max maximum value
88 */
90{
91 Rast_make_colors(colors, "ramp", min, max);
92}
93
94/*!
95 * \brief Make color ramp (floating-point)
96 *
97 * Generates a color table with 3 sections: red only, green only, and
98 * blue only, each increasing from none to full intensity. This table
99 * is good for continuous data, such as elevation.
100 *
101 * \param colors pointer to Colors structure which holds color info
102 * \param min minimum value
103 * \param max maximum value
104 */
106{
107 Rast_make_fp_colors(colors, "ramp", min, max);
108}
109
110/*!
111 * \brief Make rainbow colors (integer)
112 *
113 * Generates a "shifted" rainbow color table - yellow to green to cyan
114 * to blue to magenta to red. The color table is based on rainbow
115 * colors. (Normal rainbow colors are red, orange, yellow, green,
116 * blue, indigo, and violet.) This table is good for continuous data,
117 * such as elevation.
118 *
119 * \param colors pointer to Colors structure which holds color info
120 * \param min minimum value
121 * \param max maximum value
122 */
124{
125 Rast_make_colors(colors, "rainbow", min, max);
126}
127
128/*!
129 * \brief Make rainbow colors (floating-point)
130 *
131 * Generates a "shifted" rainbow color table - yellow to green to cyan
132 * to blue to magenta to red. The color table is based on rainbow
133 * colors. (Normal rainbow colors are red, orange, yellow, green,
134 * blue, indigo, and violet.) This table is good for continuous data,
135 * such as elevation.
136 *
137 * \param colors pointer to Colors structure which holds color info
138 * \param min minimum value
139 * \param max maximum value
140 */
142{
143 Rast_make_fp_colors(colors, "rainbow", min, max);
144}
145
146/*!
147 * \brief Create GYR color table (integer)
148 *
149 * Generates a color table green-yellow-red.
150 *
151 * \param colors pointer to Colors structure which holds color info
152 * \param min minimum value
153 * \param max maximum value
154 */
156{
157 Rast_make_colors(colors, "gyr", min, max);
158}
159
160/*!
161 * \brief Create GYR color table (floating-point)
162 *
163 * Generates a color table green-yellow-red.
164 *
165 * \param colors pointer to Colors structure which holds color info
166 * \param min minimum value
167 * \param max maximum value
168 */
170{
171 Rast_make_fp_colors(colors, "gyr", min, max);
172}
173
174/*!
175 * \brief Make linear grey scale (integer)
176 *
177 * Generates a grey scale color table. Each color is a level of grey,
178 * increasing from black to white.
179 *
180 * \param colors pointer to Colors structure which holds color info
181 * \param min minimum value
182 * \param max maximum value
183 */
185{
186 Rast_make_colors(colors, "grey", min, max);
187}
188
189/*!
190 * \brief Make linear grey scale (floating-point)
191 *
192 * Generates a grey scale color table. Each color is a level of grey,
193 * increasing from black to white.
194 *
195 * \param colors pointer to Colors structure which holds color info
196 * \param min minimum value
197 * \param max maximum value
198 */
200{
201 Rast_make_fp_colors(colors, "grey", min, max);
202}
203
204/*!
205 * \brief Create BYR color table (integer)
206 *
207 * Generates a color table blue-yellow-red.
208 *
209 * \param colors pointer to Colors structure which holds color info
210 * \param min minimum value
211 * \param max maximum value
212 */
214{
215 Rast_make_colors(colors, "byr", min, max);
216}
217
218/*!
219 * \brief Create BYR color table (floating-point)
220 *
221 * Generates a color table blue-yellow-red.
222 *
223 * \param colors pointer to Colors structure which holds color info
224 * \param min minimum value
225 * \param max maximum value
226 */
228{
229 Rast_make_fp_colors(colors, "byr", min, max);
230}
231
232/*!
233 * \brief Create BGYR color table (integer)
234 *
235 * Generates a color table blue-green-yellow-red.
236 *
237 * \param colors pointer to Colors structure which holds color info
238 * \param min minimum value
239 * \param max maximum value
240 */
242{
243 Rast_make_colors(colors, "bgyr", min, max);
244}
245
246/*!
247 * \brief Create BGYR color table (floating-point)
248 *
249 * Generates a color table blue-green-yellow-red.
250 *
251 * \param colors pointer to Colors structure which holds color info
252 * \param min minimum value
253 * \param max maximum value
254 */
256{
257 Rast_make_fp_colors(colors, "bgyr", min, max);
258}
259
260/*!
261 * \brief Create BYG color table (integer)
262 *
263 * Generates a color table blue-yellow-green.
264 *
265 * \param colors pointer to Colors structure which holds color info
266 * \param min minimum value
267 * \param max maximum value
268 */
270{
271 Rast_make_colors(colors, "byg", min, max);
272}
273
274/*!
275 * \brief Create BYG color table (floating-point)
276 *
277 * Generates a color table blue-yellow-green.
278 *
279 * \param colors pointer to Colors structure which holds color info
280 * \param min minimum value
281 * \param max maximum value
282 */
284{
285 Rast_make_fp_colors(colors, "byg", min, max);
286}
287
288/*!
289 * \brief Make aspect colors (integer)
290 *
291 * Generates a color table for aspect data.
292 *
293 * \param colors pointer to Colors structure which holds color info
294 * \param min minimum value
295 * \param max maximum value
296 */
298{
299 Rast_make_colors(colors, "aspect", min, max);
300}
301
302/*!
303 * \brief Make aspect colors (floating-point)
304 *
305 * Generates a color table for aspect data.
306 *
307 * \param colors pointer to Colors structure which holds color info
308 * \param min minimum value
309 * \param max maximum value
310 */
312{
313 Rast_make_fp_colors(colors, "aspect", min, max);
314}
void Rast_make_bgyr_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Create BGYR color table (floating-point)
void Rast_make_aspect_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Make aspect colors (floating-point)
void Rast_make_byg_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Create BYG color table (floating-point)
void Rast_make_bgyr_colors(struct Colors *colors, CELL min, CELL max)
Create BGYR color table (integer)
void Rast_make_ryg_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Create RYG color table (floating-point)
void Rast_make_ramp_colors(struct Colors *colors, CELL min, CELL max)
Make color ramp (integer)
void Rast_make_grey_scale_colors(struct Colors *colors, CELL min, CELL max)
Make linear grey scale (integer)
void Rast_make_gyr_colors(struct Colors *colors, CELL min, CELL max)
Create GYR color table (integer)
void Rast_make_rainbow_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Make rainbow colors (floating-point)
void Rast_make_byg_colors(struct Colors *colors, CELL min, CELL max)
Create BYG color table (integer)
void Rast_make_byr_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Create BYR color table (floating-point)
void Rast_make_wave_colors(struct Colors *colors, CELL min, CELL max)
Make color wave (integer)
void Rast_make_byr_colors(struct Colors *colors, CELL min, CELL max)
Create BYR color table (integer)
void Rast_make_aspect_colors(struct Colors *colors, CELL min, CELL max)
Make aspect colors (integer)
void Rast_make_rainbow_colors(struct Colors *colors, CELL min, CELL max)
Make rainbow colors (integer)
void Rast_make_grey_scale_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Make linear grey scale (floating-point)
void Rast_make_ramp_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Make color ramp (floating-point)
void Rast_make_gyr_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Create GYR color table (floating-point)
void Rast_make_wave_fp_colors(struct Colors *colors, DCELL min, DCELL max)
Make color wave (floating-point)
void Rast_make_ryg_colors(struct Colors *colors, CELL min, CELL max)
Create RYG color table (integer)
void Rast_make_fp_colors(struct Colors *, const char *, DCELL, DCELL)
Load color rules from predefined floating-point color table.
void Rast_make_colors(struct Colors *, const char *, CELL, CELL)
Load color rules from predefined color table.
#define min(x, y)
Definition draw2.c:29
#define max(x, y)
Definition draw2.c:30
double DCELL
Definition gis.h:632
int CELL
Definition gis.h:631
Definition gis.h:689