| 16 |
|
transmission, reflection front (normal side), reflection back */ |
| 17 |
|
typedef enum {RMPtrans=0, RMPreflF, RMPreflB} RMPref; |
| 18 |
|
|
| 19 |
< |
/* General plane-ordered component matrix */ |
| 19 |
> |
/* General [row][col][cmp] component matrix */ |
| 20 |
|
typedef struct { |
| 21 |
+ |
char *info; |
| 22 |
+ |
void *mapped; |
| 23 |
+ |
double *mtx; |
| 24 |
+ |
COLOR cexp; |
| 25 |
+ |
float wlpart[4]; |
| 26 |
|
int nrows, ncols; |
| 27 |
|
short ncomp; |
| 28 |
|
uby8 dtype; |
| 29 |
|
uby8 swapin; |
| 25 |
– |
char *info; |
| 26 |
– |
double mtx[3]; /* extends struct */ |
| 30 |
|
} RMATRIX; |
| 31 |
|
|
| 32 |
< |
#define rmx_lval(rm,r,c,i) (rm)->mtx[(i)+(rm)->ncomp*((c)+(size_t)(rm)->ncols*(r))] |
| 32 |
> |
#define rmx_lval(rm,r,c) ((rm)->mtx + (rm)->ncomp*((c)+(size_t)(rm)->ncols*(r))) |
| 33 |
|
|
| 34 |
< |
/* Allocate a nr x nc matrix with n components */ |
| 34 |
> |
/* Initialize a RMATRIX struct but don't allocate array space */ |
| 35 |
> |
extern RMATRIX *rmx_new(int nr, int nc, int n); |
| 36 |
> |
|
| 37 |
> |
/* Prepare a RMATRIX for writing (allocate array if needed) */ |
| 38 |
> |
extern int rmx_prepare(RMATRIX *rm); |
| 39 |
> |
|
| 40 |
> |
/* Call rmx_new() and rmx_prepare() */ |
| 41 |
|
extern RMATRIX *rmx_alloc(int nr, int nc, int n); |
| 42 |
|
|
| 43 |
|
/* Free a RMATRIX array */ |