diff --git a/AUTHORS.txt b/AUTHORS.txt index 16598176c..62b67501e 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -38,6 +38,7 @@ Other contributors (profiles, ideas, mockups, testing, forum activity, translati Thorsten Bartolomäus Patrik Brunner Fernando Carello + Rodrigo Nuno Bragança da Cunha Pat David Reine Edvardsson André Gauthier diff --git a/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp10.icm b/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp10.icm new file mode 100644 index 000000000..ac3cf1274 Binary files /dev/null and b/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp10.icm differ diff --git a/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp11.icm b/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp11.icm new file mode 100644 index 000000000..b609e3e5a Binary files /dev/null and b/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp11.icm differ diff --git a/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp12.icm b/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp12.icm new file mode 100644 index 000000000..79a44e113 Binary files /dev/null and b/rtdata/iccprofiles/input/sd14-bl15-crop-matrix-gamma-wp12.icm differ diff --git a/rtdata/iccprofiles/input/sd1_merrill_cloudy8140-CROP-WP10.icm b/rtdata/iccprofiles/input/sd1_merrill_cloudy8140-CROP-WP10.icm new file mode 100644 index 000000000..5d4cdaf03 Binary files /dev/null and b/rtdata/iccprofiles/input/sd1_merrill_cloudy8140-CROP-WP10.icm differ diff --git a/rtdata/iccprofiles/input/sd1_merrill_cloudy8140-CROP-WP11.icm b/rtdata/iccprofiles/input/sd1_merrill_cloudy8140-CROP-WP11.icm new file mode 100644 index 000000000..58ea30140 Binary files /dev/null and b/rtdata/iccprofiles/input/sd1_merrill_cloudy8140-CROP-WP11.icm differ diff --git a/rtdata/iccprofiles/input/sd1_merrill_sunny8161-crop-wp10.icm b/rtdata/iccprofiles/input/sd1_merrill_sunny8161-crop-wp10.icm new file mode 100644 index 000000000..48d0225cd Binary files /dev/null and b/rtdata/iccprofiles/input/sd1_merrill_sunny8161-crop-wp10.icm differ diff --git a/rtdata/iccprofiles/input/sd1_merrill_sunny8161-crop-wp11.icm b/rtdata/iccprofiles/input/sd1_merrill_sunny8161-crop-wp11.icm new file mode 100644 index 000000000..1f613eda6 Binary files /dev/null and b/rtdata/iccprofiles/input/sd1_merrill_sunny8161-crop-wp11.icm differ diff --git a/rtdata/iccprofiles/input/sd1_merrill_tungsten8130-CROP-WP10.icm b/rtdata/iccprofiles/input/sd1_merrill_tungsten8130-CROP-WP10.icm new file mode 100644 index 000000000..7a5c322b3 Binary files /dev/null and b/rtdata/iccprofiles/input/sd1_merrill_tungsten8130-CROP-WP10.icm differ diff --git a/rtdata/iccprofiles/input/sd1_merrill_tungsten8130-CROP-WP11.icm b/rtdata/iccprofiles/input/sd1_merrill_tungsten8130-CROP-WP11.icm new file mode 100644 index 000000000..bb55e3a86 Binary files /dev/null and b/rtdata/iccprofiles/input/sd1_merrill_tungsten8130-CROP-WP11.icm differ diff --git a/rtengine/camconst.json b/rtengine/camconst.json index bc16c3c86..d75b46a70 100755 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1138,6 +1138,38 @@ Quality X: unknown, ie we knowing to little about the camera properties to know ] } }, + + { // Quality c, corrections for frame size, black level not declared properly + "make_model": "Sigma SD14", + "dcraw_matrix": [ 16411,-4764,-2383,8110,2603,-645,3135,3878,1984 ], // experimental inverted icc wp12 - build with BL=15 + // "dcraw_matrix": [ 13804,-4156,-1896,6917,1909,-431,2768,2989,1741 ], // experimental inverted icc wp10 - build with BL=15 + "ranges": { "black": 15, "white": 4080 },// peripheral black stripes give BL around 37 + "raw_crop": [ 18, 12, 2652, 1768 ] + }, + + { // Quality c, correction for frame width + "make_model": "Sigma SD1", + "dcraw_matrix": [ 5270,42,-814,3737,5506,124,1112,9714,4510 ], // experimental from icm 1.04477,-0.74838,1.01617, -0.54028,2.52690,-3.83257, 0.54869,-0.69556,3.73746 + "ranges": { "black": 16, "white": 4070 },// BL is 16 or 31, should be measured at the horizontal black stripe at the top + "raw_crop": [ 12, 52, -110, -8 ] + }, + { // Quality C, correction for frame width, color matrix investigated .. + "make_model": "Sigma SD1 Merrill", + "dcraw_matrix": [ 7211,-1577,-769,4996,3428,440,2717,7117,4699 ], // experimental inverted icc cloudy8140 d65 + // "dcraw_matrix": [ 5666,139,-892,3780,5428,270,1366,9757,4526 ], // experimental inverted icc sunny8161 + // "dcraw_matrix": [ 10288,-2449,-1718,8976,1868,-1608,7011,5039,-249 ], // experimental inverted icc tungsten8130 wp11 + // "dcraw_matrix": [ 5864,679,-1491,2963,7635,-919,-640,13738,2790 ], // experimental inverted icc sunny8160 + // "dcraw_matrix": [ 14032,-2231,-1016,-5263,14816,170,-112,183,9113 ], // hardcoded + "ranges": { "black": 16, "white": 4070 }, // BL is 16 or 31, should be measured at the horizontal black stripe at the top + "raw_crop": [ 12, 52, -110, -8 ] // for small size all numbers/2 + }, + { // Quality C, correction for frame width, color matrix guessed .. + "make_model": [ "Sigma DP1 Merrill", "Sigma DP2 Merrill", "Sigma DP3 Merrill" ], + "dcraw_matrix": [ 7211,-1577,-769,4996,3428,440,2717,7117,4699 ], // copy fron SD1 Merrill icc cloudy8140 d65 + "ranges": { "black": 16, "white": 4070 }, // BL is 16 or 31, should be measured at the horizontal black stripe at the bottom + "raw_crop": [ 12, 0, -110, -62 ] // for small size all numbers/2 + }, + { // Quality A, correction for color matrix from Colin Walker's d50 to dng d65 "make_model": "Sony NEX-C3", diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index a924397d7..bba64ba71 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -3255,7 +3255,7 @@ void CLASS foveon_sd_load_raw() pred[c] += diff[dindex->leaf]; if (pred[c] >> 16 && ~pred[c] >> 16) derror(); } - FORC3 image[row*width+col][c] = pred[c]; + FORC3 image[row*width+col][c] = pred[c] < 0 ? 0 : pred[c]; } } } @@ -8306,6 +8306,7 @@ void CLASS identify() if (height > width) pixel_aspect = 2; filters = 0; simple_coeff(0); + adobe_coeff (make, model); } else if (!strcmp(make,"Canon") && tiff_bps == 15) { switch (width) { case 3344: width -= 66; diff --git a/rtengine/dcraw.patch b/rtengine/dcraw.patch index 50d360a6d..e322f28fe 100755 --- a/rtengine/dcraw.patch +++ b/rtengine/dcraw.patch @@ -1,5 +1,5 @@ ---- dcraw.c 2014-07-24 16:15:36.700261700 +0200 -+++ dcraw.cc 2015-02-10 18:21:01.213732653 +0100 +--- dcraw.c 2015-04-17 13:02:57 +0000 ++++ dcraw.cc 2015-04-17 13:09:41 +0000 @@ -1,3 +1,15 @@ +/*RT*/#include +/*RT*/#include @@ -647,6 +647,15 @@ struct decode *cur; int i, len; +@@ -2960,7 +3255,7 @@ + pred[c] += diff[dindex->leaf]; + if (pred[c] >> 16 && ~pred[c] >> 16) derror(); + } +- FORC3 image[row*width+col][c] = pred[c]; ++ FORC3 image[row*width+col][c] = pred[c] < 0 ? 0 : pred[c]; + } + } + } @@ -3571,6 +3866,8 @@ if (load_raw == &CLASS phase_one_load_raw || load_raw == &CLASS phase_one_load_raw_c) @@ -1375,7 +1384,15 @@ case 34892: load_raw = &CLASS lossy_dng_load_raw; break; default: load_raw = 0; } -@@ -8347,7 +8385,7 @@ +@@ -8268,6 +8306,7 @@ + if (height > width) pixel_aspect = 2; + filters = 0; + simple_coeff(0); ++ adobe_coeff (make, model); + } else if (!strcmp(make,"Canon") && tiff_bps == 15) { + switch (width) { + case 3344: width -= 66; +@@ -8347,7 +8386,7 @@ width -= 44; } else if (!strcmp(model,"D3200") || !strcmp(model,"D600") || @@ -1384,7 +1401,7 @@ width -= 46; } else if (!strcmp(model,"D4") || !strcmp(model,"Df")) { -@@ -8567,24 +8605,53 @@ +@@ -8567,24 +8606,53 @@ if (load_raw == &CLASS lossless_jpeg_load_raw) load_raw = &CLASS hasselblad_load_raw; if (raw_width == 7262) { @@ -1440,7 +1457,7 @@ } else if (raw_width == 4090) { strcpy (model, "V96C"); height -= (top_margin = 6); -@@ -8637,6 +8704,7 @@ +@@ -8637,6 +8705,7 @@ filters = 0x16161616; } } else if (!strcmp(make,"Leica") || !strcmp(make,"Panasonic")) { @@ -1448,7 +1465,7 @@ if ((flen - data_offset) / (raw_width*8/7) == raw_height) load_raw = &CLASS panasonic_load_raw; if (!load_raw) { -@@ -8654,6 +8722,7 @@ +@@ -8654,6 +8723,7 @@ } filters = 0x01010101 * (uchar) "\x94\x61\x49\x16" [((filters-1) ^ (left_margin & 1) ^ (top_margin << 1)) & 3]; @@ -1456,7 +1473,7 @@ } else if (!strcmp(model,"C770UZ")) { height = 1718; width = 2304; -@@ -8883,6 +8952,14 @@ +@@ -8883,6 +8953,14 @@ memcpy (rgb_cam, cmatrix, sizeof cmatrix); raw_color = 0; } @@ -1471,7 +1488,7 @@ if (raw_color) adobe_coeff (make, model); if (load_raw == &CLASS kodak_radc_load_raw) if (raw_color) adobe_coeff ("Apple","Quicktake"); -@@ -8899,7 +8976,7 @@ +@@ -8899,7 +8977,7 @@ if (!tiff_bps) tiff_bps = 12; if (!maximum) maximum = (1 << tiff_bps) - 1; if (!load_raw || height < 22 || width < 22 || @@ -1480,7 +1497,7 @@ is_raw = 0; #ifdef NO_JASPER if (load_raw == &CLASS redcine_load_raw) { -@@ -8978,195 +9055,250 @@ +@@ -8978,195 +9056,250 @@ } #endif @@ -1906,7 +1923,7 @@ struct tiff_tag { ushort tag, type; int count; -@@ -9188,585 +9320,12 @@ +@@ -9188,585 +9321,12 @@ unsigned gps[26]; char desc[512], make[64], model[64], soft[32], date[20], artist[64]; }; diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index 64ddbebbb..42eae61bb 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -121,7 +121,7 @@ void dfInfo::updateRawImage() int H = ri->get_height(); int W = ri->get_width(); ri->compress_image(); - int rSize = W*((ri->getSensorType()!=ST_NONE)?1:3); + int rSize = W*((ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS)?1:3); acc_t **acc = new acc_t*[H]; for( int row=0; rowloadRaw(true)){ temp->compress_image(); //\ TODO would be better working on original, because is temporary nFiles++; - if( ri->getSensorType()!=ST_NONE ){ + if( ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS ){ for( int row=0; rowdata[row][col]; @@ -174,7 +174,7 @@ void dfInfo::updateRawImage() void dfInfo::updateBadPixelList( RawImage *df ) { const float threshold=10.f/8.f; - if( ri->getSensorType()!=ST_NONE ){ + if( ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS ){ std::vector badPixelsTemp; #pragma omp parallel diff --git a/rtengine/expo_before_b.cc b/rtengine/expo_before_b.cc index 5c06848a2..07dfc2e93 100644 --- a/rtengine/expo_before_b.cc +++ b/rtengine/expo_before_b.cc @@ -57,7 +57,7 @@ void RawImageSource::processRawWhitepoint(float expos, float preser) { if (fabs(preser)<0.001f) { // No highlight protection - simple mutiplication - if (ri->getSensorType()!=ST_NONE) + if (ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS) #pragma omp parallel for for (int row=0;rowgetSensorType()!=ST_NONE) { + if (ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS) { // Demosaic to allow calculation of luminosity. if(ri->getSensorType()==ST_BAYER) fast_demosaic (0,0,W,H); @@ -84,7 +84,7 @@ void RawImageSource::processRawWhitepoint(float expos, float preser) { #pragma omp parallel { float maxValFloatThr = 0.f; - if (ri->getSensorType()!=ST_NONE) + if (ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS) #pragma omp for schedule(dynamic,16) nowait for(int row=0;rowmaxValFloatThr) - maxValFloatThr = rawData[row][col*3+c]; + for (int c=0;c<3;c++) + if (rawData[row][col*3+c]>maxValFloatThr) + maxValFloatThr = rawData[row][col*3+c]; } #pragma omp critical @@ -124,7 +125,7 @@ void RawImageSource::processRawWhitepoint(float expos, float preser) { lut[(int)j] = exp(EV*((float)maxVal-j) / ((float)maxVal-K) * log(2.0)); } - if (ri->getSensorType()!=ST_NONE) + if (ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS) #pragma omp parallel for schedule(dynamic,16) for(int row=0;rowget_height(); int W = ri->get_width(); ri->compress_image(); - int rSize = W*((ri->getSensorType()!=ST_NONE)?1:3); + int rSize = W*((ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS)?1:3); acc_t **acc = new acc_t*[H]; for( int row=0; rowloadRaw(true)){ temp->compress_image(); //\ TODO would be better working on original, because is temporary nFiles++; - if( ri->getSensorType()!=ST_NONE ){ + if( ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS ){ for( int row=0; rowdata[row][col]; diff --git a/rtengine/imageio.h b/rtengine/imageio.h index 9484b6045..1ccc6a5ee 100644 --- a/rtengine/imageio.h +++ b/rtengine/imageio.h @@ -63,7 +63,7 @@ namespace rtengine { ST_NONE, // use this value if the image is already demosaiced (i.e. not a raw file) ST_BAYER, ST_FUJI_XTRANS, - //ST_FOVEON, + ST_FOVEON, //ST_FUJI_EXR } eSensorType; diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 9c0ba04ef..a91e20edb 100755 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -50,6 +50,8 @@ eSensorType RawImage::getSensorType() { return ST_BAYER; else if (isXtrans()) return ST_FUJI_XTRANS; + else if (isFoveon()) + return ST_FOVEON; return ST_NONE; } @@ -403,6 +405,25 @@ int RawImage::loadRaw (bool loadData, bool closeFile, ProgressListener *plistene crop_masked_pixels(); free (raw_image); raw_image=NULL; + } else { + if (cc && cc->has_rawCrop()) { // foveon images + int lm, tm, w, h; + cc->get_rawCrop(lm, tm, w, h); + left_margin = lm; + top_margin = tm; + if (w < 0) { + width += w; + width -= left_margin; + } else if (w > 0) { + width = min((int)width,w); + } + if (h < 0) { + height += h; + height -= top_margin; + } else if (h > 0) { + height = min((int)height,h); + } + } } // Load embedded profile @@ -534,9 +555,9 @@ float** RawImage::compress_image() #pragma omp parallel for for (int row = 0; row < height; row++) for (int col = 0; col < width; col++) { - this->data[row][3 * col + 0] = image[row * width + col][0]; - this->data[row][3 * col + 1] = image[row * width + col][1]; - this->data[row][3 * col + 2] = image[row * width + col][2]; + this->data[row][3 * col + 0] = image[(row+top_margin) * iwidth + col+left_margin][0]; + this->data[row][3 * col + 1] = image[(row+top_margin) * iwidth + col+left_margin][1]; + this->data[row][3 * col + 2] = image[(row+top_margin) * iwidth + col+left_margin][2]; } } free(image); // we don't need this anymore diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 441b26450..4f7dae634 100755 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -110,6 +110,7 @@ protected: int maximum_c4[4]; bool isBayer() const { return (filters!=0 && filters!=9); } bool isXtrans() const { return filters==9; } + bool isFoveon() const { return is_foveon; } public: @@ -117,6 +118,10 @@ public: std::string get_filename() const { return filename;} int get_width() const { return width; } int get_height() const { return height; } + int get_iwidth() const { return iwidth; } + int get_iheight() const { return iheight; } + int get_leftmargin() const { return left_margin; } + int get_topmargin() const { return top_margin; } int get_FujiWidth() const { return fuji_width; } eSensorType getSensorType(); diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 4369f1199..018d9d017 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -330,7 +330,7 @@ void RawImageSource::getImage (ColorTemp ctemp, int tran, Imagefloat* image, Pre #pragma omp for #endif for (int ix=0; ix=maxy-skip) i=maxy-skip-1; // avoid trouble - if (ri->getSensorType()!=ST_NONE || ri->get_colors() == 1) { + if (ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS || ri->get_colors() == 1) { for (int j=0,jx=sx1; j=maxx-skip) jx=maxx-skip-1; // avoid trouble float rtot,gtot,btot; rtot=gtot=btot=0; @@ -1118,6 +1118,8 @@ int RawImageSource::load (Glib::ustring fname, bool batch) { if(ri->getSensorType()==ST_FUJI_XTRANS) border = 7; + else if(ri->getSensorType()==ST_FOVEON) + border = 0; if ( ri->get_profile() ) embProfile = cmsOpenProfileFromMem (ri->get_profile(), ri->get_profileLen()); @@ -1390,7 +1392,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le cfa_linedn(0.00002*(raw.bayersensor.linenoise)); } - if ( (raw.ca_autocorrect || fabs(raw.cared)>0.001 || fabs(raw.cablue)>0.001) && ri->getSensorType()!=ST_FUJI_XTRANS ) { // Auto CA correction disabled for X-Trans, for now... + if ( (raw.ca_autocorrect || fabs(raw.cared)>0.001 || fabs(raw.cablue)>0.001) && ri->getSensorType() == ST_BAYER ) { // Auto CA correction disabled for X-Trans, for now... if (plistener) { plistener->setProgressStr ("CA Auto Correction..."); plistener->setProgress (0.0); @@ -1707,7 +1709,7 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, Raw { unsigned short black[4]={ri->get_cblack(0),ri->get_cblack(1),ri->get_cblack(2),ri->get_cblack(3)}; - if (ri->getSensorType()!=ST_NONE) { + if (ri->getSensorType()==ST_BAYER || ri->getSensorType()==ST_FUJI_XTRANS) { if (!rawData) rawData(W,H); if (riDark && W == riDark->get_width() && H == riDark->get_height()) { // This works also for xtrans-sensors, because black[0] to black[4] are equal for these @@ -1953,7 +1955,7 @@ void RawImageSource::scaleColors(int winx,int winy,int winw,int winh, const RAWP //adjust black level (eg Canon) bool isMono = false; - if (getSensorType()==ST_BAYER) { + if (getSensorType()==ST_BAYER || getSensorType()==ST_FOVEON ) { black_lev[0]=raw.bayersensor.black1;//R black_lev[1]=raw.bayersensor.black0;//G1 diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 86fb0a63e..7edd2c670 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -330,7 +330,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati unsigned filter = ri->get_filters(); int firstgreen = 1; // locate first green location in the first row - if(ri->getSensorType()!=ST_FUJI_XTRANS) + if(ri->getSensorType()==ST_BAYER) while (!FISGREEN(filter,1,firstgreen)) firstgreen++; @@ -415,9 +415,14 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati } } } else { - for (int row = 1, y = 0; row < height - 1 && y < tmph; row += vskip, y++) { - rofs = row * width; - for (int col = firstgreen, x = 0; col < width - 1 && x < tmpw; col += hskip, x++) { + int iwidth = ri->get_iwidth(); + int iheight = ri->get_iheight(); + int left_margin = ri->get_leftmargin(); + firstgreen += left_margin; + int top_margin = ri->get_topmargin(); + for (int row = 1 + top_margin, y = 0; row < iheight + top_margin - 1 && y < tmph; row += vskip, y++) { + rofs = row * iwidth; + for (int col = firstgreen, x = 0; col < iwidth + left_margin - 1 && x < tmpw; col += hskip, x++) { int ofs = rofs + col; tmpImg->r(y,x) = image[ofs][0]; tmpImg->g(y,x) = image[ofs][1]; @@ -493,7 +498,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati tpp->aeHistogram[((int)(image[i* width+j][0]))>>tpp->aeHistCompression]+=gadd; tpp->aeHistogram[((int)(image[i* width+j][0]))>>tpp->aeHistCompression]+=badd; } - } else if(ri->getSensorType()!=ST_FUJI_XTRANS) { + } else if(ri->getSensorType()==ST_BAYER) { for (int j = start; j < end; j++) if (FISGREEN(filter,i,j)) tpp->aeHistogram[((int)(tpp->camwbGreen*image[i* width+j][1]))>>tpp->aeHistCompression]+=gadd; @@ -501,7 +506,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati tpp->aeHistogram[((int)(tpp->camwbRed * image[i* width+j][0]))>>tpp->aeHistCompression]+=radd; else if (FISBLUE(filter,i,j)) tpp->aeHistogram[((int)(tpp->camwbBlue *image[i* width+j][2]))>>tpp->aeHistCompression]+=badd; - } else { + } else if(ri->getSensorType()==ST_FUJI_XTRANS) { for (int j = start; j < end; j++) if (ri->ISXTRANSGREEN(i,j)) tpp->aeHistogram[((int)(tpp->camwbGreen*image[i* width+j][1]))>>tpp->aeHistCompression]+=gadd; @@ -509,6 +514,12 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati tpp->aeHistogram[((int)(tpp->camwbRed * image[i* width+j][0]))>>tpp->aeHistCompression]+=radd; else if (ri->ISXTRANSBLUE(i,j)) tpp->aeHistogram[((int)(tpp->camwbBlue *image[i* width+j][2]))>>tpp->aeHistCompression]+=badd; + } else /* if(ri->getSensorType()==ST_FOVEON) */{ + for (int j = start; j < end; j++) { + tpp->aeHistogram[((int)(image[i* width+j][0]*2.f))>>tpp->aeHistCompression]+=radd; + tpp->aeHistogram[((int)(image[i* width+j][1]))>>tpp->aeHistCompression]+=gadd; + tpp->aeHistogram[((int)(image[i* width+j][2]*0.5f))>>tpp->aeHistCompression]+=badd; + } } } @@ -530,7 +541,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati start = 32; end = width - 32; } - if(ri->getSensorType()!=ST_FUJI_XTRANS) { + if(ri->getSensorType()==ST_BAYER) { for (int j = start; j < end; j++) { if (!filter) { double d = tpp->defGain * image[i * width + j][0]; @@ -560,7 +571,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati bn++; } } - } else { + } else if(ri->getSensorType()==ST_FUJI_XTRANS) { for (int j = start; j < end; j++) { if (ri->ISXTRANSGREEN(i,j)) { double d = tpp->defGain * image[i * width + j][1]; @@ -584,6 +595,24 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati bn++; } } + } else /* if(ri->getSensorType()==ST_FOVEON) */ { + for (int j = start; j < end; j++) { + double d = tpp->defGain * image[i * width + j][0]; + if (d <= 64000.) { + avg_r += d; + rn++; + } + d = tpp->defGain * image[i * width + j][1]; + if (d <= 64000.) { + avg_g += d; + gn++; + } + d = tpp->defGain * image[i * width + j][2]; + if (d <= 64000.) { + avg_b += d; + bn++; + } + } } }