From 28f8ac15898f029e86ab7cb01f41964ac7997538 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 2 Feb 2016 17:58:30 -0200 Subject: Changes to make code more portable across different compilers. --- skelft_core.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'skelft_core.cpp') 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 #include #include #include @@ -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); -- cgit v1.2.3