Re: Artec AT3 and A6000C Plus driver

Chris Pinkham (
Tue, 31 Mar 1998 10:54:47 -0500 (EST)

Rogier Wolff wrote:
> Chris Pinkham wrote:
> > week or so. I have the driver working for greyscale and am finishing up
> > correcting a RGB-mode line-offset problem similar to the Microtek.

> Would it be a good idea to make a sort of "library" that can solve the
> line-offset problems, given a few parameters passed by the backend?

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 Pinkham |
| |

Source code, list archive, and docs:
To unsubscribe: echo unsubscribe sane-devel | mail