File: pathlevel.c

package info (click to toggle)
gwyddion 2.52-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 46,588 kB
  • sloc: ansic: 367,740; python: 7,788; sh: 5,245; makefile: 4,317; xml: 3,631; cpp: 2,550; pascal: 418; perl: 154; ruby: 130
file content (582 lines) | stat: -rw-r--r-- 19,374 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
/*
 *  $Id: pathlevel.c 20677 2017-12-18 18:22:52Z yeti-dn $
 *  Copyright (C) 2007 David Necas (Yeti).
 *  E-mail: yeti@gwyddion.net.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
 */

#include "config.h"
#include <stdlib.h>
#include <gtk/gtk.h>
#include <libgwyddion/gwymacros.h>
#include <libgwyddion/gwymath.h>
#include <libgwymodule/gwymodule-tool.h>
#include <libprocess/datafield.h>
#include <libprocess/linestats.h>
#include <libgwydgets/gwystock.h>
#include <libgwydgets/gwydgetutils.h>
#include <libgwydgets/gwynullstore.h>
#include <app/gwyapp.h>

#define GWY_TYPE_TOOL_PATH_LEVEL            (gwy_tool_path_level_get_type())
#define GWY_TOOL_PATH_LEVEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GWY_TYPE_TOOL_PATH_LEVEL, GwyToolPathLevel))
#define GWY_IS_TOOL_PATH_LEVEL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GWY_TYPE_TOOL_PATH_LEVEL))
#define GWY_TOOL_PATH_LEVEL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GWY_TYPE_TOOL_PATH_LEVEL, GwyToolPathLevelClass))

enum {
    NLINES = 1024,
    MAX_THICKNESS = 128
};

enum {
    COLUMN_I, COLUMN_X0, COLUMN_Y0, COLUMN_X1, COLUMN_Y1, NLCOLUMNS
};

typedef struct _GwyToolPathLevel      GwyToolPathLevel;
typedef struct _GwyToolPathLevelClass GwyToolPathLevelClass;

/* Line start or end. */
typedef struct {
    gint row;
    gint id;
    gboolean end;
} ChangePoint;

typedef struct {
    gint thickness;
} ToolArgs;

struct _GwyToolPathLevel {
    GwyPlainTool parent_instance;

    ToolArgs args;

    GtkTreeView *treeview;
    GtkTreeModel *model;

    GtkObject *thickness;
    GtkWidget *apply;

    /* potential class data */
    GType layer_type_line;
};

struct _GwyToolPathLevelClass {
    GwyPlainToolClass parent_class;
};

static gboolean module_register(void);

static GType    gwy_tool_path_level_get_type         (void) G_GNUC_CONST;
static void     gwy_tool_path_level_finalize         (GObject *object);
static void     gwy_tool_path_level_init_dialog      (GwyToolPathLevel *tool);
static void     gwy_tool_path_level_data_switched    (GwyTool *gwytool,
                                                      GwyDataView *data_view);
static void     gwy_tool_path_level_response         (GwyTool *gwytool,
                                                      gint response_id);
static void     gwy_tool_path_level_selection_changed(GwyPlainTool *plain_tool,
                                                      gint hint);
static void     gwy_tool_path_level_thickness_changed(GwyToolPathLevel *tool,
                                                      GtkAdjustment *adj);
static void     gwy_tool_path_level_render_cell      (GtkCellLayout *layout,
                                                      GtkCellRenderer *renderer,
                                                      GtkTreeModel *model,
                                                      GtkTreeIter *iter,
                                                      gpointer user_data);
static void     gwy_tool_path_level_apply            (GwyToolPathLevel *tool);
static void     gwy_tool_path_level_sel_to_isel      (GwyToolPathLevel *tool,
                                                      gint i,
                                                      gint *isel);
static void     gwy_tool_path_level_save_args        (GwyToolPathLevel *tool);

static const gchar thickness_key[] = "/module/pathlevel/thickness";

static GwyModuleInfo module_info = {
    GWY_MODULE_ABI_VERSION,
    &module_register,
    N_("Path level tool, performs row leveling along on user-set lines."),
    "Yeti <yeti@gwyddion.net>",
    "1.9",
    "David Nečas (Yeti)",
    "2007",
};

static const ToolArgs default_args = {
    1,
};

