#include #include #include #include #include #include #include #include #include "transport.h" /*! * \brief screen left edge * * Returns the coordinate of the left edge of the screen. * * \param void * \return int */ int R_screen_left(void) { return trans->screen_left(); } /*! * \brief screen right edge * * Returns the coordinate of the right edge of the screen. * * \param void * \return int */ int R_screen_rite(void) { return trans->screen_rite(); } /*! * \brief bottom of screen * * Returns the coordinate of the bottom of the screen. * * \param void * \return int */ int R_screen_bot(void) { return trans->screen_bot(); } /*! * \brief top of screen * * Returns the coordinate of the top of the screen. * * \param void * \return int */ int R_screen_top(void) { return trans->screen_top(); } int R_get_num_colors(int *n) { return trans->get_num_colors(n); } /*! * \brief select floating color table * * Selects a * float color table to be used for subsequent color calls. It is expected that * the user will follow this call with a call to erase and reinitialize the * entire graphics screen. * Returns 0 if successful, non-zero if unsuccessful. * * \param void * \return int */ int R_color_table_float(void) { return trans->color_table_float(); } /*! * \brief select fixed color table * * Selects a fixed * color table to be used for subsequent color calls. It is expected that the * user will follow this call with a call to erase and reinitialize the entire * graphics screen. * Returns 0 if successful, non-zero if unsuccessful. * * \param void * \return int */ int R_color_table_fixed(void) { return trans->color_table_fixed(); } int R_color_offset(int n) { return trans->color_offset(n); } /*! * \brief select color * * Selects the color to be * used in subsequent draw commands. * * \param index * \return int */ int R_color(int index) { return trans->color(index); } /*! * \brief select standard color * * Selects the * standard color to be used in subsequent draw commands. The * color value is best retrieved using D_translate_color. * See Display_Graphics_Library. * * \param index * \return int */ int R_standard_color(int index) { return trans->standard_color(index); } /*! * \brief select color * * When in * float mode (see R_color_table_float), this call selects the color * most closely matched to the red, grn, and blue intensities * requested. These values must be in the range of 0-255. * * \param red * \param grn * \param blue * \return int */ int R_RGB_color(unsigned char red, unsigned char grn, unsigned char blu) { return trans->RGB_color(red, grn, blu); return 0; } /*! * \brief define single color * * Sets color number num to the * intensities represented by red, grn, and blue. * * \param red * \param grn * \param blu * \param num number * \return int */ int R_reset_color(unsigned char red, unsigned char grn, unsigned char blu, int index) { return trans->reset_color(red, grn, blu, index); } /*! * \brief define multiple colors * * Sets color numbers * min through max to the intensities represented in the arrays * red, grn, and blue. * * \param min * \param max * \param red * \param grn * \param blue * \return int */ int R_reset_colors(int min, int max, unsigned char *red, unsigned char *grn, unsigned char *blu) { return trans->reset_colors(min, max, red, grn, blu); } /*! * \brief change the width of line * * Changes the width of line to be used in subsequent draw commands. * * \param width * \return int */ int R_line_width(int width) { return trans->line_width(width); } /*! * \brief erase screen * * Erases the entire screen to black. * * \param void * \return int */ int R_erase(void) { return trans->erase(); } /*! * \brief move current location * * Move the current location to the absolute screen coordinate x,y. * Nothing is drawn on the screen. * * \param x * \param y * \return int */ int R_move_abs(int x, int y) { return trans->move_abs(x, y); } /*! * \brief move current location * * Shift the current screen location by the values in dx and dy: \code Newx = Oldx + dx; Newy = Oldy + dy; \endcode * Nothing is drawn on the screen. * * \param x dx * \param y dy * \return int */ int R_move_rel(int x, int y) { return trans->move_rel(x, y); } /*! * \brief draw line * * Draw a line using the current color, selected via R_color, from the * current location to the location specified by x,y. The current location * is updated to x,y. * * \param x * \param y * \return int */ int R_cont_abs(int x, int y) { return trans->cont_abs(x, y); } /*! * \brief draw line * * Draw a line using the * current color, selected via R_color, from the current location to * the relative location specified by x and y. The current * location is updated: \code Newx = Oldx + x; Newy = Oldy + y; \endcode * * \param x * \param y * \return int */ int R_cont_rel(int x, int y) { return trans->cont_rel(x, y); } /*! * \brief draw a series of dots * * Pixels at the num absolute positions in the x and * y arrays are turned to the current color. The current location is * left updated to the position of the last dot. * * \param xarray x * \param yarray y * \param number * \return int */ int R_polydots_abs(int *xarray, int *yarray, int number) { return trans->polydots_abs(xarray, yarray, number); } /*! * \brief draw a series of dots * * Pixels at the number relative positions in the x and * y arrays are turned to the current color. The first position is * relative to the starting current location; the succeeding positions are then * relative to the previous position. The current location is updated to the * position of the last dot. * * \param xarray x * \param yarray y * \param number * \return int */ int R_polydots_rel(int *xarray, int *yarray, int number) { return trans->polydots_rel(xarray, yarray, number); } /*! * \brief draw an open polygon * * The number absolute positions in the x and y * arrays are used to generate a multisegment line (often curved). This line is * drawn with the current color. The current location is left updated to the * position of the last point. * Note. It is not assumed that the line is closed, i.e., no line is * drawn from the last point to the first point. * * \param xarray x * \param yarray y * \param number * \return int */ int R_polyline_abs(int *xarray, int *yarray, int number) { return trans->polyline_abs(xarray, yarray, number); } /*! * \brief draw an open polygon * * The number relative positions in the x and y * arrays are used to generate a multisegment line (often curved). The first * position is relative to the starting current location; the succeeding * positions are then relative to the previous position. The current location is * updated to the position of the last point. This line is drawn with the current * color. * Note. No line is drawn between the last point and the first point. * * \param xarray x * \param yarray y * \param number * \return int */ int R_polyline_rel(int *xarray, int *yarray, int number) { return trans->polyline_rel(xarray, yarray, number); } /*! * \brief draw a closed polygon * * The number absolute positions in the x and y arrays * outline a closed polygon which is filled with the current color. The current * location is undefined afterwards. * * \param xarray x * \param yarray y * \param number * \return int */ int R_polygon_abs(int *xarray, int *yarray, int number) { return trans->polygon_abs(xarray, yarray, number); } /*! * \brief draw a closed polygon * * The number relative positions in the x and y * arrays outline a closed polygon which is filled with the current color. The * first position is relative to the starting current location; the succeeding * positions are then relative to the previous position. The current location is * undefined afterwards. * * \param xarray x * \param yarray y * \param number * \return int */ int R_polygon_rel(int *xarray, int *yarray, int number) { return trans->polygon_rel(xarray, yarray, number); } /*! * \brief fill a box * * A box is drawn in the current color using the coordinates x1,y1 and * x2,y2 as opposite corners of the box. The current location is undefined * afterwards * * \param x1 * \param y1 * \param x2 * \param y2 * \return int */ int R_box_abs(int x1, int y1, int x2, int y2) { return trans->box_abs(x1, y1, x2, y2); } /*! * \brief fill a box * * A box is drawn in the current color using the current location as one corner * and the current location plus x and y as the opposite corner * of the box. The current location is undefined afterwards. * * \param x * \param y * \return int */ int R_box_rel(int x, int y) { return trans->box_rel(x, y); } /*! * \brief set text size * * Sets text pixel width and height to width and height. * * \param width * \param height * \return int */ int R_text_size(int width, int height) { return trans->text_size(width, height); } int R_text_rotation(float rotation) { return trans->text_rotation(rotation); } /*! * \brief set text clipping frame * * Subsequent calls to R_text will have text strings * clipped to the screen frame defined by top, bottom, left, right. * * \param t top * \param b bottom * \param l left * \param r right * \return int */ int R_set_window(int t, int b, int l, int r) { return trans->set_window(t, b, l, r); } /*! * \brief write text * * Writes text in the current color and font, at the current text * width and height, starting at the current screen location. * * \param sometext * \return int */ int R_text(const char *text) { return trans->text(text); } /*! * \brief get text extents * * The extent of the area enclosing the text * is returned in the integer pointers top, bottom, left, and * right. No text is actually drawn. This is useful for capturing the * text extent so that the text location can be prepared with proper background * or border. * * \param sometext * \param t top * \param b bottom * \param l left * \param r right * \return int */ int R_get_text_box(const char *text, int *t, int *b, int *l, int *r) { return trans->get_text_box(text, t, b, l, r); } /*! * \brief choose font * * Set current font to font name. Available fonts are: *
Font NameDescription
cyrilc cyrillic
gothgbt Gothic Great Britain triplex
gothgrt Gothic German triplex
gothitt Gothic Italian triplex
greekc Greek complex
greekcs Greek complex script
greekp Greek plain
greeks Greek simplex
italicc Italian complex
italiccs Italian complex small
italict Italian triplex
romanc Roman complex
romancs Roman complex small
romand Roman duplex
romanp Roman plain
romans Roman simplex
romant Roman triplex
scriptc Script complex
scripts Script simplex
* * \param name * \return int */ int R_font(const char *name) { return trans->font(name); } int R_font_freetype(const char *name) { return trans->font_freetype(name); } int R_charset(const char *name) { return trans->charset(name); } int R_font_freetype_release(void) { return trans->font_freetype_release(); } int R_panel_save(const char *name, int t, int b, int l, int r) { return trans->panel_save(name, t, b, l, r); } int R_panel_restore(const char *name) { return trans->panel_restore(name); } int R_panel_delete(const char *name) { return trans->panel_delete(name); } /*! * \brief initialize color arrays * * The three 256 * member arrays, red, green, and blue, establish look-up * tables which translate the raw image values supplied in * R_RGB_raster to color intensity values which are then displayed on * the video screen. These two commands are tailor-made for imagery data coming * off sensors which give values in the range of 0-255. * * \param r red * \param g green * \param b blue * \return int */ int R_set_RGB_color(unsigned char *r, unsigned char *g, unsigned char *b) { return trans->set_RGB_color(r, g, b); } /*! * \brief draw a raster * * This is useful * only in fixed color mode (see R_color_table_fixed). Starting at * the current location, the num colors represented by the intensities * described in the red, grn, and blu arrays are drawn for * nrows consecutive pixel rows. The raw values in these arrays are in * the range of 0-255. They are used to map into the intensity maps which were * previously set with R_set_RGB_color. The withzero flag is * used to indicate whether 0 values are to be treated as a color (1) or should * be ignored (0). If ignored, those screen pixels in these locations are not * modified. This option is useful for graphic overlays. * * \param n num * \param nrows * \param red * \param grn * \param blu * \param nul withzero * \return int */ int R_RGB_raster(int n, int nrows, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *nul) { return trans->RGB_raster(n, nrows, red, grn, blu, nul); } /*! * \brief Send arguments to the driver * * Sends arguments to the driver, preceded by the RASTER_CHAR opcode; * the actual work is done by the driver. A raster drawing operation is * performed. The result is that a rectangular area of width num * and height nrows, with its top-left corner at the current location, * is filled with nrows copies of the data pointed to by ras. * * \param num is the number of columns. * \param nrows is the number of rows to be drawn, all of which are identical * (this is used for vertical scaling). * \param withzero should be true (non-zero) if zero pixels are to be drawn in * color zero, false (zero) if they are to be transparent (i.e. * not drawn). * \param ras should point to num bytes of data, which constitute the * pixels for a single row of a raster image. * * Example: to draw a byte-per-pixel image: \code unsigned char image[HEIGHT][WIDTH]; for (y = 0; y < HEIGHT; y++) { R_move_abs(x_left, y_top + y); R_raster_char(WIDTH, 1, 1, image[y]); } \endcode * */ int R_raster_char(int num, int nrows, int withzero, const unsigned char *ras) { return trans->raster_char(num, nrows, withzero, ras); } int R_raster_int(int num, int nrows, int withzero, const int *ras) { return trans->raster_int(num, nrows, withzero, ras); }