Lines Matching refs:req
747 hp5400_test_scan_response (struct ScanResponse *resp, struct ScanRequest *req)
749 (void) req; /* to avoid compilation warning */
770 DoAverageScan (int iHandle, struct ScanRequest *req, int code,
782 if (InitScan2 (SCAN_TYPE_CALIBRATION, req, &HWParams, &res, 0, code) != 0)
821 DoScan (int iHandle, struct ScanRequest *req, const char *filename, int code,
847 if (InitScan2 (SCAN_TYPE_NORMAL, req, &HWParams, res, 1, 0x40) != 0)
874 struct ScanRequest req;
884 memset(&req, 0, sizeof(req));
886 req.x1 = 0x08;
887 req.dpix = htons (300); /* = 300 dpi */
888 req.dpiy = htons (300); /* = 300 dpi */
889 req.offx = htons (0); /* = 0cm */
890 req.offy = htons (0); /* = 0cm */
891 req.lenx = htons (2690); /* = 22.78cm */
892 req.leny = htons (50); /* = 0.42cm */
894 req.flags1 = htons (0x0000);
895 req.flags2 = htons (0x0010);
896 req.flags3 = htons (0x3020); /* First calibration scan, 48bpp */
898 req.gamma[0] = htons (100);
899 req.gamma[1] = htons (100);
900 req.gamma[2] = htons (100);
902 if (DoAverageScan (iHandle, &req, 0x40, high_array) != 0)
942 memset(&req, 0, sizeof(req));
944 req.x1 = 0x08;
945 req.dpix = htons (300); /* = 300 dpi */
946 req.dpiy = htons (300); /* = 300 dpi */
947 req.offx = htons (0); /* = 0cm */
948 req.offy = htons (0); /* = 0cm */
949 req.lenx = htons (2690); /* = 22.78cm */
950 req.leny = htons (16); /* = 0.14cm */
952 req.flags1 = htons (0x0000);
953 req.flags2 = htons (0x0010);
954 req.flags3 = htons (0x3024); /* Second calibration scan, 48bpp */
956 req.gamma[0] = htons (100);
957 req.gamma[1] = htons (100);
958 req.gamma[2] = htons (100);
960 if (DoAverageScan (iHandle, &req, 0x00, low_array) != 0)
1010 struct ScanRequest req;
1026 memset(&req, 0, sizeof(req));
1028 req.x1 = 0x08;
1029 req.dpix = htons (params->iDpi);
1030 req.dpiy = htons (params->iLpi);
1034 req.offx = htons (params->iLeft);
1035 req.offy = htons (params->iTop);
1036 req.lenx = htons (params->iWidth);
1037 req.leny = htons (params->iHeight);
1039 req.flags1 = htons (0x0080);
1040 req.flags2 = htons (0x0000);
1041 req.flags3 = htons ((params->iDpi < 2400) ? 0x18E8 : 0x18C0); /* Try preview scan */
1043 req.gamma[0] = htons (100);
1044 req.gamma[1] = htons (100);
1045 req.gamma[2] = htons (100);
1051 result = DoScan (iHandle, &req, filename, 0x40, &res);
1145 struct ScanRequest req;
1149 memset(&req, 0, sizeof(req));
1151 req.x1 = 0x08;
1152 req.dpix = htons (pParams->iDpi); /* = 300 dpi */
1153 req.dpiy = htons (pParams->iLpi); /* = 300 dpi */
1154 req.offx = htons (pParams->iLeft); /* = 0cm */
1155 req.offy = htons (pParams->iTop); /* = 0cm */
1156 req.lenx = htons (pParams->iWidth); /* = 22.78cm */
1161 req.leny = htons (pParams->iHeight); /* = 0.42cm */
1163 req.flags1 = htons ((scantype == SCAN_TYPE_CALIBRATION) ? 0x0000 : 0x0080);
1164 req.flags2 = htons ((scantype == SCAN_TYPE_CALIBRATION) ? 0x0010 :
1167 req.flags3 = htons (0x18E8);
1169 req.gamma[0] = htons (100);
1170 req.gamma[1] = htons (100);
1171 req.gamma[2] = htons (100);
1179 InitScan2 (scantype, &req, pHWParams, &res, pParams->iColourOffset, 0x40);
1195 InitScan2 (enum ScanType scantype, struct ScanRequest *req,
1212 HP5400_DBG (DBG_MSG, "Off(%d,%d) : Len(%d,%d)\n", htons (req->offx),
1213 htons (req->offy), htons (req->lenx), htons (req->leny));
1215 if (htons (req->offx) > 0x09F8)
1216 req->offx = htons (0x09F8);
1217 if (htons (req->offy) > 0x0DB6)
1218 req->offy = htons (0x0DB6);
1220 if( htons( req->offx ) < 0 ) req->offx = 0;
1221 if( htons( req->offy ) < 0 ) req->offy = 0;
1223 if (htons (req->offx) + htons (req->lenx) > 0x09F8)
1224 req->lenx = htons (0x09F8 - htons (req->offx));
1225 if (htons (req->offy) + htons (req->leny) > 0x0DB6)
1226 req->leny = htons (0x0DB6 - htons (req->offy));
1227 if (htons (req->lenx) <= 1)
1229 if (htons (req->leny) <= 1)
1292 for (i = 0; i < sizeof (*req); i++)
1294 HP5400_DBG (DBG_MSG, "%02X ", ((unsigned char *) req)[i]);
1303 sizeof (*req), req) < 0)
1349 float pixels = ((float) htons (req->lenx) * (float) htons (req->leny)) *
1350 ((float) htons (req->dpix) * (float) htons (req->dpiy)) /
1358 htons (req->lenx), htons (req->leny),
1359 htons (req->dpix), htons (req->dpiy), HW_LPI, HW_LPI, bpp);