当前位置: 首页>>代码示例>>Java>>正文


Java ByteMatrix.getHeight方法代码示例

本文整理汇总了Java中com.google.zxing.qrcode.encoder.ByteMatrix.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java ByteMatrix.getHeight方法的具体用法?Java ByteMatrix.getHeight怎么用?Java ByteMatrix.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.zxing.qrcode.encoder.ByteMatrix的用法示例。


在下文中一共展示了ByteMatrix.getHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertByteMatrixToBitMatrix

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
/**
 * Convert the ByteMatrix to BitMatrix.
 *
 * @param matrix The input matrix.
 * @return The output matrix.
 */
private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix) {
  int matrixWidgth = matrix.getWidth();
  int matrixHeight = matrix.getHeight();

  BitMatrix output = new BitMatrix(matrixWidgth, matrixHeight);
  output.clear();
  for (int i = 0; i < matrixWidgth; i++) {
    for (int j = 0; j < matrixHeight; j++) {
      // Zero is white in the bytematrix
      if (matrix.get(i, j) == 1) {
        output.set(i, j);
      }
    }
  }

  return output;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:24,代码来源:DataMatrixWriter.java

示例2: convertByteMatrixToBitMatrix

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
/**
 * Convert the ByteMatrix to BitMatrix.
 *
 * @param matrix The input matrix.
 * @return The output matrix.
 */
private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix) {
    int matrixWidgth = matrix.getWidth();
    int matrixHeight = matrix.getHeight();

    BitMatrix output = new BitMatrix(matrixWidgth, matrixHeight);
    output.clear();
    for (int i = 0; i < matrixWidgth; i++) {
        for (int j = 0; j < matrixHeight; j++) {
            // Zero is white in the bytematrix
            if (matrix.get(i, j) == 1) {
                output.set(i, j);
            }
        }
    }

    return output;
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:24,代码来源:DataMatrixWriter.java

示例3: convertByteMatrixToBitMatrix

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
/**
 * Convert the ByteMatrix to BitMatrix.
 * 
 * @param matrix
 *            The input matrix.
 * @return The output matrix.
 */
private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix) {
	int matrixWidgth = matrix.getWidth();
	int matrixHeight = matrix.getHeight();

	BitMatrix output = new BitMatrix(matrixWidgth, matrixHeight);
	output.clear();
	for (int i = 0; i < matrixWidgth; i++) {
		for (int j = 0; j < matrixHeight; j++) {
			// Zero is white in the bytematrix
			if (matrix.get(i, j) == 1) {
				output.set(i, j);
			}
		}
	}

	return output;
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:25,代码来源:DataMatrixWriter.java

示例4: renderResult

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix renderResult(QRCode code, int width, int height, int quietZone) {
  ByteMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int qrWidth = inputWidth + (quietZone * 2);
  int qrHeight = inputHeight + (quietZone * 2);
  int outputWidth = Math.max(width, qrWidth);
  int outputHeight = Math.max(height, qrHeight);

  int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
  // Padding includes both the quiet zone and the extra white pixels to accommodate the requested
  // dimensions. For example, if input is 25x25 the QR will be 33x33 including the quiet zone.
  // If the requested size is 200x160, the multiple will be 4, for a QR of 132x132. These will
  // handle all the padding from 100x100 (the actual QR) up to 200x160.
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY) == 1) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }

  return output;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:34,代码来源:QRCodeWriter.java

