[sane-devel] HP5470c scanner nearly working!

2003-02-23 Thread Martijn van Oosterhout
--WplhKdTI2c8ulnbP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Feb 22, 2003 at 02:06:31PM +0100, Bertrik Sikken wrote:
 Martijn van Oosterhout wrote:
 Thanks for that. My main questions are: what functions do you need to
 implement and is it backend push or caller pull for the data? Maybe I'll
 look through the source for the hp3300 driver to see what I can do.
 
 There is a document somewhere on www.mostang.com/sane which describes
 the sane api quite well.

I havn't found this document yet, but I'm making good progress.

 The frontend pulls data from the backend (by means of the sane_read=20
 function)
=20
 The sane api allows a lot of flexibility for scanner settings, by letting
 the scanner backend present a set of options to the scanner frontend.
 For example the backend can present the vertical scan position as
 a value in the range 0..300 with unit mm. Another example is scan
 resolution which can take on one of a set of discrete values
 {75, 150, 300, 600, 1200} with unit dpi.
 You can probably copy the mechanism for informing the frontend about
 these options and for setting / getting the values of these options
 from other backends without making a lot of changes.

Yep, I've been copying and pasting from the hp3300 backend. Maybe not a good
choice but it seems to be working OK. At the moment I can see by stracing
xscanimage that it's opening my .so but it's just exiting saying it didn't
find anything. Obviously the dlopen() isn't succeeding but I'm not getting
an error.

 Some important functions in the sane api are
 * sane_get_parameters, which reports the actual size in pixels and bytes
 if the scan would be done with the currently set scanner settings.
 So you may need to convert from mm to pixels here.

At what stage is this function called? Because I can get the scanner to give
me the actual values rather than my guesses, but it's not good if it's going
to be called dozens of times before the actual scan starts.

 * sane_start, which indicates that image capture should be started.
 Here you could probably convert the scan options into values / tables
 that the scanner hardware understands.
 * sane_read, which reads chunks of image data.

Can I safely assume the caller of sane_read will provide a buffer 10K.
Probably not hey? So I have to buffer possibly down to the subpixel level.

Thanks anyway,
--=20
Martijn van Oosterhout   klep...@svana.org   http://svana.org/kleptog/
 Support bacteria! They're the only culture some people have.

--WplhKdTI2c8ulnbP
Content-Type: application/pgp-signature
Content-Disposition: inline

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+V4IgY5Twig3Ge+YRAsG8AKDLqAroBeVNuKSaREtuTl1QXBPBrwCgy/fl
Y2z/wzoivQDjJnsB7udhQNQ=
=2t6m
-END PGP SIGNATURE-

--WplhKdTI2c8ulnbP--


[sane-devel] HP5470c scanner nearly working!

2003-02-23 Thread Martijn van Oosterhout
--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Feb 22, 2003 at 03:54:37PM +0100, Henning Meier-Geinitz wrote:
 Hi,
=20
 On Sun, Feb 23, 2003 at 12:58:56AM +1100, Martijn van Oosterhout wrote:
 It's called the SANE Standard or Programmer's Manual. It can be
 found on the documentation page: http://www.mostang.com/sane/docs.html
=20
 Some tips are also in doc/backend-writing.txt. E.g. for writing
 portable code.

Thanks, I found them. I'm reading them now. Actually, I have one addition
for the backend-writing.txt

* Please do not assume that `void *' has the same size as `int'.  On some
  systems, it's `long' and the size of this type may be bigger than that of
  an int (this is true for practially any of the 64-bit systems). Where this
  comes up is with opaque handles. For example:

  int OpaqueHandle;
  MyScanner *s =3D (MyScanner *)OpaqueHandle;

  will FAIL on most 64 bit systems. Please use `void *' or better
  `SANE_Handle'.


  Can I safely assume the caller of sane_read will provide a buffer 10K.
  Probably not hey? So I have to buffer possibly down to the subpixel lev=
el.
=20
 No. The buffer can be as low as 1 byte. In backends that need to do
 image manipulation, usually a buffer of one or multiple scan lines is
 used. Especially if you need to do line distance correction (CCD
 scanners), you may need 10 or more lines of each color.

Heh. I wonder if all backends really support a buffer that small. Nice
stress test :)

--=20
Martijn van Oosterhout   klep...@svana.org   http://svana.org/kleptog/
 Support bacteria! They're the only culture some people have.

