Esempio n. 1
0
        public Result decode(BinaryBitmap image, System.Collections.Hashtable hints)
        {
            DecoderResult decoderResult;

            ResultPoint[] points;
            if (hints != null && hints.ContainsKey(DecodeHintType.PURE_BARCODE))
            {
                BitMatrix bits = extractPureBits(image);
                if (bits.IsBlank())
                {
                    return(null);
                }

                decoderResult = decoder.decode(bits);
                points        = NO_POINTS;
            }
            else
            {
                DetectorResult detectorResult = new Detector(image).detect();
                if (detectorResult.IsBlank())
                {
                    return(null);
                }

                decoderResult = decoder.decode(detectorResult.Bits);
                if (decoderResult.IsBlank())
                {
                    return(null);
                }

                points = detectorResult.Points;
            }
            return(new Result(decoderResult.Text, decoderResult.RawBytes, points, BarcodeFormat.PDF417));
        }
Esempio n. 2
0
		public Result decode(BinaryBitmap image, System.Collections.Hashtable hints)
		{
			DecoderResult decoderResult;
			ResultPoint[] points;
			if (hints != null && hints.ContainsKey(DecodeHintType.PURE_BARCODE))
			{
				BitMatrix bits = extractPureBits(image);
				decoderResult = decoder.decode(bits);
				points = NO_POINTS;
			}
			else
			{
				DetectorResult detectorResult = new Detector(image).detect();
				decoderResult = decoder.decode(detectorResult.Bits);
				points = detectorResult.Points;
			}
			return new Result(decoderResult.Text, decoderResult.RawBytes, points, BarcodeFormat.PDF417);
		}
Esempio n. 3
0
        public Result decode(BinaryBitmap image, Dictionary <object, object> hints)
        {
            DecoderResult decoderResult;

            ResultPoint[] points;
            if (hints != null && hints.ContainsKey(DecodeHintType.PURE_BARCODE))
            {
                BitMatrix bits = extractPureBits(image);
                decoderResult = decoder.decode(bits);
                points        = NO_POINTS;
            }
            else
            {
                DetectorResult detectorResult = new Detector(image).detect();
                decoderResult = decoder.decode(detectorResult.Bits);
                points        = detectorResult.Points;
            }
            return(new Result(decoderResult.Text, decoderResult.RawBytes, points, BarcodeFormat.PDF417));
        }
Esempio n. 4
0
        // public Result decode(BinaryBitmap image, System.Collections.Hashtable hints) // commented by .net follower (http://dotnetfollower.com)
        public Result decode(BinaryBitmap image, System.Collections.Generic.Dictionary <Object, Object> hints) // added by .net follower (http://dotnetfollower.com)
        {
            DecoderResult decoderResult;

            ResultPoint[] points;
            if (hints != null && hints.ContainsKey(DecodeHintType.PURE_BARCODE))
            {
                BitMatrix bits = extractPureBits(image);
                decoderResult = decoder.decode(bits);
                points        = NO_POINTS;
            }
            else
            {
                DetectorResult detectorResult = new Detector(image).detect();
                decoderResult = decoder.decode(detectorResult.Bits);
                points        = detectorResult.Points;
            }
            return(new Result(decoderResult.Text, decoderResult.RawBytes, points, BarcodeFormat.PDF417));
        }