示例5: renderResult

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix renderResult(QRCode code, int width, int height, int quietZone) {
    ByteMatrix input = code.getMatrix();
    if (input == null) {
        throw new IllegalStateException();
    }
    int inputWidth = input.getWidth();
    int inputHeight = input.getHeight();
    int qrWidth = inputWidth + (quietZone << 1);
    int qrHeight = inputHeight + (quietZone << 1);
    int outputWidth = Math.max(width, qrWidth);
    int outputHeight = Math.max(height, qrHeight);
    int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
    int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
    int topPadding = (outputHeight - (inputHeight * multiple)) / 2;
    BitMatrix output = new BitMatrix(outputWidth, outputHeight);
    int inputY = 0;
    int outputY = topPadding;
    while (inputY < inputHeight) {
        int inputX = 0;
        int outputX = leftPadding;
        while (inputX < inputWidth) {
            if (input.get(inputX, inputY) == (byte) 1) {
                output.setRegion(outputX, outputY, multiple, multiple);
            }
            inputX++;
            outputX += multiple;
        }
        inputY++;
        outputY += multiple;
    }
    return output;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:33,代码来源:QRCodeWriter.java

示例6: renderResult

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix renderResult(QRCode code, int width, int height, int quietZone) {
    ByteMatrix input = code.getMatrix();
    if (input == null) {
        throw new IllegalStateException();
    }
    int inputWidth = input.getWidth();
    int inputHeight = input.getHeight();
    int qrWidth = inputWidth + (quietZone * 2);
    int qrHeight = inputHeight + (quietZone * 2);
    int outputWidth = Math.max(width, qrWidth);
    int outputHeight = Math.max(height, qrHeight);
    int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
    int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
    int topPadding = (outputHeight - (inputHeight * multiple)) / 2;
    BitMatrix output = new BitMatrix(outputWidth, outputHeight);
    int inputY = 0;
    int outputY = topPadding;
    while (inputY < inputHeight) {
        int inputX = 0;
        int outputX = leftPadding;
        while (inputX < inputWidth) {
            if (input.get(inputX, inputY) == (byte) 1) {
                output.setRegion(outputX, outputY, multiple, multiple);
            }
            inputX++;
            outputX += multiple;
        }
        inputY++;
        outputY += multiple;
    }
    return output;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:33,代码来源:QRCodeWriter.java

示例7: convertByteMatrixToBitMatrix

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix) {
    int matrixWidgth = matrix.getWidth();
    int matrixHeight = matrix.getHeight();
    BitMatrix output = new BitMatrix(matrixWidgth, matrixHeight);
    output.clear();
    for (int i = 0; i < matrixWidgth; i++) {
        for (int j = 0; j < matrixHeight; j++) {
            if (matrix.get(i, j) == (byte) 1) {
                output.set(i, j);
            }
        }
    }
    return output;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:15,代码来源:DataMatrixWriter.java

示例8: renderResult

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix renderResult(QRCode code, int width, int height, int quietZone) {
    ByteMatrix input = code.getMatrix();
    if (input == null) {
        throw new IllegalStateException();
    }
    int inputWidth = input.getWidth();
    int inputHeight = input.getHeight();
    int qrWidth = inputWidth + (quietZone * 2);
    int qrHeight = inputHeight + (quietZone * 2);
    int outputWidth = Math.max(width, qrWidth);
    int outputHeight = Math.max(height, qrHeight);

    int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
    // Padding includes both the quiet zone and the extra white pixels to accommodate the requested
    // dimensions. For example, if input is 25x25 the QR will be 33x33 including the quiet zone.
    // If the requested size is 200x160, the multiple will be 4, for a QR of 132x132. These will
    // handle all the padding from 100x100 (the actual QR) up to 200x160.
    int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
    int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

    BitMatrix output = new BitMatrix(outputWidth, outputHeight);

    for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
        // Write the contents of this row of the barcode
        for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
            if (input.get(inputX, inputY) == 1) {
                output.setRegion(outputX, outputY, multiple, multiple);
            }
        }
    }

    return output;
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:34,代码来源:QRCodeWriter.java

示例9: renderResult

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix renderResult(QRCode code, int width, int height, int quietZone) {
    ByteMatrix input = code.getMatrix();
    if (input == null) {
        throw new IllegalStateException();
    }
    int inputWidth = input.getWidth();
    int inputHeight = input.getHeight();
    int qrWidth = inputWidth + (quietZone << 1);
    int qrHeight = inputHeight + (quietZone << 1);
    int outputWidth = Math.max(width, qrWidth);
    int outputHeight = Math.max(height, qrHeight);

    int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
    // Padding includes both the quiet zone and the extra white pixels to accommodate the requested
    // dimensions. For example, if input is 25x25 the QR will be 33x33 including the quiet zone.
    // If the requested size is 200x160, the multiple will be 4, for a QR of 132x132. These will
    // handle all the padding from 100x100 (the actual QR) up to 200x160.
    int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
    int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

    BitMatrix output = new BitMatrix(outputWidth, outputHeight);

    for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
        // Write the contents of this row of the barcode
        for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
            if (input.get(inputX, inputY) == 1) {
                output.setRegion(outputX, outputY, multiple, multiple);
            }
        }
    }

    return output;
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:34,代码来源:QRCodeWriter.java

示例10: renderResult

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix renderResult(QRCode code, int width, int height, int quietZone) {
  ByteMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int qrWidth = inputWidth + (quietZone << 1);
  int qrHeight = inputHeight + (quietZone << 1);
  int outputWidth = Math.max(width, qrWidth);
  int outputHeight = Math.max(height, qrHeight);

  int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
  // Padding includes both the quiet zone and the extra white pixels to accommodate the requested
  // dimensions. For example, if input is 25x25 the QR will be 33x33 including the quiet zone.
  // If the requested size is 200x160, the multiple will be 4, for a QR of 132x132. These will
  // handle all the padding from 100x100 (the actual QR) up to 200x160.
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY) == 1) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }

  return output;
}
 
开发者ID:Thinkmill,项目名称:reacteu-app,代码行数:34,代码来源:QRCodeWriter.java

