Stoitcho Goutsev (100) wrote:

Mark,

Color matrices work in the same way as transformation matrices. Color

matrices works on the same way as transformation matrices with the

difference that they apply on color vectors [RGBAw] where w = 1.

In the docs you can see that the vector the trasnformations are applied on

is ARGB. I believe it was an error in the docs for .NET1.x (only with this I

could explain the unexpected results that I got using ARGB verctor. I

believe the vector is [RGBAw] rather than [ARGBw]. I see that this part of

the docs stay unchanged for .NET 2.0. Since I haven't use them for a long

time I don't know if they changed something there. I doubt it however

because it could've been a compatibility issue.

But this is a 5x5 matrix, im guessing 3 are RGB, no idea what eveything

else does.

as I said 4th is for the transparency and fifth is always 1 to homogenize

the coordinate system.

Using homogenous coordinates also means that *translations* can be done

in the same system. It helps to know a little about the use of matrices

to represent geometric transformations here, because basically we are

doing exactly the same thing, except that our 'axes' are R G B A

instead of X Y Z.

In 3d space, if we just use 3x3 matrices, the only transformations we

can represent are *linear* - that is, T(a+b) = T(a) + T(b), and by

implication, T(0) = 0 for all transformations T. With this model we can

have rotations, reflections, and skew/shears - but the origin will

always stay in the same place. It would be nice to be able to represent

translations in the same model. We do this with that extra homogenizing

coordinate. Suppose we let

T = 1 0 0 0 / 0 1 0 0 / 0 0 1 0 / a b c 1

We can see that P = (x y z 1)(transpose) will give us TP = (x+a y+b z+c

1), which is the translation we desired. This can of course be combined

with any linear operation in the top left 3x3 of T.

Thus in color space we can implement 'translations' such as adding 0.2

R to the whole color space.

--

Larry Lard

Replies to group please