--- ray/src/px/warp3d.h 1997/02/04 16:03:49 3.1 +++ ray/src/px/warp3d.h 2004/03/28 20:33:14 3.5 @@ -1,13 +1,16 @@ -/* Copyright (c) 1997 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid: $Id: warp3d.h,v 3.5 2004/03/28 20:33:14 schorsch Exp $ */ /* * Header file for 3D warping routines. */ +#ifndef _RAD_WARP3D_H_ +#define _RAD_WARP3D_H_ #include "lookup.h" +#ifdef __cplusplus +extern "C" { +#endif + /* interpolation flags */ #define W3EXACT 01 /* no interpolation (slow) */ #define W3FAST 02 /* discontinuous approx. (fast) */ @@ -26,21 +29,31 @@ typedef unsigned char GNDX[3]; /* grid index type */ typedef float W3VEC[3]; /* vector type for 3D warp maps */ struct grid3d { - W3VEC gmin, gmax; /* grid boundaries */ - GNDX gn; /* grid dimensions */ - W3VEC gstep; /* grid voxel size */ unsigned char flags; /* interpolation flags */ + GNDX gn; /* grid dimensions */ + W3VEC gmin, gstep; /* grid corner and voxel size */ LUTAB gtab; /* grid lookup table */ }; /* a regular, sparse warping grid */ typedef struct { - W3VEC *ip, *op; /* discrete input/output pairs */ + W3VEC *ip, *ov; /* discrete input/displ. pairs */ int npts; /* number of point pairs */ W3VEC llim, ulim; /* lower and upper input limits */ double d2min, d2max; /* min. and max. point distance^2 */ struct grid3d grid; /* point conversion grid */ } WARP3D; /* a warp map */ -extern WARP3D *new3dw(), *load3dw(); +extern int warp3d(W3VEC po, W3VEC pi, WARP3D *wp); +extern int add3dpt(WARP3D* wp, W3VEC pti, W3VEC pto); +extern WARP3D* new3dw(int flgs); +extern WARP3D* load3dw(char *fn, WARP3D *wp); +extern void free3dw(WARP3D *wp); +extern int set3dwfl(WARP3D *wp, int flgs); #define W3VCPY(v1,v2) ((v1)[0]=(v2)[0],(v1)[1]=(v2)[1],(v1)[2]=(v2)[2]) + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_WARP3D_H_ */ +