home *** CD-ROM | disk | FTP | other *** search
- /* *****************************************************************************
- *
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- *
- ***************************************************************************** */
- #include "fast.h"
- #include "event.h"
- #include "device.h"
-
- extern void do_quit(), do_rightmouse(), do_resize(), display(), ShowFast();
- extern void dir_fft(), inv_fft(), add_noise();
- extern void add_box(), this_quit(), this_pow(), this_log();
- extern void size256_256(), size288_300(), size512_512();
- extern void faster(), propagate(), reverse();
- extern void do_fourier(), do_power(), do_filter(), do_filpow();
-
- int main_menu, quit_menu, size_menu, forward_menu, backward_menu;
-
- extern int max_proc;
-
- Init(name)
- char *name;
- {
- prefsize(WIN_SIZE+WIN_RIGHT, WIN_SIZE);
- {
- char *t, *strrchr();
- winopen((t=strrchr(name, '/')) != NULL ? t+1 : name);
- }
-
- wintitle("2D FFT");
-
- add_event(ANY, REDRAW, ANY, display, NULL);
- qdevice(REDRAW);
-
- add_event(ANY, ESCKEY, UP, do_quit, NULL);
- qdevice(ESCKEY);
-
- add_event(ANY, F1KEY, UP, do_fourier, NULL);
- qdevice(F1KEY);
-
- add_event(ANY, F2KEY, UP, do_power, NULL);
- qdevice(F2KEY);
-
- add_event(ANY, F3KEY, UP, do_filter, NULL);
- qdevice(F3KEY);
-
- add_event(ANY, F4KEY, UP, do_filpow, NULL);
- qdevice(F4KEY);
-
- add_event(ANY, WINQUIT, ANY, do_quit, NULL);
- qdevice(WINQUIT);
-
- add_event(ANY, RIGHTMOUSE, DOWN, do_rightmouse, NULL);
- qdevice(RIGHTMOUSE);
-
- doublebuffer();
- RGBmode();
- gconfig();
-
- cpack(oBLACK);
- clear();
- swapbuffers();
-
- CreateMenus();
-
- do_resize();
- }
-
- char str[64];
- CreateMenus() {
- size_menu = defpup(" Size %t| 256 x 256 %f| 288 x 300 %f| 512 x 512 %f",
- size256_256, size288_300, size512_512);
- forward_menu = defpup(
- "WAVEs %t|Reset %f|Size %m|------|Propagate %f|------|Faster %f|Reverse %f|------|Quit %f",
- do_resize, size_menu, propagate, faster, reverse, this_quit);
-
- main_menu = forward_menu;
-
- quit_menu = defpup("Quit %t|Really %f|Cancel %f",
- do_quit, ShowFast);
- }
-