home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_01 / 1001061a < prev    next >
Text File  |  1991-12-12  |  2KB  |  72 lines

  1.    /***********************************************
  2.     *
  3.     *    get_edge_options(...
  4.     *
  5.     *    This function queries the user for the
  6.     *    parameters need to perform edge
  7.     *    detection.
  8.     *
  9.     ***********************************************/
  10.  
  11.  
  12. get_edge_options(detect_type, threshold, high, size)
  13.     int *detect_type, *high, *size, *threshold;
  14. {
  15.     int not_finished, response;
  16.     not_finished = 1;
  17.     while(not_finished){
  18.  
  19.       printf("\nThe Edge Detector options are:\n");
  20.       printf("\n\t1.  Type of edge detector is %d", *detect_type);
  21.       printf("\n\t      (recall 1=Prewitt     2=Kirsch");
  22.       printf("\n\t              3=Sobel       4=quick");
  23.       printf("\n\t              5=homogeneity 6=difference");
  24.       printf("\n\t              7=contrast    8=gaussian");
  25.       printf("\n\t2.  Threshold output is %d (0=off 1=on)", 
  26. *threshold);
  27.       printf("\n\t3.  High threshold is %d", *high);
  28.       printf("\n\t4.  Size is %d (gaussian only)", *size);
  29.       printf("\n\nEnter choice (0 = no change) _\b");
  30.  
  31.  
  32.       get_integer(&response);
  33.  
  34.       if(response == 0){
  35.         not_finished = 0;
  36.       }
  37.  
  38.  
  39.       if(response == 1){
  40.         printf("\n\nEnter type of edge detector");
  41.         printf("\n\t      (recall 1=Prewitt     2=Kirsch");
  42.         printf("\n\t              3=Sobel       4=quick");
  43.         printf("\n\t              5=homogeneity 6=difference");
  44.         printf("\n\t              7=contrast    8=gaussian");
  45.         printf("\n  _\b");
  46.         get_integer(detect_type);
  47.       }
  48.  
  49.       if(response == 2){
  50.         printf("\n\nEnter threshold output (0=off 1=on)");
  51.         printf("\n  _\b");
  52.         get_integer(threshold);
  53.       }
  54.  
  55.       if(response == 3){
  56.         printf("\n\nEnter high threshold");
  57.         printf("\n  _\b");
  58.  
  59.         get_integer(high);
  60.       }
  61.  
  62.       if(response == 4){
  63.         printf("\n\nEnter size for gaussian (7 or 9)");
  64.         printf("\n  _\b");
  65.         get_integer(size);
  66.       }
  67.     }  /* ends while not_finished */
  68.  
  69. }  /* ends get_edge_options */
  70. /* End of File */ 
  71.  
  72.