home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume4 / quickplot / part2 / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  2.5 KB  |  71 lines

  1. /* :set tabstop=4                                                    */
  2. /*
  3.  * $Header: defs.h,v 1.1 86/04/20 16:16:52 sysad Exp $
  4.  */
  5.  
  6. /*
  7.  * $Log:    defs.h,v $
  8.  * Revision 1.1  86/04/20  16:16:52  sysad
  9.  * Initial distribution version
  10.  * 
  11.  * 
  12.  */
  13.  
  14.  
  15. /* It is the intent of the author that this software may be distributed
  16.  * and used freely, without restriction.  If you make improvements or
  17.  * enhancements, I would appreciate a copy.
  18.  *
  19.  * Duane H. Hesser    Teltone Corporation
  20.  * ....uw-beaver!tikal!sysad
  21.  * ....uw-beaver!tikal!dhh
  22.  */
  23.  
  24. #ifndef QUICKPLOT
  25. #define    GRAPHICSCHAR    '\005'    /* puts printer in graphics mode    */
  26. #define    XPERINCH    ((double)60.0)        /* horizontal dot density    */
  27. #define    YPERINCH    ((double)72.0)        /* vertical dot density        */
  28. #define    SPACEX    ((8 * XPERINCH) - 1)    /* dots for 8 inch plot area*/
  29. #define    SPACEY    ((8 * YPERINCH)    - 1)    /* dots for 8 inch plot area*/
  30. #define    XDOTS    792                /* maximum possible horizontal dots    */
  31. /* we lose 12 dots vertically with the print head positioned for
  32.  * printing on the first line in ascii mode
  33.  */
  34. #define    YDOTS    780                /* maximum possible vertical dots    */
  35. #define    XBYTES    (XDOTS/6)        /* bytes needed for XDOTS            */
  36. #define    MAXX    (XDOTS - 1)        /* maximum plottable x value        */
  37. #define    MAXY    (YDOTS - 1)        /* maximum plottable y value        */
  38. #else
  39. #define    PLOTCHAR    'X'            /* use this char for plotting        */
  40. #define    XPERINCH    ((double)10.0)        /* horizontal dot density    */
  41. #define    YPERINCH    ((double)6.0)        /* vertical dot density        */
  42. #define    SPACEX    ((8 * XPERINCH) - 1)    /* dots for 8 inch plot area*/
  43. #define    SPACEY    ((8 * YPERINCH)    - 1)    /* dots for 8 inch plot area*/
  44. #define    XDOTS    132                /* maximum possible horizontal dots    */
  45. #define    YDOTS    66                /* maximum possible vertical dots    */
  46. #define    XBYTES    (XDOTS)            /* horizontal dimension of array    */
  47. #define    MAXX    (XDOTS - 1)        /* maximum plottable x value        */
  48. #define    MAXY    (YDOTS - 1)        /* maximum plottable y value        */
  49. #endif
  50.  
  51. /* Horizontal dimension of Row array.
  52.  * Add 1 byte for a null, 1 for LF, 1 for graphics byte
  53.  */
  54. #define    XARRAYSIZE    (XBYTES + 3)
  55.  
  56. /* Linemode masks; used in make_line() for lplot                    */
  57. #define    SOLID 0177777
  58. #define    DOTTED 001
  59. #define    SHORTDASHED 003
  60. #define    DOTDASHED 013
  61. #define    LONGDASHED 007
  62.  
  63. #ifndef QUICKPLOT
  64. #define    mapx(x)    ((((double)x - lowx_space) * mapxfac) + Xmargin + 0.5)
  65. #define    mapy(y)    ((((double)y - lowy_space) * mapyfac) + Ymargin + 0.5)
  66. #define    plotbit(x,a)    (x & (1 << a))
  67. #else
  68. #define    mapx(x)    ((((double)x - lowx_space) * mapxfac) + Xmargin + 0.01)
  69. #define    mapy(y)    ((((double)y - lowy_space) * mapyfac) + Ymargin + 0.01)
  70. #endif
  71.