Lines Matching defs:scanner
7 * @brief SANE backend for Plustek scanner
60 * - homeing of USB scanner is now working correctly
336 getScanMode( Plustek_Scanner *scanner )
342 mode = scanner->val[OPT_MODE].w;
343 if( scanner->val[OPT_EXT_MODE].w != 0 )
346 scanner->params.depth = scanner->val[OPT_BIT_DEPTH].w;
350 scanner->params.depth = 1;
351 } else if( scanner->params.depth == 8 ) {
358 scanner->params.depth = 16;
386 close_pipe( Plustek_Scanner *scanner )
388 if( scanner->r_pipe >= 0 ) {
391 close( scanner->r_pipe );
392 scanner->r_pipe = -1;
394 if( scanner->w_pipe >= 0 ) {
397 close( scanner->w_pipe );
398 scanner->w_pipe = -1;
479 Plustek_Scanner *scanner = (Plustek_Scanner *)args;
480 Plustek_Device *dev = scanner->hw;
487 close( scanner->r_pipe );
488 scanner->r_pipe = -1;
495 data_length = scanner->params.lines * scanner->params.bytes_per_line;
499 DBG( _DBG_PROC, "buf = 0x%08lx\n", (unsigned long)scanner->buf );
501 if( NULL == scanner->buf ) {
507 buf = scanner->buf;
508 status = usbDev_Prepare( scanner->hw, buf );
519 write( scanner->w_pipe, &ipc, sizeof(ipc));
529 for( line = 0; line < scanner->params.lines; line++ ) {
531 status = usbDev_ReadLine( scanner->hw );
535 write( scanner->w_pipe, buf, scanner->params.bytes_per_line );
536 buf += scanner->params.bytes_per_line;
543 close( scanner->w_pipe );
544 scanner->w_pipe = -1;
565 do_cancel( Plustek_Scanner *scanner, SANE_Bool closepipe )
571 scanner->scanning = SANE_FALSE;
573 if( sanei_thread_is_valid (scanner->reader_pid) ) {
578 scanner->calibrating = SANE_FALSE;
587 sanei_thread_sendsig( scanner->reader_pid, SIGUSR1 );
591 res = sanei_thread_waitpid( scanner->reader_pid, 0 );
594 if( res != scanner->reader_pid ) {
599 sanei_thread_kill( scanner->reader_pid );
601 sanei_thread_sendsig( scanner->reader_pid, SIGKILL );
605 sanei_thread_invalidate( scanner->reader_pid );
608 usb_StartLampTimer( scanner->hw );
611 scanner->calibrating = SANE_FALSE;
614 close_pipe( scanner );
617 drvclose( scanner->hw );
629 * @param s - pointer to the scanner specific structure
674 * @param s - pointer to the scanner specific structure
1083 /* scanner buttons */
1095 "of the scanner buttons.");
1321 /* go ahead and open the scanner device */
1328 /* okay, so assign the handle and the scanner type */
1331 dev->sane.type = SANE_I18N("sheetfed scanner");
1333 dev->sane.type = SANE_I18N("flatbed scanner");
2407 /* open the driver and get some information about the scanner
2427 /* All ready to go. Set image def and see what the scanner