⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hsa_graf.doc

📁 The HSA Screen Graphics Library
💻 DOC
📖 第 1 页 / 共 3 页
字号:













     
     13-Jul-87                                                          Page 7








     Hardwood Software Associates
     
             HSA_GRAF - Screen Graphics Library (V1.01)  
             HSA_GRAF - Screen Graphics Library (V1.01)  
     
     
                            GR_STR - String Display Functions
                            _________________________________
     
     NAME:                G_STR_H - Display a horizontal message on screen
                          G_STR_H                                         
     SYNOPSIS:            g_str_h (x,y,msg);
                          int x;                      Dot address of x
                          int y;                      Dot address of y.
                          char *msg;                  Message to display.
     DESCRIPTION:         Display a horizontal message on the screen at the
                          specified X,Y coordinates. (X = -1 - use last ones
                          specified)
     CAUTIONS:            Uses ROM character table.
                          Last coordinates for characters are different than
                          last point/line coordinates.
     
                              GR_FILL - Area Fill Function
                              ____________________________
     
     NAME:                G_FILL - Fill an area from a seed
                          G_FILL                           
     SYNOPSIS:            g_fill (x,y,new_color);
                          int x;                      Seed x dot address
                          int y;                      Seed y dot address
                          int new_color;              Color to fill with
     DESCRIPTION:         Starting at the seed location fill the screen with
                          the specified color until a boundary is reached.  A
                          boundary pixel is one that has a color different
                          than the original seed pixel color.
     CAUTIONS:            Because this routine calls itself recursively, it
                          can use a great deal of stack space.  Approximately
                          26 bytes per horizontal line of fill should be
                          allowed.  This means that to fill a Hercules screen
                          would require a stack size of at least 8352 bytes.
     NOTE:                This routine is adapted from a Pascal routine
                          published in the May, 1986 issue of Computer
                          Language Magazine by William F. Polik


















     
     13-Jul-87                                                          Page 8








     Hardwood Software Associates
     
             HSA_GRAF - Screen Graphics Library (V1.01)  
             HSA_GRAF - Screen Graphics Library (V1.01)  
     
     
                            GR_MISC - Miscellaneous Functions
                            _________________________________
     
     NAME:                G_SAVE - Save the current graphics screen image in
                          G_SAVE                                            
                                     the buffer
     SYNOPSIS:            g_save (buffer,number);
                          int buffer[number];        Buffer to receive screen
                                                     image
                          int number;                Number of words to save
     CAUTIONS:            This routine saves the entire graphics screen, it is
                          not a window save,  No checking is done to insure
                          that the buffer is large enough.  For the Hercules
                          board the array should be 16384.  Fot the EGA
                          board only the last bit plane is saved, therefore
                          it might not be as useful.
     
     NAME:                G_RESTORE - Restore the graphics screen image from
                          G_RESTORE                                         
                                        the buffer
     SYNOPSIS:            g_restore (buffer,number);
                          int buffer[number];        Buffer containing screen
                                                     image
                          int number;                Number of words to save
     CAUTIONS:            This routine restore the entire graphics screen, it
                          is not a window restore.
     
     NAME:                G_ORIGIN - Set screen origin location
                          G_ORIGIN                             
     SYNOPSIS:            g_origin (loc);
                          int loc;                   Origin location:
                                                       0 - Upper left corner
                                                       1 - Lower left corner
     DESCRIPTION:         Set screen origin location.
     RETURNS:             0  - successful
                          -1 - Invalid location
     
     NAME:                G_BS_H - Back space one character position
                          G_BS_H                                    
     SYNOPSIS:            g_bs_h ();
     DESCRIPTION:         Back space the current character position one place.
     
     
     NAME:                G_CLR - Clear the current graphics page
                          G_CLR                                  
     SYNOPSIS:            g_clr ();
     DESCRIPTION:         Clears the current graphics page and the last
                          coordinate values for lines and characters.









     
     13-Jul-87                                                          Page 9








     Hardwood Software Associates
     
             HSA_GRAF - Screen Graphics Library (V1.01)  
             HSA_GRAF - Screen Graphics Library (V1.01)  
     
     
                    GR_ATTR - Functions to Control Screen Attributes
                    ________________________________________________
     
     
     NAME:                G_SOLID - Set line type to solid
                          G_SOLID                         
     SYNOPSIS:            g_solid ();
     DESCRIPTION:         Set line type to solid lines.
     
     NAME:                G_DOT - Set line type to dotted
                          G_DOT                          
     SYNOPSIS:            g_dot ();
     DESCRIPTION:         Set line type to dotted lines.
     
     NAME:                G_DASH - Set line type to dashed
                          G_DASH                          
     SYNOPSIS:            g_dash ();
     DESCRIPTION:         Set line type to dashed lines.
     
     NAME:                G_SET_LINE - Set line type mask
                          G_SET_LINE                     
     SYNOPSIS:            g_set_line (type);
                          unsigned int type;         Line type mask
     DESCRIPTION:         Set line type.  The line type is a word that defines
                          if the next pel will be set.  If the bit is 1 the
                          the element is set.  For example:
                            type = 0x3333;  /* Set two pel then skip two */
     
     NAME:                G_FORE_COLOR - Set foreground color
                          G_FORE_COLOR                       
     SYNOPSIS:            g_fore_color (color);
                          int color;                 Foreground color
     DESCRIPTION:         Sets the foreground color.  The foreground color is
                          used to draw lines and display strings.
     
     NAME:                G_BACK_COLOR - Set background color
                          G_BACK_COLOR                       
     SYNOPSIS:            g_back_color (color);
                          int color;                 Background color
     DESCRIPTION:         Sets the background color.  The background color is
                          used to clear the screen and behind display strings.
     
     NAME:                G_REVERSE_COLOR - Swap foreground and background
                          G_REVERSE_COLOR                                 
                                              colors
     SYNOPSIS:            g_reverse_color ();
     DESCRIPTION:         Swaps the current foreground color with the current
                          background color.
     
     NAME:                G_MODE - Set mode for screen drawing
                          G_MODE                              
     SYNOPSIS:            g_mode(mode);
                          int mode;                  Point set mode for all
                                                     graphics commands.
                                                     Graphics (lines/points):
                                                       0 = clear bit
                                                       1 = set bit
                                                       2 = exclusive OR bit
                                                     Graphics text:
                                                       0 = reverse video
     
     13-Jul-87                                                          Page 10








     Hardwood Software Associates
     
             HSA_GRAF - Screen Graphics Library (V1.01)  
             HSA_GRAF - Screen Graphics Library (V1.01)  
     
                                                       1 = normal video
                                                       2 = exclusive OR
     DESCRIPTION:         Set up the mode for setting points for all other
                          commands.
















































     
     13-Jul-87                                                          Page 11








     Hardwood Software Associates
     
             HSA_GRAF - Screen Graphics Library (V1.01)  
             HSA_GRAF - Screen Graphics Library (V1.01)  
     
     
                      GR_DRAW - Functions to Draw Lines and Points
                      ____________________________________________
     
     
     NAME:                G_POINT - Set the specified dot in the current
                          G_POINT                                       
                                      graphics page
     SYNOPSIS:            g_point (x,y);
                          int x;                      X coordinate of dot
                                                       (0 <= x <= max X)
                          int y;                      Y coordinate of dot
                                                       (0 <= y <= max Y)
     DESCRIPTION:         Sets the dot at the specified coordinates and save
                          the coordinates for future calls.
     
     NAME:                G_LINE - Draw a line
                          G_LINE              
     SYNOPSIS:            g_line (x1,y1,x2,y2);
                          int x1;                    X coordinate of start of line
                                                       (0 <= x1 <= max X)
                          int y1                     Y coordinate of start of line
                                                       (0 <= y1 <= max Y)
                          int x2;                    X coordinate of end of line
                                                       (0 <= x2 <= max X)
                          int y2                     Y coordinate of end of line
                                                       (0 <= y2 <= max Y)
     DESCRIPTION:         Draw a line between the specified coordinates.  If
                          the start coordinate x is equal to -1 then
                          coordinate set by previous graphics call is used.

























     
     13-Jul-87                                                          Page 12








     Hardwood Software Associates
     
             HSA_GRAF - Screen Graphics Library (V1.01)  
             HSA_GRAF - Screen Graphics Library (V1.01)  
     
     
                  GR_SCALE - Functions to Perform Screen Scaled Actions
                  _____________________________________________________
     
     
     NAME:                G_SCALE - Set screen scale factors
                          G_SCALE                           
     SYNOPSIS:            g_scale (xdots,ydots);
                          int xdots;                 Dots per inch horizontal
                                                       (default = 90)
                          int ydots;                 Dots per inch vertical
                                                       (default = 63)
     DESCRIPTION:         Set the scale factors for x and y axes (in dots per
                          inch). These scale factors are used by all "gs"
                          routines.
     CAUTIONS:            Both values must be <= 255.
     
     NAME:                GS_LOC - Return current location (scaled)
                          GS_LOC                                   
     SYNOPSIS:            gs_loc (x,y);
                          int *x;                    X coordinate of dot
                                                     (0 <= x <= max X*xdots*1000)
                          int *y;                    Y coordinate of dot
                                                     (0 <= y <= max Y*ydots*1000)
     DESCRIPTION:         Return the location of the current point scaled.
     
     
     NAME:                GS_POINT - Set a point (scaled)
                          GS_POINT                       
     SYNOPSIS:            gs_point (x,y);
                          int x;                     X coordinate of dot
                                                     (0 <= x <= max X*xdots*1000)
                          int y;                     Y coordinate of dot
                                                     (0 <= y <= max Y*ydots*1000)
     DESCRIPTION:         Sets the dot at the specified coordinates and save
                          the coordinates for future calls, arguments in
                          screen inches * 1000.
     
     NAME:                GS_R_POINT - Return the color of the specified point
                          GS_R_POINT                                          
     SYNOPSIS:            g_r_point(x,y);
                          int x;                     X coordinate
                                                     (0 <= x <= max X*xdots*1000)
                          int y;                     Y coordinate
                                                     (0 <= y <= max Y*ydots*1000)
     DESCRIPTION:         Return the color of the specified point.
     RETURNS:             The color of the specified point.
     
     NAME:                GS_LINE - Draw a line (scaled)
                          GS_LINE                       
     SYNOPSIS:            gs_line (x1,y1,x2,y2);
                          int x1;                    X coordinate of start of line
                                                     (0 <= x1 <= max X*xdots*1000)
                          int y1;                    Y coordinate of start of line
                                                     (0 <= y1 <= max Y*ydots*1000)
                          int x2;                    X coordinate of end of line
                                                     (0 <= x2 <= max X*xdots*1000)
                          int y2;                    Y coordinate of end of line
     
     13-Jul-87                                                          Page 13








     Hardwood Software Associates
     
             HSA_GRAF - Screen Graphics Library (V1.01)  
             HSA_GRAF - Screen Graphics Library (V1.01)  
     
                                                     (0 <= y2 <= max Y*ydots*1000)
     DESCRIPTION:         Draw a line between the specified coordinates.  If
                          the start coordinate x is equal to -1 then
                          coordinate set by previous graphics call is used.
     
     NAME:                GS_STR_H - Display a horizontal message on screen
                          GS_STR_H                                         
                                       (scaled)
     SYNOPSIS:            gs_str_h (x,y,msg);
                          int x;                     X coordinate of start of message
                          int y;                     Y coordinate of start of message
                          char *msg;                 Message to display.
     DESCRIPTION:         Display a horizontal message on the screen at the
                          specified X,Y coordinates. (X = -1 - use last ones
                          specified)
     CAUTIONS:            Uses ROM character table.
                          Last coordinates for characters are different than
                          last point/line coordinates.
     

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -