Ok so lets say I have an int[][] arrayA
and an int[][] arrayB
. At any given coordinate in this array lies an RGB value. What I want to do is merge the RGB values from arrayA
and array
2 into a new array, newArray
, using a weighted average method.
So what I'm doing is extracting the red, green, and blue values from each RGB value like this:
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;
I do the same for arrayB, and now I want to merge them. Here's where I'm having trouble. Do I just do newRed=(curRedA+curRedB)/2
or is there some other way to do this?
arrayA values: { { 0, 0x44, 0x5500, 0x660000 } };
arrayB values: { { 2, 4, 6, 8 } };
newArray expected values: { 0, 0x44, 6, 0x660000 } };