// Type == 0 means segment is sampled
private static double EvalSegmentedFn(final cmsToneCurve g, double R)
	{
	    int i;
	    for (i = g.nSegments-1; i >= 0 ; --i)
	    {
	        // Check for domain
	        if ((R > g.Segments[i].x0) && (R <= g.Segments[i].x1))
	        {
	            // Type == 0 means segment is sampled
	            if (g.Segments[i].Type == 0)
	            {
	                float R1 = (float)(R - g.Segments[i].x0);
	                float[] Out = new float[1];
	                // Setup the table (TODO: clean that)
	                g.SegInterp[i].Table = g.Segments[i].SampledPoints;
	                g.SegInterp[i].Interpolation.getFloat().run(new float[]{R1}, Out, g.SegInterp[i]);
	                return Out[0];
	            }
	            else
	            {
	            	return g.Evals[i].run(g.Segments[i].Type, g.Segments[i].Params, R);
	            }
	        }
	    }
	    return MINUS_INF;
	}
if ((R > g.Segments[i].x0) && (R <= g.Segments[i].x1))
{
// Type == 0 means segment is sampled
if (g.Segments[i].Type == 0)
{
private static double EvalSegmentedFn(final cmsToneCurve g, double R)
{
int i;
for (i = g.nSegments-1; i >= 0 ; --i)
{
// Check for domain
if ((R > g.Segments[i].x0) && (R <= g.Segments[i].x1))
{
// Type == 0 means segment is sampled
if (g.Segments[i].Type == 0)
{
float R1 = (float)(R - g.Segments[i].x0);
float[] Out = new float[1];
// Setup the table (TODO: clean that)
g.SegInterp[i].Table = g.Segments[i].SampledPoints;
g.SegInterp[i].Interpolation.getFloat().run(new float[]{R1}, Out, g.SegInterp[i]);
return Out[0];
}
else
private static double EvalSegmentedFn(final cmsToneCurve g, double R)
{
int i;
for (i = g.nSegments-1; i >= 0 ; --i)
{
// Check for domain
if ((R > g.Segments[i].x0) && (R <= g.Segments[i].x1))
{
// Type == 0 means segment is sampled
if (g.Segments[i].Type == 0)
{
float R1 = (float)(R - g.Segments[i].x0);
float[] Out = new float[1];
// Setup the table (TODO: clean that)
g.SegInterp[i].Table = g.Segments[i].SampledPoints;
g.SegInterp[i].Interpolation.getFloat().run(new float[]{R1}, Out, g.SegInterp[i]);
return Out[0];
}
else
{
return g.Evals[i].run(g.Segments[i].Type, g.Segments[i].Params, R);
}
}
}
return MINUS_INF;
}