forked from martinbowling/zxing.MonoTouch
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jcarruthers
committed
Jan 20, 2011
0 parents
commit d2c05d3
Showing
148 changed files
with
25,701 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
|
||
// TODO: Review the values of the assembly attributes | ||
|
||
[assembly: AssemblyTitle("")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Revision | ||
// Build Number | ||
// | ||
// You can specify all the values or you can default the Revision and Build Numbers | ||
// by using the '*' as shown below: | ||
|
||
[assembly: AssemblyVersion("1.0.*")] | ||
|
||
// | ||
// In order to sign your assembly you must specify a key to use. Refer to the | ||
// Microsoft .NET Framework documentation for more information on assembly signing. | ||
// | ||
// Use the attributes below to control which key is used for signing. | ||
// | ||
// Notes: | ||
// (*) If no key is specified, the assembly is not signed. | ||
// (*) KeyName refers to a key that has been installed in the Crypto Service | ||
// Provider (CSP) on your machine. KeyFile refers to a file which contains | ||
// a key. | ||
// (*) If the KeyFile and the KeyName values are both specified, the | ||
// following processing occurs: | ||
// (1) If the KeyName can be found in the CSP, that key is used. | ||
// (2) If the KeyName does not exist and the KeyFile does exist, the key | ||
// in the KeyFile is installed into the CSP and used. | ||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. | ||
// When specifying the KeyFile, the location of the KeyFile should be | ||
// relative to the project output directory which is | ||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is | ||
// located in the project directory, you would specify the AssemblyKeyFile | ||
// attribute as [assembly: AssemblyKeyFile("..\..\mykey.snk")] | ||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework | ||
// documentation for more information on this. | ||
// | ||
|
||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyDelaySign(false)] | ||
[assembly: AssemblyKeyFile("")] | ||
[assembly: AssemblyKeyName("")] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* Copyright 2007 ZXing authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
using System; | ||
namespace com.google.zxing | ||
{ | ||
|
||
/// <summary> Enumerates barcode formats known to this package. | ||
/// | ||
/// </summary> | ||
/// <author> Sean Owen | ||
/// </author> | ||
/// <author>www.Redivivus.in ([email protected]) - Ported from ZXING Java Source | ||
/// </author> | ||
|
||
public sealed class BarcodeFormat | ||
{ | ||
public System.String Name | ||
{ | ||
get | ||
{ | ||
return name; | ||
} | ||
|
||
} | ||
|
||
// No, we can't use an enum here. J2ME doesn't support it. | ||
|
||
//UPGRADE_NOTE: Final was removed from the declaration of 'VALUES '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
private static readonly System.Collections.Hashtable VALUES = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable()); | ||
|
||
/// <summary>QR Code 2D barcode format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'QR_CODE '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat QR_CODE = new BarcodeFormat("QR_CODE"); | ||
|
||
/// <summary>DataMatrix 2D barcode format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'DATAMATRIX '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat DATAMATRIX = new BarcodeFormat("DATAMATRIX"); | ||
|
||
/// <summary>UPC-E 1D format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'UPC_E '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat UPC_E = new BarcodeFormat("UPC_E"); | ||
|
||
/// <summary>UPC-A 1D format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'UPC_A '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat UPC_A = new BarcodeFormat("UPC_A"); | ||
|
||
/// <summary>EAN-8 1D format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'EAN_8 '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat EAN_8 = new BarcodeFormat("EAN_8"); | ||
|
||
/// <summary>EAN-13 1D format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'EAN_13 '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat EAN_13 = new BarcodeFormat("EAN_13"); | ||
|
||
/// <summary>Code 128 1D format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'CODE_128 '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat CODE_128 = new BarcodeFormat("CODE_128"); | ||
|
||
/// <summary>Code 39 1D format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'CODE_39 '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat CODE_39 = new BarcodeFormat("CODE_39"); | ||
|
||
/// <summary>ITF (Interleaved Two of Five) 1D format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'ITF '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat ITF = new BarcodeFormat("ITF"); | ||
|
||
/// <summary>PDF417 format. </summary> | ||
//UPGRADE_NOTE: Final was removed from the declaration of 'PDF417 '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
public static readonly BarcodeFormat PDF417 = new BarcodeFormat("PDF417"); | ||
|
||
//UPGRADE_NOTE: Final was removed from the declaration of 'name '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
private System.String name; | ||
|
||
private BarcodeFormat(System.String name) | ||
{ | ||
this.name = name; | ||
VALUES[name] = this; | ||
} | ||
|
||
public override System.String ToString() | ||
{ | ||
return name; | ||
} | ||
|
||
public static BarcodeFormat valueOf(System.String name) | ||
{ | ||
BarcodeFormat format = (BarcodeFormat) VALUES[name]; | ||
if (format == null) | ||
{ | ||
throw new System.ArgumentException(); | ||
} | ||
return format; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright 2009 ZXing authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
using System; | ||
using BitArray = com.google.zxing.common.BitArray; | ||
using BitMatrix = com.google.zxing.common.BitMatrix; | ||
namespace com.google.zxing | ||
{ | ||
|
||
/// <summary> This class hierarchy provides a set of methods to convert luminance data to 1 bit data. | ||
/// It allows the algorithm to vary polymorphically, for example allowing a very expensive | ||
/// thresholding technique for servers and a fast one for mobile. It also permits the implementation | ||
/// to vary, e.g. a JNI version for Android and a Java fallback version for other platforms. | ||
/// | ||
/// </summary> | ||
/// <author> [email protected] (Daniel Switkin) | ||
/// </author> | ||
/// <author>www.Redivivus.in ([email protected]) - Ported from ZXING Java Source | ||
/// </author> | ||
|
||
public abstract class Binarizer | ||
{ | ||
virtual public LuminanceSource LuminanceSource | ||
{ | ||
get | ||
{ | ||
return source; | ||
} | ||
|
||
} | ||
/// <summary> Converts a 2D array of luminance data to 1 bit data. As above, assume this method is expensive | ||
/// and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or | ||
/// may not apply sharpening. Therefore, a row from this matrix may not be identical to one | ||
/// fetched using getBlackRow(), so don't mix and match between them. | ||
/// | ||
/// </summary> | ||
/// <returns> The 2D array of bits for the image (true means black). | ||
/// </returns> | ||
public abstract BitMatrix BlackMatrix{get;} | ||
|
||
//UPGRADE_NOTE: Final was removed from the declaration of 'source '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" | ||
private LuminanceSource source; | ||
|
||
protected internal Binarizer(LuminanceSource source) | ||
{ | ||
if (source == null) | ||
{ | ||
throw new System.ArgumentException("Source must be non-null."); | ||
} | ||
this.source = source; | ||
} | ||
|
||
/// <summary> Converts one row of luminance data to 1 bit data. May actually do the conversion, or return | ||
/// cached data. Callers should assume this method is expensive and call it as seldom as possible. | ||
/// This method is intended for decoding 1D barcodes and may choose to apply sharpening. | ||
/// For callers which only examine one row of pixels at a time, the same BitArray should be reused | ||
/// and passed in with each call for performance. However it is legal to keep more than one row | ||
/// at a time if needed. | ||
/// | ||
/// </summary> | ||
/// <param name="y">The row to fetch, 0 <= y < bitmap height. | ||
/// </param> | ||
/// <param name="row">An optional preallocated array. If null or too small, it will be ignored. | ||
/// If used, the Binarizer will call BitArray.clear(). Always use the returned object. | ||
/// </param> | ||
/// <returns> The array of bits for this row (true means black). | ||
/// </returns> | ||
public abstract BitArray getBlackRow(int y, BitArray row); | ||
|
||
/// <summary> Creates a new object with the same type as this Binarizer implementation, but with pristine | ||
/// state. This is needed because Binarizer implementations may be stateful, e.g. keeping a cache | ||
/// of 1 bit data. See Effective Java for why we can't use Java's clone() method. | ||
/// | ||
/// </summary> | ||
/// <param name="source">The LuminanceSource this Binarizer will operate on. | ||
/// </param> | ||
/// <returns> A new concrete Binarizer implementation object. | ||
/// </returns> | ||
public abstract Binarizer createBinarizer(LuminanceSource source); | ||
} | ||
} |
Oops, something went wrong.