aboutsummaryrefslogtreecommitdiff
path: root/skelft_core.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-02-02 17:58:30 -0200
committerSamuel Fadel <samuelfadel@gmail.com>2016-02-02 17:58:30 -0200
commit28f8ac15898f029e86ab7cb01f41964ac7997538 (patch)
treee4cbfae3d7ec2977f877812a1da62287f7253091 /skelft_core.cpp
parentdc50effe61c833da9c15b886d5ebba65620b99f0 (diff)
Changes to make code more portable across different compilers.
Diffstat (limited to 'skelft_core.cpp')
-rw-r--r--skelft_core.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/skelft_core.cpp b/skelft_core.cpp
index e4cec20..3b85fb0 100644
--- a/skelft_core.cpp
+++ b/skelft_core.cpp
@@ -1,3 +1,4 @@
+#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <cstring>
@@ -31,8 +32,8 @@ int skelft2DSize(int nx, int ny) {
pow(2.0f, int(log(float(nx)) / log(2.0f) +
1))); // Find minimal pow of 2 which fits the input image
int dy = (int) floor(pow(2.0f, int(log(float(ny)) / log(2.0f) + 1)));
- int fboSize = max(dx, dy); // DT/FT/skeleton image size (pow of 2, should be
- // able to contain the input image)
+ int fboSize = std::max(dx, dy); // DT/FT/skeleton img size (pow of 2, should
+ // be able to contain the input image)
return fboSize;
}
@@ -184,7 +185,7 @@ void skelft2DSave(short *outputFT, int dx, int dy, const char *f) {
int size = dx * dy;
int bb = 0;
- float range = max(dx, dy) / 255.0f;
+ float range = std::max(dx, dy) / 255.0f;
for (short *v = outputFT, *vend = outputFT + size; v < vend; ++v) {
short val = *v;
buf[bb++] = (unsigned char) (val / range);