Re: DS-7 Backend

David Mosberger-Tang (David.Mosberger@acm.org)
Thu, 7 May 1998 19:12:55 -0700

>>>>> On Thu, 7 May 1998 15:04:06 -0400 (EDT), Matt Martin <mmartin@Calvin.SFC.Lehigh.Edu> said:

Matt> Also, the native jpeg format of this camera (and others) seems
Matt> to go against the grain of SANE's operation. Seems like a
Matt> true waste to convert to raw format, then back to jpg for
Matt> saving. The TODO mentions new SANE image formats, is there
Matt> current effort or framework to allow such extension ?

It's not a waste if you want to do any image processing on the
acquired image (e.g., using GIMP). If you just want to save the
image, it's certainly not optimal though (particularly because JPG is
typically used in a lossy mode).

The file LEVEL2 in the SANE distribution spells out some additional
features that would be nice to have. One entry reads:

o Additional image data types, such as JPEG, MPEG, FlashPix, raw.
These would be useful for devices that directly generate such
formats (still cameras, for example). The raw image format could
be used when no other format is applicable. This would allow to
at least read and save the data in a file. This would probably
have to be coupled with adding a function that lets a frontend
tell the backend what level it supports, something like
sane_set_level (int max_supported_level).
[Based on suggestion by Andreas Beck <becka@charon.rz.beck-sw.de>]

What I would like to see is a library of conversion filters, e.g.,
JPG->PPM, FlashPix->PPM, PPM->JPG, PPM->FlashPix and so on (much like
the PNM utilities). Then, a frontend could declare what image types
it supports and the backend declares what image type it supports. If
there is a mismatch, a pipeline of available filters can be
constructed that will make it possible for the frontend to interpret
the backends data. E.g., xscanimage when running under GIMP would
declare "PPM" only, then when you'd attempt to read from a JPG-only
camera, the JPG->PPM filter would be used.

Since this would be a fairly significant change to the SANE API, I
think we should do this extension as part of a next major revision.
If you're interested in working on this, you could design the DS-7
backend in a way that works with the existing SANE (i.e., JPG always
gets converted to PPM) but makes it easy to adapt to the new
environment once work on the extended API begins.

--david

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com