GWY_MODULE_QUERY2(module_info, pathlevel)

G_DEFINE_TYPE(GwyToolPathLevel, gwy_tool_path_level, GWY_TYPE_PLAIN_TOOL)

static gboolean
module_register(void)
{
    gwy_tool_func_register(GWY_TYPE_TOOL_PATH_LEVEL);

    return TRUE;
}

static void
gwy_tool_path_level_class_init(GwyToolPathLevelClass *klass)
{
    GwyPlainToolClass *ptool_class = GWY_PLAIN_TOOL_CLASS(klass);
    GwyToolClass *tool_class = GWY_TOOL_CLASS(klass);
    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);

    gobject_class->finalize = gwy_tool_path_level_finalize;

    tool_class->stock_id = GWY_STOCK_PATH_LEVEL;
    tool_class->title = _("Path Level");
    tool_class->tooltip = _("Level rows using intersections with given lines");
    tool_class->prefix = "/module/pathlevel";
    tool_class->default_height = 240;
    tool_class->data_switched = gwy_tool_path_level_data_switched;
    tool_class->response = gwy_tool_path_level_response;

    ptool_class->selection_changed = gwy_tool_path_level_selection_changed;
}

static void
gwy_tool_path_level_finalize(GObject *object)
{
    GwyToolPathLevel *tool;

    tool = GWY_TOOL_PATH_LEVEL(object);
    gwy_tool_path_level_save_args(tool);

    if (tool->model) {
        gtk_tree_view_set_model(tool->treeview, NULL);
        GWY_OBJECT_UNREF(tool->model);
    }

    G_OBJECT_CLASS(gwy_tool_path_level_parent_class)->finalize(object);
}

static void
gwy_tool_path_level_init(GwyToolPathLevel *tool)
{
    GwyPlainTool *plain_tool;
    GwyContainer *settings;

    plain_tool = GWY_PLAIN_TOOL(tool);
    tool->layer_type_line = gwy_plain_tool_check_layer_type(plain_tool,
                                                            "GwyLayerLine");
    if (!tool->layer_type_line)
        return;

    plain_tool->unit_style = GWY_SI_UNIT_FORMAT_MARKUP;
    plain_tool->lazy_updates = TRUE;

    settings = gwy_app_settings_get();
    tool->args = default_args;
    gwy_container_gis_int32_by_name(settings, thickness_key,
                                    &tool->args.thickness);

    gwy_plain_tool_connect_selection(plain_tool, tool->layer_type_line,
                                     "line");

    gwy_tool_path_level_init_dialog(tool);
}

static void
gwy_tool_path_level_init_dialog(GwyToolPathLevel *tool)
{
    static const gchar *lcolumns[] = {
        "<b>n</b>",
        "<b>x<sub>1</sub></b>",
        "<b>y<sub>1</sub></b>",
        "<b>x<sub>2</sub></b>",
        "<b>y<sub>2</sub></b>",
    };
    GtkTreeViewColumn *column;
    GtkCellRenderer *renderer;
    GtkDialog *dialog;
    GtkWidget *scwin, *label;
    GtkTable *table;
    GwyNullStore *store;
    gint row;
    guint i;

    dialog = GTK_DIALOG(GWY_TOOL(tool)->dialog);

    store = gwy_null_store_new(0);
    tool->model = GTK_TREE_MODEL(store);
    tool->treeview = GTK_TREE_VIEW(gtk_tree_view_new_with_model(tool->model));
    gwy_plain_tool_enable_object_deletion(GWY_PLAIN_TOOL(tool), tool->treeview);

    for (i = 0; i < NLCOLUMNS; i++) {
        column = gtk_tree_view_column_new();
        gtk_tree_view_column_set_expand(column, TRUE);
        gtk_tree_view_column_set_alignment(column, 0.5);
        g_object_set_data(G_OBJECT(column), "id", GUINT_TO_POINTER(i));
        renderer = gtk_cell_renderer_text_new();
        g_object_set(renderer, "xalign", 1.0, NULL);
        gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(column), renderer, TRUE);
        gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(column), renderer,
                                           gwy_tool_path_level_render_cell, tool,
                                           NULL);
        label = gtk_label_new(NULL);
        gtk_label_set_markup(GTK_LABEL(label), lcolumns[i]);
        gtk_tree_view_column_set_widget(column, label);
        gtk_widget_show(label);
        gtk_tree_view_append_column(tool->treeview, column);
    }

    scwin = gtk_scrolled_window_new(NULL, NULL);
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scwin),
                                   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
    gtk_container_add(GTK_CONTAINER(scwin), GTK_WIDGET(tool->treeview));
    gtk_box_pack_start(GTK_BOX(dialog->vbox), scwin, TRUE, TRUE, 0);

    table = GTK_TABLE(gtk_table_new(1, 3, FALSE));
    gtk_table_set_col_spacings(table, 6);
    gtk_table_set_row_spacings(table, 2);
    gtk_container_set_border_width(GTK_CONTAINER(table), 4);
    gtk_box_pack_start(GTK_BOX(dialog->vbox), GTK_WIDGET(table),
                       FALSE, FALSE, 0);
    row = 0;

    tool->thickness = gtk_adjustment_new(tool->args.thickness,
                                         1, MAX_THICKNESS, 1, 10, 0);
    gwy_table_attach_adjbar(GTK_WIDGET(table), row, _("_Thickness:"), _("px"),
                            tool->thickness, GWY_HSCALE_SQRT | GWY_HSCALE_SNAP);
    g_signal_connect_swapped(tool->thickness, "value-changed",
                             G_CALLBACK(gwy_tool_path_level_thickness_changed),
                             tool);
    row++;

    gwy_plain_tool_add_clear_button(GWY_PLAIN_TOOL(tool));
    gwy_tool_add_hide_button(GWY_TOOL(tool), TRUE);
    tool->apply = gtk_dialog_add_button(dialog, GTK_STOCK_APPLY,
                                        GTK_RESPONSE_APPLY);
    gtk_dialog_set_response_sensitive(dialog, GTK_RESPONSE_APPLY, FALSE);
    gwy_help_add_to_tool_dialog(dialog, GWY_TOOL(tool), GWY_HELP_NO_BUTTON);

    gtk_widget_show_all(dialog->vbox);
}

static void
gwy_tool_path_level_data_switched(GwyTool *gwytool,
                                  GwyDataView *data_view)
{
    GwyPlainTool *plain_tool;
    GwyToolPathLevel *tool;
    gboolean ignore;

    plain_tool = GWY_PLAIN_TOOL(gwytool);
    ignore = (data_view == plain_tool->data_view);

    GWY_TOOL_CLASS(gwy_tool_path_level_parent_class)->data_switched(gwytool,
                                                                    data_view);

    if (ignore || plain_tool->init_failed)
        return;

    tool = GWY_TOOL_PATH_LEVEL(gwytool);
    if (data_view) {
        gwy_object_set_or_reset(plain_tool->layer,
                                tool->layer_type_line,
                                "thickness", tool->args.thickness,
                                "editable", TRUE,
                                "focus", -1,
                                NULL);
        gwy_selection_set_max_objects(plain_tool->selection, NLINES);
    }
}

static void
gwy_tool_path_level_response(GwyTool *gwytool,
                             gint response_id)
{
    GwyToolPathLevel *tool;

    GWY_TOOL_CLASS(gwy_tool_path_level_parent_class)->response(gwytool,
                                                               response_id);

    tool = GWY_TOOL_PATH_LEVEL(gwytool);
    if (response_id == GTK_RESPONSE_APPLY)
        gwy_tool_path_level_apply(tool);
}

static void
gwy_tool_path_level_selection_changed(GwyPlainTool *plain_tool,
                                      gint hint)
{
    GwyToolPathLevel *tool;
    GwyNullStore *store;
    gint n;

    tool = GWY_TOOL_PATH_LEVEL(plain_tool);
    store = GWY_NULL_STORE(tool->model);
    n = gwy_null_store_get_n_rows(store);
    g_return_if_fail(hint <= n);

    if (hint < 0) {
        gtk_tree_view_set_model(tool->treeview, NULL);
        if (plain_tool->selection)
            n = gwy_selection_get_data(plain_tool->selection, NULL);
        else
            n = 0;
        gwy_null_store_set_n_rows(store, n);
        gtk_tree_view_set_model(tool->treeview, tool->model);
    }
    else {
        GtkTreeSelection *selection;
        GtkTreePath *path;
        GtkTreeIter iter;

        if (hint < n)
            gwy_null_store_row_changed(store, hint);
        else
            gwy_null_store_set_n_rows(store, n+1);

        gtk_tree_model_iter_nth_child(tool->model, &iter, NULL, hint);
        path = gtk_tree_model_get_path(tool->model, &iter);
        selection = gtk_tree_view_get_selection(tool->treeview);
        gtk_tree_selection_select_iter(selection, &iter);
        gtk_tree_view_scroll_to_cell(tool->treeview, path, NULL,
                                     FALSE, 0.0, 0.0);
    }

    gtk_widget_set_sensitive(tool->apply, !!gwy_null_store_get_n_rows(store));
}

static void
gwy_tool_path_level_thickness_changed(GwyToolPathLevel *tool,
                                      GtkAdjustment *adj)
{
    GwyPlainTool *plain_tool;

    tool->args.thickness = gwy_adjustment_get_int(adj);
    plain_tool = GWY_PLAIN_TOOL(tool);
    if (plain_tool->layer)
        g_object_set(plain_tool->layer,
                     "thickness", tool->args.thickness,
                     NULL);
    /* TODO? */
}

static void
gwy_tool_path_level_render_cell(GtkCellLayout *layout,
                                GtkCellRenderer *renderer,
                                GtkTreeModel *model,
                                GtkTreeIter *iter,
                                gpointer user_data)
{
    GwyToolPathLevel *tool = (GwyToolPathLevel*)user_data;
    gchar buf[16];
    gint isel[4];
    guint id, idx;

    id = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(layout), "id"));
    gtk_tree_model_get(model, iter, 0, &idx, -1);
    if (id == COLUMN_I) {
        g_snprintf(buf, sizeof(buf), "%d", idx + 1);
        g_object_set(renderer, "text", buf, NULL);
        return;
    }

    gwy_tool_path_level_sel_to_isel(tool, idx, isel);
    switch (id) {
        case COLUMN_X0:
        g_snprintf(buf, sizeof(buf), "%d", isel[0]);
        break;

        case COLUMN_Y0:
        g_snprintf(buf, sizeof(buf), "%d", isel[1]);
        break;

        case COLUMN_X1:
        g_snprintf(buf, sizeof(buf), "%d", isel[2]);
        break;

        case COLUMN_Y1:
        g_snprintf(buf, sizeof(buf), "%d", isel[3]);
        break;

        default:
        g_return_if_reached();
        break;
    }

    g_object_set(renderer, "text", buf, NULL);
}

static gint
change_point_compare(gconstpointer a, gconstpointer b)
{
    const ChangePoint *pa = (const ChangePoint*)a;
    const ChangePoint *pb = (const ChangePoint*)b;

    if (pa->row < pb->row)
        return -1;
    if (pa->row > pb->row)
        return 1;

    if (pa->end < pb->end)
        return -1;
    if (pa->end > pb->end)
        return 1;

    if (pa->id < pb->id)
        return -1;
    if (pa->id > pb->id)
        return 1;

    g_return_val_if_reached(0);
}

