Annotation of researchv10no/cmd/view2d/wedge.c, revision 1.1.1.1

1.1       root        1: /* step wedge for displaying color map or grey scale */
                      2: #include <fio.h>
                      3: #include <stdio.h>
                      4: 
                      5: main(argc,argv)
                      6:   char **argv;
                      7: {
                      8:   short *w;
                      9:   int i, j, nx=255, ny=20, nc=255;
                     10:   
                     11:   for(argc--, argv++; *argv && (**argv == '-' ); argv++){
                     12:     switch(argv[0][1]){
                     13:      case 'c':
                     14:         nc = atoi(&argv[0][2]);
                     15:         break;
                     16:      case 'n':
                     17:         i = sscanf(&argv[0][2], "%d, %d", &nx, &ny);
                     18:         if(i == 1) { ny = nx/10; i = 2; }
                     19:        break;
                     20:     }
                     21:   }
                     22:   w = (short *)malloc(nx*ny*sizeof(short));
                     23:   Fprint(2,"nx %d\n",nx);
                     24:   Fprint(2,"ny %d\n",ny);
                     25:   Fprint(2,"nc %d\n",nc);
                     26: 
                     27:   for(i=0;i<nx;i++){
                     28:     for(j=0;j<ny;j++){
                     29:       w[i+j*nx] = i;
                     30:     }
                     31:   }
                     32:   view2d(1,nx,ny,0.,0,0,1,1,nc,w);
                     33:   exit(0);
                     34: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.