Package com.google.zxing

Examples of com.google.zxing.BinaryBitmap


        in.delete();
    }
   
    private void checkFormat(File file, BarcodeFormat format) throws IOException {
        Reader reader = new MultiFormatReader();
        BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(new BufferedImageLuminanceSource(ImageIO.read(file))));
        Result result;
        try {
            result = reader.decode(bitmap);
        } catch (ReaderException ex) {
            throw new IOException(ex);
View Full Code Here


        throws Exception {
        final MultiFormatReader reader = new MultiFormatReader();
        final BufferedInputStream in = exchange.getContext()
                .getTypeConverter()
                .mandatoryConvertTo(BufferedInputStream.class, stream);
        final BinaryBitmap bitmap = new BinaryBitmap(
                new HybridBinarizer(
                        new BufferedImageLuminanceSource(ImageIO.read(in))));
        final Result result = reader.decode(bitmap, readerHintMap);
       
        // write the found barcode format into the header
View Full Code Here

  public String decode(BufferedImage image) {

    // convert the image to a binary bitmap source
    LuminanceSource source = new BufferedImageLuminanceSource(image);
    BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

    // decode the barcode
    QRCodeReader reader = new QRCodeReader();

    try {
View Full Code Here

        throws Exception {
        final MultiFormatReader reader = new MultiFormatReader();
        final BufferedInputStream in = exchange.getContext()
                .getTypeConverter()
                .mandatoryConvertTo(BufferedInputStream.class, stream);
        final BinaryBitmap bitmap = new BinaryBitmap(
                new HybridBinarizer(
                        new BufferedImageLuminanceSource(ImageIO.read(in))));
        final Result result = reader.decode(bitmap, readerHintMap);
       
        // write the found barcode format into the header
View Full Code Here

   * @param image Buffered image for barcode recognition.
   * @return Results array.
   */
  public static Result[] getBarcodeResults(BufferedImage image) {
    LuminanceSource source = new BufferedImageLuminanceSource(image);
    BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
    Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>();
    hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
    Result[] results = null;
    try {
      MultiFormatReader multiFormatReader = new MultiFormatReader();
View Full Code Here

TOP

Related Classes of com.google.zxing.BinaryBitmap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.