components.hardware.sanescanner

class SaneScanner(config={}, **kwds)[source]

Bases: Component

Base class for scanners using the Linux SANE scanner library.

This component requires the python-sane package.

Different scanners have different configuration options, so the config documentation is generated dynamically when a scanner class derived from SaneScanner is instantiated. A derived class for each connected scanner make and model is defined when the sanescanner module is imported.

The component has two outputs. preview is used when the scanner’s preview config setting is selected. The scanned image is streamed continually, allowing downstream processes such as gamma correction to be adjusted for best image quality.

The main output is used to send a single scanned image when the preview config setting is not selected. This would typically be connected to a similar processing pipeline but ending in an image file writer.

outputs = ['output', 'preview']

Comments or questions? Please email jim@jim-easterbrook.me.uk.