ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/warp3d.h
Revision: 3.2
Committed: Wed Feb 5 15:59:10 1997 UTC (27 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 3.1: +3 -4 lines
Log Message:
important bug fixes and improvements

File Contents

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