Changeset View
Changeset View
Standalone View
Standalone View
imagelib/effects/kpEffectBlurSharpen.cpp
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 93 | { | |||
---|---|---|---|---|---|
97 | 97 | | |||
98 | 98 | | |||
99 | // The numbers that follow were picked by experimentation to try to get | 99 | // The numbers that follow were picked by experimentation to try to get | ||
100 | // an effect linearly proportional to <strength> and at the same time, | 100 | // an effect linearly proportional to <strength> and at the same time, | ||
101 | // be fast enough. | 101 | // be fast enough. | ||
102 | // | 102 | // | ||
103 | // I still have no idea what "radius" and "sigma" mean. | 103 | // I still have no idea what "radius" and "sigma" mean. | ||
104 | 104 | | |||
105 | const double RadiusMin = .1; | 105 | const double RadiusMin = 0.1; | ||
106 | const double RadiusMax = 2.5; | 106 | const double RadiusMax = 2.5; | ||
107 | const double radius = RadiusMin + | 107 | const double radius = RadiusMin + | ||
108 | (strength - 1) * | 108 | (strength - 1) * | ||
109 | (RadiusMax - RadiusMin) / | 109 | (RadiusMax - RadiusMin) / | ||
110 | (kpEffectBlurSharpen::MaxStrength - 1); | 110 | (kpEffectBlurSharpen::MaxStrength - 1); | ||
111 | 111 | | |||
112 | const double SigmaMin = .5; | 112 | const double SigmaMin = 0.5; | ||
113 | const double SigmaMax = 3.0; | 113 | const double SigmaMax = 3.0; | ||
114 | const double sigma = SigmaMin + | 114 | const double sigma = SigmaMin + | ||
115 | (strength - 1) * | 115 | (strength - 1) * | ||
116 | (SigmaMax - SigmaMin) / | 116 | (SigmaMax - SigmaMin) / | ||
117 | (kpEffectBlurSharpen::MaxStrength - 1); | 117 | (kpEffectBlurSharpen::MaxStrength - 1); | ||
118 | 118 | | |||
119 | const double RepeatMin = 1; | 119 | const double RepeatMin = 1; | ||
120 | const double RepeatMax = 2; | 120 | const double RepeatMax = 2; | ||
121 | const double repeat = qRound (RepeatMin + | 121 | const double repeat = qRound (RepeatMin + | ||
122 | (strength - 1) * | 122 | (strength - 1) * | ||
123 | (RepeatMax - RepeatMin) / | 123 | (RepeatMax - RepeatMin) / | ||
124 | (kpEffectBlurSharpen::MaxStrength - 1)); | 124 | (kpEffectBlurSharpen::MaxStrength - 1)); | ||
125 | 125 | | |||
126 | // I guess these values are more proper as they use an auto-calculated | 126 | // I guess these values are more proper as they use an auto-calculated | ||
127 | // radius but they cause sharpen() to be too slow. | 127 | // radius but they cause sharpen() to be too slow. | ||
128 | #if 0 | 128 | #if 0 | ||
129 | const double radius = 0/*auto-calculate*/; | 129 | const double radius = 0/*auto-calculate*/; | ||
130 | 130 | | |||
131 | const double SigmaMin = .6; | 131 | const double SigmaMin = 0.6; | ||
132 | const double SigmaMax = 1.0; | 132 | const double SigmaMax = 1.0; | ||
133 | const double sigma = SigmaMin + | 133 | const double sigma = SigmaMin + | ||
134 | (strength - 1) * | 134 | (strength - 1) * | ||
135 | (SigmaMax - SigmaMin) / | 135 | (SigmaMax - SigmaMin) / | ||
136 | (kpEffectBlurSharpen::MaxStrength - 1); | 136 | (kpEffectBlurSharpen::MaxStrength - 1); | ||
137 | 137 | | |||
138 | const double RepeatMin = 1; | 138 | const double RepeatMin = 1; | ||
139 | const double RepeatMax = 3; | 139 | const double RepeatMax = 3; | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |