home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / lib / mathlib / libfft / fft2 / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.7 KB  |  95 lines

  1. /* *****************************************************************************
  2. *
  3. * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. *
  6. * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  7. * the contents of this file may not be disclosed to third parties, copied or
  8. * duplicated in any form, in whole or in part, without the prior written
  9. * permission of Silicon Graphics, Inc.
  10. *
  11. * RESTRICTED RIGHTS LEGEND:
  12. * Use, duplication or disclosure by the Government is subject to restrictions
  13. * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  14. * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  15. * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  16. * rights reserved under the Copyright Laws of the United States.
  17. *
  18. ***************************************************************************** */
  19. #include "fast.h"
  20. #include "event.h"
  21. #include "device.h"
  22.  
  23. extern void do_quit(), do_rightmouse(), do_resize(), display(), ShowFast();
  24. extern void dir_fft(), inv_fft(), add_noise();
  25. extern void add_box(), this_quit(), this_pow(), this_log();
  26. extern void size256_256(), size288_300(), size512_512();
  27. extern void faster(), propagate(), reverse();
  28. extern void do_fourier(), do_power(), do_filter(), do_filpow();
  29.  
  30. int main_menu, quit_menu, size_menu, forward_menu, backward_menu;
  31.  
  32. extern int max_proc;
  33.  
  34. Init(name)
  35. char *name;
  36. {
  37.     prefsize(WIN_SIZE+WIN_RIGHT, WIN_SIZE);
  38.     {
  39.         char *t, *strrchr();
  40.         winopen((t=strrchr(name, '/')) != NULL ? t+1 : name);
  41.     }
  42.  
  43.     wintitle("2D FFT");
  44.  
  45.     add_event(ANY, REDRAW, ANY, display, NULL);
  46.     qdevice(REDRAW);
  47.     
  48.     add_event(ANY, ESCKEY, UP, do_quit, NULL);
  49.     qdevice(ESCKEY);
  50.  
  51.     add_event(ANY, F1KEY, UP, do_fourier, NULL);
  52.     qdevice(F1KEY);
  53.  
  54.     add_event(ANY, F2KEY, UP, do_power, NULL);
  55.     qdevice(F2KEY);
  56.  
  57.     add_event(ANY, F3KEY, UP, do_filter, NULL);
  58.     qdevice(F3KEY);
  59.  
  60.     add_event(ANY, F4KEY, UP, do_filpow, NULL);
  61.     qdevice(F4KEY);
  62.  
  63.     add_event(ANY, WINQUIT, ANY, do_quit, NULL);
  64.     qdevice(WINQUIT);
  65.     
  66.     add_event(ANY, RIGHTMOUSE, DOWN, do_rightmouse, NULL);
  67.     qdevice(RIGHTMOUSE);
  68.  
  69.     doublebuffer();
  70.     RGBmode();
  71.     gconfig();
  72.  
  73.     cpack(oBLACK);
  74.     clear();
  75.     swapbuffers();
  76.  
  77.     CreateMenus();
  78.  
  79.     do_resize();
  80. }
  81.  
  82.     char str[64];
  83. CreateMenus() {
  84.     size_menu = defpup(" Size %t| 256 x 256 %f| 288 x 300 %f| 512 x 512 %f",
  85.             size256_256, size288_300, size512_512);
  86.     forward_menu = defpup(
  87. "WAVEs %t|Reset %f|Size %m|------|Propagate %f|------|Faster %f|Reverse %f|------|Quit %f",
  88.         do_resize, size_menu, propagate, faster, reverse, this_quit);
  89.  
  90.     main_menu = forward_menu;
  91.  
  92.     quit_menu = defpup("Quit %t|Really %f|Cancel %f",
  93.             do_quit, ShowFast);
  94. }
  95.