![]() |
![]() |
![]() |
Gnome Scan Reference Manual | ![]() |
---|---|---|---|---|
GnomeScanJob; GnomeScanJob* gnome_scan_job_new (void); GnomeScanSettings* gnome_scan_job_get_settings (GnomeScanJob *job); void gnome_scan_job_set_scanner (GnomeScanJob *job, GnomeScanner *scanner); GnomeScanner* gnome_scan_job_get_scanner (GnomeScanJob *job); void gnome_scan_job_set_sink (GnomeScanJob *job, GnomeScanSink *sink); GnomeScanSink* gnome_scan_job_get_sink (GnomeScanJob *job); void gnome_scan_job_run (GnomeScanJob *job); void gnome_scan_job_cancel (GnomeScanJob *job);
"scanner" GnomeScanner : Read / Write "settings" GnomeScanSettings : Read / Write "sink" GnomeScanSink : Read / Write
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.
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 ; |
GnomeScanJob* gnome_scan_job_new (void);
Instanciate a new job. The job create its own GnomeScanSettings upon construction. Well, i don't like that, this may change later.
Returns : | a new GnomeScanJob |
GnomeScanSettings* gnome_scan_job_get_settings (GnomeScanJob *job);
Retrieve the settings used by the job.
job : |
a GnomeScanJob |
Returns : | the job GnomeScanSettings
|
void gnome_scan_job_set_scanner (GnomeScanJob *job, GnomeScanner *scanner);
Set the source of the acquisition.
job : |
a GnomeScanJob |
scanner : |
a GnomeScanner |
GnomeScanner* gnome_scan_job_get_scanner (GnomeScanJob *job);
Retrieve the scanner used to acquire image.
job : |
a GnomeScanJob |
Returns : | a GnomeScanner |
void gnome_scan_job_set_sink (GnomeScanJob *job, GnomeScanSink *sink);
Set the scan sink.
job : |
a GnomeScanJob |
sink : |
a GnomeScanSink |
GnomeScanSink* gnome_scan_job_get_sink (GnomeScanJob *job);
Retrieve the sink used to output acquired image.
job : |
a GnomeScanJob |
Returns : | a GnomeScanSink |
void gnome_scan_job_run (GnomeScanJob *job);
Configure, iterate each part of the job and monitor task progress. You should call this function in a new thread. Ideally, you should never use this function directly and use GnomeScanAcquisitionDialog instead.
See: GnomeScanAcquisitionDialog or g_thread_create()
job : |
a GnomeScanJob |
void gnome_scan_job_cancel (GnomeScanJob *job);
Ask the job to stop.
job : |
a running GnomeScanJob |
scanner
" property"scanner" GnomeScanner : Read / Write
The GnomeScanner responsible of image acquisition.
settings
" property"settings" GnomeScanSettings : Read / Write
The GnomeScanSettings object containing all user settings for plugins.
sink
" property"sink" GnomeScanSink : Read / Write
The sink responsible to output acquired images.