~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to lib/raster/com_proto.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
#include <stdio.h>
3
 
 
4
 
#include <sys/types.h>
5
 
#include <sys/stat.h>
6
 
#include <fcntl.h>
7
 
#include <unistd.h>
8
 
 
9
 
#include <grass/gis.h>
10
 
#include <grass/raster.h>
11
 
#include <grass/graphics.h>
12
 
 
13
 
#include "transport.h"
14
 
 
15
 
/*!
16
 
 * \brief screen left edge
17
 
 *
18
 
 * Returns the coordinate of the left edge of the screen.
19
 
 *
20
 
 *  \param void
21
 
 *  \return int
22
 
 */
23
 
 
24
 
int R_screen_left(void)
25
 
{
26
 
    return trans->screen_left();
27
 
}
28
 
 
29
 
/*!
30
 
 * \brief screen right edge
31
 
 *
32
 
 * Returns the coordinate of the right edge of the screen.
33
 
 *
34
 
 *  \param void
35
 
 *  \return int
36
 
 */
37
 
 
38
 
int R_screen_rite(void)
39
 
{
40
 
    return trans->screen_rite();
41
 
}
42
 
 
43
 
/*!
44
 
 * \brief bottom of screen
45
 
 *
46
 
 * Returns the coordinate of the bottom of the screen.
47
 
 *
48
 
 *  \param void
49
 
 *  \return int
50
 
 */
51
 
 
52
 
int R_screen_bot(void)
53
 
{
54
 
    return trans->screen_bot();
55
 
}
56
 
 
57
 
 
58
 
/*!
59
 
 * \brief top of screen
60
 
 *
61
 
 * Returns the coordinate of the top of the screen.
62
 
 *
63
 
 *  \param void
64
 
 *  \return int
65
 
 */
66
 
 
67
 
int R_screen_top(void)
68
 
{
69
 
    return trans->screen_top();
70
 
}
71
 
 
72
 
void R_get_num_colors(int *n)
73
 
{
74
 
    trans->get_num_colors(n);
75
 
}
76
 
 
77
 
 
78
 
/*!
79
 
 * \brief select standard color
80
 
 *
81
 
 * Selects the
82
 
 * standard <b>color</b> to be used in subsequent draw commands.  The
83
 
 * <b>color</b> value is best retrieved using <i>D_translate_color.</i>
84
 
 * See Display_Graphics_Library.
85
 
 *
86
 
 *  \param index
87
 
 *  \return int
88
 
 */
89
 
 
90
 
void R_standard_color(int index)
91
 
{
92
 
    trans->standard_color(index);
93
 
}
94
 
 
95
 
/*!
96
 
 * \brief select color
97
 
 *
98
 
 * When in
99
 
 * float mode (see <i>R_color_table_float</i>), this call selects the color
100
 
 * most closely matched to the <b>red, grn</b>, and <b>blue</b> intensities
101
 
 * requested. These values must be in the range of 0-255.
102
 
 *
103
 
 *  \param red
104
 
 *  \param grn
105
 
 *  \param blue
106
 
 *  \return int
107
 
 */
108
 
 
109
 
void R_RGB_color(unsigned char red, unsigned char grn, unsigned char blu)
110
 
{
111
 
    trans->RGB_color(red, grn, blu);
112
 
}
113
 
 
114
 
/*!
115
 
 * \brief change the width of line
116
 
 *
117
 
 * Changes the <b>width</b> of line to be used in subsequent draw commands.
118
 
 *
119
 
 *  \param width
120
 
 *  \return int
121
 
 */
122
 
 
123
 
void R_line_width(int width)
124
 
{
125
 
    trans->line_width(width);
126
 
}
127
 
 
128
 
/*!
129
 
 * \brief erase screen
130
 
 *
131
 
 * Erases the entire screen to black.
132
 
 *
133
 
 *  \param void
134
 
 *  \return int
135
 
 */
136
 
 
137
 
void R_erase(void)
138
 
{
139
 
    trans->erase();
140
 
}
141
 
 
142
 
/*!
143
 
 * \brief move current location
144
 
 *
145
 
 * Move the current location to the absolute screen coordinate <b>x,y.</b>
146
 
 * Nothing is drawn on the screen.
147
 
 *
148
 
 *  \param x
149
 
 *  \param y
150
 
 *  \return int
151
 
 */
152
 
 
153
 
void R_move_abs(int x, int y)
154
 
{
155
 
    trans->move_abs(x, y);
156
 
}
157
 
 
158
 
