GnomeScanJob

GnomeScanJob — Handling acquisition, processing and outputting

Synopsis


#include <gnome-scan.h>

                    GnomeScanJob;
GnomeScanJob*       gnome_scan_job_new                  (GnomeScanSettings *settings,
                                                         GnomeScanSink *sink);
void                gnome_scan_job_set_settings         (GnomeScanJob *job,
                                                         GnomeScanSettings *settings);
GnomeScanSettings*  gnome_scan_job_get_settings         (GnomeScanJob *job);
void                gnome_scan_job_add_processor        (GnomeScanJob *job,
                                                         GnomeScanPlugin *processor);
void                gnome_scan_job_set_sink             (GnomeScanJob *job,
                                                         GnomeScanSink *sink);

Object Hierarchy

  GObject
   +----GnomeScanJob

Properties

  "scanner"                  GnomeScanner*         : Read / Write
  "settings"                 GnomeScanSettings*    : Read / Write
  "sink"                     GnomeScanSink*        : Read / Write

Description

In Gnome Scan, the job of scanning is divided in three parts : acquiring, processing and outputting. The first stage is handled by GnomeScanner plugin. The second is handled using GeglOperation. The latter is handled by GnomeScanSink plugin.

The purpose of GnomeScanJob is to marshal the configuration and execution of these three part, allowing to easily delegate job execution in a worker thread.

Details

GnomeScanJob

typedef struct {
	gdouble		progress;
	gchar*		stage;
	gboolean	done;
} GnomeScanJob;

A GnomeScanJob object handle the acquisition, processing and outputing of images. Use gnome_scan_job_run() to execute the job. During its execution, the job will fill progress and stage in order you to know what he is doing. This way, the main thread can know what the worker thread is doing.

gdouble progress;

a fraction indicating the progress of the execution (from 0 to 1)

gchar *stage;

a description of the current stage being executed.

gboolean done;


gnome_scan_job_new ()

GnomeScanJob*       gnome_scan_job_new                  (GnomeScanSettings *settings,
                                                         GnomeScanSink *sink);

Instanciate a new job. If settings is null, a new GnomeScanSettings is created.

settings :

a GnomeScanSettings or NULL

sink :

the GnomeScanSink

Returns :

a new GnomeScanJob

gnome_scan_job_set_settings ()

void                gnome_scan_job_set_settings         (GnomeScanJob *job,
                                                         GnomeScanSettings *settings);

Set the settings for this job.

job :

a GnomeScanJob

settings :

a GnomeScanSettings

gnome_scan_job_get_settings ()

GnomeScanSettings*  gnome_scan_job_get_settings         (GnomeScanJob *job);

Retrieve the settings used by the job.

job :

a GnomeScanJob

Returns :

the job GnomeScanSettings

gnome_scan_job_add_processor ()

void                gnome_scan_job_add_processor        (GnomeScanJob *job,
                                                         GnomeScanPlugin *processor);

Add processor as plugin for building the pipeline.

job :

a GnomeScanJob

processor :

a GnomeScanPlugin

gnome_scan_job_set_sink ()

void                gnome_scan_job_set_sink             (GnomeScanJob *job,
                                                         GnomeScanSink *sink);

Set the scan sink.

job :

a GnomeScanJob

sink :

a GnomeScanSink

Property Details

The "scanner" property

  "scanner"                  GnomeScanner*         : Read / Write

The GnomeScanner responsible of image acquisition.


The "settings" property

  "settings"                 GnomeScanSettings*    : Read / Write

The GnomeScanSettings object containing all user settings for plugins.


The "sink" property

  "sink"                     GnomeScanSink*        : Read / Write

The sink responsible to output acquired images.