1.9w+
社区成员
void Gettexturefun(CImage image,double xf[])
{
if (image == null)
{
return;
}
int i,j;
int nWidth = image.GetWidth();
int nHeight = image.GetHeight();
int k;
k=0;
int source[][] = new int [nWidth*2][nHeight*2];
double a[101][101];
for (i = 1; i < nWidth-1; i++)
{
for (j = 1; j < nHeight-1; j++)
{
int rr = 0, gg = 0, bb = 0;
long clr = image.GetPixel( i, j);
rr=GetRValue(clr); //这个函数Java如果没有要加
gg=GetGValue(clr);
bb= GetBValue(clr);
source[i][j] = int(0.3*rr+0.59*gg+0.11*bb); //这行不确定能不能强制类型转换
}
}
for (i=0;i <50;i++)
{
for (j=0;j <50;j++)
{
if (i==j)
{
a[i][j] = PXY(i,j,source,nWidth,nHeight);
}
}
}
for (i=1;i <50;i++)
{
for(j=1;j <50;j++)
{
if (i==j)
{
xf[k]= a[i][j]-a[0][0];
k=k+1;
}
}
}
}