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/digiphot/apphot/polyphot/apyshift.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/digiphot/apphot/polyphot/apyshift.x')
-rw-r--r-- | noao/digiphot/apphot/polyphot/apyshift.x | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/polyphot/apyshift.x b/noao/digiphot/apphot/polyphot/apyshift.x new file mode 100644 index 00000000..4fd56cbe --- /dev/null +++ b/noao/digiphot/apphot/polyphot/apyshift.x @@ -0,0 +1,41 @@ +include "../lib/apphot.h" +include "../lib/polyphot.h" + +# AP_YSHIFT -- Shift a polygon to a new center position. + +procedure ap_yshift (py, im, x, y, nver, newx, newy) + +pointer py # pointer to the polyphot structure +pointer im # the input image descriptor +real x[ARB] # x coordinates of the vertices +real y[ARB] # y coordinates of the vertices +int nver # number of vertices +real newx, newy # new x and y coordinates of center + +real xshift, yshift +real apstatr() +int apstati() + +begin + call apsetr (py, PYX, apstatr (py, PYCX)) + call apsetr (py, PYY, apstatr (py, PYCY)) + + xshift = newx - apstatr (py, PYCX) + yshift = newy - apstatr (py, PYCY) + call aaddkr (x, xshift, x, nver) + call aaddkr (y, yshift, y, nver) + call apsetr (py, PYCX, newx) + call apsetr (py, PYCY, newy) + + switch (apstati(py,WCSOUT)) { + case WCS_WORLD, WCS_PHYSICAL: + call ap_ltoo (py, newx, newy, xshift, yshift, 1) + case WCS_TV: + call ap_ltov (im, newx, newy, xshift, yshift, 1) + default: + xshift = newx + yshift = newy + } + call apsetr (py, OPYCX, xshift) + call apsetr (py, OPYCY, yshift) +end |