1
可以说我有一个int[][] arrayA
和一个int[][] arrayB
。在这个数组中的任何给定坐标都有一个RGB值。我想要做的是将arrayA
和array
2的RGB值合并成一个新的数组,newArray
,使用加权平均法。阵列RGB操作
所以我在做什么,从这样每个RGB值提取红色,绿色和蓝色值:
curColA=RGB //suppose RGB is just the RGB in any given point
int curRedA = (curCol >> 16) & 0xFF;
int curGreenA = (curCol >> 8) & 0xFF;
int curBlueA= curCol & 0xFF;
我做同样的arrayB,现在我想将它们合并。这是我遇到麻烦的地方。我只是做newRed=(curRedA+curRedB)/2
还是有其他方式来做到这一点?
arrayA values: { { 0, 0x44, 0x5500, 0x660000 } };
arrayB values: { { 2, 4, 6, 8 } };
newArray expected values: { 0, 0x44, 6, 0x660000 } };
什么是redWeight等于? – Snowman 2010-10-06 06:13:38
@fprime - 我不确定。按照我理解的方式,使用加权平均值的想法似乎不符合您的预期输出。 – sje397 2010-10-06 06:20:29