Exemplo n.º 1
0
 /// <summary>Compares the Format Information of this and o</summary>
 /// <param name="o">object to compare to</param>
 /// <returns>True if o is a FormatInformationObject and the error-correction level and the datamask are equal, false otherwise
 ///     </returns>
 public override bool Equals(Object o)
 {
     if (!(o is iText.Barcodes.Qrcode.FormatInformation))
     {
         return(false);
     }
     iText.Barcodes.Qrcode.FormatInformation other = (iText.Barcodes.Qrcode.FormatInformation)o;
     return(this.errorCorrectionLevel == other.errorCorrectionLevel && this.dataMask == other.dataMask);
 }
 /// <param name="maskedFormatInfo1">format info indicator, with mask still applied</param>
 /// <param name="maskedFormatInfo2">
 /// second copy of same info; both are checked at the same time
 /// to establish best match
 /// </param>
 /// <returns>
 /// information about the format it specifies, or <c>null</c>
 /// if doesn't seem to match any known pattern
 /// </returns>
 internal static iText.Barcodes.Qrcode.FormatInformation DecodeFormatInformation(int maskedFormatInfo1, int
                                                                                 maskedFormatInfo2)
 {
     iText.Barcodes.Qrcode.FormatInformation formatInfo = DoDecodeFormatInformation(maskedFormatInfo1, maskedFormatInfo2
                                                                                    );
     if (formatInfo != null)
     {
         return(formatInfo);
     }
     // Should return null, but, some QR codes apparently
     // do not mask this info. Try again by actually masking the pattern
     // first
     return(DoDecodeFormatInformation(maskedFormatInfo1 ^ FORMAT_INFO_MASK_QR, maskedFormatInfo2 ^ FORMAT_INFO_MASK_QR
                                      ));
 }