--9amGYk9869ThD9tj
Content-Type: application/pgp-signature
Content-Disposition: inline

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+WAb6Y5Twig3Ge+YRAsl1AJ46PETiuAqEeiQTypJsdQtpvJnN8wCg1zWK
0zspflfr9nUlb9OOVnQ622Y=
=1S2+
-END PGP SIGNATURE-

--9amGYk9869ThD9tj--


[sane-devel] HP5470c scanner nearly working!

2003-02-23 Thread Henning Meier-Geinitz
Hi,

On Sun, Feb 23, 2003 at 10:25:46AM +1100, Martijn van Oosterhout wrote:
 On Sat, Feb 22, 2003 at 03:54:37PM +0100, Henning Meier-Geinitz wrote:
  Some tips are also in doc/backend-writing.txt. E.g. for writing
  portable code.
 
 Thanks, I found them. I'm reading them now. Actually, I have one addition
 for the backend-writing.txt

Thanks, I will add it.

   Can I safely assume the caller of sane_read will provide a buffer 10K.
   Probably not hey? So I have to buffer possibly down to the subpixel level.
  
  No. The buffer can be as low as 1 byte. In backends that need to do
  image manipulation, usually a buffer of one or multiple scan lines is
  used. Especially if you need to do line distance correction (CCD
  scanners), you may need 10 or more lines of each color.
 
 Heh. I wonder if all backends really support a buffer that small. Nice
 stress test :)

scanimage -T and frontend/tstbackend both try 1 byte per read scans.
So every backend in the sane distribution should be able to do this :-)

Bye,
  Henning


[sane-devel] HP5470c scanner nearly working!

