SCGetScanSize(3) Impressario SCGetScanSize(3)NAMESCGetScanSize - Determine the amount of image data to be scanned
SYNOPSIS
#include <stdio.h>
#include <scanner.h>
int SCGetScanSize(SCANNER *s, long *width, long *height,
long *bytesPerLine);
DESCRIPTIONSCGetScanSize is called after calling SCSetup(3) to determine how much
image data to retrieve from the scanner. *width gets filled in with the
number of pixels in each row, *height gets filled in with the number of
rows in the image, and *bytesPerLine gets filled in with the number of
bytes in each row.
If the data type being scanned has a packing of SC_PLANAR, then the total
number of bytes to be scanned is given by the number of channels *
*height * *bytesPerLine. Otherwise, the total number of bytes is simply
*height * *bytesPerLine. See SCSetup(3) and SCGetDataTypes(3) for more
information about data types.
After calling SCGetScanSize, a scanning application should allocate
buffers and write image file headers as appropriate, and then call
SCScan(3) or SCScanFD(3) to start the actual scan.
RETURN VALUESCGetScanSize returns 0 if successful. If an error occurs, -1 is
returned and SCerrno is set to indicate the reason for failure.
EXECUTION ERROR CODESSCGetScanSize will fail under the following circumstances.
SCECOMM Error communicating with scanner driver
SCEDEV Scanner driver error
SEE ALSOlibscan(3), SCSetup(3), SCScan(3), SCScanFD(3).
Page 1