48 |
|
#define normbright(c) (int)((67L*(c)[RED]+168L*(c)[GRN]+21L*(c)[BLU])/256) |
49 |
|
#endif |
50 |
|
|
51 |
+ |
#define luminance(col) (470. * bright(col)) |
52 |
+ |
|
53 |
|
#define intens(col) ( (col)[0] > (col)[1] \ |
54 |
|
? (col)[0] > (col)[2] ? (col)[0] : (col)[2] \ |
55 |
|
: (col)[1] > (col)[2] ? (col)[1] : (col)[2] ) |
68 |
|
#define YDECR 2 |
69 |
|
#define YMAJOR 4 |
70 |
|
|
71 |
+ |
/* picture format identifier */ |
72 |
+ |
#define COLRFMT "32-bit_rle_rgbe" |
73 |
+ |
|
74 |
|
/* macros for exposures */ |
75 |
|
#define EXPOSSTR "EXPOSURE=" |
76 |
|
#define EXPOSSTRL 9 |
84 |
|
#define isaspect(hl) (!strncmp(hl,ASPECTSTR,ASPECTSTRL)) |
85 |
|
#define aspectval(hl) atof((hl)+ASPECTSTRL) |
86 |
|
#define fputaspect(pa,fp) fprintf(fp,"%s%f\n",ASPECTSTR,pa) |
87 |
+ |
|
88 |
+ |
/* macros for color correction */ |
89 |
+ |
#define COLCORSTR "COLORCORR=" |
90 |
+ |
#define COLCORSTRL 10 |
91 |
+ |
#define iscolcor(hl) (!strncmp(hl,COLCORSTR,COLCORSTRL)) |
92 |
+ |
#define colcorval(cc,hl) sscanf(hl+COLCORSTRL,"%f %f %f", \ |
93 |
+ |
&(cc)[RED],&(cc)[GRN],&(cc)[BLU]) |
94 |
+ |
#define fputcolcor(cc,fp) fprintf(fp,"%s %f %f %f\n",COLCORSTR, \ |
95 |
+ |
(cc)[RED],(cc)[GRN],(cc)[BLU]) |
96 |
|
|
97 |
|
extern double ldexp(), atof(); |