Changeset 38062 for trunk/Ohana/src/opihi/cmd.data/tv.c
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
-
trunk/Ohana
- Property svn:mergeinfo deleted
-
trunk/Ohana/src/opihi/cmd.data/tv.c
r37807 r38062 28 28 } 29 29 30 int plane = 0; 31 if ((N = get_argument (argc, argv, "-plane"))) { 32 remove_argument (N, &argc, argv); 33 plane = atoi (argv[N]); 34 remove_argument (N, &argc, argv); 35 } 36 if (plane < 0) { 37 gprint (GP_ERR, " ERROR: -plane (plane) : cannot be negative\n"); 38 return (FALSE); 39 } 40 30 41 /* shell exits on pipe close, FIX */ 31 42 if ((N = get_argument (argc, argv, "-kill"))) { … … 55 66 GetCoords (&coords, &buf[0].header); 56 67 57 image.data1d = (float *) buf[0].matrix.buffer;58 68 image.Nx = buf[0].matrix.Naxis[0]; 59 69 image.Ny = buf[0].matrix.Naxis[1]; 70 71 int tooBig = buf[0].matrix.Naxis[2] ? (plane >= buf[0].matrix.Naxis[2]) : plane > 0; 72 if (tooBig) { 73 gprint (GP_ERR, " ERROR: -plane (plane) : out of bounds (%d vs %d)\n", plane, buf[0].matrix.Naxis[2]); 74 return (FALSE); 75 } 76 int Npix2D = image.Nx * image.Ny; 77 78 float *imdata = (float *) buf[0].matrix.buffer; 79 image.data1d = &imdata[plane*Npix2D]; 60 80 61 81 // send only the root of the file, not the full path
Note:
See TracChangeset
for help on using the changeset viewer.
