Code cleanups
on behalf of Lebedev, see issue 1332
This commit is contained in:
@@ -16,14 +16,18 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <iomanip>
|
||||
|
||||
#include "cropwindow.h"
|
||||
#include "options.h"
|
||||
#include <iomanip>
|
||||
#include "guiutils.h"
|
||||
#include "../rtengine/mytime.h"
|
||||
#include "imagearea.h"
|
||||
#include "cursormanager.h"
|
||||
#include "../rtengine/safegtk.h"
|
||||
#include "../rtengine/rt_math.h"
|
||||
|
||||
using namespace rtengine;
|
||||
|
||||
struct ZoomStep {
|
||||
Glib::ustring label;
|
||||
@@ -758,25 +762,25 @@ void CropWindow::expose (Cairo::RefPtr<Cairo::Context> cr) {
|
||||
currIndex = currWS+3*k + kh*pixWSRowStride;
|
||||
curL = 0.299*(currIndex)[0]+0.587*(currIndex)[1]+0.114*(currIndex)[2];
|
||||
sum_L += curL;
|
||||
sumsq_L += pow(curL,2);
|
||||
sumsq_L += SQR(curL);
|
||||
|
||||
// Band2 @ blur_radius2
|
||||
if (kh>=-blur_radius2 && kh<=blur_radius2 && k>=-blur_radius2 && k<=blur_radius2){
|
||||
sum_L2 += curL;
|
||||
sumsq_L2 += pow(curL,2);
|
||||
sumsq_L2 += SQR(curL);
|
||||
}
|
||||
}
|
||||
}
|
||||
//*************
|
||||
// averages
|
||||
kernel_size= pow(2*blur_radius+1,2); // consider -1: Bessel's correction for the sample standard deviation (tried, did not make any visible difference)
|
||||
kernel_size2= pow(2*blur_radius2+1,2);
|
||||
kernel_size= SQR(2*blur_radius+1); // consider -1: Bessel's correction for the sample standard deviation (tried, did not make any visible difference)
|
||||
kernel_size2= SQR(2*blur_radius2+1);
|
||||
avg_L = sum_L/kernel_size;
|
||||
avg_L2 = sum_L2/kernel_size2;
|
||||
|
||||
|
||||
stdDev_L = sqrt(sumsq_L/kernel_size - pow(avg_L,2));
|
||||
stdDev_L2 = sqrt(sumsq_L2/kernel_size2 - pow(avg_L2,2));
|
||||
stdDev_L = sqrt(sumsq_L/kernel_size - SQR(avg_L));
|
||||
stdDev_L2 = sqrt(sumsq_L2/kernel_size2 - SQR(avg_L2));
|
||||
|
||||
//TODO: try to normalize by average L of the entire (preview) image
|
||||
|
||||
|
Reference in New Issue
Block a user