/*!
159
 
 * \brief move current location
160
 
 *
161
 
 * Shift the current screen location by the values in <b>dx</b> and <b>dy</b>:
162
 
 \code
163
 
 Newx = Oldx + dx;
164
 
 Newy = Oldy + dy;
165
 
 \endcode
166
 
 * Nothing is drawn on the screen.
167
 
 *
168
 
 *  \param x dx
169
 
 *  \param y dy
170
 
 *  \return int
171
 
 */
172
 
 
173
 
void R_move_rel(int x, int y)
174
 
{
175
 
    trans->move_rel(x, y);
176
 
}
177
 
 
178
 
/*!
179
 
 * \brief draw line
180
 
 *
181
 
 * Draw a line using the current color, selected via <i>R_color</i>, from the 
182
 
 * current location to the location specified by <b>x,y.</b> The current location
183
 
 * is updated to <b>x,y.</b>
184
 
 *
185
 
 *  \param x
186
 
 *  \param y
187
 
 *  \return int
188
 
 */
189
 
 
190
 
void R_cont_abs(int x, int y)
191
 
{
192
 
    trans->cont_abs(x, y);
193
 
}
194
 
 
195
 
/*!
196
 
 * \brief draw line
197
 
 *
198
 
 * Draw a line using the
199
 
 * current color, selected via <i>R_color</i>, from the current location to
200
 
 * the relative location specified by <b>x</b> and <b>y.</b> The current
201
 
 * location is updated:
202
 
 \code
203
 
 Newx = Oldx + x;
204
 
 Newy = Oldy + y;
205
 
 \endcode
206
 
 *
207
 
 *  \param x
208
 
 *  \param y
209
 
 *  \return int
210
 
 */
211
 
 
212
 
void R_cont_rel(int x, int y)
213
 
{
214
 
    trans->cont_rel(x, y);
215
 
}
216
 
 
217
 
/*!
218
 
 * \brief draw a series of dots
219
 
 *
220
 
 * Pixels at the <b>num</b> absolute positions in the <b>x</b> and
221
 
 * <b>y</b> arrays are turned to the current color. The current location is
222
 
 * left updated to the position of the last dot.
223
 
 *
224
 
 *  \param xarray x
225
 
 *  \param yarray y
226
 
 *  \param number
227
 
 *  \return int
228
 
 */
229
 
 
230
 
void R_polydots_abs(const int *xarray, const int *yarray, int number)
231
 
{
232
 
    trans->polydots_abs(xarray, yarray, number);
233
 
}
234
 
 
235
 
/*!
236
 
 * \brief draw a series of dots
237
 
 *
238
 
 * Pixels at the <b>number</b> relative positions in the <b>x</b> and
239
 
 * <b>y</b> arrays are turned to the current color. The first position is
240
 
 * relative to the starting current location; the succeeding positions are then
241
 
 * relative to the previous position. The current location is updated to the
242
 
 * position of the last dot.
243
 
 *
244
 
 *  \param xarray x
245
 
 *  \param yarray y
246
 
 *  \param number
247
 
 *  \return int
248
 
 */
249
 
 
250
 
void R_polydots_rel(const int *xarray, const int *yarray, int number)
251
 
{
252
 
    trans->polydots_rel(xarray, yarray, number);
253
 
}
254
 
 
255
 
/*!
256
 
 * \brief draw an open polygon
257
 
 *
258
 
 * The <b>number</b> absolute positions in the <b>x</b> and <b>y</b>
259
 
 * arrays are used to generate a multisegment line (often curved). This line is
260
 
 * drawn with the current color. The current location is left updated to the
261
 
 * position of the last point.
262
 
 * <b>Note.</b> It is not assumed that the line is closed, i.e., no line is
263
 
 * drawn from the last point to the first point.
264
 
 *
265
 
 *  \param xarray x
266
 
 *  \param yarray y
267
 
 *  \param number
268
 
 *  \return int
269
 
 */
270
 
 
271
 
void R_polyline_abs(const int *xarray, const int *yarray, int number)
272
 
{
273
 
    trans->polyline_abs(xarray, yarray, number);
274
 
}
275
 
 
276
 
/*!
277
 
 * \brief draw an open polygon
278
 
 *
279
 
 * The <b>number</b> relative positions in the <b>x</b> and <b>y</b>
280
 
 * arrays are used to generate a multisegment line (often curved). The first
281
 
 * position is relative to the starting current location; the succeeding
282
 
 * positions are then relative to the previous position. The current location is
283
 
 * updated to the position of the last point. This line is drawn with the current
284
 
 * color.
285
 
 * <b>Note.</b> No line is drawn between the last point and the first point.
286
 
 *
287
 
 *  \param xarray x
288
 
 *  \param yarray y
289
 
 *  \param number
290
 
 *  \return int
291
 
 */
