private Result decodeInternal(BinaryBitmap image) { int size = readers.Count; for (int i = 0; i < size; i++) { Reader reader = (Reader) readers[i]; try { return reader.decode(image, hints); } catch (ReaderException) { // continue } } throw ReaderException.Instance; }
/// <summary> Decode an image using the hints provided. Does not honor existing state. /// /// </summary> /// <param name="image">The pixel data to decode /// </param> /// <param name="hints">The hints to use, clearing the previous state. /// </param> /// <returns> The contents of the image /// </returns> /// <throws> ReaderException Any errors which occurred </throws> public Result decode(BinaryBitmap image, System.Collections.Hashtable hints) { Hints = hints; return decodeInternal(image); }
/// <summary> Decode an image using the state set up by calling setHints() previously. Continuous scan /// clients will get a <b>large</b> speed increase by using this instead of decode(). /// /// </summary> /// <param name="image">The pixel data to decode /// </param> /// <returns> The contents of the image /// </returns> /// <throws> ReaderException Any errors which occurred </throws> public Result decodeWithState(BinaryBitmap image) { // Make sure to set up the default state so we don't crash if (readers == null) { Hints = null; } return decodeInternal(image); }
/// <summary> This version of decode honors the intent of Reader.decode(BinaryBitmap) in that it /// passes null as a hint to the decoders. However, that makes it inefficient to call repeatedly. /// Use setHints() followed by decodeWithState() for continuous scan applications. /// /// </summary> /// <param name="image">The pixel data to decode /// </param> /// <returns> The contents of the image /// </returns> /// <throws> ReaderException Any errors which occurred </throws> public Result decode(BinaryBitmap image) { Hints = null; return decodeInternal(image); }