diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/nproto/ir/iroverlap.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/nproto/ir/iroverlap.x')
-rw-r--r-- | noao/nproto/ir/iroverlap.x | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/noao/nproto/ir/iroverlap.x b/noao/nproto/ir/iroverlap.x new file mode 100644 index 00000000..822e6e99 --- /dev/null +++ b/noao/nproto/ir/iroverlap.x @@ -0,0 +1,40 @@ +# IR_OVERLAP -- Procedure to compute the overlap between two rectangles. + +int procedure ir_overlap (pc1out, pc2out, pl1out, pl2out, c1out, c2out, + l1out, l2out, oc1out, oc2out, ol1out, ol2out) + +int pc1out, pc2out # previous subraster column limits +int pl1out, pl2out # previous subraster line limits +int c1out, c2out # current subraster column limits +int l1out, l2out # current subraster line limits +int oc1out, oc2out # overlap column limits +int ol1out, ol2out # overlap line limits + +begin + # Check for the case where no intersection is present. + if (c1out > pc2out || c2out < pc1out || l1out > pl2out || + l2out < pl1out) + return (NO) + + # Compute the column overlap limits. + if (pc1out <= c1out) + oc1out = c1out + else + oc1out = pc1out + if (pc2out <= c2out) + oc2out = pc2out + else + oc2out = c2out + + # Compute the line overlap limits. + if (pl1out <= l1out) + ol1out = l1out + else + ol1out = pl1out + if (pl2out <= l2out) + ol2out = pl2out + else + ol2out = l2out + + return (YES) +end |