Package com.google.zxing.client.j2se

Examples of com.google.zxing.client.j2se.BufferedImageLuminanceSource


        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


        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
        exchange.getOut()
                .setHeader(Barcode.BARCODE_FORMAT, result.getBarcodeFormat());
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();
View Full Code Here

        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
        exchange.getOut()
                .setHeader(Barcode.BARCODE_FORMAT, result.getBarcodeFormat());
View Full Code Here

   * Returns all Result objects from barcode recognition of the given image.
   * @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 {
View Full Code Here

TOP

Related Classes of com.google.zxing.client.j2se.BufferedImageLuminanceSource

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.