xscanimage, gtk and gamma curves.

Didier Carlier (carlierd@acm.org)
Sun, 01 Feb 1998 00:17:58 +0100

This a question about the handling of gamma curves with more than 256 entries.

The coolscan scanner uses tables with 2048 entries and I declared them like
this:

scanner->opt[OPT_GAMMA_VECTOR].name = SANE_NAME_GAMMA_VECTOR;
scanner->opt[OPT_GAMMA_VECTOR].title = SANE_TITLE_GAMMA_VECTOR;
scanner->opt[OPT_GAMMA_VECTOR].desc = SANE_DESC_GAMMA_VECTOR;
scanner->opt[OPT_GAMMA_VECTOR].type = SANE_TYPE_INT;
scanner->opt[OPT_GAMMA_VECTOR].unit = SANE_UNIT_NONE;
scanner->opt[OPT_GAMMA_VECTOR].size = 2048 * sizeof (SANE_Word);
scanner->opt[OPT_GAMMA_VECTOR].constraint_type = SANE_CONSTRAINT_RANGE;
scanner->opt[OPT_GAMMA_VECTOR].constraint.range = &gamma_range; /* 0->2047 */

If I press the 'linear' button on the right of the gamma curves displayed by
xscanimage, the backend is passed a gamma table which looks very good:

[coolscan] 000: 0000 0001 0002 0003 0004 0005 0006 0007
[coolscan] 008: 0008 0009 0010 0011 0012 0013 0014 0015
[coolscan] 016: 0016 0017 0018 0019 0020 0021 0022 0023
...
[coolscan] 2024 2024 2025 2026 2027 2028 2029 2030 2031
[coolscan] 2032 2032 2033 2034 2035 2036 2037 2038 2039
[coolscan] 2040 2040 2041 2042 2043 2044 2045 2046 2047

However, if I press on the gamma button and enter 1.8 in the pop-up window, I
get the following:

[coolscan] 000: 0000 0000 0000 0000 0000 0000 0000 0083
[coolscan] 008: 0083 0083 0083 0083 0083 0122 0122 0122
[coolscan] 016: 0122 0122 0122 0122 0153 0153 0153 0153
....
[coolscan] 2024 2043 2043 2043 2043 2043 2043 2043 2043
[coolscan] 2032 2043 2043 2043 2043 2047 2047 2047 2047
[coolscan] 2040 2047 2047 2051 2051 2051 2051 2051 2051

There are 2 problems here:
- the curve is not as smooth as it could be,
- the last 6 points are outside of the requested range.

I could handle the second problem within the backend code, but the first one
is much less obvious.

Am I doing something wrong ? Is this a known problem/limitation ?

Kind regards,
Didier

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com