From 7e1e46aee5771b7bcc46b00c23962d45aeac91b9 Mon Sep 17 00:00:00 2001 From: ffsup2 Date: Fri, 26 Nov 2010 22:45:40 +0100 Subject: [PATCH] Patch by Emil to make autoexposure of thumbs and preview image agree --- rtengine/rtthumbnail.cc | 8 ++++---- rtgui/previewloader.cc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index ac269569d..939558f21 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -385,7 +385,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati tpp->aeHistogram = new unsigned int[65536 >> tpp->aeHistCompression]; memset(tpp->aeHistogram, 0, (65536 >> tpp->aeHistCompression) * sizeof(int)); int radd = 4; - int gadd = 2; + int gadd = 4; int badd = 4; if (!filter) radd = gadd = badd = 1; @@ -401,11 +401,11 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati } for (int j = start; j < end; j++) if (FISGREEN(filter,i,j)) - tpp->aeHistogram[image[i * width + j][1] >> tpp->aeHistCompression] += gadd; + tpp->aeHistogram[CLIP((int)(tpp->camwbGreen*image[i* width+j][1]))>>tpp->aeHistCompression]+=gadd; else if (FISRED(filter,i,j)) - tpp->aeHistogram[image[i * width + j][0] >> tpp->aeHistCompression] += radd; + tpp->aeHistogram[CLIP((int)(tpp->camwbRed * image[i* width+j][0]))>>tpp->aeHistCompression]+=radd; else if (FISBLUE(filter,i,j)) - tpp->aeHistogram[image[i * width + j][2] >> tpp->aeHistCompression] += badd; + tpp->aeHistogram[CLIP((int)(tpp->camwbBlue *image[i* width+j][2]))>>tpp->aeHistCompression]+=badd; } // generate autoWB diff --git a/rtgui/previewloader.cc b/rtgui/previewloader.cc index c8a5fa337..288ce79e0 100644 --- a/rtgui/previewloader.cc +++ b/rtgui/previewloader.cc @@ -65,9 +65,9 @@ public: Impl() { - int threadCount=1; + int threadCount=2; #ifdef _OPENMP - threadCount=omp_get_num_procs(); + threadCount=int(omp_get_num_procs()*1.5); #endif threadPool_=new Glib::ThreadPool(threadCount,0);