M
Mark Ingram
Right, ive got the following array with which to setup a color matrix.
bm[0][0] = 1; bm[0][1] = 0; bm[0][2] = 0; bm[0][3] = 0; bm[0][4] = 0;
bm[1][0] = 0; bm[1][1] = 1; bm[1][2] = 0; bm[1][3] = 0; bm[1][4] = 0;
bm[2][0] = 0; bm[2][1] = 0; bm[2][2] = 1; bm[2][3] = 0; bm[2][4] = 0;
bm[3][0] = 0; bm[3][1] = 0; bm[3][2] = 0; bm[3][3] = 1; bm[3][4] = 0;
bm[4][0] = brightness; bm[4][1] = brightness; bm[4][2] = brightness;
bm[4][3] = 0; bm[4][4] = 1;
It basically adjusts the brightness of an image whilst preserving the
transparency of the image. However, if "bm[4][3] = 1;" the transparency
is not preserved and is replaced with white.
What do all the values in the array represent? I understand when you
have a normal matrix it doesnt change anything and looks like:
1 0 0
0 1 0
0 0 1
But this is a 5x5 matrix, im guessing 3 are RGB, no idea what eveything
else does.
Can someone shed some light on this for me?
Thanks,
bm[0][0] = 1; bm[0][1] = 0; bm[0][2] = 0; bm[0][3] = 0; bm[0][4] = 0;
bm[1][0] = 0; bm[1][1] = 1; bm[1][2] = 0; bm[1][3] = 0; bm[1][4] = 0;
bm[2][0] = 0; bm[2][1] = 0; bm[2][2] = 1; bm[2][3] = 0; bm[2][4] = 0;
bm[3][0] = 0; bm[3][1] = 0; bm[3][2] = 0; bm[3][3] = 1; bm[3][4] = 0;
bm[4][0] = brightness; bm[4][1] = brightness; bm[4][2] = brightness;
bm[4][3] = 0; bm[4][4] = 1;
It basically adjusts the brightness of an image whilst preserving the
transparency of the image. However, if "bm[4][3] = 1;" the transparency
is not preserved and is replaced with white.
What do all the values in the array represent? I understand when you
have a normal matrix it doesnt change anything and looks like:
1 0 0
0 1 0
0 0 1
But this is a 5x5 matrix, im guessing 3 are RGB, no idea what eveything
else does.
Can someone shed some light on this for me?
Thanks,