--- ray/src/util/cmatrix.h 2015/05/04 20:53:21 2.7 +++ ray/src/util/cmatrix.h 2019/08/12 18:28:37 2.9 @@ -1,4 +1,4 @@ -/* RCSid $Id: cmatrix.h,v 2.7 2015/05/04 20:53:21 greg Exp $ */ +/* RCSid $Id: cmatrix.h,v 2.9 2019/08/12 18:28:37 greg Exp $ */ /* * Color matrix routine declarations. * @@ -8,6 +8,7 @@ #ifndef _RAD_CMATRIX_H_ #define _RAD_CMATRIX_H_ +#include #include "color.h" #ifdef __cplusplus @@ -28,7 +29,7 @@ typedef struct { #define COLSPEC (sizeof(COLORV)==sizeof(float) ? "%f %f %f" : "%lf %lf %lf") -#define cm_lval(cm,r,c) ((cm)->cmem + 3*((r)*(cm)->ncols + (c))) +#define cm_lval(cm,r,c) ((cm)->cmem + 3*((size_t)(r)*(cm)->ncols + (c))) #define cv_lval(cm,i) ((cm)->cmem + 3*(i)) @@ -48,9 +49,6 @@ extern CMATRIX *cm_load(const char *inspec, int nrows, /* Extract a column vector from a matrix */ extern CMATRIX *cm_column(const CMATRIX *cm, int c); - -/* Scale a matrix by a single value */ -extern CMATRIX *cm_scale(const CMATRIX *cm1, const COLOR sca); /* Multiply two matrices (or a matrix and a vector) and allocate the result */ extern CMATRIX *cm_multiply(const CMATRIX *cm1, const CMATRIX *cm2);