Example #1
0
        public void Transform(ColorTransformMatrix matrix)
        {
            decimal c1 = Component1;
            decimal c2 = Component2;
            decimal c3 = Component3;

            Component1 = matrix.M11 * c1 + matrix.M12 * c2 + matrix.M13 * c3;
            Component2 = matrix.M21 * c1 + matrix.M22 * c2 + matrix.M23 * c3;
            Component3 = matrix.M31 * c1 + matrix.M32 * c2 + matrix.M33 * c3;
        }
Example #2
0
        public void Transform(ColorTransformMatrix matrix)
        {
            decimal m11 = matrix.M11;
            decimal m12 = matrix.M12;
            decimal m13 = matrix.M13;
            decimal m21 = matrix.M21;
            decimal m22 = matrix.M22;
            decimal m23 = matrix.M23;
            decimal m31 = matrix.M31;
            decimal m32 = matrix.M32;
            decimal m33 = matrix.M33;

            decimal c1 = M11;
            decimal c2 = M21;
            decimal c3 = M31;

            M11 = m11 * c1 + m12 * c2 + m13 * c3;
            M21 = m21 * c1 + m22 * c2 + m23 * c3;
            M31 = m31 * c1 + m32 * c2 + m33 * c3;

            c1 = M12;
            c2 = M22;
            c3 = M32;

            M12 = m11 * c1 + m12 * c2 + m13 * c3;
            M22 = m21 * c1 + m22 * c2 + m23 * c3;
            M32 = m31 * c1 + m32 * c2 + m33 * c3;

            c1 = M13;
            c2 = M23;
            c3 = M33;

            M13 = m11 * c1 + m12 * c2 + m13 * c3;
            M23 = m21 * c1 + m22 * c2 + m23 * c3;
            M33 = m31 * c1 + m32 * c2 + m33 * c3;
        }