Directory contains Code for variant graphics display library. Currently has code for X11 and dummy libraries. See Readme in .. for full description of how this works. Subdirectories: xgraphics - Routines for X11 version of library. dummy_graphics - Dummy placeholder routines for dummy version of library. The following are descriptions of the user callable routines that must be implemented in any variant library. -------------------------------------------------------------------------- NAME close_display SYNOPSIS #include "graphics.h" void close_display( screenimagetype *screenimage) DESCRIPTION Erases displayed screenimage, and closes connection to display device. screenimage struct can now be used to display another image. -------------------------------------------------------------------------- NAME display_image SYNOPSIS #include "utility.h" #include "graphics.h" void display_image( imagetype *image, screenimagetype *screenimage) DESCRIPTION Takes an image, opens the appropriate channels, displays it, and returns a handle to the displayed screenimage which can be used to implement further graphical interaction. -------------------------------------------------------------------------- NAME redisplay_image SYNOPSIS #include "utility.h" #include "graphics.h" void redisplay_image( imagetype *image, screenimagetype *screenimage) DESCRIPTION Displays an image in a screenimage that hooked to an aready open window. This avoids requests for initial repositioning, and new windows do not keep popping up. -------------------------------------------------------------------------- NAME draw_cross, draw_cross_rc SYNOPSIS #include "graphics.h" void draw_cross( screenimagetype *screenimage, int x, int y, int radius, char *color) void draw_cross_rc( screenimagetype *screenimage, int row, int col, int radius, char *color) DESCRIPTION Draws cross of specified radius and color centered at specified point. Draw_cross_rc takes row/col arguments instead of x/y -------------------------------------------------------------------------- NAME draw_line, draw_line_rc SYNOPSIS #include "graphics.h" void draw_line( screenimagetype *screenimage int x1, int y1, int x2, int y2, char *color) void draw_line_rc( screenimagetype *screenimage, int row1, int col1, int row2, int col2 char *color) DESCRIPTION Draws the specified line segment in overlay to an already opened and displayed screenimage. Draw_line_rc takes row/col arguments instead of x/y -------------------------------------------------------------------------- NAME draw_lines SYNOPSIS #include "graphics.h" void draw_lines( screenimagetype *screenimage) DESCRIPTION Draw a sequence of lines on the specified screenimage using the mouse to input endpoints. What's it good for? Mostly testing of display interface. -------------------------------------------------------------------------- NAME draw_point, draw_point_rc SYNOPSIS #include "graphics.h" void draw_point( screenimagetype *screenimage int x, int y, char *color) void draw_point_rc( screenimagetype *screenimage, int row, int col, char *color) DESCRIPTION Draws a single specified point in overlay on an already opened and displayed screenimage. Draw_point_rc takes row/col arguments instead of x/y. -------------------------------------------------------------------------- NAME draw_points SYNOPSIS #include "graphics.h" void draw_points( screenimagetype *screenimage, int n_points, xy_point_type *xy_points, char *color) DESCRIPTION Draws a set of points contained in an array of xy_point_type to displayed screenimage overlay. Provided because a lot of graphics interfaces have functions for displaying point sets that are significantly faster then a corresponding sequence of calls to the display single point function. -------------------------------------------------------------------------- NAME draw_rectangle, draw_rectangle_rc SYNOPSIS #include "graphics.h" void draw_rectangle( screenimagetype *screenimage, int x, int y, int width, int height, char *color); void draw_rectangle_rc( screenimagetype *screenimage, int row, int col, int nrows, int ncols, char *color); DESCRIPTION Outlines the specified rectangle in the specified color Not especially designed for efficiency, the draw_line routines are called several times rather than loading up a data strucutre and calling draw_lines for multiple lines, but in the usual usage, this in not likely to be noticeable. Draw_rectangle_rc takes row/col arguments instead of x/y. -------------------------------------------------------------------------- NAME erase_rectangle, erase_rectangle_rc SYNOPSIS #include "graphics.h" void erase_rectangle( screenimagetype *screenimage, int x, int y, int width, height) void erase_rectangle_rc( screenimagetype *screenimage, int row, int col, int nrows, int ncols) DESCRIPTION Erases lines and points drawn on within the specified rectangle on displayed screenimage. Does not affect underlying image, since lines and points are assumed to be put in an overlay or functional equivalent. Erase_rectangle_rc takes row/col arguments instead of x/y. -------------------------------------------------------------------------- NAME get_window SYNOPSIS #include "utility.h" #include "graphics.h" void get_window ( screenimagetype *screenimage, imagetype *window_image) DESCRIPTION Prompts the user for diagonal corners of a window in displayed screenimage (e.g. via mouse); then extracts and returns subimage in window_image. -------------------------------------------------------------------------- NAME getxy, get_row_col SYNOPSIS #include "graphics.h" void getxy ( screenimagetype *screenimage, int *x, int *y) void get_row_col ( screenimagetype *screenimage, int *row, int *col) DESCRIPTION Returns x and y image coordinates provided by user (e.g. via mouse) Assumes screenimage is displayed. Get_row_col takes row/col arguments instead of x/y. -------------------------------------------------------------------------- NAME hold_display SYNOPSIS #include "graphics.h" void hold_display( screenimagetype *screenimage) DESCRIPTION Keeps specified display window (screenimage) around after process terminates. Done, e.g., with a fork and a loop on an X status variable. --------------------------------------------------------------------------