[Hp5400backend-cvs-update] hp5400/hp5400 hp5400.c,1.21,1.22
Status: Alpha
Brought to you by:
soumarmt
|
From: <kl...@us...> - 2003-03-11 10:35:13
|
Update of /cvsroot/hp5400backend/hp5400/hp5400
In directory sc8-pr-cvs1:/tmp/cvs-serv16957
Modified Files:
hp5400.c
Log Message:
Add checks so that if the scanner returns errors, we actually notice and
abort the scan. This is so that trying to scan when the scanner has got to a
bad state, we don't freeze the frontend too.
Index: hp5400.c
===================================================================
RCS file: /cvsroot/hp5400backend/hp5400/hp5400/hp5400.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** hp5400.c 10 Mar 2003 11:58:38 -0000 1.21
--- hp5400.c 11 Mar 2003 10:35:02 -0000 1.22
***************
*** 560,564 ****
HWParams.iXferHandle = iHandle;
! InitScan2( SCAN_TYPE_CALIBRATION, req, &HWParams, &res, 0, code ); /* No colour offseting, we want raw */
length = htonl(res.xsize) / 6;
--- 560,565 ----
HWParams.iXferHandle = iHandle;
! if( InitScan2( SCAN_TYPE_CALIBRATION, req, &HWParams, &res, 0, code ) != 0 )
! return -1; /* No colour offseting, we want raw */
length = htonl(res.xsize) / 6;
***************
*** 618,622 ****
HWParams.iXferHandle = iHandle;
! InitScan2( SCAN_TYPE_NORMAL, req, &HWParams, res, 1, 0x40 );
fprintf( file, "P%d\n%d %d\n", 6, htonl(res->xsize)/3, htons(res->ysize) );
--- 619,624 ----
HWParams.iXferHandle = iHandle;
! if( InitScan2( SCAN_TYPE_NORMAL, req, &HWParams, res, 1, 0x40 ) != 0 )
! return -1;
fprintf( file, "P%d\n%d %d\n", 6, htonl(res->xsize)/3, htons(res->ysize) );
***************
*** 668,672 ****
req.gamma[2] = htons( 100 );
! DoAverageScan( iHandle, &req, 0x40, high_array );
#ifdef CALIB_DEBUG
--- 670,675 ----
req.gamma[2] = htons( 100 );
! if( DoAverageScan( iHandle, &req, 0x40, high_array ) != 0 )
! return -1;
#ifdef CALIB_DEBUG
***************
*** 725,729 ****
req.gamma[2] = htons( 100 );
! DoAverageScan( iHandle, &req, 0x00, low_array );
#ifdef CALIB_DEBUG
--- 728,733 ----
req.gamma[2] = htons( 100 );
! if( DoAverageScan( iHandle, &req, 0x00, low_array ) != 0 )
! return -1;
#ifdef CALIB_DEBUG
***************
*** 799,803 ****
req.flags1 = htons( 0x0080 );
req.flags2 = htons( 0x0000 );
! req.flags3 = htons( 0x18E8 ); /* Try preview scan */
req.gamma[0] = htons( 100 );
--- 803,807 ----
req.flags1 = htons( 0x0080 );
req.flags2 = htons( 0x0000 );
! req.flags3 = htons( ( params ->iDpi < 2400 ) ? 0x18E8 : 0x18C0 ); /* Try preview scan */
req.gamma[0] = htons( 100 );
***************
*** 805,809 ****
req.gamma[2] = htons( 100 );
! Calibrate( iHandle, params ->iDpi );
SetDefaultGamma( iHandle );
--- 809,814 ----
req.gamma[2] = htons( 100 );
! if( Calibrate( iHandle, params ->iDpi ) != 0 )
! return -1;
SetDefaultGamma( iHandle );
***************
*** 910,914 ****
req.gamma[2] = htons( 100 );
! Calibrate( pHWParams->iXferHandle, pParams ->iDpi );
/* SetDefaultGamma( pHWParams->iXferHandle ); ** Must be done by caller */
--- 915,920 ----
req.gamma[2] = htons( 100 );
! if( Calibrate( pHWParams->iXferHandle, pParams ->iDpi ) != 0 )
! return -1;
/* SetDefaultGamma( pHWParams->iXferHandle ); ** Must be done by caller */
|