各位好
我是objective-c 初学者
想请各位翻译一下这段
谢谢
=======================
main (){
int width = 100;
int height=100;
byte[] rawData = new byte[width*height*4];
int byteIndex = 0;
for(int x=0; x<width;x++)
{
for(int y=0;y<height;y++)
{
run(ref rawData, x, y, byteIndex)
byteIndex += 4;
}
}
}
void run(ref byte[] _rawData,int _x, int _y, int _byteIndex)
{
int outputColor =
(rawData[byteIndex] + rawData[byteIndex+1] + rawData[byteIndex+2]) / 3;
rawData[byteIndex] = (char) (outputColor);
rawData[byteIndex+1] = (char) (outputColor);
rawData[byteIndex+2] = (char) (outputColor);
}