Lines Matching refs:mi
1492 parse_inquiry(Microtek_Info *mi, unsigned char *result)
1505 snprintf(mi->vendor_id, 8 + 1, "%.*s", 8, (char *)&result[8]);
1506 snprintf(mi->model_name, 16 + 1, "%.*s", 16, (char *)&result[16]);
1507 snprintf(mi->revision_num, 4 + 1, "%.*s", 4, (char *)&result[32]);
1508 snprintf(mi->vendor_string, 20 + 1, "%.*s", 20, (char *)&result[36]);
1510 mi->device_type = (SANE_Byte)(result[0] & 0x1f);
1511 mi->SCSI_firmware_ver_major = (SANE_Byte)((result[1] & 0xf0) >> 4);
1512 mi->SCSI_firmware_ver_minor = (SANE_Byte)(result[1] & 0x0f);
1513 mi->scanner_firmware_ver_major = (SANE_Byte)((result[2] & 0xf0) >> 4);
1514 mi->scanner_firmware_ver_minor = (SANE_Byte)(result[2] & 0x0f);
1515 mi->response_data_format = (SANE_Byte)(result[3]);
1517 mi->res_step = (SANE_Byte)(result[56] & 0x03);
1518 mi->modes = (SANE_Byte)(result[57]);
1519 mi->pattern_count = (SANE_Int)(result[58] & 0x7f);
1520 mi->pattern_dwnld = (SANE_Byte)(result[58] & 0x80) > 0;
1521 mi->feed_type = (SANE_Byte)(result[59] & 0x0F);
1522 mi->compress_type = (SANE_Byte)(result[59] & 0x30);
1523 mi->unit_type = (SANE_Byte)(result[59] & 0xC0);
1525 mi->doc_size_code = (SANE_Byte)result[60];
1529 mi->cont_settings = (SANE_Int)((result[61] & 0xf0) >> 4);
1531 mi->cont_settings = (SANE_Int)(result[72]);
1532 mi->min_contrast = -42;
1533 mi->max_contrast = (mi->cont_settings * 7) - 49;
1535 mi->exp_settings = (SANE_Int)(result[61] & 0x0f);
1537 mi->exp_settings = (SANE_Int)(result[73]);
1538 mi->min_exposure = -18;
1539 mi->max_exposure = (mi->exp_settings * 3) - 21;
1541 mi->contrast_vals = (SANE_Int)(result[72]);
1542 mi->min_contrast = -42;
1543 mi->max_contrast = 49;
1544 if (mi->contrast_vals)
1545 mi->max_contrast = (mi->contrast_vals * 7) - 49;
1547 mi->exposure_vals = (SANE_Int)(result[73]);
1548 mi->min_exposure = -18;
1549 mi->max_exposure = 21;
1550 if (mi->exposure_vals)
1551 mi->max_exposure = (mi->exposure_vals * 3) - 21;
1554 mi->model_code = (SANE_Byte)(result[62]);
1555 switch (mi->model_code) {
1567 mi->base_resolution = 300;
1570 mi->base_resolution = 400;
1578 mi->base_resolution = 600;
1582 mi->base_resolution = 1000;
1585 mi->base_resolution = 1828;
1588 mi->base_resolution = 1950;
1591 mi->base_resolution = 300;
1593 mi->model_code);
1599 switch (mi->doc_size_code) {
1601 mi->max_x = 8.5 * mi->base_resolution - 1;
1602 mi->max_y = 14.0 * mi->base_resolution - 1;
1605 mi->max_x = 8.5 * mi->base_resolution - 1;
1606 mi->max_y = 11.0 * mi->base_resolution - 1;
1609 mi->max_x = 8.5 * mi->base_resolution - 1;
1610 mi->max_y = 11.69 * mi->base_resolution - 1;
1613 mi->max_x = 8.5 * mi->base_resolution - 1;
1614 mi->max_y = 13.0 * mi->base_resolution - 1;
1617 mi->max_x = 8.0 * mi->base_resolution - 1;
1618 mi->max_y = 10.0 * mi->base_resolution - 1;
1621 mi->max_x = 8.3 * mi->base_resolution - 1;
1622 mi->max_y = 14.0 * mi->base_resolution - 1;
1625 mi->max_x = 8.3 * mi->base_resolution - 1;
1626 mi->max_y = 13.5 * mi->base_resolution - 1;
1629 mi->max_x = 8.0 * mi->base_resolution - 1;
1630 mi->max_y = 14.0 * mi->base_resolution - 1;
1634 mi->max_x = (35.0 / MM_PER_INCH) * mi->base_resolution - 1;
1635 mi->max_y = (35.0 / MM_PER_INCH) * mi->base_resolution - 1;
1638 mi->max_x = 5.0 * mi->base_resolution - 1;
1639 mi->max_y = 5.0 * mi->base_resolution - 1;
1643 mi->max_x = (36.0 / MM_PER_INCH) * mi->base_resolution - 1;
1644 mi->max_y = (36.0 / MM_PER_INCH) * mi->base_resolution - 1;
1648 mi->max_x = mi->max_y = 0;
1650 mi->doc_size_code);
1656 float base_res_dpmm = (float) mi->base_resolution / MM_PER_INCH;
1657 mi->doc_x_range.min = SANE_FIX(0);
1658 mi->doc_x_range.max = SANE_FIX((float)mi->max_x / base_res_dpmm);
1659 mi->doc_x_range.quant = SANE_FIX(0);
1660 mi->doc_y_range.min = SANE_FIX(0);
1661 mi->doc_y_range.max = SANE_FIX((float)mi->max_y / base_res_dpmm);
1662 mi->doc_y_range.quant = SANE_FIX(0);
1665 mi->source_options = (SANE_Byte)(result[63]);
1667 mi->expanded_resolution = (result[64] & 0x01);
1669 if ((mi->model_code == 0x66) || (mi->model_code == 0x63)) {
1670 mi->expanded_resolution = 0xFF;
1675 if (mi->model_code == 0x5b) {
1677 mi->does_expansion = 1;
1679 mi->does_expansion = 0;
1681 mi->enhance_cap = (result[65] & 0x03);
1685 case 0x00: mi->max_lookup_size = 0; break;
1686 case 0x01: mi->max_lookup_size = 256; break;
1687 case 0x03: mi->max_lookup_size = 1024; break;
1688 case 0x05: mi->max_lookup_size = 4096; break;
1689 case 0x09: mi->max_lookup_size = 65536; break;
1691 mi->max_lookup_size = 0;
1708 mi->max_lookup_size = 65536;
1710 mi->max_lookup_size = 4096;
1712 mi->max_lookup_size = 1024;
1714 mi->max_lookup_size = 256;
1716 mi->max_lookup_size = 0;
1719 if ((mi->model_code == 0x66) || (mi->model_code == 0x63)) {
1720 mi->max_lookup_size = 1024;
1726 case 0x00: mi->max_gamma_val = 255; mi->gamma_size = 1; break;
1727 case 0x01: mi->max_gamma_val = 1023; mi->gamma_size = 2; break;
1728 case 0x02: mi->max_gamma_val = 4095; mi->gamma_size = 2; break;
1729 case 0x03: mi->max_gamma_val = 65535; mi->gamma_size = 2; break;
1731 mi->max_gamma_val = 0; mi->gamma_size = 0;
1737 case 0x00: mi->max_gamma_bit_depth = 8; mi->gamma_size = 1; break;
1738 case 0x01: mi->max_gamma_bit_depth = 10; mi->gamma_size = 2; break;
1739 case 0x02: mi->max_gamma_bit_depth = 12; mi->gamma_size = 2; break;
1740 case 0x03: mi->max_gamma_bit_depth = 16; mi->gamma_size = 2; break;
1742 mi->max_gamma_bit_depth = 0; mi->gamma_size = 0;
1747 mi->fast_color_preview = (SANE_Byte)(result[67] & 0x01);
1748 mi->xfer_format_select = (SANE_Byte)(result[68] & 0x01);
1749 mi->color_sequence = (SANE_Byte)(result[69] & 0x7f);
1750 mi->does_3pass = (SANE_Byte)(!(result[69] & 0x80));
1751 mi->does_mode1 = (SANE_Byte)(result[71] & 0x01);
1753 mi->bit_formats = (SANE_Byte)(result[74] & 0x0F);
1754 mi->extra_cap = (SANE_Byte)(result[75] & 0x07);
1758 if (!((mi->model_code == 0x66) || (mi->model_code == 0x63))) {
1759 mi->extra_cap &= ~MI_EXCAP_DIS_RECAL;
1764 if (mi->model_code == 0x64) {
1766 mi->does_3pass = 1;
1767 mi->modes &= ~MI_MODES_ONEPASS;
1779 dump_inquiry(Microtek_Info *mi, unsigned char *result)
1794 DBG(1, "Device Type Code: 0x%02x\n", mi->device_type);
1795 DBG(1, "Model Code: 0x%02x\n", mi->model_code);
1797 mi->vendor_id, mi->model_name);
1798 DBG(1, "Vendor Specific String: '%s'\n", mi->vendor_string);
1799 DBG(1, "Firmware Rev: '%s'\n", mi->revision_num);
1802 mi->SCSI_firmware_ver_major, mi->SCSI_firmware_ver_minor,
1803 mi->scanner_firmware_ver_major, mi->scanner_firmware_ver_minor);
1804 DBG(1, "Response data format: 0x%02x\n", mi->response_data_format);
1808 (mi->modes & MI_MODES_LINEART) ? "Lineart " : "",
1809 (mi->modes & MI_MODES_HALFTONE) ? "Halftone " : "",
1810 (mi->modes & MI_MODES_GRAY) ? "Gray " : "",
1811 (mi->modes & MI_MODES_COLOR) ? "Color " : "",
1812 (mi->modes & MI_MODES_TRANSMSV) ? "(X-msv) " : "",
1813 (mi->modes & MI_MODES_ONEPASS) ? "(OnePass) " : "",
1814 (mi->modes & MI_MODES_NEGATIVE) ? "(Negative) " : "");
1817 (mi->res_step & MI_RESSTEP_1PER) ? "1% " : "",
1818 (mi->res_step & MI_RESSTEP_5PER) ? "5%" : "",
1819 (mi->expanded_resolution) ? "yes" : "no",
1820 (mi->expanded_resolution == 0xFF) ? "(but says no)" : "");
1822 (mi->bit_formats & MI_FMT_CAP_4BPP) ? "4 " : "",
1823 (mi->bit_formats & MI_FMT_CAP_10BPP) ? "10 " : "",
1824 (mi->bit_formats & MI_FMT_CAP_12BPP) ? "12 " : "",
1825 (mi->bit_formats & MI_FMT_CAP_16BPP) ? "16 " : "");
1827 mi->doc_size_code);
1829 mi->max_x, mi->max_y);
1831 (mi->unit_type & MI_UNIT_PIXELS) ? "pixels " : "",
1832 (mi->unit_type & MI_UNIT_8TH_INCH) ? "1/8\"'s " : "");
1834 mi->pattern_count, (mi->pattern_dwnld) ? "Yes" : "No");
1837 (mi->compress_type & MI_COMPRSS_HUFF) ? "huffman " : "",
1838 (mi->compress_type & MI_COMPRSS_RD) ? "read-data " : "");
1840 mi->cont_settings, mi->exp_settings);
1842 (mi->enhance_cap & MI_ENH_CAP_SHADOW) ? "yes" : "no ",
1843 (mi->enhance_cap & MI_ENH_CAP_MIDTONE) ? "yes" : "no ");
1845 (mi->extra_cap & MI_EXCAP_OFF_CTL) ? "yes" : "no");
1849 mi->max_lookup_size, mi->gamma_size, mi->max_gamma_val);
1853 mi->max_lookup_size, mi->gamma_size, mi->max_gamma_bit_depth);
1857 (mi->feed_type & MI_FEED_FLATBED) ? "flatbed " : "",
1858 (mi->feed_type & MI_FEED_EDGEFEED) ? "edge-feed " : "",
1859 (mi->feed_type & MI_FEED_AUTOSUPP) ? "yes" : "no");
1861 (mi->source_options & MI_SRC_FEED_SUPP) ? "yes" : "no ",
1862 (mi->source_options & MI_SRC_FEED_BT) ? "yes" : "no ");
1864 (mi->source_options & MI_SRC_HAS_FEED) ? "yes" : "no ",
1865 (mi->source_options & MI_SRC_FEED_RDY) ? "yes" : "no ");
1867 (mi->source_options & MI_SRC_HAS_TRANS) ? "yes" : "no ");
1875 (mi->fast_color_preview) ? "yes" : "no");
1877 (mi->xfer_format_select) ? "yes" : "no");
1879 switch (mi->color_sequence) {
1891 MDBG_ADD("UNKNOWN CODE (0x%02x)", mi->color_sequence);
1894 /* if (mi->modes & MI_MODES_ONEPASS) XXXXXXXXXXX */
1896 (mi->does_3pass ? "yes" : "no"));
1898 (mi->does_mode1) ? "yes" : "no");
1900 (mi->extra_cap & MI_EXCAP_DIS_LNTBL) ? "yes" : "no");
1902 (mi->extra_cap & MI_EXCAP_DIS_RECAL) ? "yes" : "no");
1905 mi->does_expansion ? "yes" : "no");