public static async Task FlipHorizontalAsync(this IColorMatrix sourceColorMatrix) { IColorMatrix me = await sourceColorMatrix.CloneAsync(); for (uint row = 0; row < sourceColorMatrix.Height; row++) { for (uint column = 0; column < sourceColorMatrix.Width; column++) { await sourceColorMatrix.SetItem(row, column, me.ColorItems[row, (sourceColorMatrix.Width - 1) - column]); } } }
public static async Task RotateClockwiseAsync(this IColorMatrix sourceColorMatrix) { IColorMatrix me = await sourceColorMatrix.CloneAsync(); for (uint row = 0; row < sourceColorMatrix.Height; row++) { for (uint column = 0; column < sourceColorMatrix.Width; column++) { await sourceColorMatrix.SetItem(row, column, me.ColorItems[(sourceColorMatrix.Height - 1) - column, row]); } } }