Changeset 37781
- Timestamp:
- Jan 3, 2015, 7:29:49 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/kapa2/src
- Files:
-
- 3 edited
-
CursorOps.c (modified) (2 diffs)
-
InterpretKeys.c (modified) (1 diff)
-
LoadPicture.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/kapa2/src/CursorOps.c
r37780 r37781 100 100 // Sx, Sy are the screen coordinates of the Ix,Iy pixel 101 101 Image_to_Picture (&Sx, &Sy, Ix, Iy, picture); 102 103 // Sx,Sy should be forced into the pixel 104 int Sxi = Sx + 0.5; 105 int Syi = Sy + 0.5; 102 106 103 107 // i_start, j_start are now limited to valid screen coordinates 104 *i_start = MIN (MAX (Sx , 0), picture[0].dx);105 *j_start = MIN (MAX (Sy , 0), picture[0].dy);108 *i_start = MIN (MAX (Sxi, 0), picture[0].dx); 109 *j_start = MIN (MAX (Syi, 0), picture[0].dy); 106 110 } 107 111 … … 127 131 Iy = MIN (MAX (Iy, 0), matrix[0].Naxis[1]); 128 132 129 // I_end, J_end are the last displayed image pixel130 // *I_end = Ix;131 // *J_end = Iy;132 133 133 // Sx, Sy are the screen coordinates of the Ix,Iy pixel 134 134 Image_to_Picture (&Sx, &Sy, Ix, Iy, picture); 135 135 136 double IxTest, IyTest; 137 Picture_to_Image (&IxTest, &IyTest, Sx, Sy, picture); 138 fprintf (stderr, "dx,dy: %d,%d : %f,%f : %f,%f : %f:%f\n", picture[0].dx, picture[0].dy, Ix, Iy, Sx, Sy, IxTest, IyTest); 136 // Sx,Sy should be forced into the pixel 137 int Sxi = Sx + 0.5; 138 int Syi = Sy + 0.5; 139 140 // double IxTest, IyTest; 141 // Picture_to_Image (&IxTest, &IyTest, Sx, Sy, picture); 142 // fprintf (stderr, "dx,dy: %d,%d : %f,%f : %f,%f : %f:%f\n", picture[0].dx, picture[0].dy, Ix, Iy, Sx, Sy, IxTest, IyTest); 139 143 140 144 // i_start, j_start are now limited to valid screen coordinates 141 *i_end = MIN (MAX (Sx, 0), picture[0].dx); 142 *j_end = MIN (MAX (Sy, 0), picture[0].dy); 145 // XXX: i_end, j_end *should* be the last valid screen pixel plus 1 146 *i_end = MIN (MAX (Sxi, 0), picture[0].dx); 147 *j_end = MIN (MAX (Syi, 0), picture[0].dy); 143 148 144 149 // round off error can leave us with a small number of extra pixels here. -
branches/eam_branches/ipp-20140904/Ohana/src/kapa2/src/InterpretKeys.c
r37759 r37781 91 91 # define SET_CHANNEL_CASE(NCHAN) \ 92 92 case XK_F##NCHAN: \ 93 image[0].currentChannel = NCHAN-1; \ 93 94 image[0].image = &image[0].channel[NCHAN-1]; \ 94 95 SetColorScale (graphic, image); \ 95 Remap (graphic, image); \96 96 Reorient (graphic, image, image[0].picture.Xc, image[0].picture.Yc, 0); \ 97 Screen_to_Image (&X, &Y, (double)(event[0].x + 0.5), (double)(event[0].y + 0.5), &image[0].picture); \ 98 UpdateStatusBox (graphic, image, X, Y, 0.0, 1); \ 97 99 break; 100 101 // Remap (graphic, image); 98 102 99 103 // the number of entries here must match the value of NCHANNELS in contants.h -
branches/eam_branches/ipp-20140904/Ohana/src/kapa2/src/LoadPicture.c
r37759 r37781 59 59 // image[0].wide.expand = (wx > 1.0) ? ceil (-wx) : floor (1.0 / wx); 60 60 image[0].wide.expand = (wx > 1.0) ? floor (-wx) : ceil (1.0 / wx); 61 fprintf (stderr, "%d : %f\n", image[0].wide.expand, wx);61 // fprintf (stderr, "%d : %f\n", image[0].wide.expand, wx); 62 62 // image[0].wide.expand = (wx > 1.0) ? ceil (-wx) : floor (1.0 / wx); 63 63
Note:
See TracChangeset
for help on using the changeset viewer.
