diff --git a/Code/Visu/otbImageViewerBase.txx b/Code/Visu/otbImageViewerBase.txx index 177eed0a1287edb169d8cbaced7c6b4693a147d7..5099acc6c903189fe542bec177fd4f71ee4b5790 100644 --- a/Code/Visu/otbImageViewerBase.txx +++ b/Code/Visu/otbImageViewerBase.txx @@ -119,7 +119,7 @@ namespace otb PixelType pixel = it.Get(); for(unsigned int i = 0;i<m_InputImage->GetNumberOfComponentsPerPixel();++i) { - sl->GetNthElement(0)->PushBack(vcl_sqrt(pixel[m_RedChannelIndex]*pixel[m_RedChannelIndex]+pixel[m_GreenChannelIndex]*pixel[m_GreenChannelIndex])); + sl->GetNthElement(0)->PushBack(vcl_sqrt(static_cast<double>(pixel[m_RedChannelIndex]*pixel[m_RedChannelIndex]+pixel[m_GreenChannelIndex]*pixel[m_GreenChannelIndex]))); } ++it; } @@ -132,7 +132,7 @@ namespace otb PixelType pixel = it.Get(); for(unsigned int i = 0;i<m_InputImage->GetNumberOfComponentsPerPixel();++i) { - sl->GetNthElement(0)->PushBack(vcl_atan2(pixel[m_RedChannelIndex],pixel[m_GreenChannelIndex])); + sl->GetNthElement(0)->PushBack(vcl_atan2(static_cast<double>(pixel[m_RedChannelIndex]),static_cast<double>(pixel[m_GreenChannelIndex]))); } ++it; } diff --git a/Code/Visu/otbImageWidgetBase.txx b/Code/Visu/otbImageWidgetBase.txx index aedfaf5a4149a380e00c13eda9b25a667af4e5c7..61dcb46e9ae5e149661016fb0f3c6dabac387529 100644 --- a/Code/Visu/otbImageWidgetBase.txx +++ b/Code/Visu/otbImageWidgetBase.txx @@ -398,8 +398,8 @@ ImageWidgetBase<TPixel> } case COMPLEX_MODULUS: { - unsigned char modulus = Normalize(static_cast<PixelType>(vcl_sqrt(it.Get()[m_RedChannelIndex]*it.Get()[m_RedChannelIndex] - +it.Get()[m_GreenChannelIndex]*it.Get()[m_GreenChannelIndex])),0); + unsigned char modulus = Normalize(static_cast<PixelType>(vcl_sqrt(static_cast<double>(it.Get()[m_RedChannelIndex]*it.Get()[m_RedChannelIndex] + +it.Get()[m_GreenChannelIndex]*it.Get()[m_GreenChannelIndex]))),0); m_OpenGlBuffer[index] = modulus; m_OpenGlBuffer[index+1] = modulus; m_OpenGlBuffer[index+2] = modulus; @@ -409,7 +409,7 @@ ImageWidgetBase<TPixel> } case COMPLEX_PHASE: { - unsigned char phase = Normalize(static_cast<PixelType>(vcl_atan2(it.Get()[m_RedChannelIndex],it.Get()[m_GreenChannelIndex])),0); + unsigned char phase = Normalize(static_cast<PixelType>(vcl_atan2(static_cast<double>(it.Get()[m_RedChannelIndex]),static_cast<double>(it.Get()[m_GreenChannelIndex]))),0); m_OpenGlBuffer[index] = phase; m_OpenGlBuffer[index+1] = phase; m_OpenGlBuffer[index+2] = phase;