From ed7087bf6bf16753b8e71a3836864b829585f30a Mon Sep 17 00:00:00 2001 From: Otmane Lahlou <otmane.lahlou@c-s.fr> Date: Tue, 20 Oct 2009 15:44:37 +0200 Subject: [PATCH] ENH : add a case in channel order rendering for image with at least 4 bands --- .../otbStandardRenderingFunction.h | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Code/Visualization/otbStandardRenderingFunction.h b/Code/Visualization/otbStandardRenderingFunction.h index f2a73a1c90..de34421eb6 100644 --- a/Code/Visualization/otbStandardRenderingFunction.h +++ b/Code/Visualization/otbStandardRenderingFunction.h @@ -181,12 +181,22 @@ public: //m_PixelRepresentationFunction, now, we may get a better default if (m_PixelRepresentationFunction.IsUsingDefaultParameters()) { - if (this->GetListSample()->GetMeasurementVectorSize() >=3) - { - m_PixelRepresentationFunction.SetRedChannelIndex(0); - m_PixelRepresentationFunction.SetGreenChannelIndex(1); - m_PixelRepresentationFunction.SetBlueChannelIndex(2); - } + // Case of image with 4 bands or more : Display in the B,G,R ,NIR channel order + if (this->GetListSample()->GetMeasurementVectorSize() >=4) + { + m_PixelRepresentationFunction.SetRedChannelIndex(2); + m_PixelRepresentationFunction.SetGreenChannelIndex(1); + m_PixelRepresentationFunction.SetBlueChannelIndex(0); + } + + // Classic case + if (this->GetListSample()->GetMeasurementVectorSize() ==3) + { + m_PixelRepresentationFunction.SetRedChannelIndex(0); + m_PixelRepresentationFunction.SetGreenChannelIndex(1); + m_PixelRepresentationFunction.SetBlueChannelIndex(2); + } + } } if(m_AutoMinMax) -- GitLab