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

Comparing ray/src/util/cmatrix.h (file contents):
Revision 2.1 by greg, Mon Jan 20 21:29:04 2014 UTC vs.
Revision 2.7 by greg, Mon May 4 20:53:21 2015 UTC

# Line 15 | Line 15 | extern "C" {
15   #endif
16  
17   /* Data types for file loading */
18 < enum {DTfromHeader, DTascii, DTfloat, DTdouble, DTrgbe, DTxyze};
18 > enum {DTfromHeader=0, DTascii, DTrgbe, DTxyze, DTfloat, DTdouble, DTend};
19  
20 + extern const char       *cm_fmt_id[];
21 + extern const int        cm_elem_size[];
22 +
23   /* A color coefficient matrix -- vectors have ncols==1 */
24   typedef struct {
25          int     nrows, ncols;
# Line 30 | Line 33 | typedef struct {
33   #define cv_lval(cm,i)   ((cm)->cmem + 3*(i))
34  
35   /* Allocate a color coefficient matrix */
36 < extern CMATRIX *cm_alloc(int nrows, int ncols);
36 > extern CMATRIX  *cm_alloc(int nrows, int ncols);
37  
38   /* Resize color coefficient matrix */
39 < extern CMATRIX *cm_resize(CMATRIX *cm, int nrows);
39 > extern CMATRIX  *cm_resize(CMATRIX *cm, int nrows);
40  
41   #define cm_free(cm)     free(cm)
42  
43 < /* Load header to obtain data type */
44 < int getDTfromHeader(FILE *fp);
43 > /* Load header to obtain/check data type and matrix dimensions */
44 > extern char     *cm_getheader(int *dt, int *nr, int *nc, FILE *fp);
45  
46 < /* Allocate and load a matrix from the given file (or stdin if NULL) */
47 < extern CMATRIX *cm_load(const char *fname, int nrows, int ncols, int dtype);
46 > /* Allocate and load a matrix from the given input (or stdin if NULL) */
47 > extern CMATRIX  *cm_load(const char *inspec, int nrows, int ncols, int dtype);
48  
49   /* Extract a column vector from a matrix */
50 < extern CMATRIX *cm_column(const CMATRIX *cm, int c);
50 > extern CMATRIX  *cm_column(const CMATRIX *cm, int c);
51  
52   /* Scale a matrix by a single value */
53 < extern CMATRIX *cm_scale(const CMATRIX *cm1, const COLOR sca);
53 > extern CMATRIX  *cm_scale(const CMATRIX *cm1, const COLOR sca);
54  
55   /* Multiply two matrices (or a matrix and a vector) and allocate the result */
56 < extern CMATRIX *cm_multiply(const CMATRIX *cm1, const CMATRIX *cm2);
56 > extern CMATRIX  *cm_multiply(const CMATRIX *cm1, const CMATRIX *cm2);
57  
58 < /* print out matrix as ASCII text -- no header */
59 < extern void cm_print(const CMATRIX *cm, FILE *fp);
58 > /* write out matrix to file (precede by resolution string if picture) */
59 > extern int      cm_write(const CMATRIX *cm, int dtype, FILE *fp);
60  
61 < /* Load and convert a matrix BSDF from the given XML file */
62 < extern CMATRIX *cm_loadBSDF(char *fname, COLOR cLamb);
61 > /* Load and convert a matrix BTDF from the given XML file */
62 > extern CMATRIX  *cm_loadBTDF(char *fname);
63  
64   #ifdef __cplusplus
65   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines