coolscan2 update to 0.1.7

DEVEL_2_0_BRANCH-1
Andras Major 2002-08-21 23:36:00 +00:00
rodzic 30caa0cb6b
commit 29b7b4d674
3 zmienionych plików z 68 dodań i 31 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
/* ========================================================================= */
/*
SANE - Scanner Access Now Easy.
coolscan2.c , version 0.1.6
coolscan2.c , version 0.1.7
This file is part of the SANE package.
@ -56,6 +56,8 @@
/*
Revision log:
0.1.7, 22/08/2002, andras: added exposure correction option
and hack for LS-40 IR readout
0.1.6, 14/06/2002, andras: types etc. fixed, fixes for LS-8000
0.1.5, 26/04/2002, andras: lots of minor fixes related to saned
0.1.4, 22/04/2002, andras: first version to be included in SANE CVS
@ -93,7 +95,7 @@
#define CS2_VERSION_MAJOR 0
#define CS2_VERSION_MINOR 1
#define CS2_REVISION 6
#define CS2_REVISION 7
#define CS2_CONFIG_FILE "coolscan2.conf"
#define WSIZE (sizeof (SANE_Word))
@ -175,6 +177,7 @@ typedef enum
CS2_OPTION_DEPTH,
CS2_OPTION_EXPOSURE,
CS2_OPTION_EXPOSURE_R,
CS2_OPTION_EXPOSURE_G,
CS2_OPTION_EXPOSURE_B,
@ -253,7 +256,7 @@ typedef struct
logical_width, logical_height;
int odd_padding;
double exposure_r, exposure_g, exposure_b;
double exposure, exposure_r, exposure_g, exposure_b;
unsigned long real_exposure[10];
SANE_Bool focus_on_centre;
@ -515,6 +518,26 @@ sane_open (SANE_String_Const name, SANE_Handle * h)
o.constraint.word_list = word_list;
}
break;
case CS2_OPTION_EXPOSURE:
o.name = "exposure";
o.title = "Exposure multiplier";
o.desc = "Exposure multiplier for all channels";
o.type = SANE_TYPE_FIXED;
o.unit = SANE_UNIT_NONE;
o.size = WSIZE;
o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
o.constraint_type = SANE_CONSTRAINT_RANGE;
range = (SANE_Range *) cs2_xmalloc (sizeof (SANE_Range));
if (!range)
alloc_failed = 1;
else
{
range->min = SANE_FIX (0.);
range->max = SANE_FIX (10.);
range->quant = SANE_FIX (0.1);
o.constraint.range = range;
}
break;
case CS2_OPTION_EXPOSURE_R:
o.name = "red-exposure";
o.title = "Red exposure time";
@ -973,9 +996,10 @@ sane_open (SANE_String_Const name, SANE_Handle * h)
s->focus = 0;
s->focusx = 0;
s->focusy = 0;
s->exposure_r = 240.;
s->exposure_g = 240.;
s->exposure_b = 200.;
s->exposure = 1.;
s->exposure_r = 1200.;
s->exposure_g = 1200.;
s->exposure_b = 1000.;
s->infrared_stage = CS2_INFRARED_OFF;
s->infrared_next = CS2_INFRARED_OFF;
s->infrared_buf = NULL;
@ -1048,6 +1072,9 @@ sane_control_option (SANE_Handle h, SANE_Int n, SANE_Action a, void *v,
case CS2_OPTION_PREVIEW:
*(SANE_Word *) v = s->preview;
break;
case CS2_OPTION_EXPOSURE:
*(SANE_Word *) v = SANE_FIX (s->exposure);
break;
case CS2_OPTION_EXPOSURE_R:
*(SANE_Word *) v = SANE_FIX (s->exposure_r);
break;
@ -1195,6 +1222,9 @@ sane_control_option (SANE_Handle h, SANE_Int n, SANE_Action a, void *v,
case CS2_OPTION_PREVIEW:
s->preview = *(SANE_Word *) v;
break;
case CS2_OPTION_EXPOSURE:
s->exposure = SANE_UNFIX (*(SANE_Word *) v);
break;
case CS2_OPTION_EXPOSURE_R:
s->exposure_r = SANE_UNFIX (*(SANE_Word *) v);
break;
@ -1305,6 +1335,7 @@ sane_control_option (SANE_Handle h, SANE_Int n, SANE_Action a, void *v,
status = cs2_get_exposure (s);
if (status)
return status;
s->exposure = 1.;
s->exposure_r = s->real_exposure[1] / 100.;
s->exposure_g = s->real_exposure[2] / 100.;
s->exposure_b = s->real_exposure[3] / 100.;
@ -1318,6 +1349,7 @@ sane_control_option (SANE_Handle h, SANE_Int n, SANE_Action a, void *v,
status = cs2_get_exposure (s);
if (status)
return status;
s->exposure = 1.;
s->exposure_r = s->real_exposure[1] / 100.;
s->exposure_g = s->real_exposure[2] / 100.;
s->exposure_b = s->real_exposure[3] / 100.;
@ -1724,7 +1756,7 @@ cs2_open (const char *device, cs2_interface_t interface, cs2_t ** sp)
s->type = CS2_TYPE_LS30;
else if (!strncmp (s->product_string, "LS-40 ED ", 16))
s->type = CS2_TYPE_LS40;
else if (!strncmp (s->product_string, "LS-2000 ", 16)) /* XXXXXXX ????????? */
else if (!strncmp (s->product_string, "LS-2000 ", 16))
s->type = CS2_TYPE_LS2000;
else if (!strncmp (s->product_string, "LS-4000 ED ", 16))
s->type = CS2_TYPE_LS4000;
@ -2524,7 +2556,7 @@ cs2_convert_options (cs2_t * s)
s->odd_padding = 0;
if ((s->bytes_per_pixel == 1) && (s->logical_width & 0x01)
&& (s->type != CS2_TYPE_LS30))
&& (s->type != CS2_TYPE_LS30) && (s->type != CS2_TYPE_LS2000))
s->odd_padding = 1;
if (s->focus_on_centre)
@ -2540,9 +2572,9 @@ cs2_convert_options (cs2_t * s)
s->subframe / s->unit_mm;
}
s->real_exposure[1] = s->exposure_r * 100.;
s->real_exposure[2] = s->exposure_g * 100.;
s->real_exposure[3] = s->exposure_b * 100.;
s->real_exposure[1] = s->exposure * s->exposure_r * 100.;
s->real_exposure[2] = s->exposure * s->exposure_g * 100.;
s->real_exposure[3] = s->exposure * s->exposure_b * 100.;
for (i_colour = 0; i_colour < 3; i_colour++)
if (s->real_exposure[cs2_colour_list[i_colour]] < 1)
@ -2615,7 +2647,10 @@ cs2_scan (cs2_t * s, cs2_scan_t type)
cs2_scanner_ready (s, CS2_STATUS_READY);
cs2_init_buffer (s);
cs2_parse_cmd (s, "24 00 00 00 00 00 00 00 3a 00");
if (s->type == CS2_TYPE_LS40)
cs2_parse_cmd (s, "24 00 00 00 00 00 00 00 3a 80");
else
cs2_parse_cmd (s, "24 00 00 00 00 00 00 00 3a 00");
cs2_parse_cmd (s, "00 00 00 00 00 00 00 32");
cs2_pack_byte (s, cs2_colour_list[i_colour]);

Wyświetl plik

@ -10,7 +10,7 @@
;
:backend "coolscan2"
:version "0.1.6"
:version "0.1.7"
:status :beta
:manpage "sane-coolscan2"
:url "http://coolscan2.sourceforge.net/"
@ -23,17 +23,19 @@
:interface "SCSI"
:comment "working -- model available to developer"
:model "LS 2000"
:interface "SCSI"
:model "LS 40 ED"
:interface "USB"
:comment "linux kernel problems might cause trouble"
:model "LS 4000 ED"
:interface "IEEE1394"
:comment "untested -- feedback needed"
:comment "needs linux kernel 2.4.19 or later"
:model "LS 8000 ED"
:interface "IEEE1394"
:comment "needs linux kernel patch for versions around 2.4.18"
:comment "needs linux kernel 2.4.19 or later"
; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level.

Wyświetl plik

@ -1,4 +1,4 @@
.TH sane-coolscan2 5 "03/05/2002"
.TH sane-coolscan2 5 "22/08/2002"
.IX sane-coolscan2
.SH NAME
sane-coolscan2 - SANE backend for Nikon Coolscan film scanners
@ -11,7 +11,7 @@ backend should be considered
.B beta-quality
software. Most functions have been stable for a long time, but of
course new development can not and will not function properly from
the very first day. Please report any strange behavior to the
the very first day. Please report any strange behaviour to the
maintainer of the backend.
.PP
@ -28,18 +28,9 @@ LS-2000 SCSI
.br
LS-40 ED (Coolscan IV) USB
.br
LS-8000 ED IEEE 1394
.RE
.PP
The following scanners should work with this backend, but are unconfirmed:
.PP
.RS
Model: Connection Type
.br
--------------------------- -------------------
.br
LS-4000 ED IEEE 1394
.br
LS-8000 ED IEEE 1394
.RE
Please send mail to the backend author (andras@users.sourceforge.net) to
@ -77,8 +68,8 @@ the backend is initialized (usually each time you start the frontend).
If set to "yes", the scanner will read the infrared channel, thus allowing
defect removal in software. The infrared image is read during a second scan,
with no options altered. The backend must not be restarted between the scans.
It will not therefore not work with scanimage, only
with graphical frontends.
If you use scanimage, perform a batch scan with batch-count=2 to obtain the
IR information.
.TP
.I --depth <n>
Here <n> can either be 8 or the maximum number of bits supported by the
@ -102,6 +93,10 @@ will maintain the white balance, while
.I --ae
will adjust each channel separately.
.TP
.I --exposure
Multiply all exposure times with this value. This allows exposure
correction without modifying white balance.
.TP
.I --eject
Eject the film strip.
.TP
@ -169,6 +164,11 @@ automatic film strip feeder when the backend is initialized, the frame option
will not appear at all. Also, restarting the frontend after swapping film
adapters is strongly recommended.
Linux kernels prior to 2.4.19 had a patch that truncated INQUIRY data
from IEEE 1394 scanners to 36 bytes, discarding vital information
about the scanner. The IEEE 1394 models therefore only work with
2.4.19 or later.
No real bugs currently known, please report any to the backend maintainer
or the SANE developers' email list.