[sane-devel] Additional frame types in Sane 1

René Rebe rene at exactcode.de
Fri Jul 27 10:44:27 UTC 2007


On Friday 27 July 2007 12:35:03 m. allan noah wrote:
> On 7/27/07, René Rebe <rene at exactcode.de> wrote:
> > On Saturday 30 June 2007 09:14:16 René Rebe wrote:
> > > Hi,
> > >
> > > On Friday 29 June 2007 23:12:40 m. allan noah wrote:
> > > > well, after letting this sit for a few weeks to see if i could think
> > > > of a better way, i stumbled across the fact that the sane backend for
> > > > bell and howell scanners already supports 3 additional frame types.
> > > > they are used to send variants of G4 fax, and the text that comes from
> > > > a hardware bar/patchcode reader. this code has been a part of sane for
> > > > years, and it has not hurt anyone.
> > > >
> > > > therefor, i am moving ahead with adding other frame-type support to
> > > > the mainline fujitsu backend. i will put the additional frametype
> > > > defines in sane.h, unless there are valid objections. i may also move
> > > > the ones that are in bh, too, so that the list remains unique.
> > >
> > > Oh nice! Thanks for digging up this prior art, did not saw this yet either.
> >
> > I just notice scanadf includes the same custom-copy of "non-basic"
> > FRAME types:
> >
> > 1.1          (tommarto 12-Jan-02): #ifndef sane_isbasicframe
> > 1.1          (tommarto 12-Jan-02): #define SANE_FRAME_TEXT 10
> > 1.1          (tommarto 12-Jan-02): #define SANE_FRAME_JPEG 11
> > 1.1          (tommarto 12-Jan-02): #define SANE_FRAME_G31D 12
> > 1.1          (tommarto 12-Jan-02): #define SANE_FRAME_G32D 13
> > 1.1          (tommarto 12-Jan-02): #define SANE_FRAME_G42D 14
> > 1.1          (tommarto 12-Jan-02): #define sane_strframe(f) ( (f) == SANE_FRAME_GRAY ? "gray" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_RGB ? "RGB" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_RED ? "red" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_GREEN ? "green" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_BLUE ? "blue" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_TEXT ? "text" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_JPEG ? "jpeg" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_G31D ? "g31d" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_G32D ? "g32d" : \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_G42D ? "g42d" : \
> > 1.1          (tommarto 12-Jan-02):   "unknown" )
> > 1.1          (tommarto 12-Jan-02):
> > 1.1          (tommarto 12-Jan-02): #define sane_isbasicframe(f) ( (f) == SANE_FRAME_GRAY || \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_RGB || \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_RED || \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_GREEN || \
> > 1.1          (tommarto 12-Jan-02):   (f) == SANE_FRAME_BLUE )
> > 1.1          (tommarto 12-Jan-02):
> > 1.1          (tommarto 12-Jan-02): #endif
> >
> > Unbelievable this was not added cleanly to SANE back in 2002.
> 
> actually, not unbelievable at all. i guess tom did not want to start a fight :)

Probably he was not trained from linux-kernel :-)

> > We certainly want to change the bh backend and scanadf to use the
> > SANE FRAME_JPEG, these days.
> 
> yes- i intend to do this in a month or so (very busy ATM), but i
> hesitate to change bh backend, since it's not mine :)

Well - the only problem is that since the now official FRAME_JPEG
has another enum value a new bh backend would pass the JPEG
data with another FRAME value, so the modified bh backend would
only function correctly with an equally updated scanadf.

This non-mainstream FRAME tinkering from 4 years ago is a little
problematic today.

Yours,

-- 
  René Rebe - ExactCODE GmbH - Europe, Germany, Berlin
  http://exactcode.de | http://t2-project.org | http://rene.rebe.name



More information about the sane-devel mailing list