1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : Wavelets Noise Reduction threaded image filter.
8
* This filter work in YCrCb color space.
10
* Copyright (C) 2005-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
12
* This program is free software; you can redistribute it
13
* and/or modify it under the terms of the GNU General
14
* Public License as published by the Free Software Foundation;
15
* either version 2, or (at your option)
18
* This program is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* ============================================================ */
30
#include "digikam_export.h"
31
#include "dimgthreadedfilter.h"
38
class DIGIKAM_EXPORT NRContainer
48
thresholds[0] = 1.2; // Y
49
thresholds[1] = 1.2; // Cr
50
thresholds[2] = 1.2; // Cb
51
softness[0] = 0.9; // Y
52
softness[1] = 0.9; // Cr
53
softness[2] = 0.9; // Cb
60
/** If false thresholds and softness values are the same for Y, Cr, and Cb
61
else, each chanel has a dedicated value.
65
/** General settings if advanced is false
70
/** Separated values per chanel
72
double thresholds[3]; // Y, Cr, Cb thresholds.
73
double softness[3]; // Y, Cr, Cb softness.
76
// --------------------------------------------------------------------------
78
class DIGIKAM_EXPORT NRFilter : public DImgThreadedFilter
83
NRFilter(DImg* orgImage, QObject* parent, const NRContainer& settings);
90
void waveletDenoise(float* fimg[3], unsigned int width, unsigned int height,
91
float threshold, double softness);
92
inline void hatTransform(float* temp, float *base, int st, int size, int sc);
94
void srgb2ycbcr(float** fimg, int size);
95
void ycbcr2srgb(float** fimg, int size);
98
void srgb2lab(float** fimg, int size);
99
void lab2srgb(float** fimg, int size);
100
void srgb2xyz(float** fimg, int size);
101
void xyz2srgb(float** fimg, int size);
105
NRFilterPriv* const d;
108
} // namespace Digikam
110
#endif /* NRFILTER_H */