--- ray/src/util/rmatrix.h 2019/09/03 23:43:07 2.11 +++ ray/src/util/rmatrix.h 2021/01/19 23:32:00 2.13 @@ -1,4 +1,4 @@ -/* RCSid $Id: rmatrix.h,v 2.11 2019/09/03 23:43:07 greg Exp $ */ +/* RCSid $Id: rmatrix.h,v 2.13 2021/01/19 23:32:00 greg Exp $ */ /* * Header file for general matrix routines. */ @@ -12,6 +12,10 @@ extern "C" { #endif +/* Preferred BSDF component: + transmission, reflection front (normal side), reflection back */ +typedef enum {RMPtrans=0, RMPreflF, RMPreflB} RMPref; + /* General plane-ordered component matrix */ typedef struct { int nrows, ncols; @@ -19,7 +23,7 @@ typedef struct { uby8 dtype; uby8 swapin; char *info; - double mtx[1]; /* extends struct */ + double mtx[3]; /* extends struct */ } RMATRIX; #define rmx_lval(rm,r,c,i) (rm)->mtx[(i)+(rm)->ncomp*((c)+(size_t)(rm)->ncols*(r))] @@ -34,7 +38,7 @@ extern void rmx_free(RMATRIX *rm); extern int rmx_newtype(int dtyp1, int dtyp2); /* Load matrix from supported file type (NULL for stdin, '!' with command) */ -extern RMATRIX *rmx_load(const char *inspec); +extern RMATRIX *rmx_load(const char *inspec, RMPref rmp); /* Append header information associated with matrix data */ extern int rmx_addinfo(RMATRIX *rm, const char *info);