本文整理匯總了C#中ZXing.Common.BitMatrix.getRow方法的典型用法代碼示例。如果您正苦於以下問題:C# BitMatrix.getRow方法的具體用法?C# BitMatrix.getRow怎麽用?C# BitMatrix.getRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ZXing.Common.BitMatrix
的用法示例。
在下文中一共展示了BitMatrix.getRow方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: xor
/// <summary>
/// Exclusive-or (XOR): Flip the bit in this {@code BitMatrix} if the corresponding
/// mask bit is set.
/// </summary>
/// <param name="mask">The mask.</param>
public void xor(BitMatrix mask)
{
if (width != mask.Width || height != mask.Height
|| rowSize != mask.RowSize)
{
throw new ArgumentException("input matrix dimensions do not match");
}
var rowArray = new BitArray(width / 32 + 1);
for (int y = 0; y < height; y++)
{
int offset = y * rowSize;
int[] row = mask.getRow(y, rowArray).Array;
for (int x = 0; x < rowSize; x++)
{
bits[offset + x] ^= row[x];
}
}
}
示例2: rotate180
// The following could go to the BitMatrix class (maybe in a more efficient version using the BitMatrix internal
// data structures)
/// <summary>
/// Rotate180s the specified bit matrix.
/// </summary>
/// <param name="bitMatrix">bit matrix to rotate</param>
internal static void rotate180(BitMatrix bitMatrix)
{
int width = bitMatrix.Width;
int height = bitMatrix.Height;
BitArray firstRowBitArray = new BitArray(width);
BitArray secondRowBitArray = new BitArray(width);
BitArray tmpBitArray = new BitArray(width);
for (int y = 0; y < height + 1 >> 1; y++)
{
firstRowBitArray = bitMatrix.getRow(y, firstRowBitArray);
bitMatrix.setRow(y, mirror(bitMatrix.getRow(height - 1 - y, secondRowBitArray), tmpBitArray));
bitMatrix.setRow(height - 1 - y, mirror(firstRowBitArray, tmpBitArray));
}
}