Example #1
0
void splint2(double *x1a,double *x2a,double *ya,double *y2a,int32 m,int32 n,double x2,double *x1,int32 nx1,double *y)
{
double *y1temp;
double *yy1temp;
double *y2temp;
double *yy2temp;
int i,j,k;



y2temp = new double[m];
yy2temp = new double[m];


for (i=0; i<m; i++)
	{
	splint_0(x2a,ya+i*n,y2a+i*n,n,x2,yy2temp + i);
	}
spline_0(x1a,yy2temp,m,1.0e30,1.0e30,y2temp);
for (k=0; k<nx1; k++)
	{
	splint_0(x1a,yy2temp,y2temp,m,x1[k],y+k);
	}
	

delete y2temp;
delete yy2temp;
} 
Example #2
0
// covert a single value
double LinearData::CnvtLinearInv(double data,int32 ch)
{
double temp;

if (y2 == 0L) return data;

if (sizes[ch] < 18) splint_0(curves[ch],values[ch],y3[ch],sizes[ch],data,&temp);
else piceLin_0(curves[ch],values[ch],y3[ch],sizes[ch],data,&temp);

return temp;
}
Example #3
0
// convert values to linear values
McoStatus LinearData::CnvtLinear(double *data, int32 num, int32 ch)
{
int i;

if (y2 == 0L) return MCO_OBJECT_NOT_INITIALIZED;

for (i=0; i<num; i++)
	{
	if (sizes[ch] < 18) splint_0(values[ch],curves[ch],y2[ch],sizes[ch],data[i],&data[i]);
	else piceLin_0(values[ch],curves[ch],y2[ch],sizes[ch],data[i],&data[i]);
	}
return MCO_SUCCESS;
}
Example #4
0
//save to input black table when window is closed
McoStatus	PrinterType::setblack(McoHandle blacktableH)
{
	short 	i;
	double *black;
	double *y2_hands;
	double ypn;
	
	y2_hands = new double[num_hands];
	
	black = (double*)McoLockHandle(blacktableH);
	
	ypn=(y_hands[num_hands-1]-y_hands[num_hands-2])/
		(x_hands[num_hands-1]-x_hands[num_hands-2]);
	
	spline_0(x_hands,y_hands,num_hands,1E30,1E30,y2_hands);
//L to Black table	
	for( i = 0; i <= 100; i++)
		splint_0(x_hands,y_hands,y2_hands,num_hands,i, black+i);

//fix on 8/23
//clipping the _yd_points which on the left of letfmost hand
//to the value of the leftmost hand
//on the right of rightmost hand to the value of the rightmost hand
	for( i = 0; i <= 100; i++){
		if( i <= x_hands[0] ) //left of the leftmost hand
			black[i] = y_hands[0];
		if( i >= x_hands[num_hands-1] ) //left of the leftmost hand
			black[i] = y_hands[num_hands-1];
	}

//clipping the table and normaliz to 1
	for( i = 0; i <= 100; i++){
		if(black[i] < 0)
			black[i] = 0;
		else if(black[i] > 100)
			black[i] = 1.0;
		else
			black[i] /= 100.0;
	}

				
	McoUnlockHandle(blacktableH);
	
	delete y2_hands;
	
	return MCO_SUCCESS;
}