这是我遇到问题的代码。我需要能够阻止数组超过值 255。我坚持应该如何构造这个 if 语句.. 帮助会很棒..
public short[][] Brighten(short[][] original){
short[][] result1 = new short[original.length][original[0].length];
for(int i =0;i< result1.length; ++i){
for(int j = 0;j<result1[0].length;++j){
result1[i][j] = (short) (20 + original[i][j]);
//work on this if statement
if (original[i][j]> 255){
result1[i][j] = (short)(20 - original[i][j]);
}
}
}
return result1;
}