aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Native
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-11 16:12:53 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-11 16:12:53 +0300
commit009a02d57e244e9a8ed5d70fc0743f10f68f5a33 (patch)
treea4f5ad18650c735310a3d30126dcbcee06d4a02b /Software/Visual_Studio/Native
parentbd49bdcb109a227130d7db6856e659b435d16530 (diff)
downloadTango-009a02d57e244e9a8ed5d70fc0743f10f68f5a33.tar.gz
Tango-009a02d57e244e9a8ed5d70fc0743f10f68f5a33.zip
Done some work on PPC & Color Lab Module.
Diffstat (limited to 'Software/Visual_Studio/Native')
-rw-r--r--Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp
index 7346a9898..68b7e0c93 100644
--- a/Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp
+++ b/Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp
@@ -5,6 +5,7 @@
#include <iostream>
#include <stdio.h>
+#define epsTol 0.05
Interp::Interp(void)
{
}
@@ -26,6 +27,15 @@ void Interp::Eval(double InValue, double &OutValue)
int errType = 0;
ind = -1;
+ //Check Bounds
+ if((InValue<m_xValues[0] - epsTol) || (InValue >m_xValues[m_length - 1] + epsTol))
+ throw std::exception("Value out of Bounds");
+ if ((InValue > m_xValues[0] - epsTol) && (InValue < m_xValues[0]))
+ InValue = m_xValues[0];
+
+ if ((InValue > m_xValues[m_length - 1] ) && (InValue < m_xValues[m_length - 1]+ epsTol))
+ InValue = m_xValues[m_length - 1];
+
for (m = 0; m < m_length - 1; ++m)
{
if (m_xValues[m] <= InValue && m_xValues[m + 1] >= InValue)