ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rmatrix.h
(Generate patch)

Comparing ray/src/util/rmatrix.h (file contents):
Revision 2.8 by greg, Mon Aug 28 15:59:46 2017 UTC vs.
Revision 2.16 by greg, Tue Nov 21 01:30:20 2023 UTC

# Line 12 | Line 12
12   extern "C" {
13   #endif
14  
15 < /* General plane-ordered component matrix */
15 > /* Preferred BSDF component:
16 >        transmission, reflection front (normal side), reflection back */
17 > typedef enum {RMPtrans=0, RMPreflF, RMPreflB} RMPref;
18 >
19 > /* General [row][col][cmp] component matrix */
20   typedef struct {
17        int     nrows, ncols, ncomp;
18        int     dtype;
21          char    *info;
22 <        double  mtx[1];                 /* extends struct */
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;
30   } RMATRIX;
31  
32 < #define rmx_lval(rm,r,c,i)      (rm)->mtx[(i)+(rm)->ncomp*((c)+(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 */
# Line 32 | Line 47 | extern void    rmx_free(RMATRIX *rm);
47   extern int      rmx_newtype(int dtyp1, int dtyp2);
48  
49   /* Load matrix from supported file type (NULL for stdin, '!' with command) */
50 < extern RMATRIX  *rmx_load(const char *inspec);
50 > extern RMATRIX  *rmx_load(const char *inspec, RMPref rmp);
51  
52   /* Append header information associated with matrix data */
53   extern int      rmx_addinfo(RMATRIX *rm, const char *info);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines