From 3d62e748c41555eb0937fae86031a89d415ce139 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 17 Sep 2024 22:19:24 +0200 Subject: [PATCH] Fix warning: unused var and sign comparison --- tutorial/ar/tutorial-panda3d-renderer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tutorial/ar/tutorial-panda3d-renderer.cpp b/tutorial/ar/tutorial-panda3d-renderer.cpp index 39cf1d8aba..c1e734df1b 100644 --- a/tutorial/ar/tutorial-panda3d-renderer.cpp +++ b/tutorial/ar/tutorial-panda3d-renderer.cpp @@ -32,7 +32,7 @@ void displayNormals(const vpImage &normalsImage, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < normalsImage.getSize(); ++i) { + for (int i = 0; i < static_cast(normalsImage.getSize()); ++i) { normalDisplayImage.bitmap[i].R = static_cast((normalsImage.bitmap[i].R + 1.0) * 127.5f); normalDisplayImage.bitmap[i].G = static_cast((normalsImage.bitmap[i].G + 1.0) * 127.5f); normalDisplayImage.bitmap[i].B = static_cast((normalsImage.bitmap[i].B + 1.0) * 127.5f); @@ -48,7 +48,7 @@ void displayDepth(const vpImage &depthImage, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < depthImage.getSize(); ++i) { + for (int i = 0; i < static_cast(depthImage.getSize()); ++i) { float val = std::max(0.f, (depthImage.bitmap[i] - nearV) / (farV - nearV)); depthDisplayImage.bitmap[i] = static_cast(val * 255.f); } @@ -61,7 +61,7 @@ void displayLightDifference(const vpImage &colorImage, const vpImage(colorImage.getSize()); ++i) { float I1 = 0.299 * colorImage.bitmap[i].R + 0.587 * colorImage.bitmap[i].G + 0.114 * colorImage.bitmap[i].B; float I2 = 0.299 * colorDiffuseOnly.bitmap[i].R + 0.587 * colorDiffuseOnly.bitmap[i].G + 0.114 * colorDiffuseOnly.bitmap[i].B; lightDifference.bitmap[i] = static_cast(round(abs(I1 - I2))); @@ -76,7 +76,7 @@ void displayCanny(const vpImage &cannyRawData, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < cannyRawData.getSize(); ++i) { + for (int i = 0; i < static_cast(cannyRawData.getSize()); ++i) { vpRGBf &px = cannyRawData.bitmap[i]; canny.bitmap[i] = 255 * (px.R * px.R + px.G * px.G > 0); //canny.bitmap[i] = static_cast(127.5f + 127.5f * atan(px.B)); @@ -258,10 +258,8 @@ int main(int argc, const char **argv) } renderer.renderFrame(); bool end = false; - bool firstFrame = true; std::vector renderTime, fetchTime, displayTime; while (!end) { - const double beforeComputeBB = vpTime::measureTimeMs(); //! [Updating render parameters] float nearV = 0, farV = 0; geometryRenderer->computeNearAndFarPlanesFromNode(objectName, nearV, farV, true);