home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
vis-ftp.cs.umass.edu
/
vis-ftp.cs.umass.edu.tar
/
vis-ftp.cs.umass.edu
/
pub
/
CMU
/
cmu_files
/
cal
/
test.h
< prev
Wrap
Text File
|
1990-12-11
|
854b
|
35 lines
#define LEFT 0
#define RIGHT 1
#define NUMDISTORTIONPOLYS 4
#define UNDISTORT(eye) ((eye == LEFT) ? 0 : 1)
#define DISTORT(eye) ((eye == LEFT) ? 2 : 3)
/* ideal to XY */
#define IXY(x1,y1,x2,y2,eye) \
coordsel(DISTORT(eye)); \
coordmap1((double)x1, (double)y1, &x2, &y2);
/* XY to ideal */
#define XYI(x1,y1,x2,y2,eye) \
coordsel(UNDISTORT(eye)); \
coordmap1((double)x1, (double)y1, &x2, &y2);
/* ideal to row-column */
#define IRC(x,y,r,c,eye) {\
double xt, yt; \
coordsel (DISTORT(eye)); \
coordmap1((double)x, (double)y, &xt, &yt); \
r = (0.5 - yt) * (maxrow+1) + 0.5; \
c = (0.5 + xt) * (maxcol+1) + 0.5; \
}
/* row-column to ideal */
#define RCI(r,c,x,y,eye) {\
double xt, yt; \
xt = (c)/(double)(maxcol+1) - 0.5; \
yt = 0.5 - (r)/(double)(maxrow+1); \
coordsel (UNDISTORT(eye)); \
coordmap1(xt, yt, &x, &y); \
}