Andrew> I was wondering why scanimage was producing such dark
Andrew> images, and realized that the bit depth returned from
Andrew> sane_get_parameters() in qcam.c is hard-wired to 8--the
Andrew> configured bit depth (4 or 6 bits) isn't used. Why is that
Andrew> done?
4 and 6 bit/sample are unsupported depths (see below).
Andrew> scanimage.c also assumes that grey-scale images will always
Andrew> have a bit depth of 8; for the moment I've been simply
Andrew> hand-editing the generated .pnm file, changing the number of
Andrew> colours from 255 to 63.
Argh, I think I mentioned in the SANE docs that the bit depth must be
either 1, 8 or 16 bits per sample, but I just checked and found that I
didn't say so explicitly. I fixed that now by adding the following to
the section on the Image Data Format:
\begin{changebar}
Valid bit depths are 1, 8, or 16 bits per sample. If a device's
natural bit depth is something else, it is up to the driver to scale
the sample values appropriately (e.g., a 4 bit sample could be
scaled by a factor of four to represent a sample value of depth 8).
\end{changebar}
So, the intent is that the qcam backend scales 4 and 6 bit samples to
8 bit samples. Then everything will work as intended.
--david
-- Source code, list archive, and docs: http://www.azstarnet.com/~axplinux/sane/ To unsubscribe: mail -s unsubscribe sane-devel-request@listserv.azstarnet.com