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] ) |
81 |
|
#define isaspect(hl) (!strncmp(hl,ASPECTSTR,ASPECTSTRL)) |
82 |
|
#define aspectval(hl) atof((hl)+ASPECTSTRL) |
83 |
|
#define fputaspect(pa,fp) fprintf(fp,"%s%f\n",ASPECTSTR,pa) |
84 |
+ |
|
85 |
+ |
/* macros for color correction */ |
86 |
+ |
#define COLCORSTR "COLORCORR=" |
87 |
+ |
#define COLCORSTRL 10 |
88 |
+ |
#define iscolcor(hl) (!strncmp(hl,COLCORSTR,COLCORSTRL)) |
89 |
+ |
#define colcorval(cc,hl) sscanf(hl+COLCORSTRL,"%f %f %f", \ |
90 |
+ |
&(cc)[RED],&(cc)[GRN],&(cc)[BLU]) |
91 |
+ |
#define fputcolcor(cc,fp) fprintf(fp,"%s %f %f %f\n",COLCORSTR, \ |
92 |
+ |
(cc)[RED],(cc)[GRN],(cc)[BLU]) |
93 |
|
|
94 |
|
extern double ldexp(), atof(); |