~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/gis/color_compat.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/****************************************************************************
3
 
 *
4
 
 * MODULE:       gis library
5
 
 * AUTHOR(S):    Glynn Clements <glynn@gclements.plus.com>
6
 
 * COPYRIGHT:    (C) 2007 Glynn Clements and the GRASS Development Team
7
 
 *
8
 
 * NOTE:         Compatibility wrappers for G_make_*[_fp]_colors()
9
 
 *
10
 
 *  This program is free software; you can redistribute it and/or modify
11
 
 *  it under the terms of the GNU General Public License as published by
12
 
 *  the Free Software Foundation; either version 2 of the License, or
13
 
 *  (at your option) any later version.
14
 
 *
15
 
 *  This program is distributed in the hope that it will be useful,
16
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 *  GNU General Public License for more details.
19
 
 *
20
 
 *****************************************************************************/
21
 
 
22
 
#include <grass/gis.h>
23
 
 
24
 
 
25
 
/*!
26
 
 * \brief make color wave
27
 
 *
28
 
 * Generates a color table with 3 sections: red only,
29
 
 * green only, and blue only, each increasing from none to full intensity and
30
 
 * back down to none.  This table is good for continuous data like elevation.
31
 
 *
32
 
 *  \param colors
33
 
 *  \param min
34
 
 *  \param max
35
 
 *  \return int
36
 
 */
37
 
 
38
 
int G_make_wave_colors(struct Colors *colors, CELL min, CELL max)
39
 
{
40
 
    return G_make_colors(colors, "wave", min, max);
41
 
}
42
 
 
43
 
int G_make_wave_fp_colors(struct Colors *colors, DCELL min, DCELL max)
44
 
{
45
 
    return G_make_fp_colors(colors, "wave", min, max);
46
 
}
47
 
 
48
 
 
49
 
int G_make_ryg_colors(struct Colors *colors, CELL min, CELL max)
50
 
{
51
 
    return G_make_colors(colors, "ryg", min, max);
52
 
}
53
 
 
54
 
int G_make_ryg_fp_colors(struct Colors *colors, DCELL min, DCELL max)
55
 
{
56
 
    return G_make_fp_colors(colors, "ryg", min, max);
57
 
}
58
 
 
59
 
/*!
60
 
 * \brief make color ramp
61
 
 *
62
 
 * Generates a color table with 3 sections: red only,
63
 
 * green only, and blue only, each increasing from none to full intensity. This
64
 
 * table is good for continuous data, such as elevation.
65
 
 *
66
 
 *  \param colors
67
 
 *  \param min
68
 
 *  \param max
69
 
 *  \return int
70
 
 */
71
 
 
72
 
int G_make_ramp_colors(struct Colors *colors, CELL min, CELL max)
73
 
{
74
 
    return G_make_colors(colors, "ramp", min, max);
75
 
}
76
 
 
77
 
int G_make_ramp_fp_colors(struct Colors *colors, DCELL min, DCELL max)
78
 
{
79
 
    return G_make_fp_colors(colors, "ramp", min, max);
80
 
}
81
 
 
82
 
/*!
83
 
 * \brief make rainbow colors
84
 
 *
85
 
 * Generates a "shifted" rainbow color table - yellow
86
 
 * to green to cyan to blue to magenta to red. The color table is based on
87
 
 * rainbow colors. (Normal rainbow colors are red, orange, yellow, green, blue,
88
 
 * indigo, and violet.)  This table is good for continuous data, such as
89
 
 * elevation.
90
 
 *
91
 
 *  \param colors
92
 
 *  \param min
93
 
 *  \param max
94
 
 *  \return int
95
 
 */
96
 
 
97
 
int G_make_rainbow_colors(struct Colors *colors, CELL min, CELL max)
98
 
{
99
 
    return G_make_colors(colors, "rainbow", min, max);
100
 
}
101
 
 
102
 
int G_make_rainbow_fp_colors(struct Colors *colors, DCELL min, DCELL max)
103
 
{
104
 
    return G_make_fp_colors(colors, "rainbow", min, max);
105
 
}
106
 
 
107
 
 
108
 
int G_make_gyr_colors(struct Colors *colors, CELL min, CELL max)
109
 
{
110
 
    return G_make_colors(colors, "gyr", min, max);
111
 
}
112
 
 
113
 
int G_make_gyr_fp_colors(struct Colors *colors, DCELL min, DCELL max)
114
 
{
115
 
    return G_make_fp_colors(colors, "gyr", min, max);
116
 
}
117
 
 
118
 
/*!
119
 
 * \brief make linear grey scale
120
 
 *
121
 
 * Generates a grey scale color table. Each color
122
 
 * is a level of grey, increasing from black to white.
123
 
 *
124
 
 *  \param colors
125
 
 *  \param min
126
 
 *  \param max
127
 
 *  \return int
128
 
 */
129
 
 
130
 
int G_make_grey_scale_colors(struct Colors *colors, CELL min, CELL max)
131
 
{
132
 
    return G_make_colors(colors, "grey", min, max);
133
 
}
134
 
 
135
 
int G_make_grey_scale_fp_colors(struct Colors *colors, DCELL min, DCELL max)
136
 
{
137
 
    return G_make_fp_colors(colors, "grey", min, max);
138
 
}
139
 
 
140
 
int G_make_byr_colors(struct Colors *colors, CELL min, CELL max)
141
 
{
142
 
    return G_make_colors(colors, "byr", min, max);
143
 
}
144
 
 
145
 
int G_make_byr_fp_colors(struct Colors *colors, DCELL min, DCELL max)
146
 
{
147
 
    return G_make_fp_colors(colors, "byr", min, max);
148
 
}
149
 
 
150
 
int G_make_bgyr_colors(struct Colors *colors, CELL min, CELL max)
151
 
{
152
 
    return G_make_colors(colors, "bgyr", min, max);
153
 
}
154
 
 
155
 
int G_make_bgyr_fp_colors(struct Colors *colors, DCELL min, DCELL max)
156
 
{
157
 
    return G_make_fp_colors(colors, "bgyr", min, max);
158
 
}
159
 
 
160
 
int G_make_byg_colors(struct Colors *colors, CELL min, CELL max)
161
 
{
162
 
    return G_make_colors(colors, "byg", min, max);
163
 
}
164
 
 
165
 
int G_make_byg_fp_colors(struct Colors *colors, DCELL min, DCELL max)
166
 
{
167
 
    return G_make_fp_colors(colors, "byg", min, max);
168
 
}
169
 
 
170
 
/*!
171
 
 * \brief make aspect colors
172
 
 *
173
 
 * Generates a color table for aspect data.
174
 
 *
175
 
 *  \param colors
176
 
 *  \param min
177
 
 *  \param max
178
 
 *  \return int
179
 
 */
180
 
 
181
 
int G_make_aspect_colors(struct Colors *colors, CELL min, CELL max)
182
 
{
183
 
    return G_make_colors(colors, "aspect", min, max);
184
 
}
185
 
 
186
 
int G_make_aspect_fp_colors(struct Colors *colors, DCELL min, DCELL max)
187
 
{
188
 
    return G_make_fp_colors(colors, "aspect", min, max);
189
 
}