Class ReaderOptions

java.lang.Object
com.digimarc.dms.readers.ReaderOptions
Direct Known Subclasses:
ReaderOptionsExtended

public class ReaderOptions extends Object
ReaderOptions allows an application to set options within a reader object.
  • Field Details

    • InvertedBarcodeInterval

      public static final String InvertedBarcodeInterval
      InvertedBarcodeInterval sets how frequently an image reader (ImageReader or VideoCaptureReader) will attempt to read an inverted barcode.

      Values:
         "0" - Disables inverted reading (Default)
         "1" - Every frame is read as inverted
         "2" - Every other frame is read as inverted
         "3" - Every third frame is read as inverted
         etc.

      See Also:
    • EnableImageFrameStorage

      public static final String EnableImageFrameStorage
      By default frames where a symbology was found are stored temporarily to allow the application to access and save the image if it desires. The image frames are generally used by apps as thumbnails as associated with the read results. The EnableImageFrameStorage option allows an application to turn off this frame storage. This can save on runtime memory usage and on some lower end devices this may improve performance.

      Values:
         "0" - Off. Frames storage disabled.
         "1" - On. Frame storage enabled (default).

      See Also:
    • TraditionalBarcodeReadDistance

      public static final String TraditionalBarcodeReadDistance
      Traditional barcode read distance

      Values:
         Distance_Near - Near distance reading (default).
         Distance_Far - Far distance reading.
         Distance_FullRange - Full range (near and far) distance reading.
      See Also:
    • ITF_BarcodeMinLength

      public static final String ITF_BarcodeMinLength
      Sets the minimum barcode length for reading ITF barcodes. ITF barcodes containing fewer characters than this length will not be decoded. Be aware that decreasing the minimum code length can increase the chance of a misread. The default value is 10.


      Constraints:
         - The length cannot be less than 8.
         - The length cannot be greater than the ITF maximum length (24).
         - The value must be even.

      See Also:
    • EnablePlasticsReading

      public static final String EnablePlasticsReading
      Configures an ImageReader or VideoCaptureReader to search for Digimarc Barcodes on plastic substrates. Enabling this option increases processing overhead.

      EnablePlasticsReading does not support bitmap reading.

      Values:
         "0" - Off. Plastics reading disabled (default).
         "1" - On. Plastics reading enabled.

      See Also:
    • Distance_Near

      public static final String Distance_Near
      In Near Distance mode traditional barcode reading is tuned for reading codes closer to the device. This mode works best when the code is 3-12 inches from the device.
      See Also:
    • Distance_Far

      public static final String Distance_Far
      In Far Distance mode traditional barcode reading is tuned for reading codes farther away from the device. This mode works best when the code is 12-48 inches from the device. This mode requires 4K camera resolution (3840x2160) for best read robustness. When the mode is enabled the Manager.getRecommendedResolution(int) method will return this resolution or a similar one appropriate for the handset.
      See Also:
    • Distance_FullRange

      public static final String Distance_FullRange
      In Full_Range mode traditional barcode reading can read codes at a range of 3-48 inches from the device. This mode requires 4K camera resolution (3840x2160) for best read robustness. When the mode is enabled the Manager.getRecommendedResolution(int) method will return this resolution or a similar one appropriate for the handset.

      Note that this mode uses more processing power. This mode is not recommended for most use cases.

      See Also:
  • Constructor Details

    • ReaderOptions

      public ReaderOptions()
  • Method Details

    • getKeys

      @NonNull public Set<String> getKeys()
      Get the key set from the ReaderOptions object.
      Returns:
      Set of Strings containing all of the available keys.
    • getValue

      @Nullable public String getValue(@NonNull String key)
      Get the value associated with a given key.
      Parameters:
      key - Key to search for.
      Returns:
      Value associated with the key or null if the key is not present.
    • setValue

      public void setValue(@NonNull String key, @NonNull String value)
      Stores a key value pair in the options dictionary.
      Parameters:
      key - Key
      value - String value
    • setValue

      public void setValue(@NonNull String key, int value)
      Stores a key value pair in the options dictionary. Note that the integer value specified will be stored as a string internally.
      Parameters:
      key - Key
      value - Integer value
    • isOptionPresent

      public static boolean isOptionPresent(@Nullable ReaderOptions options, @NonNull String optionName)
      Checks the provided options dictionary for the specified name.
      Parameters:
      options - Options dictionary.
      optionName - Options value name to lookup.
      Returns:
      Was the named value present?
    • isOptionSet

      public static boolean isOptionSet(@Nullable ReaderOptions options, @NonNull String optionName, @NonNull String optionValue)
      Checks the provided options dictionary for the specified name-value pair.
      Parameters:
      options - Options dictionary.
      optionName - Options value name to lookup.
      optionValue - Value needed for a true result.
      Returns:
      Was the named value present and did the stored value match our optionValue parameter?
    • getIntegerValue

      public static int getIntegerValue(@Nullable ReaderOptions options, @NonNull String key, int defaultValue)
      Get an integer value from the options dictionary.
      Parameters:
      options - Options dictionary.
      key - Options value name to lookup.
      defaultValue - Default value.
      Returns:
      The stored value will be returned if present in the options dictionary. The default value will be returned if either the dictionary is null or the key is not found in the dictionary.
    • getStringValue

      @NonNull public static String getStringValue(@Nullable ReaderOptions options, @NonNull String key, @NonNull String defaultValue)