| 1 | schorsch | 3.4 | /* RCSid: $Id: warp3d.h,v 3.3 2003/02/22 02:07:28 greg Exp $ */ | 
| 2 | greg | 3.1 | /* | 
| 3 |  |  | * Header file for 3D warping routines. | 
| 4 |  |  | */ | 
| 5 | schorsch | 3.4 | #ifndef _RAD_WARP3D_H_ | 
| 6 |  |  | #define _RAD_WARP3D_H_ | 
| 7 | greg | 3.1 |  | 
| 8 |  |  | #include "lookup.h" | 
| 9 |  |  |  | 
| 10 | schorsch | 3.4 | #ifdef __cplusplus | 
| 11 |  |  | extern "C" { | 
| 12 |  |  | #endif | 
| 13 |  |  |  | 
| 14 | greg | 3.1 | /* interpolation flags */ | 
| 15 |  |  | #define W3EXACT         01              /* no interpolation (slow) */ | 
| 16 |  |  | #define W3FAST          02              /* discontinuous approx. (fast) */ | 
| 17 |  |  |  | 
| 18 |  |  | /* return flags for warp3d() */ | 
| 19 |  |  | #define W3OK            0               /* normal return status */ | 
| 20 |  |  | #define W3GAMUT         01              /* out of gamut */ | 
| 21 |  |  | #define W3BADMAP        02              /* singular map */ | 
| 22 |  |  | #define W3ERROR         04              /* system error (check errno) */ | 
| 23 |  |  |  | 
| 24 |  |  | #define GNBITS  6               /* number of bits per grid size <= 8 */ | 
| 25 |  |  | #define MAXGN   (1<<GNBITS)     /* maximum grid dimension */ | 
| 26 |  |  |  | 
| 27 |  |  | typedef unsigned char   GNDX[3];        /* grid index type */ | 
| 28 |  |  |  | 
| 29 |  |  | typedef float   W3VEC[3];       /* vector type for 3D warp maps */ | 
| 30 |  |  |  | 
| 31 |  |  | struct grid3d { | 
| 32 | greg | 3.2 | unsigned char   flags;          /* interpolation flags */ | 
| 33 | greg | 3.1 | GNDX    gn;                     /* grid dimensions */ | 
| 34 | greg | 3.2 | W3VEC   gmin, gstep;            /* grid corner and voxel size */ | 
| 35 | greg | 3.1 | LUTAB   gtab;                   /* grid lookup table */ | 
| 36 |  |  | };                              /* a regular, sparse warping grid */ | 
| 37 |  |  |  | 
| 38 |  |  | typedef struct { | 
| 39 | greg | 3.2 | W3VEC   *ip, *ov;               /* discrete input/displ. pairs */ | 
| 40 | greg | 3.1 | int     npts;                   /* number of point pairs */ | 
| 41 |  |  | W3VEC   llim, ulim;             /* lower and upper input limits */ | 
| 42 |  |  | double  d2min, d2max;           /* min. and max. point distance^2 */ | 
| 43 |  |  | struct grid3d   grid;           /* point conversion grid */ | 
| 44 |  |  | } WARP3D;                       /* a warp map */ | 
| 45 |  |  |  | 
| 46 |  |  | extern WARP3D   *new3dw(), *load3dw(); | 
| 47 |  |  |  | 
| 48 |  |  | #define  W3VCPY(v1,v2)  ((v1)[0]=(v2)[0],(v1)[1]=(v2)[1],(v1)[2]=(v2)[2]) | 
| 49 | schorsch | 3.4 |  | 
| 50 |  |  | #ifdef __cplusplus | 
| 51 |  |  | } | 
| 52 |  |  | #endif | 
| 53 |  |  | #endif /* _RAD_WARP3D_H_ */ | 
| 54 |  |  |  |