public double[,] CreateTransformationMatrix() { // создаем единичную матрицу 2х2 double[,] matrix = Matrices.CreateIdentityMatrix(2); matrix[0, 0] += HorizontalStretch; matrix[1, 1] += VerticalStretch; return(matrix); }
/// /// Объединяет преобразования в единую матрицу трансформации /// private static double[,] CreateTransformationMatrix (IImageTransformation[] vectorTransformations, int dimensions) { double[,] vectorTransMatrix = Matrices.CreateIdentityMatrix(dimensions); // перемножает матрицы трансформации foreach (var trans in vectorTransformations) { vectorTransMatrix = Matrices.Multiply(vectorTransMatrix, trans.CreateTransformationMatrix()); } return(vectorTransMatrix); }
public double[,] CreateTransformationMatrix() { // создаем единичную матрицу 2х2 double[,] matrix = Matrices.CreateIdentityMatrix(2); if (FlipHorizontally) { matrix[0, 0] *= -1; } if (FlipVertically) { matrix[1, 1] *= -1; } return(matrix); }