home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / os2sdk / os2sdk10 / apps / mandel / mdraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  3.2 KB  |  92 lines

  1. /**    mdraw.h - mdraw include file
  2.  *    R. A. Garmoe  87/02/05
  3.  */
  4.  
  5.  
  6. #define MOUSE            /* compile mouse support */
  7.  
  8. #define FALSE    0
  9. #define TRUE    ~FALSE
  10.  
  11. #define UP    72        /* up arrow scan code */
  12. #define DOWN    80        /* down arrow scan code */
  13. #define RIGHT    77        /* right arrow scan code */
  14. #define LEFT    75        /* left arrow scan code */
  15.  
  16.  
  17. #define RESTORE_MODE    0    /* request for notification to restore mode */
  18. #define RESERVED    0    /* reserved word */
  19. #define REDRAW        1    /* request for notification to redraw */
  20. #define BLOCK        1    /* wait until screen I/O is available */
  21. #define STACKSIZE    2048    /* size of stack to allocate for threads */
  22. #define GIVEUPOWNER    1    /* owner indicator */
  23. #define KILLTHREAD    1    /* kill indicator  */
  24.  
  25. #define MAXREAL 2000        /* maximum number of real coordinates */
  26. #define MAXLOOP 1000        /* maximum number of iterations */
  27. #define BUFFER    4096        /* number of ints to read at one time */
  28.  
  29. #define SCANTIME 20        /* scan time in milliseconds */
  30. #define RIPPLE_UP   0        /* ripple palette registers up */
  31. #define RIPPLE_DN   1        /* ripple palette registers down */
  32.  
  33. #define PAGESIZE 0x8000     /* size of display page in EGA memory */
  34. #define BLACK    0x00        /* EGA black value       */
  35. #define BLUE    0x01        /* EGA blue value       */
  36. #define GREEN    0x02        /* EGA green value       */
  37. #define CYAN    0x03        /* EGA cyan value       */
  38. #define RED    0x04        /* EGA red value       */
  39. #define MAGENTA 0x05        /* EGA magenta value       */
  40. #define BROWN    0x06        /* EGA brown value       */
  41. #define WHITE    0x07        /* EGA white value       */
  42. #define DGRAY    0x08        /* EGA dark gray value       */
  43. #define LBLUE    0x09        /* EGA light blue       */
  44. #define LGREEN    0x0a        /* EGA light green       */
  45. #define LCYAN    0x0b        /* EGA light cyan value    */
  46. #define LRED    0x0c        /* EGA light red value       */
  47. #define LMAGENTA 0x0d        /* EGA light magenta value */
  48. #define YELLOW    0x0e        /* EGA yellow value       */
  49. #define IWHITE    0x0f        /* EGA intense white value */
  50.  
  51. struct cmplx {
  52.     double     realp;     /* real part of number */
  53.     double     imagp;     /* imaginary part of number */
  54. };
  55.  
  56.  
  57. /**    This structure forms a linked list of pointers to image descriptors.
  58.  *    The image descriptor is stored in allocated segments so that
  59.  *    DS is not filled up with the image descriptor.
  60.  */
  61.  
  62.  
  63. struct ilist {
  64.     struct ilist *next;    /* pointer to next ilist */
  65.     struct ilist *prev;    /* pointer to previous ilist */
  66.     struct image far *desc; /* pointer to segement containing image data */
  67. };
  68.  
  69.  
  70. /**    This structure which is stored in a allocated far segment contains
  71.  *    the data that describes the image.  This is basically the data
  72.  *    stored in the header of the .cnt file.
  73.  */
  74.  
  75.  
  76. struct image {
  77.     unsigned savesel[2];    /* selectors for screen saves */
  78.     struct    cmplx ul;    /* coordinates of upper left corner */
  79.     struct    cmplx lr;    /* coordinates of lower right corner */
  80.     int    nimag;        /* number of imaginary coordinates */
  81.     int    lni;
  82.     int    lnr;
  83.     int    mloop;        /* maximum loop count */
  84.     int    nreal;        /* number of real coordinates */
  85.  
  86.     double    rinc;        /* increment in real coordinate */
  87.     double    iinc;        /* increment in imaginary coordinate */
  88.     double    aspect;     /* aspect ratio */
  89.     char    cmap[MAXLOOP + 1];   /* mapping from iteration counter to color */
  90.     long    hist[MAXLOOP + 1]; /* histogram counters */
  91. };
  92.