Mercurial > hg > orthanc-stone
diff OrthancStone/Sources/Scene2D/Internals/OpenGLFloatTextureProgram.cpp @ 1571:85e117739eca
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Sep 2020 17:46:39 +0200 |
parents | 244ad1e4e76a |
children | 92fca2b3ba3d |
line wrap: on
line diff
--- a/OrthancStone/Sources/Scene2D/Internals/OpenGLFloatTextureProgram.cpp Mon Sep 21 14:50:26 2020 +0200 +++ b/OrthancStone/Sources/Scene2D/Internals/OpenGLFloatTextureProgram.cpp Mon Sep 21 17:46:39 2020 +0200 @@ -62,12 +62,12 @@ namespace Internals { OpenGLFloatTextureProgram::Data::Data( - OpenGL::IOpenGLContext& context - , const Orthanc::ImageAccessor& texture - , bool isLinearInterpolation) - : texture_(context) - , offset_(0.0f) - , slope_(0.0f) + OpenGL::IOpenGLContext& context, + const Orthanc::ImageAccessor& texture, + bool isLinearInterpolation) : + texture_(context), + offset_(0.0f), + slope_(0.0f) { if (texture.GetFormat() != Orthanc::PixelFormat_Float32) { @@ -107,17 +107,17 @@ * <=> texture = (value - offset) / slope **/ - float texture = (*p - offset_) / slope_; - if (texture < 0) + float value = (*p - offset_) / slope_; + if (value < 0) { - texture = 0; + value = 0; } - else if (texture >= 65535.0f) + else if (value >= 65535.0f) { - texture = 65535.0f; + value = 65535.0f; } - uint16_t t = static_cast<uint16_t>(texture); + uint16_t t = static_cast<uint16_t>(value); q[0] = t / 256; // red q[1] = t % 256; // green