7
void UpdatePixRegion(int ilo, int ihi, int jlo, int jhi, int increment,
10
register int i, j, k, l, index;
11
register u_char *from, *to, *tempk, *tempkl, value, *pflag;
12
register double *pintegr, *pltime, corr;
14
for (i = ilo; i < ihi + 1; i++)
16
for (j = jlo; j < jhi + 1; j++)
18
to = pict + (i * pict_width * scale + j) * scale;
19
from = grid + (i * pict_width + j);
20
pflag = flag + (i * pict_width + j);
21
pintegr = integr + (i * pict_width + j);
22
pltime = ltime + (i * pict_width + j);
24
/* increment == 0 means animation is done and displaying integrals */
28
corr = *from > 1 ? *from - 1 : 0;
29
corr = corr * (time - *pltime);
33
fprintf(stderr, "error: time =%f ltime =%f height =%d \n",
41
*from = *from + increment;
43
index = GA_MIN(index,MAX_COL-1);
50
/* calculate max value of integrals */
56
else /* done with animation display integral */
58
index = (int) (((*pintegr) / maxval) * MAX_COL);
59
index = GA_MIN(index, MAX_COL - 1);
62
index = MAX_COL; /* sets the "accessed" color */
68
for (k = 0, tempk = to; k < scale; k++, tempk += pict_width * scale)
70
for (l = 0, tempkl = tempk; l < scale; l++, tempkl++)
81
void DisplayPixRegion(int ilo, int ihi, int jlo, int jhi)
83
int count, x, y, height, width;
87
height = (ihi - ilo + 1) * scale;
88
width = (jhi - jlo + 1) * scale;
90
XPutImage(display, window, gc, image, x, y, x, y, width, height);
94
for(count = 0; count < rows; count++)
96
XDrawLine(display, XtWindow(canvas_widget), gc, 0,
97
(overlay_row[count] - 1 - top_edge) * scale,
98
pict_width * scale - 1,
99
(overlay_row[count] - 1 - top_edge) * scale);
101
for(count = 0; count < cols; count++)
103
XDrawLine(display, XtWindow(canvas_widget), gc,
104
(overlay_col[count] - 1 - left_edge) * scale, 0,
105
(overlay_col[count] - 1 - left_edge) * scale,
106
pict_height * scale - 1);
110
for(count = 0; count < rows; count++)
112
XDrawLine(display, XtWindow(canvas_widget), gc, 0,
113
(overlay_row[count] - top_edge + .5) * scale,
114
pict_width * scale - 1,
115
(overlay_row[count] - top_edge + .5) * scale);
117
for(count = 0; count < cols; count++)
119
XDrawLine(display, XtWindow(canvas_widget), gc,
120
(overlay_col[count] - left_edge + .5) * scale, 0,
121
(overlay_col[count] - left_edge + .5) * scale,
122
pict_height * scale - 1);