Lines Matching refs:this

17    along with this program.  If not, see <https://www.gnu.org/licenses/>.
20 additional uses of the libraries contained in this release of SANE.
23 to produce an executable, this does not by itself cause the
34 those changes may be distributed with this exception intact.
37 whether to permit this exception to apply to your modifications.
38 If you do not wish that, delete this exception notice.
144 InitOptions(TInstance *this)
152 memset(this->aoptDesc,0,sizeof(this->aoptDesc));
153 memset(this->aoptVal,0,sizeof(this->aoptVal));
154 InitGammaTables(this,0,0);
171 pdesc=this->aoptDesc+iOpt;
172 pval=this->aoptVal+iOpt;
286 pval->wa = this->agammaY;
297 pval->wa = this->agammaR;
308 pval->wa = this->agammaG;
319 pval->wa = this->agammaB;
456 TInstance *this;
472 this = (TInstance*) calloc(1,sizeof(TInstance));
473 if (!this) return SANE_STATUS_NO_MEM;
475 *handle = (SANE_Handle)this;
477 ResetCalibration(this); /* do not release memory */
478 this->pNext=pinstFirst; /* register open handle */
479 pinstFirst=this;
480 this->model=pdev->model; /* memorize model */
483 if (sanei_usb_open (devicename, &this->hScanner) != SANE_STATUS_GOOD)
484 return SetError (this, SANE_STATUS_IO_ERROR, "cannot open scanner device");
486 this->quality=fast;
487 return InitOptions(this);
493 TInstance *this,*pParent,*p;
494 this=(TInstance*)handle;
496 if (this->hScanner)
498 if (this->state.bScanning)
499 EndScan(this);
501 sanei_usb_close(this->hScanner);
502 this->hScanner=-1;
504 ResetCalibration(this); /* release calibration data */
509 if (p==this) break;
520 pParent->pNext=this->pNext;
522 pinstFirst=this->pNext; /* NULL with last entry */
524 if (this->pchPageBuffer)
525 free(this->pchPageBuffer);
526 if (this->szErrorReason)
529 this->nErrorState, this->szErrorReason);
530 free(this->szErrorReason);
532 free(this);
538 TInstance *this=(TInstance*)handle;
540 return this->aoptDesc+iOpt;
551 TInstance *this;
552 this=(TInstance*)handle;
557 if (this->state.bScanning)
562 cap=this->aoptDesc[iOpt].cap;
581 *(SANE_Word*)pVal = this->aoptVal[iOpt].w;
584 strcpy(pVal,this->aoptVal[iOpt].s);
591 memcpy(pVal,this->aoptVal[iOpt].wa, this->aoptDesc[iOpt].size);
603 rc=sanei_constrain_value(this->aoptDesc+iOpt,pVal,pnInfo);
618 this->aoptVal[iOpt].w = *(SANE_Word*)pVal;
624 strcpy(this->aoptVal[iOpt].s,pVal);
629 memcpy(this->aoptVal[iOpt].wa, pVal, this->aoptDesc[iOpt].size);
642 SetupInternalParameters(TInstance *this)
645 this->param.res=(int)this->aoptVal[optResolution].w;
647 this->param.nBrightness=(int)(this->aoptVal[optBrightness].w>>SANE_FIXED_SCALE_SHIFT);
648 this->param.nContrast=(int)(this->aoptVal[optContrast].w>>SANE_FIXED_SCALE_SHIFT);
650 this->param.nBrightness=0;
651 this->param.nContrast=0;
653 this->param.x=(int)(SANE_UNFIX(this->aoptVal[optTLX].w)*1200.0/25.4);
654 this->param.y=(int)(SANE_UNFIX(this->aoptVal[optTLY].w)*1200.0/25.4);
655 this->param.cx=(int)(SANE_UNFIX(this->aoptVal[optBRX].w-this->aoptVal[optTLX].w)*1200.0/25.4)+1;
656 this->param.cy=(int)(SANE_UNFIX(this->aoptVal[optBRY].w-this->aoptVal[optTLY].w)*1200.0/25.4)+1;
658 if (!strcasecmp(this->aoptVal[optMode].s,aScanModes[i]))
660 this->mode=(TMode)i;
664 this->mode, this->param.res,
665 this->param.nBrightness, this->param.nContrast,
666 this->param.x,this->param.y,this->param.cx,this->param.cy);
674 TInstance *this;
675 this=(TInstance*)handle;
676 SetupInternalParameters(this);
677 GetAreaSize(this);
678 p->pixels_per_line=this->state.cxPixel;
680 p->lines=this->state.cyPixel;
682 switch (this->mode)
708 TInstance *this;
710 this=(TInstance*)handle;
712 if (this->state.bScanning) return SANE_STATUS_DEVICE_BUSY;
713 rc=SetupInternalParameters(this);
714 this->state.bCanceled=false;
715 if (!rc) rc=DoInit(this); /* oopsi, we should initialise :-) */
716 if (!rc && !this->bOptSkipOriginate) rc=DoOriginate(this,true);
717 if (!rc) rc=DoJog(this,this->calibration.yMargin);
719 this->state.bEOF=false;
720 switch (this->mode)
722 case color: rc=StartScanColor(this); break;
723 default: rc=StartScanGray(this); break;
725 if (this->state.bCanceled) return SANE_STATUS_CANCELLED;
735 TInstance *this;
736 this=(TInstance*)handle;
739 if (this->state.bEOF)
741 rc=ReadChunk(this,puchBuffer,cchMax,pcchRead);
742 DBG(DEBUG_INFO,"... line %d (%d/%d)...\n",this->state.iLine,*pcchRead,rc);
746 this->state.bEOF=true; /* flag EOF on next read() */
761 TInstance *this;
762 this=(TInstance*)handle;
764 if (this->state.bScanning)
766 this->state.bCanceled=true;
767 if (this->state.bEOF) /* regular (fast) cancel */
770 EndScan(this);
771 DoJog(this,-this->calibration.yMargin);
778 CancelScan(this);