2003-02-22 Thread Thomas Soumarmon
Le Jeudi 20 F=E9vrier 2003 13:30, Martijn van Oosterhout a =E9crit :


 Anyway, I've put a new version up on my site
 (http://svana.org/kleptog/hp5470/). Let me know if the images come out =
OK.
 My xview is having problems showing 48bpp PPM images so you may have to
 convert them to PNG to make them viewable.

 Let me know how it goes.

It compiled and ran perfectly. As in your output.png the scan area is a b=
it=20
outside the glass and the colors are OK.

I'll probably have time on next week to do some work on the scanner. Just=
 tell=20
me what you would like to do to help.=20

Great work.





[sane-devel] HP5470c scanner nearly working!

2003-02-22 Thread Bertrik Sikken
Martijn van Oosterhout wrote:

5. Turn it into a SANE backend. Hopefully this will not be hard.


I won't mind helping you with this.
What I did with the hp3300 was to put the core functionality in one
source file. Then on top of this, I could put either a sane interface
(which is quite simple) or a frontend for a console testtool.


Thanks for that. My main questions are: what functions do you need to
implement and is it backend push or caller pull for the data? Maybe I'll
look through the source for the hp3300 driver to see what I can do.

There is a document somewhere on www.mostang.com/sane which describes
the sane api quite well.
The frontend pulls data from the backend (by means of the sane_read 
function)

The sane api allows a lot of flexibility for scanner settings, by letting
the scanner backend present a set of options to the scanner frontend.
For example the backend can present the vertical scan position as
a value in the range 0..300 with unit mm. Another example is scan
resolution which can take on one of a set of discrete values
{75, 150, 300, 600, 1200} with unit dpi.
You can probably copy the mechanism for informing the frontend about
these options and for setting / getting the values of these options
from other backends without making a lot of changes.

Some important functions in the sane api are
* sane_get_parameters, which reports the actual size in pixels and bytes
if the scan would be done with the currently set scanner settings.
So you may need to convert from mm to pixels here.
* sane_start, which indicates that image capture should be started.
Here you could probably convert the scan options into values / tables
that the scanner hardware understands.
* sane_read, which reads chunks of image data.

Regards,
Bertrik



[sane-devel] HP5470c scanner nearly working!

2003-02-22 Thread Henning Meier-Geinitz
Hi,

On Sun, Feb 23, 2003 at 12:58:56AM +1100, Martijn van Oosterhout wrote:
 On Sat, Feb 22, 2003 at 02:06:31PM +0100, Bertrik Sikken wrote:
  There is a document somewhere on www.mostang.com/sane which describes
  the sane api quite well.
 
 I havn't found this document yet, but I'm making good progress.

It's called the SANE Standard or Programmer's Manual. It can be
found on the documentation page: http://www.mostang.com/sane/docs.html

Some tips are also in doc/backend-writing.txt. E.g. for writing
portable code.

  Some important functions in the sane api are
  * sane_get_parameters, which reports the actual size in pixels and bytes
  if the scan would be done with the currently set scanner settings.
  So you may need to convert from mm to pixels here.
 
 At what stage is this function called? Because I can get the scanner to give
 me the actual values rather than my guesses, but it's not good if it's going
 to be called dozens of times before the actual scan starts.

sane_get_parameters can be called before and after sane_start. Before
sane_start, you can just guess the parameters, after that they must be
exact and can't be changed. More details are in the standard.

  * sane_start, which indicates that image capture should be started.
  Here you could probably convert the scan options into values / tables
  that the scanner hardware understands.
  * sane_read, which reads chunks of image data.
 
 Can I safely assume the caller of sane_read will provide a buffer 10K.
 Probably not hey? So I have to buffer possibly down to the subpixel level.

No. The buffer can be as low as 1 byte. In backends that need to do
image manipulation, usually a buffer of one or multiple scan lines is
used. Especially if you need to do line distance correction (CCD
scanners), you may need 10 or more lines of each color.

Bye,
  Henning



[sane-devel] HP5470c scanner nearly working!

2003-02-21 Thread Martijn van Oosterhout
--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 20, 2003 at 09:19:26PM +0100, Bertrik Sikken wrote:
 Martijn van Oosterhout wrote:
 1. Actually use results of calibration scans. Anyone who has an idea how
 scanners are calibrated, point me at some info, please.
 
 With my hp3300 I do this by scanning an area on the inside of the scanner,
 which is mostly white but with a small square black area.
 I then determine the color of the darkest pixel and call this the black
 level. From the white area, several lines are averaged into a single
 white line, which gives a white level for each CCD pixel.
 Then a table is calculated which contains a gain and offset value for
 each color component (R,G,B) of each CCD pixel. The gain is
 proportional to as (white(x) - 'black') and I use simply a value
 proportional to 'black' for the offset.

Ok, Windows is doing two scans, one for the white and one for the black so
you have two values per CCD rather than one black value. What you describe =
is
basically what I was thinking of anyway, though I didn't know there was a
bit structure. It looked more like a min/max pair. I'll have another look.

 The table can be used not only for gamma correction, but also for
 brightness and contrast compensation. Infact, if a backend presents
 this table to xsane, then xsane will use it automatically for
 gamma, brightness and contrast and the backend does not even
 need to know how to calculate gamma.

That's cool. Maybe I should do that.

 5. Turn it into a SANE backend. Hopefully this will not be hard.
 
 I won't mind helping you with this.
 What I did with the hp3300 was to put the core functionality in one
 source file. Then on top of this, I could put either a sane interface
 (which is quite simple) or a frontend for a console testtool.

Thanks for that. My main questions are: what functions do you need to
implement and is it backend push or caller pull for the data? Maybe I'll
look through the source for the hp3300 driver to see what I can do.

--=20
Martijn van Oosterhout   klep...@svana.org   http://svana.org/kleptog/
 Support bacteria! They're the only culture some people have.

--lrZ03NoBR/3+SXJZ
Content-Type: application/pgp-signature
Content-Disposition: inline

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+VWhNY5Twig3Ge+YRAhUkAKCEO+3UTqKnxhhio84itcMStVyirwCgpOHY
AXXxkuClDvlb4MB95gq+TRQ=
=ozr+
-END PGP SIGNATURE-

--lrZ03NoBR/3+SXJZ--


[sane-devel] HP5470c scanner nearly working!

2003-02-21 Thread David Stevenson
On Wednesday 19 February 2003 10:52 pm, Martijn van Oosterhout wrote:
 This is only a test program, not a backend. Things still to do:
 1. Actually use results of calibration scans. Anyone who has an idea how
 scanners are calibrated, point me at some info, please.
Martin
I did some work on gains and offsets for the GT68xx backend, the CCD version. 
The CIS version is somewhat different.
I was mostly porting the code supplied by the manufacture but the principal 
was fairly straight forward.
Loop 6 times,  adjusting by trial and error, scanning the line with it's 
black mark and white strip to set the offset. With a low gain, read an 
average white and and average black and adjust offset till these are equal 
distance from mid point. 
Then start looping to set the gain.
This was done for each colour building the gain till the avg signal level was 
near max.

Let me know if you need any more details.
David




[sane-devel] HP5470c scanner nearly working!

2003-02-21 Thread Martijn van Oosterhout
--6sX45UoQRIJXqkqR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 20, 2003 at 09:19:26PM +0100, Bertrik Sikken wrote:
 In the hp3300, the calibration table uses a 16-bit word for each
 calibration value, lower 6 bits are offset and upper 10 bits gain.

Actually, I just remembered. Here is a huge difference. The calibration info
on the hp5470 amounts to 12 bytes per pixel. Three small 16 bit integers
(around 0x05e0) and three large 16 integers (around 0xa000). That why I
think that they're max and min values. At the moment they're hardcoded
because without anything it just produces nothing useful.

I'll look into all this tonight.
--=20
Martijn van Oosterhout   klep...@svana.org   http://svana.org/kleptog/
 Support bacteria! They're the only culture some people have.

--6sX45UoQRIJXqkqR
Content-Type: application/pgp-signature
Content-Disposition: inline

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+VYGZY5Twig3Ge+YRAvZYAKC60pRZtuPkQ+tg/hYIJQOCDjhn8gCdE1In
OXgyqJ25yfcbaSGFEYgkmsA=
=XXcB
-END PGP SIGNATURE-

--6sX45UoQRIJXqkqR--


[sane-devel] HP5470c scanner nearly working!

2003-02-20 Thread Thomas Soumarmon
Hi Martijn,

I began about one month ago to do the same work you've done. Unfortunatel=
y=20
about 2 weeks after the beginning my spare time reduced a lot, so I must =
say=20
that it slowed down a lot, reaching a 0 speed for about 1 month.

There is now a Sourceforge project set up for hp5400 series SANE backend =
:=20
http://sourceforge.net/projects/hp5400backend/
and=20
http://hp5400backend.sourceforge.net/
I hope you can get some information there.

I think it would be worse you add your work on that project. As you might=
 have=20
more time than I, would you want to be added as an administrator on that=20
project ?

Another thing. The test program you wrote compiled perfectly and appearen=
tly=20
worked ok. I email you the log directly.

Have a nice day.


Le Mercredi 19 F=E9vrier 2003 23:52, Martijn van Oosterhout a =E9crit :
 [Please CC any replies so I can more easily find them through the rest =
of
 my mail. Thanks.]

 I finally got totally sick of waiting for someone to make my scanner wo=
rk,
 so I did it myself. The results are on my webpage:
 http://svana.org/kleptog/hp5470/. I'm doing it over USB.

 Situation is:
 1. It finds the scanner and warms up the lamp
 2. It performs two calibrations scans like in windows
 3. Performs the preview scan and dumps it to disk

 This is only a test program, not a backend. Things still to do:
 1. Actually use results of calibration scans. Anyone who has an idea ho=
w
 scanners are calibrated, point me at some info, please.
 2. Do gamma correction. Right now the gamma correction is linear. Again=
,
 someone who knows the theory would be helpful here.
 3. Decipher data format. Looks pretty straight forward. R, G, B seperat=
e.
 4. Work out the parameters for the different scan types (BW, 24-bit, e=
tc).
 5. Turn it into a SANE backend. Hopefully this will not be hard.
 6. Make negative/slide addon work.

 Hopefully not far to go now. If anyone can test my code it would be muc=
h
 appreciated. Note this version produces a *lot* of debug info. Please s=
end
 it all for bug reports. Thanks.

 I'd like to thank Bertrik Sikken for doing some of the ground work.

 Have a nice day,



[sane-devel] HP5470c scanner nearly working!

2003-02-20 Thread Martijn van Oosterhout
--i9LlY+UWpKt15+FH
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Yeah, I saw the project but there did not seem to be anything happening.
However, the hp5400-20021018.tar.gz did form the basis for my program.

Thanks for your report of success. Seems only the version numbers are sligh=
tly
different.

Anyway, I've decoded the images and it now saves them to disk as PPM files.
If you scan anything with a lot of white you can see that the calibration
(and gamma correction) definitly needs some work. I have some theories about
how to get the figures but I havn't done it yet. Interestingly, the full
preview image includes a section which is within the case itself. Looks like
some test areas and other odd stuff going on there. I've put the image up
here: http://svana.org/kleptog/hp5470/output.png (1MB).

I've not used sourceforge much, so I'm not quite sure what that entails.
What I would like is information on how to write a SANE backend. I've
downloaded the source but there does not seem to be any kind of skeleton or
documentation on how to write a backend. What I've got is easily good enough
to pass for beta in a SANE backend.

Anyway, I've put a new version up on my site
(http://svana.org/kleptog/hp5470/). Let me know if the images come out OK.
My xview is having problems showing 48bpp PPM images so you may have to
convert them to PNG to make them viewable.

Let me know how it goes.

On Thu, Feb 20, 2003 at 09:13:47AM +0100, Thomas Soumarmon wrote:
=20
 Hi Martijn,
=20
 I began about one month ago to do the same work you've done. Unfortunatel=
y=20
 about 2 weeks after the beginning my spare time reduced a lot, so I must =
say=20
 that it slowed down a lot, reaching a 0 speed for about 1 month.
=20
 There is now a Sourceforge project set up for hp5400 series SANE backend =
:=20
 http://sourceforge.net/projects/hp5400backend/
 and=20
 http://hp5400backend.sourceforge.net/
 I hope you can get some information there.
=20
 I think it would be worse you add your work on that project. As you might=
 have=20
 more time than I, would you want to be added as an administrator on that=
=20
 project ?
=20
 Another thing. The test program you wrote compiled perfectly and appearen=
tly=20
 worked ok. I email you the log directly.
=20
 Have a nice day.
=20
=20
 Le Mercredi 19 F=E9vrier 2003 23:52, Martijn van Oosterhout a =E9crit :
  [Please CC any replies so I can more easily find them through the rest =
of
  my mail. Thanks.]
 
  I finally got totally sick of waiting for someone to make my scanner wo=
rk,
  so I did it myself. The results are on my webpage:
  http://svana.org/kleptog/hp5470/. I'm doing it over USB.
 
  Situation is:
  1. It finds the scanner and warms up the lamp
  2. It performs two calibrations scans like in windows
  3. Performs the preview scan and dumps it to disk
 
  This is only a test program, not a backend. Things still to do:
  1. Actually use results of calibration scans. Anyone who has an idea how
  scanners are calibrated, point me at some info, please.
  2. Do gamma correction. Right now the gamma correction is linear. Again,
  someone who knows the theory would be helpful here.
  3. Decipher data format. Looks pretty straight forward. R, G, B seperat=
e.
  4. Work out the parameters for the different scan types (BW, 24-bit, e=
tc).
  5. Turn it into a SANE backend. Hopefully this will not be hard.
  6. Make negative/slide addon work.
 
  Hopefully not far to go now. If anyone can test my code it would be much
  appreciated. Note this version produces a *lot* of debug info. Please s=
end
  it all for bug reports. Thanks.
 
  I'd like to thank Bertrik Sikken for doing some of the ground work.
 
  Have a nice day,
=20
 ___
 Sane-devel mailing list
 sane-de...@www.mostang.com
 http://www.mostang.com/mailman/listinfo/sane-devel

--=20
Martijn van Oosterhout   klep...@svana.org   http://svana.org/kleptog/
 Support bacteria! They're the only culture some people have.

--i9LlY+UWpKt15+FH
Content-Type: application/pgp-signature
Content-Disposition: inline

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+VMpdY5Twig3Ge+YRAgiGAKCpa1/t2vVbCv8BHKGH2726Tcbq5QCg2iGJ
rzaKlduB1RK7hL5VffsBwbk=
=cOsE
-END PGP SIGNATURE-

--i9LlY+UWpKt15+FH--


[sane-devel] HP5470c scanner nearly working!

2003-02-20 Thread Bertrik Sikken
Martijn van Oosterhout wrote:

[Please CC any replies so I can more easily find them through the rest of my
mail. Thanks.]

I finally got totally sick of waiting for someone to make my scanner work,
so I did it myself. The results are on my webpage:
http://svana.org/kleptog/hp5470/. I'm doing it over USB.

Situation is:
1. It finds the scanner and warms up the lamp
2. It performs two calibrations scans like in windows
3. Performs the preview scan and dumps it to disk

Cool!


This is only a test program, not a backend. Things still to do:
1. Actually use results of calibration scans. Anyone who has an idea how
scanners are calibrated, point me at some info, please.

With my hp3300 I do this by scanning an area on the inside of the scanner,
which is mostly white but with a small square black area.
I then determine the color of the darkest pixel and call this the black
level. From the white area, several lines are averaged into a single
white line, which gives a white level for each CCD pixel.
Then a table is calculated which contains a gain and offset value for
each color component (R,G,B) of each CCD pixel. The gain is
proportional to as (white(x) - 'black') and I use simply a value
proportional to 'black' for the offset.

In the hp3300, the calibration table uses a 16-bit word for each
calibration value, lower 6 bits are offset and upper 10 bits gain.


2. Do gamma correction. Right now the gamma correction is linear. Again,
someone who knows the theory would be helpful here.

I my case, I have 4096 entries of 8-bit each and I use
  for (i = 0; i  4096; i++) {
iData = floor(256.0 * pow(((double)i / 4096.0), 1.0 / Gamma));
pabTable[i] = iData;
  }

For your 16-bit to 16-bit table you could use something like
  for (i = 0; i  65536; i++) {
buffer[i] = floor(65536.0 * pow(((double)i / 65536.0), 1.0 / Gamma));
  }

The table can be used not only for gamma correction, but also for
brightness and contrast compensation. Infact, if a backend presents
this table to xsane, then xsane will use it automatically for
gamma, brightness and contrast and the backend does not even
need to know how to calculate gamma.


3. Decipher data format. Looks pretty straight forward. R, G, B seperate.
4. Work out the parameters for the different scan types (BW, 24-bit, etc).
5. Turn it into a SANE backend. Hopefully this will not be hard.

I won't mind helping you with this.
What I did with the hp3300 was to put the core functionality in one
source file. Then on top of this, I could put either a sane interface
(which is quite simple) or a frontend for a console testtool.


6. Make negative/slide addon work.

Hopefully not far to go now. If anyone can test my code it would be much
appreciated. Note this version produces a *lot* of debug info. Please send
it all for bug reports. Thanks.

I'd like to thank Bertrik Sikken for doing some of the ground work.

Have a nice day,

Kind regards,
Bertrik




[sane-devel] HP5470c scanner nearly working!

2003-02-20 Thread Bertrik Sikken
Martijn van Oosterhout wrote:

Yeah, I saw the project but there did not seem to be anything happening.
However, the hp5400-20021018.tar.gz did form the basis for my program.

Thanks for your report of success. Seems only the version numbers are slightly
different.

Anyway, I've decoded the images and it now saves them to disk as PPM files.
If you scan anything with a lot of white you can see that the calibration
(and gamma correction) definitly needs some work. I have some theories about
how to get the figures but I havn't done it yet. Interestingly, the full
preview image includes a section which is within the case itself. Looks like
some test areas and other odd stuff going on there. I've put the image up
here: http://svana.org/kleptog/hp5470/output.png (1MB).

The white strip with the black square is very similar to what you see in
hp3300, hp3400 and hp4300 scanners.
Also very typical is the shift in color components, where in this case
blue seems to have shifted up exactly 1 pixel and red down 1 pixel.
For the niash backend (which is still not ready by the way...) I solved
this by using a circular buffer that realigns the color components.
This can be a bit tricky, since the shift varies with vertical scan 
resolution.

Regards,
Bertrik


I've not used sourceforge much, so I'm not quite sure what that entails.
What I would like is information on how to write a SANE backend. I've
downloaded the source but there does not seem to be any kind of skeleton or
documentation on how to write a backend. What I've got is easily good enough
to pass for beta in a SANE backend.

Anyway, I've put a new version up on my site
(http://svana.org/kleptog/hp5470/). Let me know if the images come out OK.
My xview is having problems showing 48bpp PPM images so you may have to
convert them to PNG to make them viewable.

Let me know how it goes.

On Thu, Feb 20, 2003 at 09:13:47AM +0100, Thomas Soumarmon wrote:

Hi Martijn,

I began about one month ago to do the same work you've done. Unfortunately 
about 2 weeks after the beginning my spare time reduced a lot, so I must say 
that it slowed down a lot, reaching a 0 speed for about 1 month.

There is now a Sourceforge project set up for hp5400 series SANE backend : 
http://sourceforge.net/projects/hp5400backend/
and 
http://hp5400backend.sourceforge.net/
I hope you can get some information there.

I think it would be worse you add your work on that project. As you might 
have 
more time than I, would you want to be added as an administrator on that 
project ?

Another thing. The test program you wrote compiled perfectly and appearently 
worked ok. I email you the log directly.

Have a nice day.