private void  InitBlock(QRCodeImageReader enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
 public ModulePitch(QRCodeImageReader enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
			public ModulePitch(QRCodeImageReader enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
			private void  InitBlock(QRCodeImageReader enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
Example #5
0
 internal virtual DecodeResult decode(QRCodeImage qrCodeImage, Point adjust)
 {
     DecodeResult result;
     try
     {
         if (this.numTryDecode == 0)
         {
             canvas.println("Decoding started");
             int[][] image = this.imageToIntArray(qrCodeImage);
             this.imageReader = new QRCodeImageReader();
             this.qrCodeSymbol = this.imageReader.getQRCodeSymbol(image);
         }
         else
         {
             canvas.println("--");
             canvas.println("Decoding restarted #" + this.numTryDecode);
             this.qrCodeSymbol = this.imageReader.getQRCodeSymbolWithAdjustedGrid(adjust);
         }
     }
     catch (SymbolNotFoundException exception)
     {
         throw new DecodingFailedException(exception.Message);
     }
     canvas.println("Created QRCode symbol.");
     canvas.println("Reading symbol.");
     canvas.println("Version: " + this.qrCodeSymbol.VersionReference);
     canvas.println("Mask pattern: " + this.qrCodeSymbol.MaskPatternRefererAsString);
     int[] blocks = this.qrCodeSymbol.Blocks;
     canvas.println("Correcting data errors.");
     blocks = this.correctDataBlocks(blocks);
     try
     {
         sbyte[] decodedBytes = this.getDecodedByteArray(blocks, this.qrCodeSymbol.Version, this.qrCodeSymbol.NumErrorCollectionCode);
         result = new DecodeResult(this, decodedBytes, this.numLastCorrections, this.correctionSucceeded);
     }
     catch (InvalidDataBlockException exception2)
     {
         canvas.println(exception2.Message);
         throw new DecodingFailedException(exception2.Message);
     }
     return result;
 }