--- ray/src/common/color.h 1991/03/19 12:06:33 1.10 +++ ray/src/common/color.h 1991/10/24 10:29:03 1.13 @@ -48,7 +48,8 @@ typedef float COLOR[3]; /* red, green, blue */ #define normbright(c) (int)((67L*(c)[RED]+168L*(c)[GRN]+21L*(c)[BLU])/256) #endif -#define luminance(col) (470. * bright(col)) +#define D65EFFICACY 203. /* luminous efficacy of D65 */ +#define luminance(col) (D65EFFICACY * bright(col)) #define intens(col) ( (col)[0] > (col)[1] \ ? (col)[0] > (col)[2] ? (col)[0] : (col)[2] \ @@ -68,25 +69,28 @@ typedef float COLOR[3]; /* red, green, blue */ #define YDECR 2 #define YMAJOR 4 + /* picture format identifier */ +#define COLRFMT "32-bit_rle_rgbe" + /* macros for exposures */ #define EXPOSSTR "EXPOSURE=" -#define EXPOSSTRL 9 -#define isexpos(hl) (!strncmp(hl,EXPOSSTR,EXPOSSTRL)) -#define exposval(hl) atof((hl)+EXPOSSTRL) +#define LEXPOSSTR 9 +#define isexpos(hl) (!strncmp(hl,EXPOSSTR,LEXPOSSTR)) +#define exposval(hl) atof((hl)+LEXPOSSTR) #define fputexpos(ex,fp) fprintf(fp,"%s%e\n",EXPOSSTR,ex) /* macros for pixel aspect ratios */ #define ASPECTSTR "PIXASPECT=" -#define ASPECTSTRL 10 -#define isaspect(hl) (!strncmp(hl,ASPECTSTR,ASPECTSTRL)) -#define aspectval(hl) atof((hl)+ASPECTSTRL) +#define LASPECTSTR 10 +#define isaspect(hl) (!strncmp(hl,ASPECTSTR,LASPECTSTR)) +#define aspectval(hl) atof((hl)+LASPECTSTR) #define fputaspect(pa,fp) fprintf(fp,"%s%f\n",ASPECTSTR,pa) /* macros for color correction */ #define COLCORSTR "COLORCORR=" -#define COLCORSTRL 10 -#define iscolcor(hl) (!strncmp(hl,COLCORSTR,COLCORSTRL)) -#define colcorval(cc,hl) sscanf(hl+COLCORSTRL,"%f %f %f", \ +#define LCOLCORSTR 10 +#define iscolcor(hl) (!strncmp(hl,COLCORSTR,LCOLCORSTR)) +#define colcorval(cc,hl) sscanf(hl+LCOLCORSTR,"%f %f %f", \ &(cc)[RED],&(cc)[GRN],&(cc)[BLU]) #define fputcolcor(cc,fp) fprintf(fp,"%s %f %f %f\n",COLCORSTR, \ (cc)[RED],(cc)[GRN],(cc)[BLU])