static void
gwy_tool_path_level_apply(GwyToolPathLevel *tool)
{
    ChangePoint *cpts;
    GwyPlainTool *plain_tool;
    GwyDataLine *corr;
    gint n, xres, yres, row, i, j, nw, tp, tn;
    gboolean *wset;
    gdouble *cd, *d;
    gdouble s;
    gint *isel;

    plain_tool = GWY_PLAIN_TOOL(tool);
    gwy_tool_path_level_save_args(tool);
    gwy_app_undo_qcheckpoint(plain_tool->container,
                             gwy_app_get_data_key_for_id(plain_tool->id), 0);

    n = gwy_selection_get_data(plain_tool->selection, NULL);
    cpts = g_new(ChangePoint, 2*n);
    isel = g_new(gint, 4*n);
    xres = gwy_data_field_get_xres(plain_tool->data_field);
    yres = gwy_data_field_get_yres(plain_tool->data_field);
    for (i = 0; i < n; i++) {
        gwy_tool_path_level_sel_to_isel(tool, i, isel + 4*i);
        cpts[2*i].row = isel[4*i + 1];
        cpts[2*i].id = i;
        cpts[2*i].end = FALSE;
        cpts[2*i + 1].row = isel[4*i + 3];
        cpts[2*i + 1].id = i;
        cpts[2*i + 1].end = TRUE;
    }

    qsort(cpts, 2*n, sizeof(ChangePoint), change_point_compare);
    wset = g_new0(gboolean, n);
    corr = gwy_data_line_new(yres, 1.0, TRUE);
    cd = gwy_data_line_get_data(corr);
    d = gwy_data_field_get_data(plain_tool->data_field);
    tp = (tool->args.thickness - 1)/2;
    tn = tool->args.thickness/2;
    i = 0;
    for (row = 0; row < yres; row++) {
        /* Lines participating on this row leveling are in wset now: they
         * intersect this and the previous row */
        if (row) {
            s = 0.0;
            nw = 0;
            for (j = 0; j < n; j++) {
                if (wset[j]) {
                    gint p = isel[4*j + 2] - isel[4*j + 0];
                    gint q = isel[4*j + 3] - isel[4*j + 1];
                    gint sg = q > 0 ? 1 : -1;
                    gint x = ((2*(row - isel[4*j + 1]) + 1)*p + sg*q)/(2*sg*q)
                             + isel[4*j + 0];
                    gint k;

                    for (k = MAX(0, x - tp); k <= MIN(xres-1, x + tn); k++) {
                        s += d[xres*row + k] - d[xres*(row - 1) + k];
                        nw++;
                    }
                }
            }
            if (nw) {
                s /= nw;
                cd[row] = s;
            }
        }

        /* Update working set.  Sort puts starts before ends, therefore
         * horizontal lines are effectively ignored -- which is the correct
         * behaviour */
        while (i < 2*n && row == cpts[i].row) {
            if (cpts[i].end) {
                gwy_debug("row %d, removing %d from wset", row, cpts[i].id);
                g_assert(wset[cpts[i].id]);
                wset[cpts[i].id] = FALSE;
            }
            else {
                gwy_debug("row %d, adding %d to wset", row, cpts[i].id);
                g_assert(!wset[cpts[i].id]);
                wset[cpts[i].id] = TRUE;
            }
            i++;
        }
    }
    g_free(wset);
    g_free(cpts);
    g_free(isel);

    gwy_data_line_cumulate(corr);
    for (row = 0; row < yres; row++) {
        s = cd[row];
        for (j = 0; j < xres; j++)
            d[row*xres + j] -= s;
    }
    g_object_unref(corr);

    gwy_data_field_data_changed(plain_tool->data_field);
    gwy_plain_tool_log_add(plain_tool);
}

static void
gwy_tool_path_level_sel_to_isel(GwyToolPathLevel *tool,
                                gint i,
                                gint *isel)
{
    GwyPlainTool *plain_tool;
    gdouble sel[4];
    gint xres, yres;

    plain_tool = GWY_PLAIN_TOOL(tool);
    xres = gwy_data_field_get_xres(plain_tool->data_field);
    yres = gwy_data_field_get_yres(plain_tool->data_field);
    gwy_selection_get_object(plain_tool->selection, i, sel);

    sel[0] = floor(gwy_data_field_rtoj(plain_tool->data_field, sel[0]));
    sel[1] = floor(gwy_data_field_rtoi(plain_tool->data_field, sel[1]));
    sel[2] = floor(gwy_data_field_rtoj(plain_tool->data_field, sel[2]));
    sel[3] = floor(gwy_data_field_rtoi(plain_tool->data_field, sel[3]));
    if (sel[1] > sel[3]) {
        GWY_SWAP(gdouble, sel[0], sel[2]);
        GWY_SWAP(gdouble, sel[1], sel[3]);
    }
    isel[0] = CLAMP((gint)sel[0], 0, xres-1);
    isel[1] = CLAMP(floor(sel[1]), 0, yres-1);
    isel[2] = CLAMP((gint)sel[2], 0, xres-1);
    isel[3] = CLAMP(ceil(sel[3]), 0, yres-1);
}

static void
gwy_tool_path_level_save_args(GwyToolPathLevel *tool)
{
    GwyContainer *settings;

    settings = gwy_app_settings_get();
    gwy_container_set_int32_by_name(settings, thickness_key,
                                    tool->args.thickness);
}

/* vim: set cin et ts=4 sw=4 cino=>1s,e0,n0,f0,{0,}0,^0,\:1s,=0,g1s,h0,t0,+1s,c3,(0,u0 : */