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

« back to all changes in this revision

Viewing changes to ps/ps.map/r_colortable.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:
5
5
 
6
6
#include <stdlib.h>
7
7
#include <string.h>
 
8
#include <grass/colors.h>
 
9
#include <grass/raster.h>
8
10
#include <grass/glocale.h>
9
11
#include "colortable.h"
10
 
#include "ps_info.h"
11
12
#include "clr.h"
12
13
#include "local_proto.h"
13
14
 
17
18
    "where      x y",
18
19
    "width      table_width",
19
20
    "height     fptable_height",
 
21
    "lwidth     line_width",
20
22
    "raster     raster_name",
21
23
    "range      min max",
22
24
    "cols       columns",
35
37
    char *key, *data;
36
38
    char name[GNAME_MAX], mapset[GMAPSET_MAX];
37
39
    int fontsize, cols, nodata, tickbar, discrete;
38
 
    double w, h, x, y;
 
40
    double w, h, x, y, lw;
39
41
    int range_override;
40
42
    double min, max, tmpD;
41
43
    int r, g, b, ret;
42
44
    PSCOLOR color;
43
45
 
44
46
 
45
 
    fontsize = 0;
 
47
    fontsize = 10;
46
48
    set_color(&color, 0, 0, 0);
47
49
    cols = 1;
48
50
    h = w = x = y = 0.0;
 
51
    lw = 1;
 
52
    ct.font = G_store("Helvetica");
49
53
    ct.nodata = TRUE;
50
54
    ct.tickbar = FALSE;
51
55
    ct.discrete = -1;       /* default: TRUE for CELL map, FALSE for FP maps */
80
84
                continue;
81
85
        }
82
86
 
 
87
        if (KEY("lwidth")) {
 
88
            if (sscanf(data, "%lf", &lw) != 1 || lw < 0) {
 
89
                error(key, data, _("illegal width request"));
 
90
            }
 
91
            else
 
92
                continue;
 
93
        }
 
94
 
83
95
        if (KEY("raster")) {
84
96
            if (scan_gis("cell", "raster", key, data, name, mapset, 0)) {
85
97
                ct.name = G_store(name);
176
188
 
177
189
    /* set default if legend type was not specified */
178
190
    if (ct.discrete == -1) {
179
 
        if (G_raster_map_is_fp(ct.name, ct.mapset))
 
191
        if (Rast_map_is_fp(ct.name, ct.mapset))
180
192
            ct.discrete = FALSE;
181
193
        else
182
194
            ct.discrete = TRUE;
187
199
    ct.range_override = range_override;
188
200
    ct.width = w;
189
201
    ct.height = h;
 
202
    ct.lwidth = lw;
190
203
    ct.color = color;
191
204
    ct.cols = cols;
192
205