Skip to content

Commit c2d7d74

Browse files
Fix indentation and functions names
1 parent 9828d08 commit c2d7d74

File tree

5 files changed

+31
-28
lines changed

5 files changed

+31
-28
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ add_subdirectory(TMOAubry14/) #Tomas Hudziec
3232
add_subdirectory(TMOKou15/) #Tomas Hudziec
3333
add_subdirectory(TMOMeylan06/)
3434
add_subdirectory(TMODrago03/) # David Chocholaty
35-
add_subdirectory(TMOParis11/) # David Chocholaty
35+
add_subdirectory(TMOParis11/) # David Chocholaty
3636
#add_subdirectory(TMOYourOperatorNameLinux/)
3737
add_subdirectory(TMOJin14/) #
3838
add_subdirectory(TMOLee10/) #Martin Molek

TMODrago03/TMODrago03.cpp

+15-14
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ TMODrago03::TMODrago03()
5555
exposure.SetName(L"exposure");
5656
exposure.SetDescription(L"Exposure scale factor: <0,100>");
5757
exposure.SetDefault(0.0);
58-
exposure=0.0;
59-
exposure.SetRange(0,100);
58+
exposure = 0.0;
59+
exposure.SetRange(0, 100);
6060
this->Register(exposure);
6161

6262
/* Gamma */
6363
gamma.SetName(L"gamma");
6464
gamma.SetDescription(L"Gamma correction value: <1.0e-3,1.0e+2>");
6565
gamma.SetDefault(1.125);
66-
gamma=1.125;
67-
gamma.SetRange(1.0e-3,1.0e+2);
66+
gamma = 1.125;
67+
gamma.SetRange(1.0e-3, 1.0e+2);
6868
this->Register(gamma);
6969

7070
/* Bias parameter b */
@@ -80,21 +80,21 @@ TMODrago03::~TMODrago03()
8080
{
8181
}
8282

83-
double BiasFunc(double t, double bias)
83+
double biasFunc(double t, double bias)
8484
{
8585
const double LOG05 = -0.693147;
8686

8787
return pow(t, log(bias) / LOG05);
8888
}
8989

90-
void SetExp(double *exp_d)
90+
void setExp(double *exp_d)
9191
{
9292
*exp_d = pow(2, *exp_d);
9393
}
9494

9595
int TMODrago03::Transform()
9696
{
97-
double X, Y, Z;
97+
double X, Y, Z;
9898
double L_w, L_d, L_s;
9999
double interpol, divider;
100100
double exp_d;
@@ -107,7 +107,7 @@ int TMODrago03::Transform()
107107
/* Set exposure */
108108
exp_d = exposure.GetDouble();
109109
setExp(&exp_d);
110-
110+
111111
pSrc->Convert(TMO_XYZ);
112112
pDst->Convert(TMO_XYZ);
113113

@@ -124,7 +124,7 @@ int TMODrago03::Transform()
124124

125125
/* Tone mapping */
126126
L_max /= L_av;
127-
divider = log10(L_max+1.0);
127+
divider = log10(L_max + 1.0);
128128

129129
biasValue = bias.GetDouble();
130130

@@ -145,14 +145,15 @@ int TMODrago03::Transform()
145145
{
146146
L_w *= exp_d;
147147
}
148-
interpol = log(2.0 + biasFunc(L_w / L_max, biasValue) * 8.0);
149-
L_d = (log(L_w+1.0)/interpol) / divider;
148+
149+
interpol = log(2.0 + biasFunc(L_w / L_max, biasValue) * 8.0);
150+
L_d = (log(L_w + 1.0) / interpol) / divider;
150151

151152
L_s = L_d / Y;
152153

153-
*pDestinationData++ = X * L_s;
154-
*pDestinationData++ = L_d;
155-
*pDestinationData++ = Z * L_s;
154+
*pDestinationData++ = X * L_s;
155+
*pDestinationData++ = L_d;
156+
*pDestinationData++ = Z * L_s;
156157
}
157158
}
158159

TMOParis11/TMOParis11.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,30 @@ TMOParis11::TMOParis11()
3737
"setting this parameter ON change processing to Inverse Tone Mapping "
3838
"for LDR images. Otherwise is processing Tone Mapping for HDR images.");
3939
invToneMp.SetDefault(false);
40-
invToneMp=false;
40+
invToneMp = false;
4141
this->Register(invToneMp);
4242

4343
/* Detail manipulation */
4444
detailMnpl.SetName(L"detailMnpl");
4545
detailMnpl.SetDescription(L"Set Detail Manipulation -> color remapping: rgb, domain: lin. "
4646
"Otherwise (inverse) tone mapping -> color remapping: lum, domain: log.");
4747
detailMnpl.SetDefault(false);
48-
detailMnpl=false;
48+
detailMnpl = false;
4949
this->Register(detailMnpl);
5050

5151
/* Gamma */
5252
gamma.SetName(L"gamma");
5353
gamma.SetDescription(L"Gamma correction value: <1.0e-3,1.0e+2>");
5454
gamma.SetDefault(2.2);
55-
gamma=2.2;
56-
gamma.SetRange(1.0e-3,1.0e+2);
55+
gamma = 2.2;
56+
gamma.SetRange(1.0e-3, 1.0e+2);
5757
this->Register(gamma);
5858

5959
/* Sigma_r parameter */
6060
sigma_r.SetName(L"sigma_r");
6161
sigma_r.SetDescription(L"Sigma_r parameter: <0.0, 5.0>.");
6262
sigma_r.SetDefault(2.5);
63-
sigma_r=2.5;
63+
sigma_r = 2.5;
6464
sigma_r.SetRange(0.0, 5.0);
6565
this->Register(sigma_r);
6666

@@ -69,7 +69,7 @@ TMOParis11::TMOParis11()
6969
beta.SetDescription(L"Beta parameter: <0.0, 5.0>. Tone mapping: 0.0 <= beta < 1.0. "
7070
"Detail enhancement: beta = 1.0. Inverse tone mapping: beta > 1.0");
7171
beta.SetDefault(0.0);
72-
beta=0.0;
72+
beta = 0.0;
7373
beta.SetRange(0.0, 5.0);
7474
this->Register(beta);
7575

@@ -78,7 +78,7 @@ TMOParis11::TMOParis11()
7878
alpha.SetDescription(L"Alpha parameter: <0.0, 5.0>. Detail smoothing: alpha > 1.0. "
7979
"Detail enhancement: 0.0 < alpha < 1.0");
8080
alpha.SetDefault(0.25);
81-
alpha=0.25;
81+
alpha = 0.25;
8282
alpha.SetRange(0.0, 5.0);
8383
this->Register(alpha);
8484
}

tmolib/TMOImage.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2980,7 +2980,7 @@ int TMOImage::CenterWeight (int centerX, int centerY, double kernel, double *ave
29802980
int x, y, i, j, index;
29812981
int kernel_size, khalf;
29822982
int xstart, ystart;
2983-
double r, rclip, pixnb;
2983+
double r, rclip, pixnb;
29842984
double **mask;
29852985
double m, sum;
29862986

@@ -3046,7 +3046,7 @@ int TMOImage::CenterWeight (int centerX, int centerY, double kernel, double *ave
30463046
}
30473047

30483048
/* Build the Gaussian kernel */
3049-
rclip = khalf*sqrt(-log(0.1)/log(2.0));
3049+
rclip = khalf * sqrt(-log(0.1) / log(2.0));
30503050

30513051
for (x = -khalf; x <= khalf; x++)
30523052
{
@@ -3368,8 +3368,8 @@ void TMOImage::CalculateLuminance(double &maximum, double &average)
33683368

33693369
for (int i = 0; i < size; i++)
33703370
{
3371-
average += log (GetOffset(i)[1] + 1e-4);
3372-
maximum = (GetOffset(i)[1] > maximum) ? GetOffset(i)[1] : maximum;
3371+
average += log(GetOffset(i)[1] + 1e-4);
3372+
maximum = (GetOffset(i)[1] > maximum) ? GetOffset(i)[1] : maximum;
33733373
}
33743374

33753375
average = exp(average / size);

tmolib/TMOImage.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ class TMOLIB_API TMOImage
175175
virtual void GetStatisticsSquareRange(int x, int y, int size = 0);
176176
virtual double GetLuminanceYxy(int x, int y, int r = 0);
177177
virtual double SetLuminance(int x, int y, double L);
178-
virtual void CalculateLuminance(double &maximum, double &average);
178+
virtual void CalculateLuminance(double &maximum, double &average);
179179
virtual int GetMinMaxAvg(double *minimum, double *maximum, double *average);
180180
virtual int GetMinMaxAvgLog10(double *minimum, double *maximum, double *average);
181+
181182
virtual int GetDimensions(int *x, int *y);
182183
virtual int SetDimensions(int x, int y)
183184
{
@@ -186,10 +187,11 @@ class TMOLIB_API TMOImage
186187
return 0;
187188
}
188189
virtual const char *GetFilename() { return (pName); };
190+
189191
virtual int SetFilename(const char *filename);
190192
virtual int CorrectGamma(double gamma);
191193
virtual int CorrectGammaYxy(double gamma); //just for testing, not reasonable
192-
virtual int CenterWeight(int centerX, int centerY, float kernel, double *average);
194+
virtual int CenterWeight(int centerX, int centerY, double kernel, double *average);
193195
virtual int SetData(double *&newData);
194196

195197
struct TMOStatistics

0 commit comments

Comments
 (0)