com.asprise.imaging.scan

## Class FunctionalUnit

- java.lang.Object
- - com.asprise.imaging.scan.DeviceItem
  - - com.asprise.imaging.scan.FunctionalUnit

- All Implemented Interfaces:
    Closeable, AutoCloseable
  Direct Known Subclasses:
    WiaFunctionalUnit

      public abstract class FunctionalUnit
      extends DeviceItem

  Represents a functional unit available on a device, e.g., flatbed or document feeder.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FunctionalUnit.BitDepth` Bit depth.
    `static class` | `FunctionalUnit.Duplex` Duplex mode for automatic document feeding
    `static class` | `FunctionalUnit.FileFormat` Image file formats.
    `static class` | `FunctionalUnit.Mode` Scanning performance mode
    `static class` | `FunctionalUnit.OutputFormat` Output image format
    `static class` | `FunctionalUnit.PixelDataType` Pixel data type - color, grayscale and black/white, etc.
    `static class` | `FunctionalUnit.PropertyBuilder` Builder for configuring scan properties.
    `static class` | `FunctionalUnit.TiffCompression` TIFF compression schemes

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PROP_ADF` Whether multiple-scanning (ADF) is enabled
    `static String` | `PROP_JPEG_QUALITY` Specifies JPEG image quality (0 ~ 100].
    `static String` | `PROP_MODE` Specifies scan performance mode: FunctionalUnit.Mode.HIGH_SPEED or FunctionalUnit.Mode.NORMAL
    `static String` | `PROP_OUTPUT_FORMAT` Specifies output image format.
    `static String` | `PROP_TIFF_COMPRESSION` Specifies TIFF compression scheme

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract FunctionalUnit.BitDepth` | `getBitDepth()`
    `abstract long` | `getBrightness()`
    `abstract long` | `getContrast()`
    `Device` | `getDevice()` Device that owns this functional unit.
    `abstract FunctionalUnit.Duplex` | `getDuplex()`
    `abstract FunctionalUnit.PixelDataType` | `getPixelDataType()`
    `abstract long` | `getResolution()`
    `abstract boolean` | `isDocumentFeeder()` Whether this is a document feeder
    `abstract boolean` | `isFlatbed()` Whether this is a flatbed
    `abstract void` | `scan(ScanListener listener, String properties)` Performs single or multi-page ADF scan.
    `void` | `scanOnePage(File file, ScanProgressListener progressListener, String properties)` Scans one page into the target file.
    `void` | `scanOnePage(OutputStream output, ScanProgressListener listener, String properties)` Scans one page to the target output stream.
    `abstract void` | `setBitDepth(FunctionalUnit.BitDepth bitDepth)`
    `abstract void` | `setBrightness(long brightness)`
    `abstract void` | `setContrast(long contrast)`
    `abstract void` | `setDuplex(FunctionalUnit.Duplex duplex)`
    `abstract void` | `setPaperSize(PaperSize paperSize)`
    `abstract void` | `setPixelDataType(FunctionalUnit.PixelDataType dataType)`
    `abstract void` | `setResolution(long resolution)`
    `String` | `toString()`
    `abstract String` | `toString(boolean verbose, boolean withCapabilities)` String representation of this functional unit.

    - ### Methods inherited from class com.asprise.imaging.scan.DeviceItem

      `close, getCapabilities, getCapability, getCapabilityCurrentValueAsLong, getCapabilityCurrentValueAsString, getCapabilityValue, getCapabilityValueAsLong, getCapabilityValueAsString, getDescription, getId, getName, isCapabilityDirty, refreshCapabilities, setCapabilityDirty, setCapabilityValue`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### PROP_ADF

          public static final String PROP_ADF

      Whether multiple-scanning (ADF) is enabled
      See Also:
        Constant Field Values

    - #### PROP_OUTPUT_FORMAT

          public static final String PROP_OUTPUT_FORMAT

      Specifies output image format.
      See Also:
        Constant Field Values

    - #### PROP_TIFF_COMPRESSION

          public static final String PROP_TIFF_COMPRESSION

      Specifies TIFF compression scheme
      See Also:
        Constant Field Values

    - #### PROP_JPEG_QUALITY

          public static final String PROP_JPEG_QUALITY

      Specifies JPEG image quality (0 ~ 100].
      See Also:
        Constant Field Values

    - #### PROP_MODE

          public static final String PROP_MODE

      Specifies scan performance mode: FunctionalUnit.Mode.HIGH_SPEED or FunctionalUnit.Mode.NORMAL
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getDevice

          public Device getDevice()

      Device that owns this functional unit.

    - #### isFlatbed

          public abstract boolean isFlatbed()

      Whether this is a flatbed

    - #### isDocumentFeeder

          public abstract boolean isDocumentFeeder()

      Whether this is a document feeder

    - #### scan

          public abstract void scan(ScanListener listener,
                  String properties)
                             throws ScanException

      Performs single or multi-page ADF scan.
      Parameters:
        `listener` - to supply output target and to get notification.
        `properties` - scan properties, you may use FunctionalUnit.PropertyBuilder to build.
      Throws:
        `ScanException`

    - #### scanOnePage

          public void scanOnePage(File file,
                         ScanProgressListener progressListener,
                         String properties)
                           throws ScanException

      Scans one page into the target file.
      Parameters:
        `file` -
        `progressListener` - optional listener to be notified about progress.
        `properties` - scan properties, you may use FunctionalUnit.PropertyBuilder to build.
      Throws:
        `ScanException`

    - #### scanOnePage

          public void scanOnePage(OutputStream output,
                         ScanProgressListener listener,
                         String properties)
                           throws ScanException

      Scans one page to the target output stream.
      Parameters:
        `output` -
        `listener` - optional listener to be notified about progress.
        `properties` - scan properties, you may use FunctionalUnit.PropertyBuilder to build.
      Throws:
        `ScanException`

    - #### getPixelDataType

          public abstract FunctionalUnit.PixelDataType getPixelDataType()

    - #### setPixelDataType

          public abstract void setPixelDataType(FunctionalUnit.PixelDataType dataType)

    - #### getBitDepth

          public abstract FunctionalUnit.BitDepth getBitDepth()

    - #### setBitDepth

          public abstract void setBitDepth(FunctionalUnit.BitDepth bitDepth)

    - #### getResolution

          public abstract long getResolution()

    - #### setResolution

          public abstract void setResolution(long resolution)

    - #### getContrast

          public abstract long getContrast()

    - #### setContrast

          public abstract void setContrast(long contrast)

    - #### getBrightness

          public abstract long getBrightness()

    - #### setBrightness

          public abstract void setBrightness(long brightness)

    - #### setPaperSize

          public abstract void setPaperSize(PaperSize paperSize)

    - #### getDuplex

          public abstract FunctionalUnit.Duplex getDuplex()

    - #### setDuplex

          public abstract void setDuplex(FunctionalUnit.Duplex duplex)

    - #### toString

          public abstract String toString(boolean verbose,
                        boolean withCapabilities)

      String representation of this functional unit.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © Asprise Software. All Rights Reserved. Please visit the product page at asprise.com