292
 
 
293
 
void R_polyline_rel(const int *xarray, const int *yarray, int number)
294
 
{
295
 
    trans->polyline_rel(xarray, yarray, number);
296
 
}
297
 
 
298
 
/*!
299
 
 * \brief draw a closed polygon
300
 
 *
301
 
 * The <b>number</b> absolute positions in the <b>x</b> and <b>y</b> arrays
302
 
 * outline a closed polygon which is filled with the current color. The current
303
 
 * location is undefined afterwards.
304
 
 *
305
 
 *  \param xarray x
306
 
 *  \param yarray y
307
 
 *  \param number
308
 
 *  \return int
309
 
 */
310
 
 
311
 
void R_polygon_abs(const int *xarray, const int *yarray, int number)
312
 
{
313
 
    trans->polygon_abs(xarray, yarray, number);
314
 
}
315
 
 
316
 
/*!
317
 
 * \brief draw a closed polygon
318
 
 *
319
 
 * The <b>number</b> relative positions in the <b>x</b> and <b>y</b>
320
 
 * arrays outline a closed polygon which is filled with the current color. The
321
 
 * first position is relative to the starting current location; the succeeding
322
 
 * positions are then relative to the previous position. The current location is
323
 
 * undefined afterwards.
324
 
 *
325
 
 *  \param xarray x
326
 
 *  \param yarray y
327
 
 *  \param number
328
 
 *  \return int
329
 
 */
330
 
 
331
 
void R_polygon_rel(const int *xarray, const int *yarray, int number)
332
 
{
333
 
    trans->polygon_rel(xarray, yarray, number);
334
 
}
335
 
 
336
 
/*!
337
 
 * \brief fill a box
338
 
 *
339
 
 * A box is drawn in the current color using the coordinates <b>x1,y1</b> and
340
 
 * <b>x2,y2</b> as opposite corners of the box. The current location is undefined
341
 
 * afterwards
342
 
 *
343
 
 *  \param x1
344
 
 *  \param y1
345
 
 *  \param x2
346
 
 *  \param y2
347
 
 *  \return int
348
 
 */
349
 
 
350
 
void R_box_abs(int x1, int y1, int x2, int y2)
351
 
{
352
 
    trans->box_abs(x1, y1, x2, y2);
353
 
}
354
 
 
355
 
 
356
 
/*!
357
 
 * \brief fill a box
358
 
 *
359
 
 * A box is drawn in the current color using the current location as one corner 
360
 
 * and the current location plus <b>x</b> and <b>y</b> as the opposite corner 
361
 
 * of the box. The current location is undefined afterwards.
362
 
 *
363
 
 *  \param x
364
 
 *  \param y
365
 
 *  \return int
366
 
 */
367
 
 
368
 
void R_box_rel(int x, int y)
369
 
{
370
 
    trans->box_rel(x, y);
371
 
}
372
 
 
373
 
/*!
374
 
 * \brief set text size
375
 
 *
376
 
 * Sets text pixel width and height to <b>width</b> and <b>height.</b>
377
 
 *
378
 
 *  \param width
379
 
 *  \param height
380
 
 *  \return int
381
 
 */
382
 
 
383
 
void R_text_size(int width, int height)
384
 
{
385
 
    trans->text_size(width, height);
386
 
}
387
 
 
388
 
void R_text_rotation(float rotation)
389
 
{
390
 
    trans->text_rotation(rotation);
391
 
}
392
 
 
393
 
/*!
394
 
 * \brief set text clipping frame
395
 
 *
396
 
 * Subsequent calls to <i>R_text</i> will have text strings
397
 
 * clipped to the screen frame defined by <b>top, bottom, left, right.</b>
398
 
 *
399
 
 *  \param t top
400
 
 *  \param b bottom
401
 
 *  \param l left
402
 
 *  \param r right
403
 
 *  \return int
404
 
 */
405
 
 
406
 
void R_set_window(int t, int b, int l, int r)
407
 
{
408
 
    trans->set_window(t, b, l, r);
409
 
}
410
 
 
411
 
/*!
412
 
 * \brief write text
413
 
 *
414
 
 * Writes <b>text</b> in the current color and font, at the current text
415
 
 * width and height, starting at the current screen location.
416
 
 *
417
 
 *  \param sometext
418
 
 *  \return int
419
 
 */
420
 
 
421
 
void R_text(const char *text)
422
 
