10
#include <grass/raster.h>
11
#include <grass/graphics.h>
13
#include "transport.h"
16
* \brief screen left edge
18
* Returns the coordinate of the left edge of the screen.
24
int R_screen_left(void)
26
return trans->screen_left();
30
* \brief screen right edge
32
* Returns the coordinate of the right edge of the screen.
38
int R_screen_rite(void)
40
return trans->screen_rite();
44
* \brief bottom of screen
46
* Returns the coordinate of the bottom of the screen.
52
int R_screen_bot(void)
54
return trans->screen_bot();
59
* \brief top of screen
61
* Returns the coordinate of the top of the screen.
67
int R_screen_top(void)
69
return trans->screen_top();
72
void R_get_num_colors(int *n)
74
trans->get_num_colors(n);
79
* \brief select standard color
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.
90
void R_standard_color(int index)
92
trans->standard_color(index);
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.
109
void R_RGB_color(unsigned char red, unsigned char grn, unsigned char blu)
111
trans->RGB_color(red, grn, blu);
115
* \brief change the width of line
117
* Changes the <b>width</b> of line to be used in subsequent draw commands.
123
void R_line_width(int width)
125
trans->line_width(width);
129
* \brief erase screen
131
* Erases the entire screen to black.
143
* \brief move current location
145
* Move the current location to the absolute screen coordinate <b>x,y.</b>
146
* Nothing is drawn on the screen.
153
void R_move_abs(int x, int y)
155
trans->move_abs(x, y);
159
* \brief move current location
161
* Shift the current screen location by the values in <b>dx</b> and <b>dy</b>:
166
* Nothing is drawn on the screen.
173
void R_move_rel(int x, int y)
175
trans->move_rel(x, y);
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>
190
void R_cont_abs(int x, int y)
192
trans->cont_abs(x, y);
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:
212
void R_cont_rel(int x, int y)
214
trans->cont_rel(x, y);
218
* \brief draw a series of dots
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.
230
void R_polydots_abs(const int *xarray, const int *yarray, int number)
232
trans->polydots_abs(xarray, yarray, number);
236
* \brief draw a series of dots
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.
250
void R_polydots_rel(const int *xarray, const int *yarray, int number)
252
trans->polydots_rel(xarray, yarray, number);
256
* \brief draw an open polygon
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.
271
void R_polyline_abs(const int *xarray, const int *yarray, int number)
273
trans->polyline_abs(xarray, yarray, number);
277
* \brief draw an open polygon
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
285
* <b>Note.</b> No line is drawn between the last point and the first point.
293
void R_polyline_rel(const int *xarray, const int *yarray, int number)
295
trans->polyline_rel(xarray, yarray, number);
299
* \brief draw a closed polygon
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.
311
void R_polygon_abs(const int *xarray, const int *yarray, int number)
313
trans->polygon_abs(xarray, yarray, number);
317
* \brief draw a closed polygon
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.
331
void R_polygon_rel(const int *xarray, const int *yarray, int number)
333
trans->polygon_rel(xarray, yarray, number);
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
350
void R_box_abs(int x1, int y1, int x2, int y2)
352
trans->box_abs(x1, y1, x2, y2);
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.
368
void R_box_rel(int x, int y)
370
trans->box_rel(x, y);
374
* \brief set text size
376
* Sets text pixel width and height to <b>width</b> and <b>height.</b>
383
void R_text_size(int width, int height)
385
trans->text_size(width, height);
388
void R_text_rotation(float rotation)
390
trans->text_rotation(rotation);
394
* \brief set text clipping frame
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>
406
void R_set_window(int t, int b, int l, int r)
408
trans->set_window(t, b, l, r);
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.
421
void R_text(const char *text)
427
* \brief get text extents
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
443
void R_get_text_box(const char *text, int *t, int *b, int *l, int *r)
445
trans->get_text_box(text, t, b, l, r);
451
* Set current font to <b>font name</b>. Available fonts are:
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>
480
void R_font(const char *name)
485
void R_charset(const char *name)
487
trans->charset(name);
490
void R_font_list(char ***list, int *count)
492
trans->font_list(list, count);
495
void R_font_info(char ***list, int *count)
497
trans->font_info(list, count);
500
void R_panel_save(const char *name, int t, int b, int l, int r)
502
trans->panel_save(name, t, b, l, r);
505
void R_panel_restore(const char *name)
507
trans->panel_restore(name);
510
void R_panel_delete(const char *name)
512
trans->panel_delete(name);
515
void R_begin_scaled_raster(int mask, int src[2][2], int dst[2][2])
517
trans->begin_scaled_raster(mask, src, dst);
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)
524
return trans->scaled_raster(n, row, red, grn, blu, nul);
527
void R_end_scaled_raster(void)
529
trans->end_scaled_raster();
532
void R_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
534
trans->bitmap(ncols, nrows, threshold, buf);