
Filters/transformations easily added through plugins (example - rotation plugin http://code.google.com/p/artscan/source ... tion_qt.py ).
To download sources you need Mercurial: http://mercurial.selenic.com/wiki/Downl ... ryPackages , download command : hg clone https://artscan.googlecode.com/hg/ artscan
To run you need Python (tested with version 2.5): http://www.python.org/download/releases/2.5.4/
PyQt4 for Python 2.5 : http://www.riverbankcomputing.co.uk/sof ... t/download
additional packages : Babel : http://babel.edgewall.org/wiki/Download
Every plugin is descendant class of Plugin.
In constructor __init__ first filled plugin description fields (shown to the user in plugins tree and parameters editor), and added plugin parameters descriptors (first added 3 standard parameters for document/page/layer selection, and additional - rotational angle, rotational quality. Each parameter has short tag (by which you get access to parameter value), full localized name and description name,descr (displayed to user), default value (val_def), by it's type determined parameter type (int/float/string/bool), additinal parameter options (minimum, maximum, step etc), vals - list of possible values.
Actual plugin processing in done in method 'execute'. It receives values of entered parameters when user click on 'Apply' button in parameters editor.
Method self.getLayersSelection of Plugin object returns list of selected documents/pages/layers objects based on values of parameters 'documents', 'pages', 'layers'.
All selected layers objects processed in loop: for layer in self.getLayersSelection(params):.
First, image of layer readed : image = layer.getImage(), then done transformation of image : image.transformed (look in Qt/PyQt QImage documentation on possible tranformations). Then new image saved for current processed layer instead of old, and page view refreshed (layer.setImage(image, rebuildView=True)).
Currently developing/testing/planned : backround plugins execution, undo for layers/zones operations, rectangular/polygonal zones creation/editing, plugins for effects/transformations (using Qt, PIL, or PythonMagick - ImageMagick binding) / djvu,pdf import/export (split Djvu layers editing possible) / scanning (through sane/twain, with control of automatic scanners) / OCR integration (ocropus,cuneiform or other engines) and text layer editor.
Selective pages/layers/zones processing is possible by adding attributes for that objects ('Attributes' parameter in document/page/layer/zone properties editors tabs above pages list).
Also possible immediate scripts execution (in script editor on plugins panel). Executed script commands shown in log text area (bottom of plugins panel), user can copy them to script editor, and make own script by combining many processing commands.
Class hierarchy:
Code: Select all
ArtScanApplication - main application
ArtScanMainWindow - main window
Documents - container of opened documents and tab widget
Document - document, container of document pages and page view area
Page - represents document page with multiple image layers
Layer - represents page layer
Zone - selected zone on layer
Plugins - container of loaded plugins
PluginsGroup - group of plugins in plugins tree
Plugin - plugin