From ad9054664373711e4ffd78a639045495e9c4bee8 Mon Sep 17 00:00:00 2001 From: moukaddam <mhd.moukaddam@gmail.com> Date: Thu, 20 Jul 2017 18:43:40 +0100 Subject: [PATCH] fixing the return values in Get<Color>AtCoordinate functions --- NPLib/Core/NPImage.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NPLib/Core/NPImage.cxx b/NPLib/Core/NPImage.cxx index a51974927..6fb97b49f 100644 --- a/NPLib/Core/NPImage.cxx +++ b/NPLib/Core/NPImage.cxx @@ -70,7 +70,7 @@ void NPL::Image::Print(double scale){ m_Height = m_Image->GetHeight(); for(unsigned int i = 0 ; i < m_Width ; i++){ for(unsigned int j = 0 ; j < m_Height ; j++){ - unsigned int index = i*m_Width+j; + unsigned int index = i*m_Width+j; // unsigned int index = i*m_Width+j; unsigned int b = GetBlueAtPixel(i,j); unsigned int g = GetGreenAtPixel(i,j); unsigned int r = GetRedAtPixel(i,j); @@ -106,19 +106,19 @@ unsigned int NPL::Image::GetRedAtCoordinate(double x, double y){ unsigned int NPL::Image::GetGreenAtCoordinate(double x, double y){ unsigned int xp = x/m_Xscaling+m_Width/2 ; unsigned int yp = y/m_Yscaling+m_Height/2 ; - return GetRedAtPixel(xp,yp); + return GetGreenAtPixel(xp,yp); } //////////////////////////////////////////////////////////////////////////////// unsigned int NPL::Image::GetBlueAtCoordinate(double x, double y){ unsigned int xp = x/m_Xscaling+m_Width/2 ; unsigned int yp = y/m_Yscaling+m_Height/2 ; - return GetRedAtPixel(xp,yp); + return GetBlueAtPixel(xp,yp); } //////////////////////////////////////////////////////////////////////////////// unsigned int NPL::Image::GetAlphaAtCoordinate(double x, double y){ unsigned int xp = x/m_Xscaling+m_Width/2 ; unsigned int yp = y/m_Yscaling+m_Height/2 ; - return GetRedAtPixel(xp,yp); + return GetAlphaAtPixel(xp,yp); } //////////////////////////////////////////////////////////////////////////////// unsigned int NPL::Image::GetPixelAtCoordinate(double x, double y){ @@ -130,7 +130,7 @@ unsigned int NPL::Image::GetPixelAtCoordinate(double x, double y){ //////////////////////////////////////////////////////////////////////////////// unsigned int NPL::Image::PixelToIndex(unsigned int x, unsigned int y){ - unsigned int index = x*m_Width+y; + unsigned int index = x*m_Width+y; //unsigned int index = x*m_Width+y; if(index>m_Width*m_Height)// possible because of rounding index = m_Width*m_Height-1; return index; -- GitLab