.
This commit is contained in:
parent
473aa90a14
commit
82ca023f6b
1 changed files with 1 additions and 1 deletions
|
@ -27484,7 +27484,7 @@ namespace cimg_library_suffixed {
|
||||||
case 2 : { // Salt & Pepper noise
|
case 2 : { // Salt & Pepper noise
|
||||||
if (nsigma<0) nsigma = -nsigma;
|
if (nsigma<0) nsigma = -nsigma;
|
||||||
if (M==m) {
|
if (M==m) {
|
||||||
if (cimg::type<T>::is_float()) { m = (Tfloat)0; M = (Tfloat)1; }
|
if (cimg::type<T>::is_float()) { --m; ++M; }
|
||||||
else { m = (Tfloat)cimg::type<T>::min(); M = (Tfloat)cimg::type<T>::max(); }
|
else { m = (Tfloat)cimg::type<T>::min(); M = (Tfloat)cimg::type<T>::max(); }
|
||||||
}
|
}
|
||||||
cimg_rof(*this,ptrd,T) if (cimg::rand(100)<nsigma) *ptrd = (T)(cimg::rand()<0.5?M:m);
|
cimg_rof(*this,ptrd,T) if (cimg::rand(100)<nsigma) *ptrd = (T)(cimg::rand()<0.5?M:m);
|
||||||
|
|
Loading…
Reference in a new issue