示例11: toBitmap

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
public static Bitmap toBitmap(final QRCode code, final int qrcode_color, final int background_color) {
    final ByteMatrix matrix = code.getMatrix();
    final int SCALE = 4;
    final int height = matrix.getHeight() * SCALE;
    final int width = matrix.getWidth() * SCALE;
    final Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    for (int x = 0; x < width; ++x) {
        for (int y = 0; y < height; ++y) {
            bmp.setPixel(x, y, matrix.get(x / SCALE, y / SCALE) == 1 ? qrcode_color : background_color);
        }
    }
    return bmp;
}
 
开发者ID:RCasatta,项目名称:EternityWallAndroid,代码行数:14,代码来源:QrBitmap.java

示例12: a

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix a(QRCode qrcode, int i, int j)
{
    ByteMatrix bytematrix = qrcode.getMatrix();
    if (bytematrix == null)
    {
        throw new IllegalStateException();
    }
    int k = bytematrix.getWidth();
    int l = bytematrix.getHeight();
    int i1 = k + 8;
    int j1 = l + 8;
    int k1 = Math.max(i, i1);
    int l1 = Math.max(j, j1);
    int i2 = Math.min(k1 / i1, l1 / j1);
    int j2 = (k1 - k * i2) / 2;
    int k2 = (l1 - l * i2) / 2;
    BitMatrix bitmatrix = new BitMatrix(k1, l1);
    int l2 = k2;
    int l3;
    for (int i3 = 0; i3 < l; i3 = l3)
    {
        int j3 = j2;
        for (int k3 = 0; k3 < k;)
        {
            if (bytematrix.get(k3, i3) == 1)
            {
                bitmatrix.setRegion(j3, l2, i2, i2);
            }
            k3++;
            j3 += i2;
        }

        l3 = i3 + 1;
        l2 += i2;
    }

    return bitmatrix;
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:39,代码来源:QRCodeWriter.java

示例13: renderResult

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix renderResult(QRCode code, int width, int height, int quietZone) {
	ByteMatrix input = code.getMatrix();
	if (input == null) {
		throw new IllegalStateException();
	}
	int inputWidth = input.getWidth();
	int inputHeight = input.getHeight();
	int qrWidth = inputWidth + (quietZone * 2);
	int qrHeight = inputHeight + (quietZone * 2);
	int outputWidth = Math.max(width, qrWidth);
	int outputHeight = Math.max(height, qrHeight);

	int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
	// Padding includes both the quiet zone and the extra white pixels to
	// accommodate the requested
	// dimensions. For example, if input is 25x25 the QR will be 33x33
	// including the quiet zone.
	// If the requested size is 200x160, the multiple will be 4, for a QR of
	// 132x132. These will
	// handle all the padding from 100x100 (the actual QR) up to 200x160.
	int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
	int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

	BitMatrix output = new BitMatrix(outputWidth, outputHeight);

	for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
		// Write the contents of this row of the barcode
		for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
			if (input.get(inputX, inputY) == 1) {
				output.setRegion(outputX, outputY, multiple, multiple);
			}
		}
	}

	return output;
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:37,代码来源:QRCodeWriter.java

示例14: renderResult

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private static BitMatrix renderResult(QRCode code, int width, int height) {
  ByteMatrix input = code.getMatrix();
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int qrWidth = inputWidth + (QUIET_ZONE_SIZE << 1);
  int qrHeight = inputHeight + (QUIET_ZONE_SIZE << 1);
  int outputWidth = Math.max(width, qrWidth);
  int outputHeight = Math.max(height, qrHeight);

  int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
  // Padding includes both the quiet zone and the extra white pixels to accommodate the requested
  // dimensions. For example, if input is 25x25 the QR will be 33x33 including the quiet zone.
  // If the requested size is 200x160, the multiple will be 4, for a QR of 132x132. These will
  // handle all the padding from 100x100 (the actual QR) up to 200x160.
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY) == 1) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }

  return output;
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:31,代码来源:QRCodeWriter.java

示例15: isFinderPatterns

import com.google.zxing.qrcode.encoder.ByteMatrix; //导入方法依赖的package包/类
private boolean isFinderPatterns(ByteMatrix matrix, int row, int col) {
    int width = matrix.getWidth();
    int height = matrix.getHeight();

    if (row >= 0 && row <= 6 && col >= 0 && col <= 6) {
        return true;
    }
    if (row >= 0 && row <= 6 && col >= width - 7 && col <= width - 1) {
        return true;
    }
    if (col >= 0 && col <= 6 && row >= height - 7 && row <= height - 1) {
        return true;
    }
    return false;
}
 
开发者ID:Tinker-S,项目名称:FaceBarCodeDemo,代码行数:16,代码来源:FaceQREffect.java


注:本文中的com.google.zxing.qrcode.encoder.ByteMatrix.getHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。