I was going to break the code to correct this out into it's own function
anyway, maybe this could be done later. I haven't looked at the Microtek
code that closely, but I see that it also has code to convert a line of
the form 'RRRRGGGGBBBB' into 'RGBRGBRGBRGB', so it might be good to move
that out into this 'library' also sometime. From the docs that I have
for the Ultima/Artec, it looks like it always needs this conversion done
in RGB mode.
Since I haven't looked at the Microtek code too closely, I am not sure
how similar the line-offset problem is to the Ultima/Artec. Here is a
quick description of the way my scanner works.
There is a different line offset for each resolution supported. This
offset is obtained by: offset = 8 * ( vertical_resolution / 300 ).
For 300 dpi, the offset is 8, so R0 goes with G8 and B16, R1 ~ G9 ~ B17,
etc. I work around this by getting a buffer to hold the first
(offset * 2) lines of Red, and another to hold the first (offset) lines
of Green. The actual scan window has to be set to the desired size +
(offset * 2) because we throw away (offset) lines at the beginning
and end of the scan. I'm going to make a function where I pass it a
block of data and it fills in a buffer and size variable if there is
enough data to fill a row yet. I can then do the RRGGBB => RGBRGB fixup
either inside or after this function.
Chris
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| Chris Pinkham |
| cpinkham@sh001.infi.net |
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
-- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com