{
423
 
    trans->text(text);
424
 
}
425
 
 
426
 
/*!
427
 
 * \brief get text extents
428
 
 *
429
 
 * The extent of the area enclosing the <b>text</b>
430
 
 * is returned in the integer pointers <b>top, bottom, left</b>, and
431
 
 * <b>right.</b> No text is actually drawn. This is useful for capturing the
432
 
 * text extent so that the text location can be prepared with proper background
433
 
 * or border.
434
 
 *
435
 
 *  \param sometext
436
 
 *  \param t top
437
 
 *  \param b bottom
438
 
 *  \param l left
439
 
 *  \param r right
440
 
 *  \return int
441
 
 */
442
 
 
443
 
void R_get_text_box(const char *text, int *t, int *b, int *l, int *r)
444
 
{
445
 
    trans->get_text_box(text, t, b, l, r);
446
 
}
447
 
 
448
 
/*!
449
 
 * \brief choose font
450
 
 *
451
 
 * Set current font to <b>font name</b>. Available fonts are:
452
 
 * 
453
 
 <table>
454
 
 <tr><td><b>Font Name</b></td><td><b>Description</b></td></tr>
455
 
 <tr><td>cyrilc </td><td> cyrillic</td></tr>
456
 
 <tr><td>gothgbt </td><td> Gothic Great Britain triplex</td></tr>
457
 
 <tr><td>gothgrt </td><td>  Gothic German triplex</td></tr>
458
 
 <tr><td>gothitt </td><td>  Gothic Italian triplex</td></tr>
459
 
 <tr><td>greekc </td><td> Greek complex</td></tr>
460
 
 <tr><td>greekcs </td><td> Greek complex script</td></tr>
461
 
 <tr><td>greekp </td><td> Greek plain</td></tr>
462
 
 <tr><td>greeks </td><td> Greek simplex</td></tr>
463
 
 <tr><td>italicc </td><td>  Italian complex</td></tr>
464
 
 <tr><td>italiccs </td><td> Italian complex small</td></tr>
465
 
 <tr><td>italict </td><td> Italian triplex</td></tr>
466
 
 <tr><td>romanc </td><td> Roman complex</td></tr>
467
 
 <tr><td>romancs </td><td> Roman complex small</td></tr>
468
 
 <tr><td>romand </td><td> Roman duplex</td></tr>
469
 
 <tr><td>romanp </td><td> Roman plain</td></tr>
470
 
 <tr><td>romans </td><td> Roman simplex</td></tr>
471
 
 <tr><td>romant </td><td> Roman triplex</td></tr>
472
 
 <tr><td>scriptc </td><td> Script complex</td></tr>
473
 
 <tr><td>scripts </td><td> Script simplex</td></tr>
474
 
 </table>
475
 
 *
476
 
 *  \param name
477
 
 *  \return int
478
 
 */
479
 
 
480
 
void R_font(const char *name)
481
 
{
482
 
    trans->font(name);
483
 
}
484
 
 
485
 
void R_charset(const char *name)
486
 
{
487
 
    trans->charset(name);
488
 
}
489
 
 
490
 
void R_font_list(char ***list, int *count)
491
 
{
492
 
    trans->font_list(list, count);
493
 
}
494
 
 
495
 
void R_font_info(char ***list, int *count)
496
 
{
497
 
    trans->font_info(list, count);
498
 
}
499
 
 
500
 
void R_panel_save(const char *name, int t, int b, int l, int r)
501
 
{
502
 
    trans->panel_save(name, t, b, l, r);
503
 
}
504
 
 
505
 
void R_panel_restore(const char *name)
506
 
{
507
 
    trans->panel_restore(name);
508
 
}
509
 
 
510
 
void R_panel_delete(const char *name)
511
 
{
512
 
    trans->panel_delete(name);
513
 
}
514
 
 
515
 
void R_begin_scaled_raster(int mask, int src[2][2], int dst[2][2])
516
 
{
517
 
    trans->begin_scaled_raster(mask, src, dst);
518
 
}
519
 
 
520
 
int R_scaled_raster(int n, int row,
521
 
                    const unsigned char *red, const unsigned char *grn,
522
 
                    const unsigned char *blu, const unsigned char *nul)
523
 
{
524
 
    return trans->scaled_raster(n, row, red, grn, blu, nul);
525
 
}
526
 
 
527
 
void R_end_scaled_raster(void)
528
 
{
529
 
    trans->end_scaled_raster();
530
 
}
531
 
 
532
 
void R_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
533
 
{
534
 
    trans->bitmap(ncols, nrows, threshold, buf);
535
 
}