本文整理汇总了C#中Matrix3.Inverted方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix3.Inverted方法的具体用法?C# Matrix3.Inverted怎么用?C# Matrix3.Inverted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3
的用法示例。
在下文中一共展示了Matrix3.Inverted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRGBtoXYZTransformationMatrix
/// <summary>
/// This method is required to compute the transformation matrix to convert RGB to XYZ in dependency of the used white point and RR, GG, BB points
/// </summary>
/// <author>Markus Strobel</author>
/// <returns>returns the 3x3 Matrix for Compute RGB to XYZ</returns>
private static Matrix3 GetRGBtoXYZTransformationMatrix()
{
// Quelle: http://www.ryanjuckett.com/programming/rgb-color-space-conversion/
Vector3 rr = new Vector3(RR_used.X, RR_used.Y, RR_used.Z);
Vector3 gg = new Vector3(GG_used.X, GG_used.Y, GG_used.Z);
Vector3 bb = new Vector3(BB_used.X, BB_used.Y, BB_used.Z);
// Rx Gx Bx
// Ry Gy By
// Rz Gz Bz
Matrix3 M = new Matrix3(rr, gg, bb);
M.Transpose(); // M
Matrix3 MInv = M.Inverted(); // M^-1
//Vector3 WP_XYZ_used = new Vector3(WP_used.X / WP_used.Y, 1, WP_used.Z / WP_used.Y); // WP_xyz to WP_XYZ
Vector3 WP_XYZ_used = new Vector3(WP_used.X, WP_used.Y, WP_used.Z);
WP_XYZ_used.X = Reverse_Gamma_Correction(WP_XYZ_used.X);
WP_XYZ_used.Y = Reverse_Gamma_Correction(WP_XYZ_used.Y);
WP_XYZ_used.Z = Reverse_Gamma_Correction(WP_XYZ_used.Z);
Vector3 temp = new Vector3();
temp.X = MInv.M11 * WP_XYZ_used.X + MInv.M12 * WP_XYZ_used.Y + MInv.M13 * WP_XYZ_used.Z;
temp.Y = MInv.M21 * WP_XYZ_used.X + MInv.M22 * WP_XYZ_used.Y + MInv.M23 * WP_XYZ_used.Z;
temp.Z = MInv.M31 * WP_XYZ_used.X + MInv.M32 * WP_XYZ_used.Y + MInv.M33 * WP_XYZ_used.Z;
M = Matrix3.Mult(M, new Matrix3(temp.X, 0, 0, 0, temp.Y, 0, 0, 0, temp.Z));
return M;
}
示例2: TranformationMatrices_Update
public static void TranformationMatrices_Update()
{
RGBtoXYZTransformation = GetRGBtoXYZTransformationMatrix();
XYZtoRGBTransformation = RGBtoXYZTransformation.Inverted();
}