SCGetScannerRes(3) Impressario SCGetScannerRes(3)NAME
SCGetScannerRes, SCGetMinMaxRes - Determining the resolutions supported
by a scanner driver
SYNOPSIS
#include <stdio.h>
#include <scanner.h>
int SCGetScannerRes(SCANNER *s, int metric, float **xres,
float **yres, int *nres);
int SCGetMinMaxRes(SCANNER *s, int metric, float *minx, float *miny,
float *maxx, float *maxy);
DESCRIPTION
SCGetScannerRes queries the scanner driver s about the native resolutions
supported. These are the resolutions which when used for scanning will
yield the highest quality image output.
SCGetScannerRes makes *xres and *yres point to arrays of floating point
numbers, representing pairs of horizontal and vertical native
resolutions. SCGetScannerRes sets *nres to the number of elements in
each of xres and yres. metric should be passed in as either SC_INCHES or
SC_CENTIM, depending on whether the resolution is desired in pixels per
inch or pixels per centimeter.
Some scanners support all resolutions within the bounds given by
SCGetMinMaxRes (see below) equally well. For such scanners, *nres will
be 0 after a call to SCGetScannerRes.
SCGetMinMaxRes fills in *minx with the smallest resolution supported in
the horizontal direction, *miny with the smallest resolution supported in
the vertical direction, *maxx with the largest resolution supported in
the horizontal direction, and *maxy with the largest resolution supported
in the vertical direction. Use metric to specify either SC_INCHES or
SC_CENTIM for the units.
The scanner driver must support any horizontal resolution between *minx
and *maxx, and it must support any vertical resolution between *miny and
*maxy. Specifying a resolution outside these limits will yield
unpredictable results. If the resolution specified is not a resolution
pair returned by SCScannerRes, image quality may suffer. See SCSetup(3)
for more information on setting the scanning resolution.
RETURN VALUE
SCGetScannerRes and SCGetMinMaxRes return 0 if they are successful, and
-1 if an error occurs. If an error does occur, SCerrno will be set to
indicate the reason for failure.
Page 1
SCGetScannerRes(3) Impressario SCGetScannerRes(3)EXECUTION ERROR CODES
SCGetScannerRes and SCGetMinMaxRes will fail under the following
circumstances.
SCEBADMETRIC Unsupported metric
SCEDEV Scanner driver error
SCECOMM Error communicating with scanner driver
WARNING
The memory pointed to by *xres and *yres after a call to SCGetScannerRes
belongs to libscan(3) and should not be modified by the calling program.
Nor should any assumptions be made about its values after subsequent
calls to SCGetScannerRes; in other words, it should be copied to memory
owned by the calling program before future calls to SCGetScannerRes.
SEE ALSOlibscan(3), SCSetup(3).
Page 2