Class ScanImageReader<T>

Image reader that automatically generates RGBA data while reading from SANE's API using ScanDataReader. It supports the most common scan modes and image formats. More formats can be added in the future.

Use ScanImageReader.on to listen to events, available event types are declared on ScanImageReaderEventMap.

A device should already be open with sane_open(), the reader will call sane_start() do the scanning and call sane_stop().

Other SANE functions cannot be used while scanning.

Scan readers are single use.

https://sane-project.gitlab.io/standard/1.06/api.html#code-flow

Type Parameters

Hierarchy

Constructors

Properties

_allData: Uint8ClampedArray = ...
_line: number = 0
_remainder: Uint8ClampedArray = ...

Methods

  • Fire event.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • type: K
    • Rest ...args: T[K]
      Rest

    Returns null | Promise<null>

  • Add event listener.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • type: K
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: T[K]
            Rest

          Returns void

    Returns void

Generated using TypeDoc