Changeset 16228 for trunk/Ohana/src/kapa2/src/CreateZoom32.c
- Timestamp:
- Jan 24, 2008, 5:45:18 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/kapa2/src/CreateZoom32.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa2/src/CreateZoom32.c
r16061 r16228 8 8 int dropback; /* this is a bit of a kludge... */ 9 9 int dx, dy, DX, DY; 10 double expand, zoomscale, Rx, Ry;10 double expand, zoomscale, Ix, Iy; 11 11 int expand_in, expand_out; 12 12 unsigned int *out_pix, *out_pix2; … … 40 40 DY = image[0].image[0].matrix.Naxis[1]; 41 41 42 /* Rx,Ry are the screen coordinates of the first image pixel */ 43 Rx = x - expand*(int)(0.5*(dx + 1)) + 1; 44 Ry = y - expand*(int)(0.5*(dy + 1)) + 1; 42 /* Ix,Iy are the image coordinates of the first image pixel */ 43 // x,y is the image coordinate of the zoombox center 44 Ix = x - expand*(int)(0.5*(dx + 1)) + 1; 45 Iy = y - expand*(int)(0.5*(dy + 1)) + 1; 45 46 46 i_start = MIN (MAX (- Rx / expand, (1 - FRAC(Rx)) / expand), dx - expand_out + 1);47 j_start = MIN (MAX (- Ry / expand, (1 - FRAC(Ry)) / expand), dy - expand_out + 1);48 i_end = MAX (MIN ((DX- Rx) / expand, dx - expand_out + 1), 0);49 j_end = MAX (MIN ((DY- Ry) / expand, dy - expand_out + 1), 0);47 i_start = MIN (MAX (-Ix / expand, (1 - FRAC(Ix)) / expand), dx - expand_out + 1); 48 j_start = MIN (MAX (-Iy / expand, (1 - FRAC(Iy)) / expand), dy - expand_out + 1); 49 i_end = MAX (MIN ((DX-Ix) / expand, dx - expand_out + 1), 0); 50 j_end = MAX (MIN ((DY-Iy) / expand, dy - expand_out + 1), 0); 50 51 51 52 dropback = expand_out - (i_end - i_start) % expand_out; … … 53 54 54 55 out_pix = (unsigned int *) image[0].zoom.data; 55 in_pix = &image[0].pixmap[DX*(int)MAX( Ry,0) + (int)MAX(Rx,0)];56 in_pix = &image[0].pixmap[DX*(int)MAX(Iy,0) + (int)MAX(Ix,0)]; 56 57 57 58 /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
Note:
See TracChangeset
for help on using the changeset viewer.
