Update of /cvsroot/ufraw/ufraw In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10889
Modified Files: dcraw.h dcraw.cc dcraw_api.h dcraw_api.cc ufraw_ufraw.c Log Message: Add exposure normalization for FUJIFILM cameras. Thanks goes to Frank Markesteijn for discovering the FUJIFILM exposure bias tag. Index: dcraw.cc =================================================================== RCS file: /cvsroot/ufraw/ufraw/dcraw.cc,v retrieving revision 1.325 retrieving revision 1.326 diff -u -d -r1.325 -r1.326 --- dcraw.cc 15 Feb 2015 07:00:15 -0000 1.325 +++ dcraw.cc 20 Feb 2015 05:30:26 -0000 1.326 @@ -153,7 +153,7 @@ CLASS DCRaw() { -order=0; /* Suppress valgrind error. */ +order=0, fuji_dr=0; /* Suppress valgrind error. */ shot_select=0, multi_out=0, aber[0] = aber[1] = aber[2] = aber[3] = 1; gamm[0] = 0.45, gamm[1] = 4.5, gamm[2] = gamm[3] = gamm[4] = gamm[5] = 0; bright=1, user_mul[0] = user_mul[1] = user_mul[2] = user_mul[3] = 0; @@ -7241,6 +7241,8 @@ FORC(6) xtrans_abs[5-i][5-c] = fgetc(ifp) & 3; } else if (tag == 0x2ff0) { FORC4 cam_mul[c ^ 1] = get2(); + } else if (tag == 0x9650) { /* FUJIFILM exposure bias */ + fuji_dr = get2(); } else if (tag == 0xc000) { c = order; order = 0x4949; Index: dcraw.h =================================================================== RCS file: /cvsroot/ufraw/ufraw/dcraw.h,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- dcraw.h 14 Feb 2015 09:00:19 -0000 1.84 +++ dcraw.h 20 Feb 2015 05:30:26 -0000 1.85 @@ -40,7 +40,7 @@ public: /* All dcraw's global variables are members of this class. */ FILE *ifp, *ofp; - short order; + short order, fuji_dr; /*const*/ char *ifname, *ifname_display; char *meta_data, xtrans[6][6], xtrans_abs[6][6], cdesc[5], desc[512]; Index: dcraw_api.h =================================================================== RCS file: /cvsroot/ufraw/ufraw/dcraw_api.h,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- dcraw_api.h 24 Jan 2015 10:00:15 -0000 1.53 +++ dcraw_api.h 20 Feb 2015 05:30:26 -0000 1.54 @@ -40,6 +40,7 @@ double cam_rgb[4][3]; int rgbMax, black, fuji_width; double fuji_step; + short fuji_dr; int toneCurveSize, toneCurveOffset; int toneModeSize, toneModeOffset; char *message, xtrans[6][6]; Index: ufraw_ufraw.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw_ufraw.c,v retrieving revision 1.286 retrieving revision 1.287 diff -u -d -r1.286 -r1.287 --- ufraw_ufraw.c 11 Feb 2015 07:00:16 -0000 1.286 +++ ufraw_ufraw.c 20 Feb 2015 05:30:26 -0000 1.287 @@ -692,6 +692,21 @@ uf->conf->ExposureNorm, log(1.0 * raw->rgbMax / uf->conf->ExposureNorm) / log(2)); } + /* FUJIFILM cameras have a special tag for exposure normalization */ + } else if (strcasecmp(uf->conf->make, "FUJIFILM") == 0) { + if (raw->fuji_dr == 0) { + uf->conf->ExposureNorm = 0; + } else { + int c, max = raw->cam_mul[0]; + for (c = 1; c < raw->colors; c++) max = MAX(raw->cam_mul[c], max); + if (uf->LoadingID && uf->conf->ExposureNorm == 0) + uf->conf->exposure -= log(1.0 * raw->rgbMax / max) / log(2); + uf->conf->ExposureNorm = (int)(1.0 * raw->rgbMax * pow(2, (double)raw->fuji_dr / 100)); + ufraw_message(UFRAW_SET_LOG, + "Exposure Normalization set to %d (%.2f EV)\n", + uf->conf->ExposureNorm, + fabs((float)raw->fuji_dr / 100)); + } } else { uf->conf->ExposureNorm = 0; } Index: dcraw_api.cc =================================================================== RCS file: /cvsroot/ufraw/ufraw/dcraw_api.cc,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- dcraw_api.cc 14 Feb 2015 09:00:19 -0000 1.100 +++ dcraw_api.cc 20 Feb 2015 05:30:26 -0000 1.101 @@ -132,6 +132,7 @@ h->width = d->width; h->fuji_width = d->fuji_width; h->fuji_step = sqrt(0.5); + h->fuji_dr = d->fuji_dr; h->colors = d->colors; h->filters = d->filters; h->raw_color = d->raw_color; @@ -263,8 +264,8 @@ d->bad_pixels(NULL); if (d->is_foveon) { if (d->load_raw == &DCRaw::foveon_dp_load_raw) { - d->meta_data = 0; - d->foveon_dp_interpolate(); + d->meta_data = 0; + d->foveon_dp_interpolate(); } else d->foveon_interpolate(); h->raw.width = h->width = d->width; h->raw.height = h->height = d->height; ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk _______________________________________________ ufraw-cvs mailing list ufraw-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ufraw-cvs