home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / plotting / imagetoo / imagetl1.lha / Imagetool / headers / const.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-20  |  6.4 KB  |  202 lines

  1. /*
  2. ******************************************************************************
  3. *                               NCSA ImageTool 1.1 beta
  4. *                           Thu Sep 20 16:58:25 CDT 1990
  5. * NCSA ImageTool 1.1 beta source code and documentation are in the public
  6. * domain.
  7. * Specifically, we give to the public domain all rights for future licensing
  8. * of the source code, all resale rights, and all publishing rights.
  9. * We ask, but do not require, that the following message be included in all
  10. * derived works:
  11. * Portions developed at the National Center for Supercomputing Applications at
  12. * the University of Illinois at Urbana-Champaign.
  13. * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
  14. * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
  15. * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
  16. ******************************************************************************
  17. */
  18. /* cat > headers/const.h << "EOF" */
  19. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  20. /* const.h: global defines and typedefs for        */
  21. /*        ImageTool 1.1                */
  22. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  23. /* SCCS information: %W%    %G% - NCSA */
  24.  
  25. #define DEFAULT_FILE    ".imagetool_defaults"
  26. #define ORIGINXY        5
  27. #define ZFAC             2
  28. #define NMARKERS         5
  29. #define ERANGE             3
  30. #define MAXBUFSIZE           1500
  31. #define MAXTABLE        9
  32. #define NMAXHOSTS        4
  33. #define NMAXPRINTERS        4
  34. #define MAXNAMELEN            256
  35. #define MAXFRAMES             200
  36.  
  37. #define CR      13      /* return for search  pattern completion */
  38. #define ESC     27      /* escape for file-name completion */
  39. #define CTRL_A   1      /* control-C for "Clear" */
  40. #define CTRL_C   3      /* control-A for "Animate" */
  41. #define CTRL_L  12      /* control-L for "Load" */
  42. #define CTRL_R  18      /* control-R for "Restore" */
  43. #define CTRL_S  19      /* control-S for "Scale" */
  44. #define CTRL_V  22      /* control-V for "View" */
  45.  
  46. /* image format */
  47. #define RAW           1
  48. /*
  49. #define SUN           2
  50. #define NCSA          3
  51. */
  52. #define FLOAT         4
  53.  
  54. /* graph mode constant */
  55. #define PLOT_NONE         0
  56. #define PLOT_XY         1
  57. #define PLOT_CON         2
  58. #define PLOT_3D         3
  59.  
  60. /* color editing mode */
  61. #define CEDIT_NONE     0
  62. #define CEDIT_CONT     1
  63. #define CEDIT_FIDDLE     2
  64.  
  65. /* error and warning codes for imagetool - not used in 1.1 */
  66. /* #define E_NONE     0    */     /* successful return code */
  67. /* #define E_UNKNOWN    1    */    /* unknown error */
  68. /* #define E_MISSFNAME     2    */    /* file name missing */
  69. /* #define E_NOFILE     3    */    /* file not existing */
  70. /* #define E_MULFILE    4    */    /* multiple file names */
  71. /* #define E_MISSFSIZE     5    */    /* file sizes missing */
  72. /* #define E_TOOLARGE     6    */    /* image too large to fit */
  73. /* #define E_NOFOPEN     7    */    /* open failure for readable file */
  74. /* #define E_NOFOPENW     8    */    /* open failure for writable file */
  75. /* #define E_MEMCREAT     9    */    /* mem_create() fails */
  76. /* #define E_MALLOC     10    */    /* malloc() or calloc() fails */
  77. /* #define E_NOFREAD    11    */    /* file reading fails */
  78. /* #define E_NOFWRITE    12    */    /* file writing fails */
  79. /* #define E_LOGNEG    13    */    /* negative for logarithmic */
  80. /* #define E_TEMPNAM    14    */    /* tempnam() fails */
  81. /* #define E_TEXTSTORE    15    */    /* textsw_store() fails */
  82. /* #define E_CHDIR    16    */    /* chdir() fails */
  83. /* #define E_SYNTAX    17    */    /* syntax error with Unix name string */
  84. /* #define E_NOCONNECT    18    */    /* no ftp connection  */
  85. /* #define E_NODEFSYM    19    */    /* unknown symbol in default file */
  86. /* #define E_NOFONT    20    */    /* font not found */
  87.  
  88. /* #define W_FEWREAD    25    */    /* fewer bytes read from file */
  89. /* #define W_FEWWRITE    26    */    /* fewer bytes written to file */
  90. /* #define W_NOFORMAT    27    */    /* image format not supported */
  91. /* #define W_NOFACTOR    28    */    /* expansion factors missing */
  92. /* #define W_NODEFAULTS    29    */    /* no defaults setup */
  93.  
  94. #define in_rect(x,y,z)    ((x > z->r_left && x < z->r_left + z->r_width && \
  95. y > z->r_top && y < z->r_top + z->r_height))
  96.  
  97. /* Define the path to the ImageTool 1.0 help file directory */
  98. /*    Use User Defaults in ImageTool 1.1    */
  99. /* #define HELP_DIR "/usr/local/lib/imagetool/help" */
  100.  
  101. /* plotting mode constants and typedefs */
  102.  
  103. #define XPLOT_MIN     100
  104. #define XPLOT_MAX     500
  105. #define XPLENGTH     400
  106.  
  107. #define YPLOT_MIN     50
  108. #define YPLOT_MAX     450
  109. #define YPLENGTH     400
  110.  
  111. #define XPLOT_MARGIN     60 
  112. #define YPLOT_MARGIN     15 
  113. #define MARKER_LENGTH     3
  114.  
  115. #define ERR        0.000005
  116.  
  117. typedef short bool;
  118.  
  119. #define PI        3.1415926535897932384626433
  120. #define LARGE        2147483647    /* 2^31 - 1 */
  121. #define CANVAS_XSIZ    1150     /* sun terminal horizontal resolution */
  122. #define CANVAS_YSIZ    900      /* sun terminal vertical resolution */
  123. #define TRUE        1
  124. #define FALSE        0
  125.  
  126. #define LW_STROKE    100    /* every so often, flush lw buffer */
  127. #define LW_HEIGHT    792    /* in postscript machine units */
  128. #define LW_WIDTH    612    /* see manual: inside laser writer */
  129.  
  130. #define PRECISION    CANVAS_XSIZ    /* the bigger, the slower */
  131.  
  132. #define ABS(a)    ((a) > 0 ? (a) : -(a))
  133. #define ROUND(a)    (int)((a) > 0 ? ((a) + 0.5) : ((a) - 0.5))
  134. #define TORAD(a)    (((double)(a) * PI) / 180.0)
  135.  
  136. #ifndef MAX
  137. #define MAX(a,b)    ((a) > (b) ? (a) : (b))
  138. #define MIN(a,b)    ((a) < (b) ? (a) : (b))
  139. #endif
  140.  
  141. typedef struct {
  142.     float x, y, z;
  143. } Point;
  144.  
  145. typedef struct {
  146.     int x, y;
  147. } Raster;
  148.  
  149. typedef struct {
  150.     float clip_xmin, clip_ymin;
  151.     float clip_xmax, clip_ymax;
  152. } Clipper;
  153.  
  154. #define alpnum_round(c,u,l) ((c) - (u) + (l))
  155.  
  156. #define STRIP        0177
  157. #define MAXDIR        64
  158. #define BYTESPERWORD    4
  159. #define BUFFERSIZ    10240
  160.  
  161. /* ~~~~~~~~~~~~~~~~~~~~ 1.1 additions ~~~~~~~~~~~~~~~~~~~~ */
  162.  
  163. #define DEFAULT_FONT_PANEL "/ImageTool/Font_panel"
  164. #define DEFAULT_FONT_PANEL_BUTTON "/ImageTool/Font_panel_button"
  165. #define DEFAULT_FONT_MENU "/ImageTool/Font_menu"
  166. #define DEFAULT_HELP_DIR "/ImageTool/Help_dir"
  167. #define DEFAULT_PALETTE_FILE "/ImageTool/Palette_file"
  168. #define DEFAULT_IMAGE_DIR "/ImageTool/Image_dir"
  169. #define MESSAGE_LIMIT "/ImageTool/Message_limit"
  170.  
  171. #define DEFAULT_MESSAGE_LIMIT    20
  172. #define    ABSOLUTE_MESSAGE_LIMIT    100
  173.  
  174. #define TYPE_DIR    0
  175. #define TYPE_FILE    1
  176.  
  177. #define REGULAR        0
  178. #define DEFAULT        1
  179.  
  180. #define pal_msg1    (type == REGULAR) ? "palette" : "(default) palette"
  181. #define pal_msg2    (type == REGULAR) ? "Palette" : "(Default) palette"
  182.  
  183. #define BUG_EMAIL_ADDRESS "/ImageTool/Bug_email_address"
  184.  
  185. #define DEFAULT_BUG_EMAIL_ADDRESS "bugs@ncsa.uiuc.edu"
  186.  
  187. #define    PIXDEPTH    8    /* pixel depth - either 8 or 32 */
  188.  
  189. #define CTRL_N    14    /* control-N for "Get name" */
  190.  
  191.     enum img_type {RAWI, RIS8, SDS2D};
  192.     enum rect_vertical {LEFT, RIGHT};
  193.     enum rect_horizontal {TOP, BOTTOM};
  194.     enum desired_img_type {FIRST, HDFR8, HDFS2};
  195.     enum pal_type {PAL_UNKNOWN, PAL_RAW, PAL_HDF, PAL_RIS8};
  196. /* EOF */
  197.