[MATRIX] bug fix. If you #include <dlib/matrix.h> in a header file you might get a compiler error saying ambiguous call to max(). This commit fixes that. (#2287)

Co-authored-by: pf <pf@pf-ubuntu-dev>
This commit is contained in:
pfeatherstone 2021-01-18 13:58:30 +00:00 committed by GitHub
parent 22007f6665
commit 1516cf31c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1009,9 +1009,9 @@ namespace dlib
}
//clamping
c2.l = max(0.0, (116.0 * var_Y) - 16);
c2.a = max(-128.0, min(127.0, 500.0 * (var_X - var_Y)));
c2.b = max(-128.0, min(127.0, 200.0 * (var_Y - var_Z)));
c2.l = std::max(0.0, (116.0 * var_Y) - 16);
c2.a = std::max(-128.0, std::min(127.0, 500.0 * (var_X - var_Y)));
c2.b = std::max(-128.0, std::min(127.0, 200.0 * (var_Y - var_Z)));
return c2;
}
@ -1080,9 +1080,9 @@ namespace dlib
}
// clamping
c2.r = max(0.0, min(1.0, var_R));
c2.g = max(0.0, min(1.0, var_G));
c2.b = max(0.0, min(1.0, var_B));
c2.r = std::max(0.0, std::min(1.0, var_R));
c2.g = std::max(0.0, std::min(1.0, var_G));
c2.b = std::max(0.0, std::min(1.0, var_B));
return (c2);
}