Unity 垂直翻转位图颜色数据
/// <summary>
/// 垂直翻转位图颜色数据
/// </summary>
private Color[] flipVerticalBitmapColors(Color[] colors,ushort bitmapWidth,ushort bitmapHeight){
Color[] tempColors=new Color[colors.Length];
int i=bitmapHeight;
while(--i>=0){
var sourceStartIndex=i*bitmapWidth;
var destStartIndex=(bitmapHeight-i-1)*bitmapWidth;
Array.Copy(colors,sourceStartIndex,tempColors,destStartIndex,bitmapWidth);
}
return tempColors;
}