2 * Copyright 2007 ZXing authors
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 namespace com.google.zxing
\r
20 /// <summary> <p>Encapsulates the result of decoding a barcode within an image.</p>
\r
23 /// <author> Sean Owen
\r
25 /// <author>www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source
\r
28 public sealed class Result
\r
30 /// <returns> raw text encoded by the barcode, if applicable, otherwise <code>null</code>
\r
32 public System.String Text
\r
40 /// <returns> raw bytes encoded by the barcode, if applicable, otherwise <code>null</code>
\r
42 public sbyte[] RawBytes
\r
50 /// <returns> points related to the barcode in the image. These are typically points
\r
51 /// identifying finder patterns or the corners of the barcode. The exact meaning is
\r
52 /// specific to the type of barcode that was decoded.
\r
54 public ResultPoint[] ResultPoints
\r
58 return resultPoints;
\r
62 /// <returns> {@link BarcodeFormat} representing the format of the barcode that was decoded
\r
64 public BarcodeFormat BarcodeFormat
\r
72 /// <returns> {@link Hashtable} mapping {@link ResultMetadataType} keys to values. May be
\r
73 /// <code>null</code>. This contains optional metadata about what was detected about the barcode,
\r
74 /// like orientation.
\r
76 public System.Collections.Hashtable ResultMetadata
\r
80 return resultMetadata;
\r
85 //UPGRADE_NOTE: Final was removed from the declaration of 'text '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
\r
86 private System.String text;
\r
87 //UPGRADE_NOTE: Final was removed from the declaration of 'rawBytes '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
\r
88 private sbyte[] rawBytes;
\r
89 //UPGRADE_NOTE: Final was removed from the declaration of 'resultPoints '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
\r
90 private ResultPoint[] resultPoints;
\r
91 //UPGRADE_NOTE: Final was removed from the declaration of 'format '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
\r
92 private BarcodeFormat format;
\r
93 private System.Collections.Hashtable resultMetadata;
\r
95 public Result(System.String text, sbyte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format)
\r
97 if (text == null && rawBytes == null)
\r
99 throw new System.ArgumentException("Text and bytes are null");
\r
102 this.rawBytes = rawBytes;
\r
103 this.resultPoints = resultPoints;
\r
104 this.format = format;
\r
105 this.resultMetadata = null;
\r
108 public void putMetadata(ResultMetadataType type, System.Object value_Renamed)
\r
110 if (resultMetadata == null)
\r
112 resultMetadata = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable(3));
\r
114 resultMetadata[type] = value_Renamed;
\r
117 public override System.String ToString()
\r
121 return "[" + rawBytes.Length + " bytes]";
\r