27 int da, db, dc, dd, de, df, dg, dh;
31 if (lp.
gp==NULL)
return lp;
39 for (j=1; j<vp.
ys-1; j++) {
40 for (i=1; i<vp.
xs-1; i++) {
41 da =
Px(vp, i+1, j) +
Px(vp, i-1, j);
43 dc =
Px(vp, i, j+1) +
Px(vp, i, j-1);
44 Px(lp, i, j) = da - 4*db + dc;
50 for (j=1; j<vp.
ys-1; j++) {
51 for (i=1; i<vp.
xs-1; i++) {
52 da =
Px(vp, i+1, j) +
Px(vp, i-1, j);
53 db =
Px(vp, i, j+1) +
Px(vp, i, j-1);
55 dd =
Px(vp, i+1, j+1) +
Px(vp, i-1, j+1);
56 de =
Px(vp, i+1, j-1) +
Px(vp, i-1, j-1);
57 Px(lp, i, j) = da + db - 8*dc + dd + de;
63 for (j=2; j<vp.
ys-2; j++) {
64 for (i=2; i<vp.
xs-2; i++) {
66 db =
Px(vp, i+1, j) +
Px(vp, i-1, j) +
Px(vp, i, j+1) +
Px(vp, i, j-1);
67 dc =
Px(vp, i-1, j-2) +
Px(vp, i, j-2) +
Px(vp, i+1, j-2);
68 dd =
Px(vp, i-1, j+2) +
Px(vp, i, j+2) +
Px(vp, i+1, j+2);
69 de =
Px(vp, i-2, j-1) +
Px(vp, i-2, j) +
Px(vp, i-2, j+1);
70 df =
Px(vp, i+2, j-1) +
Px(vp, i+2, j) +
Px(vp, i+2, j+1);
71 dg =
Px(vp, i-2, j-2) +
Px(vp, i+2, j-2);
72 dh =
Px(vp, i-2, j+2) +
Px(vp, i+2, j+2);
73 Px(lp, i, j) = (
sWord)((-24*da-8*db+4*(dc+dd+de+df)+2*(dg+dh))/64);
93 int da, db, dc, dd, de, nr;
96 memset(&xp, 0,
sizeof(
WSGraph));
103 if (vp.
zs<=0) vp.
zs = 1;
105 if (xp.
gp==NULL)
return xp;
107 for (k=0; k<vp.
zs; k++) {
108 for (j=1; j<vp.
ys-1; j++) {
109 for (i=1; i<vp.
xs-1; i++) {
110 da =
Vx(vp, i+1, j-1, k) -
Vx(vp, i-1, j-1, k);
111 db =
Vx(vp, i+1, j, k) -
Vx(vp, i-1, j, k);
112 dc =
Vx(vp, i+1, j+1, k) -
Vx(vp, i-1, j+1, k);
113 if (k==0 || k==vp.
zs-1) {
118 dd =
Vx(vp, i+1, j, k-1) -
Vx(vp, i-1, j, k-1);
119 de =
Vx(vp, i+1, j, k+1) -
Vx(vp, i-1, j, k+1);
122 Vx(xp, i, j, k) = (
sWord)((da + 2*db + dc + dd + de)/nr);
143 double da, db, dc, dd, de, nr;
146 memset(&xp, 0,
sizeof(
FSGraph));
152 if (vp.
zs<=0) vp.
zs = 1;
154 if (xp.
gp==NULL)
return xp;
156 for (k=0; k<vp.
zs; k++) {
157 for (j=1; j<vp.
ys-1; j++) {
158 for (i=1; i<vp.
xs-1; i++) {
159 da =
Vx(vp, i+1, j-1, k) -
Vx(vp, i-1, j-1, k);
160 db =
Vx(vp, i+1, j, k) -
Vx(vp, i-1, j, k);
161 dc =
Vx(vp, i+1, j+1, k) -
Vx(vp, i-1, j+1, k);
162 if (k==0 || k==vp.
zs-1) {
167 dd =
Vx(vp, i+1, j, k-1) -
Vx(vp, i-1, j, k-1);
168 de =
Vx(vp, i+1, j, k+1) -
Vx(vp, i-1, j, k+1);
171 Vx(xp, i, j, k) = (da + 2.*db + dc + dd + de)/nr;
191 int da, db, dc, dd, de, nr;
194 memset(&xp, 0,
sizeof(
WSGraph));
200 if (vp.
zs<=0) vp.
zs = 1;
202 if (xp.
gp==NULL)
return xp;
204 for (k=0; k<vp.
zs; k++) {
205 for (j=1; j<vp.
ys-1; j++) {
206 for (i=1; i<vp.
xs-1; i++) {
207 da =
Vx(vp, i-1, j+1, k) -
Vx(vp, i-1, j-1, k);
208 db =
Vx(vp, i, j+1, k) -
Vx(vp, i, j-1, k);
209 dc =
Vx(vp, i+1, j+1, k) -
Vx(vp, i+1, j-1, k);
210 if (k==0 || k==vp.
zs-1) {
215 dd =
Vx(vp, i, j+1, k-1) -
Vx(vp, i, j-1, k-1);
216 de =
Vx(vp, i, j+1, k+1) -
Vx(vp, i, j-1, k+1);
219 Vx(xp, i, j, k) = (
sWord)((da + 2*db + dc + dd + de)/nr);
240 double da, db, dc, dd, de, nr;
243 memset(&xp, 0,
sizeof(
FSGraph));
249 if (vp.
zs<=0) vp.
zs = 1;
251 if (xp.
gp==NULL)
return xp;
253 for (k=0; k<vp.
zs; k++) {
254 for (j=1; j<vp.
ys-1; j++) {
255 for (i=1; i<vp.
xs-1; i++) {
256 da =
Vx(vp, i-1, j+1, k) -
Vx(vp, i-1, j-1, k);
257 db =
Vx(vp, i, j+1, k) -
Vx(vp, i, j-1, k);
258 dc =
Vx(vp, i+1, j+1, k) -
Vx(vp, i+1, j-1, k);
259 if (k==0 || k==vp.
zs-1) {
264 dd =
Vx(vp, i, j+1, k-1) -
Vx(vp, i, j-1, k-1);
265 de =
Vx(vp, i, j+1, k+1) -
Vx(vp, i, j-1, k+1);
268 Vx(xp, i, j, k) = (da + 2.*db + dc + dd + de)/nr;
288 int da, db, dc, dd, de;
291 memset(&xp, 0,
sizeof(
WSGraph));
304 if (xp.
gp==NULL)
return xp;
306 for (k=1; k<vp.
zs-1; k++) {
307 for (j=1; j<vp.
ys-1; j++) {
308 for (i=1; i<vp.
xs-1; i++) {
309 da =
Vx(vp, i-1, j, k+1) -
Vx(vp, i-1, j, k-1);
310 db =
Vx(vp, i+1, j, k+1) -
Vx(vp, i+1, j, k-1);
311 dc =
Vx(vp, i, j, k+1) -
Vx(vp, i, j, k-1);
312 dd =
Vx(vp, i, j-1, k+1) -
Vx(vp, i, j-1, k-1);
313 de =
Vx(vp, i, j+1, k+1) -
Vx(vp, i, j+1, k-1);
314 Vx(xp, i, j, k) = (
sWord)((da + db + 2*dc + dd + de)/12);
319 for (j=1; j<vp.
ys-1; j++) {
320 for (i=1; i<vp.
xs-1; i++) {
321 da =
Vx(vp, i-1, j, 1) -
Vx(vp, i-1, j, 0);
322 db =
Vx(vp, i+1, j, 1) -
Vx(vp, i+1, j, 0);
323 dc =
Vx(vp, i, j, 1) -
Vx(vp, i, j, 0);
324 dd =
Vx(vp, i, j-1, 1) -
Vx(vp, i, j-1, 0);
325 de =
Vx(vp, i, j+1, 1) -
Vx(vp, i, j+1, 0);
326 Vx(xp, i, j, 0) = (
sWord)((da + db + 2*dc + dd + de)/12);
328 da =
Vx(vp, i-1, j, vp.
zs-1) -
Vx(vp, i-1, j, vp.
zs-2);
329 db =
Vx(vp, i+1, j, vp.
zs-1) -
Vx(vp, i+1, j, vp.
zs-2);
330 dc =
Vx(vp, i, j, vp.
zs-1) -
Vx(vp, i, j, vp.
zs-2);
331 dd =
Vx(vp, i, j-1, vp.
zs-1) -
Vx(vp, i, j-1, vp.
zs-2);
332 de =
Vx(vp, i, j+1, vp.
zs-1) -
Vx(vp, i, j+1, vp.
zs-2);
333 Vx(xp, i, j, vp.
zs-1) = (
sWord)((da + db + 2*dc + dd + de)/12);
353 double da, db, dc, dd, de;
356 memset(&xp, 0,
sizeof(
FSGraph));
369 if (xp.
gp==NULL)
return xp;
371 for (k=1; k<vp.
zs-1; k++) {
372 for (j=1; j<vp.
ys-1; j++) {
373 for (i=1; i<vp.
xs-1; i++) {
374 da =
Vx(vp, i-1, j, k+1) -
Vx(vp, i-1, j, k-1);
375 db =
Vx(vp, i+1, j, k+1) -
Vx(vp, i+1, j, k-1);
376 dc =
Vx(vp, i, j, k+1) -
Vx(vp, i, j, k-1);
377 dd =
Vx(vp, i, j-1, k+1) -
Vx(vp, i, j-1, k-1);
378 de =
Vx(vp, i, j+1, k+1) -
Vx(vp, i, j+1, k-1);
379 Vx(xp, i, j, k) = (da + db + 2.*dc + dd + de)/12.;
384 for (j=1; j<vp.
ys-1; j++) {
385 for (i=1; i<vp.
xs-1; i++) {
386 da =
Vx(vp, i-1, j, 1) -
Vx(vp, i-1, j, 0);
387 db =
Vx(vp, i+1, j, 1) -
Vx(vp, i+1, j, 0);
388 dc =
Vx(vp, i, j, 1) -
Vx(vp, i, j, 0);
389 dd =
Vx(vp, i, j-1, 1) -
Vx(vp, i, j-1, 0);
390 de =
Vx(vp, i, j+1, 1) -
Vx(vp, i, j+1, 0);
391 Vx(xp, i, j, 0) = (da + db + 2.*dc + dd + de)/12.;
393 da =
Vx(vp, i-1, j, vp.
zs-1) -
Vx(vp, i-1, j, vp.
zs-2);
394 db =
Vx(vp, i+1, j, vp.
zs-1) -
Vx(vp, i+1, j, vp.
zs-2);
395 dc =
Vx(vp, i, j, vp.
zs-1) -
Vx(vp, i, j, vp.
zs-2);
396 dd =
Vx(vp, i, j-1, vp.
zs-1) -
Vx(vp, i, j-1, vp.
zs-2);
397 de =
Vx(vp, i, j+1, vp.
zs-1) -
Vx(vp, i, j+1, vp.
zs-2);
398 Vx(xp, i, j, vp.
zs-1) = (da + db + 2.*dc + dd + de)/12.;
416 int x, y, z, xs, ys, zs, cx, cy, cz, ps;
417 int da, db, dc, dd, de;
418 int df, dg, dh, di, dj, dk, dl, dm;
421 memset(&px, 0,
sizeof(
WSGraph));
434 if (px.
gp==NULL)
return px;
436 for (y=2; y<ys-2; y++) {
438 for (x=2; x<xs-2; x++) {
440 da = vp.
gp[cx-2*xs+2] - 2*vp.
gp[cx-2*xs] + vp.
gp[cx-2*xs-2];
441 db = vp.
gp[cx -xs+2] - 2*vp.
gp[cx -xs] + vp.
gp[cx -xs-2];
442 dc = vp.
gp[cx +2] - 2*vp.
gp[cx] + vp.
gp[cx -2];
443 dd = vp.
gp[cx +xs+2] - 2*vp.
gp[cx +xs] + vp.
gp[cx +xs-2];
444 de = vp.
gp[cx+2*xs+2] - 2*vp.
gp[cx+2*xs] + vp.
gp[cx+2*xs-2];
445 px.
gp[cx] = (
sWord)((da + 4*db + 6*dc + 4*dd + de)/64);
452 if (px.
gp==NULL)
return px;
454 for (z=2; z<zs-2; z++) {
456 for (y=2; y<ys-2; y++) {
458 for (x=2; x<xs-2; x++) {
460 da = vp.
gp[cx +2] - 2*vp.
gp[cx] + vp.
gp[cx-2];
461 db = vp.
gp[cx+xs+2] - 2*vp.
gp[cx+xs] + vp.
gp[cx+xs-2];
462 dc = vp.
gp[cx-xs+2] - 2*vp.
gp[cx-xs] + vp.
gp[cx-xs-2];
463 dd = vp.
gp[cx+ps+2] - 2*vp.
gp[cx+ps] + vp.
gp[cx+ps-2];
464 de = vp.
gp[cx-ps+2] - 2*vp.
gp[cx-ps] + vp.
gp[cx-ps-2];
465 df = vp.
gp[cx+xs+ps+2] - 2*vp.
gp[cx+xs+ps] + vp.
gp[cx+xs+ps-2];
466 dg = vp.
gp[cx+xs-ps+2] - 2*vp.
gp[cx+xs-ps] + vp.
gp[cx+xs-ps-2];
467 dh = vp.
gp[cx-xs+ps+2] - 2*vp.
gp[cx-xs+ps] + vp.
gp[cx-xs+ps-2];
468 di = vp.
gp[cx-xs-ps+2] - 2*vp.
gp[cx-xs-ps] + vp.
gp[cx-xs-ps-2];
469 dj = vp.
gp[cx+2*xs+2] - 2*vp.
gp[cx+2*xs] + vp.
gp[cx+2*xs-2];
470 dk = vp.
gp[cx-2*xs+2] - 2*vp.
gp[cx-2*xs] + vp.
gp[cx-2*xs-2];
471 dl = vp.
gp[cx+2*ps+2] - 2*vp.
gp[cx+2*ps] + vp.
gp[cx+2*ps-2];
472 dm = vp.
gp[cx-2*ps+2] - 2*vp.
gp[cx-2*ps] + vp.
gp[cx-2*ps-2];
473 px.
gp[cx] = (
sWord)((8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144);
494 int x, y, z, xs, ys, zs, cx, cy, cz, ps;
495 double da, db, dc, dd, de;
496 double df, dg, dh, di, dj, dk, dl, dm;
499 memset(&px, 0,
sizeof(
FSGraph));
512 if (px.
gp==NULL)
return px;
514 for (y=2; y<ys-2; y++) {
516 for (x=2; x<xs-2; x++) {
518 da = vp.
gp[cx-2*xs+2] - 2*vp.
gp[cx-2*xs] + vp.
gp[cx-2*xs-2];
519 db = vp.
gp[cx -xs+2] - 2*vp.
gp[cx -xs] + vp.
gp[cx -xs-2];
520 dc = vp.
gp[cx +2] - 2*vp.
gp[cx] + vp.
gp[cx -2];
521 dd = vp.
gp[cx +xs+2] - 2*vp.
gp[cx +xs] + vp.
gp[cx +xs-2];
522 de = vp.
gp[cx+2*xs+2] - 2*vp.
gp[cx+2*xs] + vp.
gp[cx+2*xs-2];
523 px.
gp[cx] = (da + 4*db + 6*dc + 4*dd + de)/64.;
530 if (px.
gp==NULL)
return px;
532 for (z=2; z<zs-2; z++) {
534 for (y=2; y<ys-2; y++) {
536 for (x=2; x<xs-2; x++) {
538 da = vp.
gp[cx +2] - 2*vp.
gp[cx] + vp.
gp[cx-2];
539 db = vp.
gp[cx+xs+2] - 2*vp.
gp[cx+xs] + vp.
gp[cx+xs-2];
540 dc = vp.
gp[cx-xs+2] - 2*vp.
gp[cx-xs] + vp.
gp[cx-xs-2];
541 dd = vp.
gp[cx+ps+2] - 2*vp.
gp[cx+ps] + vp.
gp[cx+ps-2];
542 de = vp.
gp[cx-ps+2] - 2*vp.
gp[cx-ps] + vp.
gp[cx-ps-2];
543 df = vp.
gp[cx+xs+ps+2] - 2*vp.
gp[cx+xs+ps] + vp.
gp[cx+xs+ps-2];
544 dg = vp.
gp[cx+xs-ps+2] - 2*vp.
gp[cx+xs-ps] + vp.
gp[cx+xs-ps-2];
545 dh = vp.
gp[cx-xs+ps+2] - 2*vp.
gp[cx-xs+ps] + vp.
gp[cx-xs+ps-2];
546 di = vp.
gp[cx-xs-ps+2] - 2*vp.
gp[cx-xs-ps] + vp.
gp[cx-xs-ps-2];
547 dj = vp.
gp[cx+2*xs+2] - 2*vp.
gp[cx+2*xs] + vp.
gp[cx+2*xs-2];
548 dk = vp.
gp[cx-2*xs+2] - 2*vp.
gp[cx-2*xs] + vp.
gp[cx-2*xs-2];
549 dl = vp.
gp[cx+2*ps+2] - 2*vp.
gp[cx+2*ps] + vp.
gp[cx+2*ps-2];
550 dm = vp.
gp[cx-2*ps+2] - 2*vp.
gp[cx-2*ps] + vp.
gp[cx-2*ps-2];
551 px.
gp[cx] = (8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144.;
571 int x, y, z, xs, ys, zs, cx, cy, cz, ps;
572 int da, db, dc, dd, de;
573 int df, dg, dh, di, dj, dk, dl, dm;
576 memset(&py, 0,
sizeof(
WSGraph));
589 if (py.
gp==NULL)
return py;
591 for (y=2; y<ys-2; y++) {
593 for (x=2; x<xs-2; x++) {
595 da = vp.
gp[cx+2*xs-2] - 2*vp.
gp[cx-2] + vp.
gp[cx-2*xs-2];
596 db = vp.
gp[cx+2*xs-1] - 2*vp.
gp[cx-1] + vp.
gp[cx-2*xs-1];
597 dc = vp.
gp[cx+2*xs] - 2*vp.
gp[cx] + vp.
gp[cx-2*xs];
598 dd = vp.
gp[cx+2*xs+1] - 2*vp.
gp[cx+1] + vp.
gp[cx-2*xs+1];
599 de = vp.
gp[cx+2*xs+2] - 2*vp.
gp[cx+2] + vp.
gp[cx-2*xs+2];
600 py.
gp[cx] = (
sWord)((da + 4*db + 6*dc + 4*dd + de)/64);
606 if (py.
gp==NULL)
return py;
608 for (z=2; z<zs-2; z++) {
610 for (y=2; y<ys-2; y++) {
612 for (x=2; x<xs-2; x++) {
614 da = vp.
gp[cx+2*xs] - 2*vp.
gp[cx] + vp.
gp[cx-2*xs];
615 db = vp.
gp[cx+1+2*xs] - 2*vp.
gp[cx+1] + vp.
gp[cx+1-2*xs];
616 dc = vp.
gp[cx-1+2*xs] - 2*vp.
gp[cx-1] + vp.
gp[cx-1-2*xs];
617 dd = vp.
gp[cx+ps+2*xs] - 2*vp.
gp[cx+ps] + vp.
gp[cx+ps-2*xs];
618 de = vp.
gp[cx-ps+2*xs] - 2*vp.
gp[cx-ps] + vp.
gp[cx-ps-2*xs];
619 df = vp.
gp[cx+1+ps+2*xs] - 2*vp.
gp[cx+1+ps] + vp.
gp[cx+1+ps-2*xs];
620 dg = vp.
gp[cx+1-ps+2*xs] - 2*vp.
gp[cx+1-ps] + vp.
gp[cx+1-ps-2*xs];
621 dh = vp.
gp[cx-1+ps+2*xs] - 2*vp.
gp[cx-1+ps] + vp.
gp[cx-1+ps-2*xs];
622 di = vp.
gp[cx-1-ps+2*xs] - 2*vp.
gp[cx-1-ps] + vp.
gp[cx-1-ps-2*xs];
623 dj = vp.
gp[cx+2+2*xs] - 2*vp.
gp[cx+2] + vp.
gp[cx+2-2*xs];
624 dk = vp.
gp[cx-2+2*xs] - 2*vp.
gp[cx-2] + vp.
gp[cx-2-2*xs];
625 dl = vp.
gp[cx+2*ps+2*xs] - 2*vp.
gp[cx+2*ps] + vp.
gp[cx+2*ps-2*xs];
626 dm = vp.
gp[cx-2*ps+2*xs] - 2*vp.
gp[cx-2*ps] + vp.
gp[cx-2*ps-2*xs];
627 py.
gp[cx] = (
sWord)((8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144);
648 int x, y, z, xs, ys, zs, cx, cy, cz, ps;
649 double da, db, dc, dd, de;
650 double df, dg, dh, di, dj, dk, dl, dm;
653 memset(&py, 0,
sizeof(
FSGraph));
666 if (py.
gp==NULL)
return py;
668 for (y=2; y<ys-2; y++) {
670 for (x=2; x<xs-2; x++) {
672 da = vp.
gp[cx+2*xs-2] - 2*vp.
gp[cx-2] + vp.
gp[cx-2*xs-2];
673 db = vp.
gp[cx+2*xs-1] - 2*vp.
gp[cx-1] + vp.
gp[cx-2*xs-1];
674 dc = vp.
gp[cx+2*xs] - 2*vp.
gp[cx] + vp.
gp[cx-2*xs];
675 dd = vp.
gp[cx+2*xs+1] - 2*vp.
gp[cx+1] + vp.
gp[cx-2*xs+1];
676 de = vp.
gp[cx+2*xs+2] - 2*vp.
gp[cx+2] + vp.
gp[cx-2*xs+2];
677 py.
gp[cx] = (da + 4*db + 6*dc + 4*dd + de)/64.;
683 if (py.
gp==NULL)
return py;
685 for (z=2; z<zs-2; z++) {
687 for (y=2; y<ys-2; y++) {
689 for (x=2; x<xs-2; x++) {
691 da = vp.
gp[cx+2*xs] - 2*vp.
gp[cx] + vp.
gp[cx-2*xs];
692 db = vp.
gp[cx+1+2*xs] - 2*vp.
gp[cx+1] + vp.
gp[cx+1-2*xs];
693 dc = vp.
gp[cx-1+2*xs] - 2*vp.
gp[cx-1] + vp.
gp[cx-1-2*xs];
694 dd = vp.
gp[cx+ps+2*xs] - 2*vp.
gp[cx+ps] + vp.
gp[cx+ps-2*xs];
695 de = vp.
gp[cx-ps+2*xs] - 2*vp.
gp[cx-ps] + vp.
gp[cx-ps-2*xs];
696 df = vp.
gp[cx+1+ps+2*xs] - 2*vp.
gp[cx+1+ps] + vp.
gp[cx+1+ps-2*xs];
697 dg = vp.
gp[cx+1-ps+2*xs] - 2*vp.
gp[cx+1-ps] + vp.
gp[cx+1-ps-2*xs];
698 dh = vp.
gp[cx-1+ps+2*xs] - 2*vp.
gp[cx-1+ps] + vp.
gp[cx-1+ps-2*xs];
699 di = vp.
gp[cx-1-ps+2*xs] - 2*vp.
gp[cx-1-ps] + vp.
gp[cx-1-ps-2*xs];
700 dj = vp.
gp[cx+2+2*xs] - 2*vp.
gp[cx+2] + vp.
gp[cx+2-2*xs];
701 dk = vp.
gp[cx-2+2*xs] - 2*vp.
gp[cx-2] + vp.
gp[cx-2-2*xs];
702 dl = vp.
gp[cx+2*ps+2*xs] - 2*vp.
gp[cx+2*ps] + vp.
gp[cx+2*ps-2*xs];
703 dm = vp.
gp[cx-2*ps+2*xs] - 2*vp.
gp[cx-2*ps] + vp.
gp[cx-2*ps-2*xs];
704 py.
gp[cx] = (8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144.;
724 int x, y, z, xs, ys, zs, cx, cy, cz, ps;
725 int da, db, dc, dd, de;
726 int df, dg, dh, di, dj, dk, dl, dm;
729 memset(&pz, 0,
sizeof(
WSGraph));
746 if (pz.
gp==NULL)
return pz;
748 for (z=2; z<zs-2; z++) {
750 for (y=2; y<ys-2; y++) {
752 for (x=2; x<xs-2; x++) {
754 da = vp.
gp[cx +2*ps] - 2*vp.
gp[cx] + vp.
gp[cx -2*ps];
755 db = vp.
gp[cx+1 +2*ps] - 2*vp.
gp[cx+1] + vp.
gp[cx+1 -2*ps];
756 dc = vp.
gp[cx-1 +2*ps] - 2*vp.
gp[cx-1] + vp.
gp[cx-1 -2*ps];
757 dd = vp.
gp[cx+xs+2*ps] - 2*vp.
gp[cx+xs] + vp.
gp[cx+xs-2*ps];
758 de = vp.
gp[cx-xs+2*ps] - 2*vp.
gp[cx-xs] + vp.
gp[cx-xs-2*ps];
759 df = vp.
gp[cx+1+xs+2*ps] - 2*vp.
gp[cx+1+xs] + vp.
gp[cx+1+xs-2*ps];
760 dg = vp.
gp[cx+1-xs+2*ps] - 2*vp.
gp[cx+1-xs] + vp.
gp[cx+1-xs-2*ps];
761 dh = vp.
gp[cx-1+xs+2*ps] - 2*vp.
gp[cx-1+xs] + vp.
gp[cx-1+xs-2*ps];
762 di = vp.
gp[cx-1-xs+2*ps] - 2*vp.
gp[cx-1-xs] + vp.
gp[cx-1-xs-2*ps];
763 dj = vp.
gp[cx+2 +2*ps] - 2*vp.
gp[cx+2] + vp.
gp[cx+2 -2*ps];
764 dk = vp.
gp[cx-2 +2*ps] - 2*vp.
gp[cx-2] + vp.
gp[cx-2 -2*ps];
765 dl = vp.
gp[cx+2*xs+2*ps] - 2*vp.
gp[cx+2*xs] + vp.
gp[cx+2*xs-2*ps];
766 dm = vp.
gp[cx-2*xs+2*ps] - 2*vp.
gp[cx-2*xs] + vp.
gp[cx-2*xs-2*ps];
767 pz.
gp[cx] = (
sWord)((8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144);
773 for (y=2; y<ys-2; y++) {
775 for (x=2; x<xs-2; x++) {
777 da = vp.
gp[cx +2*ps] - 2*vp.
gp[cx];
778 db = vp.
gp[cx+1 +2*ps] - 2*vp.
gp[cx+1];
779 dc = vp.
gp[cx-1 +2*ps] - 2*vp.
gp[cx-1];
780 dd = vp.
gp[cx+xs+2*ps] - 2*vp.
gp[cx+xs];
781 de = vp.
gp[cx-xs+2*ps] - 2*vp.
gp[cx-xs];
782 df = vp.
gp[cx+1+xs+2*ps] - 2*vp.
gp[cx+1+xs];
783 dg = vp.
gp[cx+1-xs+2*ps] - 2*vp.
gp[cx+1-xs];
784 dh = vp.
gp[cx-1+xs+2*ps] - 2*vp.
gp[cx-1+xs];
785 di = vp.
gp[cx-1-xs+2*ps] - 2*vp.
gp[cx-1-xs];
786 dj = vp.
gp[cx+2 +2*ps] - 2*vp.
gp[cx+2];
787 dk = vp.
gp[cx-2 +2*ps] - 2*vp.
gp[cx-2];
788 dl = vp.
gp[cx+2*xs+2*ps] - 2*vp.
gp[cx+2*xs];
789 dm = vp.
gp[cx-2*xs+2*ps] - 2*vp.
gp[cx-2*xs];
790 pz.
gp[cx] = (
sWord)((8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144);
795 for (y=2; y<ys-2; y++) {
797 for (x=2; x<xs-2; x++) {
799 da = - 2*vp.
gp[cx] + vp.
gp[cx -2*ps];
800 db = - 2*vp.
gp[cx+1] + vp.
gp[cx+1 -2*ps];
801 dc = - 2*vp.
gp[cx-1] + vp.
gp[cx-1 -2*ps];
802 dd = - 2*vp.
gp[cx+xs] + vp.
gp[cx+xs-2*ps];
803 de = - 2*vp.
gp[cx-xs] + vp.
gp[cx-xs-2*ps];
804 df = - 2*vp.
gp[cx+1+xs] + vp.
gp[cx+1+xs-2*ps];
805 dg = - 2*vp.
gp[cx+1-xs] + vp.
gp[cx+1-xs-2*ps];
806 dh = - 2*vp.
gp[cx-1+xs] + vp.
gp[cx-1+xs-2*ps];
807 di = - 2*vp.
gp[cx-1-xs] + vp.
gp[cx-1-xs-2*ps];
808 dj = - 2*vp.
gp[cx+2] + vp.
gp[cx+2 -2*ps];
809 dk = - 2*vp.
gp[cx-2] + vp.
gp[cx-2 -2*ps];
810 dl = - 2*vp.
gp[cx+2*xs] + vp.
gp[cx+2*xs-2*ps];
811 dm = - 2*vp.
gp[cx-2*xs] + vp.
gp[cx-2*xs-2*ps];
812 pz.
gp[cx] = (
sWord)((8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144);
831 int x, y, z, xs, ys, zs, cx, cy, cz, ps;
832 double da, db, dc, dd, de;
833 double df, dg, dh, di, dj, dk, dl, dm;
836 memset(&pz, 0,
sizeof(
FSGraph));
853 if (pz.
gp==NULL)
return pz;
855 for (z=2; z<zs-2; z++) {
857 for (y=2; y<ys-2; y++) {
859 for (x=2; x<xs-2; x++) {
861 da = vp.
gp[cx +2*ps] - 2*vp.
gp[cx] + vp.
gp[cx -2*ps];
862 db = vp.
gp[cx+1 +2*ps] - 2*vp.
gp[cx+1] + vp.
gp[cx+1 -2*ps];
863 dc = vp.
gp[cx-1 +2*ps] - 2*vp.
gp[cx-1] + vp.
gp[cx-1 -2*ps];
864 dd = vp.
gp[cx +xs+2*ps] - 2*vp.
gp[cx +xs] + vp.
gp[cx +xs-2*ps];
865 de = vp.
gp[cx -xs+2*ps] - 2*vp.
gp[cx -xs] + vp.
gp[cx -xs-2*ps];
866 df = vp.
gp[cx+1+xs+2*ps] - 2*vp.
gp[cx+1+xs] + vp.
gp[cx+1+xs-2*ps];
867 dg = vp.
gp[cx+1-xs+2*ps] - 2*vp.
gp[cx+1-xs] + vp.
gp[cx+1-xs-2*ps];
868 dh = vp.
gp[cx-1+xs+2*ps] - 2*vp.
gp[cx-1+xs] + vp.
gp[cx-1+xs-2*ps];
869 di = vp.
gp[cx-1-xs+2*ps] - 2*vp.
gp[cx-1-xs] + vp.
gp[cx-1-xs-2*ps];
870 dj = vp.
gp[cx+2 +2*ps] - 2*vp.
gp[cx+2] + vp.
gp[cx+2 -2*ps];
871 dk = vp.
gp[cx-2 +2*ps] - 2*vp.
gp[cx-2] + vp.
gp[cx-2 -2*ps];
872 dl = vp.
gp[cx+2*xs+2*ps] - 2*vp.
gp[cx+2*xs] + vp.
gp[cx+2*xs-2*ps];
873 dm = vp.
gp[cx-2*xs+2*ps] - 2*vp.
gp[cx-2*xs] + vp.
gp[cx-2*xs-2*ps];
874 pz.
gp[cx] = (8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144.;
880 for (y=2; y<ys-2; y++) {
882 for (x=2; x<xs-2; x++) {
884 da = vp.
gp[cx +2*ps] - 2*vp.
gp[cx];
885 db = vp.
gp[cx+1 +2*ps] - 2*vp.
gp[cx+1];
886 dc = vp.
gp[cx-1 +2*ps] - 2*vp.
gp[cx-1];
887 dd = vp.
gp[cx+xs+2*ps] - 2*vp.
gp[cx+xs];
888 de = vp.
gp[cx-xs+2*ps] - 2*vp.
gp[cx-xs];
889 df = vp.
gp[cx+1+xs+2*ps] - 2*vp.
gp[cx+1+xs];
890 dg = vp.
gp[cx+1-xs+2*ps] - 2*vp.
gp[cx+1-xs];
891 dh = vp.
gp[cx-1+xs+2*ps] - 2*vp.
gp[cx-1+xs];
892 di = vp.
gp[cx-1-xs+2*ps] - 2*vp.
gp[cx-1-xs];
893 dj = vp.
gp[cx+2 +2*ps] - 2*vp.
gp[cx+2];
894 dk = vp.
gp[cx-2 +2*ps] - 2*vp.
gp[cx-2];
895 dl = vp.
gp[cx+2*xs+2*ps] - 2*vp.
gp[cx+2*xs];
896 dm = vp.
gp[cx-2*xs+2*ps] - 2*vp.
gp[cx-2*xs];
897 pz.
gp[cx] = (8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144.;
902 for (y=2; y<ys-2; y++) {
904 for (x=2; x<xs-2; x++) {
906 da = - 2*vp.
gp[cx] + vp.
gp[cx -2*ps];
907 db = - 2*vp.
gp[cx+1] + vp.
gp[cx+1 -2*ps];
908 dc = - 2*vp.
gp[cx-1] + vp.
gp[cx-1 -2*ps];
909 dd = - 2*vp.
gp[cx+xs] + vp.
gp[cx+xs-2*ps];
910 de = - 2*vp.
gp[cx-xs] + vp.
gp[cx-xs-2*ps];
911 df = - 2*vp.
gp[cx+1+xs] + vp.
gp[cx+1+xs-2*ps];
912 dg = - 2*vp.
gp[cx+1-xs] + vp.
gp[cx+1-xs-2*ps];
913 dh = - 2*vp.
gp[cx-1+xs] + vp.
gp[cx-1+xs-2*ps];
914 di = - 2*vp.
gp[cx-1-xs] + vp.
gp[cx-1-xs-2*ps];
915 dj = - 2*vp.
gp[cx+2] + vp.
gp[cx+2 -2*ps];
916 dk = - 2*vp.
gp[cx-2] + vp.
gp[cx-2 -2*ps];
917 dl = - 2*vp.
gp[cx+2*xs] + vp.
gp[cx+2*xs-2*ps];
918 dm = - 2*vp.
gp[cx-2*xs] + vp.
gp[cx-2*xs-2*ps];
919 pz.
gp[cx] = (8*da+4*(db+dc+dd+de)+2*(df+dg+dh+di)+dj+dk+dl+dm)/144.;
942 memset(&pn, 0,
sizeof(
VSGraph));
952 if (pn.
gp==NULL)
return pn;
969 for (i=0; i<xs*ys; i++) {
986 for (i=0; i<xs*ys*zs; i++) {
1019 memset(&pn, 0,
sizeof(
VSGraph));
1029 if (pn.
gp==NULL)
return pn;
1046 for (i=0; i<xs*ys; i++) {
1063 for (i=0; i<xs*ys*zs; i++) {
1094 memset(&pn, 0,
sizeof(
WSGraph));
1104 if (pn.
gp==NULL)
return pn;
1121 for (i=0; i<xs*ys; i++) {
1124 pn.
gp[i] = (
sWord)sqrt(xx*xx + yy*yy);
1137 for (i=0; i<xs*ys*zs; i++) {
1141 pn.
gp[i] = (
sWord)sqrt(xx*xx + yy*yy + zz*zz);
1168 memset(&pn, 0,
sizeof(
FSGraph));
1178 if (pn.
gp==NULL)
return pn;
1195 for (i=0; i<xs*ys; i++) {
1198 pn.
gp[i] = sqrt(xx*xx + yy*yy);
1211 for (i=0; i<xs*ys*zs; i++) {
1215 pn.
gp[i] = sqrt(xx*xx + yy*yy + zz*zz);
1238 double alph, beta, gamm, K, H;
1239 double fx, fy, fz, fxy, fyz, fzx, fxx, fyy, fzz, nb;
1240 FSGraph px, py, pz, pxy, pyz, pzx, pxx, pyy, pzz, nab;
1243 memset(&pp, 0,
sizeof(
VSGraph));
1256 if (pp.
gp==NULL)
return pp;
1269 if (nab.
gp==NULL || px.
gp==NULL || py.
gp==NULL || pz.
gp==NULL ||
1270 pxy.
gp==NULL || pyz.
gp==NULL || pzx.
gp==NULL ||
1271 pxx.
gp==NULL || pyy.
gp==NULL || pzz.
gp==NULL) {
1287 for (i=0; i<vp.
xs*vp.
ys*vp.
zs; i++) {
1299 if (nb*(fx*fx+fy*fy) !=0) {
1300 alph = (2*fx*fy*fxy - fx*fx*fyy - fy*fy*fxx)/(fx*fx+fy*fy);
1301 beta = (2*fz*(fx*fx+fy*fy)*(fx*fzx+fy*fyz) - 2*fx*fy*fz*fz*fxy
1302 - fx*fx*fz*fz*fxx - fy*fy*fz*fz*fyy
1303 - (fx*fx+fy*fy)*(fx*fx+fy*fy)*fzz)/(nb*nb*(fx*fx+fy*fy));
1304 gamm = ((fx*fx+fy*fy)*(fy*fzx-fx*fyz) + (fx*fx-fy*fy)*fz*fxy
1305 - fx*fy*fz*(fxx-fyy))/(nb*(fx*fx+fy*fy));
1307 K = alph*beta - gamm*gamm;
1308 H = (alph + beta)/2;
1340 double Ix, Ixx, Iy, Iyy, Ixy;
1341 FSGraph px, py, pxy, pxx, pyy;
1344 memset(&pp, 0,
sizeof(
VSGraph));
1357 if (pp.
gp==NULL)
return pp;
1365 if (px.
gp==NULL||py.
gp==NULL||pxy.
gp==NULL||pxx.
gp==NULL||pyy.
gp==NULL) {
1376 for (i=0; i<vp.
xs*vp.
ys; i++) {
1382 d = 1. + Ix*Ix + Iy*Iy;
1384 K = (Ixx*Iyy-Ixy*Ixy)/(d*d);
1385 H = (Ixx+Ixx*Iy*Iy+Iyy+Iyy*Ix*Ix-2*Ix*Ixy*Iy)/(2.*d*sqrt(d));
1417 memset(&vp, 0,
sizeof(
WSGraph));
1424 if (vp.
gp==NULL)
return vp;
1426 for (i=0; i<vp.
xs*vp.
ys*vp.
zs; i++) {
1429 if (K>0 && H<0) vp.
gp[i] =
PEAK;
1430 else if (K>0 && H>0) vp.
gp[i] =
PIT;
1434 else if (K<0 && H==0) vp.
gp[i] =
MINIMAL;
1435 else if (K==0 && H<0) vp.
gp[i] =
RIDGE;
1436 else if (K==0 && H>0) vp.
gp[i] =
VALLEY;
1437 else if (K==0 && H==0) vp.
gp[i] =
FLAT;
1469 memset(&vp, 0,
sizeof(
WSGraph));
1482 if (vp.
gp==NULL)
return vp;
1485 for (i=0; i<vp.
xs*vp.
ys*vp.
zs; i++) {
1486 if (vp.
gp[i]==
FLAT) vp.
gp[i] = 500;
1487 else if (vp.
gp[i]==
PIT) vp.
gp[i] = 1000;
1492 else if (vp.
gp[i]==
RIDGE) vp.
gp[i] = 3500;
1494 else if (vp.
gp[i]==
PEAK) vp.
gp[i] = 4500;
1499 for (i=0; i<vp.
xs*vp.
ys*vp.
zs; i++) {
1500 if ((vp.
gp[i]&mode)!=0) vp.
gp[i] = cc;
1526 memset(&vp, 0,
sizeof(
WSGraph));
1533 if (la.
gp==NULL)
return la;
1536 if (vp.
gp==NULL)
return vp;
1538 for (i=0; i<vp.
xs*vp.
ys; i++) vp.
gp[i] = gd.
gp[i] - la.
gp[i];
1560 int xx, yy, zz, ns, cp, dx, ps, sw;
1581 fm = (
double*)malloc(ps*
sizeof(
double));
1582 mask.
imask = (
int*)malloc(ps*
sizeof(
int));
1583 if (fm==NULL || mask.
imask==NULL) {
1584 if (fm!=NULL) free(fm);
1586 memset(&mask, 0,
sizeof(
FMask));
1589 memset(fm, 0, ps*
sizeof(
double));
1590 memset(mask.
imask, 0, ps*
sizeof(
int));
1592 for (zz=-ns*sw; zz<=ns*sw; zz++) {
1593 for (yy=-ns; yy<=ns; yy++) {
1594 for (xx=-ns; xx<=ns; xx++) {
1595 cp = (zz+ns)*ms*ms*sw + (yy+ns)*ms + (xx+ns);
1596 fm[cp] = exp(-(xx*xx+yy*yy+zz*zz)/(sig*sig));
1597 if (fm[cp]!=0.0) min =
Min(min, fm[cp]);
1603 for (xx=0; xx<ps; xx++) {
1604 mask.
imask[xx] = (int)(fm[xx]/min+0.5);
1605 dx += mask.
imask[xx];
1630 int xx, yy, zz, cp, cw, sw;
1631 int kc, xc, xs, ps, pm, mz, zc;
1636 memset(&vp, 0,
sizeof(
WSGraph));
1642 if (xp.
zs<=1 && mask.
mode>2) {
1659 mz =
Min(ms, xp.
zs);
1667 for (i=0; i<xp.
xs*xp.
ys; i++) min =
Min(min, xp.
gp[i]);
1669 if (vp.
gp==NULL)
return vp;
1671 for (i=0; i<vp.
xs*vp.
ys; i++) vp.
gp[i] = min;
1674 for (y=xc; y<xp.
ys-xc; y++)
1675 for (x=xc; x<xp.
xs-xc; x++) {
1676 cx = z*ps + y*xs + x;
1678 for (zz=-zc*sw; zz<=zc*sw; zz++)
1679 for (yy=-xc; yy<=xc; yy++)
1680 for (xx=-xc; xx<=xc; xx++) {
1681 cp = kc + xx + yy*ms + zz*ms*ms;
1682 cw = cx + xx + yy*xs + zz*ps;
1683 dd = dd + (double)xp.
gp[cw]*mask.
imask[cp];
1685 vp.
gp[y*xs + x] = (
sWord)(dd/nf);
1704 int xx, yy, zz, cw, ux, mz;
1705 int kc, xc, zc, xs, ps, cx;
1709 memset(&vp, 0,
sizeof(
WSGraph));
1715 mz =
Min(ms, xp.
zs);
1721 memset(me, 0, ms*ms*mz*
sizeof(
sWord));
1735 for(y=xc; y<xp.
ys-xc; y++) {
1736 for(x=xc; x<xp.
xs-xc; x++) {
1737 cx = z*ps + y*xs + x;
1739 for (zz=-zc; zz<=zc; zz++) {
1740 for (yy=-xc; yy<=xc; yy++) {
1741 for (xx=-xc; xx<=xc; xx++) {
1742 cw = cx + xx + yy*xs + zz*ps;
1743 me[i++] = xp.
gp[cw];
1748 for (i=0; i<ms*ms*mz-1; i++) {
1749 for (j=i+1; j<ms*ms*mz; j++) {
1757 vp.
gp[cx-z*ps] = me[kc];
1784 int cx, cy, cz, cw, xx, yy;
1787 memset(&vp, 0,
sizeof(
WSGraph));
1793 psize = gd.
xs*gd.
ys;
1797 if (vp.
gp==NULL)
return vp;
1799 for (k=0; k<gd.
zs; k++) {
1801 for (j=0; j<gd.
ys; j++) {
1803 for (i=0; i<gd.
xs; i++) {
1806 if (gd.
gp[cx]!=0) vp.
gp[cw] =
Max(vp.
gp[cw], gd.
gp[cx]);
1814 if (vp.
gp==NULL)
return vp;
1816 for (k=0; k<gd.
zs; k++) {
1818 for (j=0; j<gd.
ys; j++) {
1820 for (i=0; i<gd.
xs; i++) {
1823 if (gd.
gp[cx]!=0) vp.
gp[cw] =
Max(vp.
gp[cw], (gd.
zs-k)+100);
1831 if (vp.
gp==NULL)
return vp;
1833 for (k=0; k<gd.
zs; k++) {
1836 for (j=0; j<gd.
ys; j++) {
1839 for (i=0; i<gd.
xs; i++) {
1842 if (gd.
gp[cx]!=0) vp.
gp[cw] =
Max(vp.
gp[cw], gd.
gp[cx]);
1850 if (vp.
gp==NULL)
return vp;
1852 for (k=0; k<gd.
zs; k++) {
1855 for (j=0; j<gd.
ys; j++) {
1857 for (i=0; i<gd.
xs; i++) {
1861 if (gd.
gp[cx]!=0) vp.
gp[cw] =
Max(vp.
gp[cw], gd.
gp[cx]);
1868 memset(&vp, 0,
sizeof(
WSGraph));
1892 int rmax, rstart, rend;
1896 memset(&wp, 0,
sizeof(
WSGraph));
1903 if (wp.
gp==NULL)
return wp;
1912 for (i=0; i<vp.
xs*vp.
ys*vp.
zs; i++) {
1913 if (vp.
gp[i]>=bc) pp.
gp[i] = 1;
1917 for (k=1; k<=vp.
zs; k++) {
1918 for (j=1; j<=vp.
ys; j++) {
1920 for (i=1; i<=vp.
xs; i++) {
1921 if (
Vxt(pp, i, j, k)!=0) df = df + 1;
1923 Vxt(pp, i, j, k) = df*df;
1928 for (k=1; k<=vp.
zs; k++) {
1929 for (j=1; j<=vp.
ys; j++) {
1931 for (i=vp.
xs; i>=1; i--) {
1932 if (
Vxt(pp, i, j, k)!=0) db = db + 1;
1934 Vxt(pp, i, j, k) =
Min(
Vxt(pp, i, j, k), db*db);
1940 for (k=1; k<=vp.
zs; k++) {
1941 for (i=1; i<=vp.
xs; i++) {
1942 for (j=1; j<=vp.
ys; j++) {
1943 Lxt(buff, j) =
Vxt(pp, i, j, k);
1945 for (j=1; j<=vp.
ys; j++) {
1948 rmax = (int)sqrt((
double)d) + 1;
1949 rstart =
Min(rmax, j-1);
1950 rend =
Min(rmax, vp.
ys-j);
1951 for (l=-rstart; l<=rend; l++) {
1952 w =
Lxt(buff, j+l) + l*l;
1956 Vxt(pp, i, j, k) = d;
1964 for (j=1; j<=vp.
ys; j++) {
1965 for (i=1; i<=vp.
xs; i++) {
1966 for (k=1; k<=vp.
zs; k++) {
1967 Lxt(buff, k) =
Vxt(pp, i, j, k);
1969 for (k=1; k<=vp.
zs; k++) {
1972 rmax = (int)sqrt((
double)d) + 1;
1973 rstart =
Min(rmax, k-1);
1974 rend =
Min(rmax, vp.
zs-k);
1975 for (l=-rstart; l<=rend; l++) {
1976 w =
Lxt(buff, k+l) + l*l;
1981 Vxt(pp, i, j, k) = d;
1987 for (i=0; i<wp.
xs*wp.
ys*wp.
zs; i++) {
1989 if (pp.
gp[i]>32767) {
1990 fprintf(stderr,
"EUCLID_DISTANCE: WARNING: distance is too long = %d!\n",pp.
gp[i]);
2023 int i, j, sp, cp, w, ll, ss;
2024 int xx, yy, vx, vy, ix, eflg=
OFF;
2025 int r8[8]={-1, 1, -1, -1, 1, -1, 1, 1};
2026 int r4[8]={ 0, 1, -1, 0, 0, -1, 1, 0};
2040 if (vp.
gp[sp]==0 || sp==0) {
2059 w = abs(vx)+abs(vy);
2060 xx = (vx*cc[0]+vy*cc[1])/w;
2061 yy = (vx*cc[2]+vy*cc[3])/w;
2062 for (j=1; j<=ix; j++) {
2063 if (vp.
gp[cp+yy*vp.
xs+xx]!=0) {
2066 cp = cp + yy*vp.
xs + xx;
2076 if(sp==cp && xx==-1 && yy==0) {
2080 w = abs(xx)+abs(yy);
2081 vx = (xx*cc[4]+yy*cc[5])/w;
2082 vy = (xx*cc[6]+yy*cc[7])/w;
2088 if (abs(vx)+abs(vy)==2) ss++;
2092 if (mode==4) ss = 0;
WSGraph make_WSGraph(int xs, int ys, int zs)
FSGraph W2FSGraph(WSGraph vp)
VSGraph make_VSGraph(int xs, int ys, int zs)
FSGraph make_FSGraph(int xs, int ys, int zs)
ISGraph make_ISGraph(int xs, int ys, int zs)
#define Lxt(v, i)
座標を 1 から数える.
#define Px(v, i, j)
2次元画像データ vの (i, j) のデータを参照する.
#define Vx(v, i, j, k)
3次元画像データ vの (i, j, k) のデータを参照する.
WSGraph yySobel(WSGraph vp)
WSGraph curv2WSGraph(VSGraph xp)
FSGraph fzzSobel(FSGraph vp)
WSGraph ySobel(WSGraph vp)
VSGraph vNabra(WSGraph vp)
VSGraph curvature(FSGraph vp)
WSGraph xSobel(WSGraph vp)
FSGraph fySobel(FSGraph vp)
FSGraph fyySobel(FSGraph vp)
FSGraph fxxSobel(FSGraph vp)
FMask gauss_mask(double sig, int ms, int md)
WSGraph zSobel(WSGraph vp)
FSGraph fxSobel(FSGraph vp)
WSGraph euclid_distance(WSGraph vp, int *rr, int bc)
WSGraph median(WSGraph xp, int ms)
FSGraph fNabra(FSGraph vp)
WSGraph to2d(WSGraph gd, int mode)
int out_round(WSGraph vp, int x, int y, IRBound *rb, int mode)
WSGraph Nabra(WSGraph vp)
FSGraph fzSobel(FSGraph vp)
WSGraph xxSobel(WSGraph vp)
VSGraph curvature3D(FSGraph vp)
VSGraph vfNabra(FSGraph vp)
WSGraph zzSobel(WSGraph vp)
WSGraph Laplacian(WSGraph vp, int mode)
WSGraph imask(WSGraph xp, FMask mask)
WSGraph WSCurve(WSGraph gx, int mode, int cc)
WSGraph edge_enhance(WSGraph gd, int mode)
#define JBXL_GRAPH_IVDARG_ERROR
無効な引数
#define JBXL_GRAPH_IVDPARAM_ERROR
無効なパラメータ
#define JBXL_GRAPH_NODATA_ERROR
データが無い
#define JBXL_GRAPH_ERROR
GRAPH ライブラリーのエラー
#define JBXL_GRAPH_IVDMODE_ERROR
無効なモード
#define JBXL_GRAPH_MEMORY_ERROR
メモリエラー
vector unit_vector(vector a)
vector set_vector(double x, double y, double z)
int * imask
pointer to mask
int nfact
normalized facter
int zs
zサイズ. 4Byte. 2Dの場合は 1.
double * gp
グラフィックデータへのポインタ. xs*ys*zs*sizeof(double)
int * gp
グラフィックデータへのポインタ. xs*ys*zs*4Byte
int zs
zサイズ. 4Byte. 2Dの場合は 1.
vector * gp
グラフィックデータへのポインタ. xs*ys*zs*sizeof(vector).
int zs
zサイズ. 4Byte. 2Dの場合は 1.
sWord * gp
グラフィックデータへのポインタ. xs*ys*zs*2Byte.