Lines Matching refs:hw
899 if (s->hw->connection == SANE_EPSON_SCSI)
903 else if (s->hw->connection == SANE_EPSON_PIO)
914 else if (s->hw->connection == SANE_EPSON_USB)
940 if (s->hw->connection == SANE_EPSON_SCSI)
944 else if (s->hw->connection == SANE_EPSON_PIO)
951 else if (s->hw->connection == SANE_EPSON_USB)
1121 #define set_focus_position(s,v) set_cmd( s,(s)->hw->cmd->set_focus_position,v)
1122 #define set_color_mode(s,v) set_cmd( s,(s)->hw->cmd->set_color_mode,v)
1123 #define set_data_format(s,v) set_cmd( s,(s)->hw->cmd->set_data_format, v)
1124 #define set_halftoning(s,v) set_cmd( s,(s)->hw->cmd->set_halftoning, v)
1125 #define set_gamma(s,v) set_cmd( s,(s)->hw->cmd->set_gamma, v)
1126 #define set_color_correction(s,v) set_cmd( s,(s)->hw->cmd->set_color_correction, v)
1127 #define set_lcount(s,v) set_cmd( s,(s)->hw->cmd->set_lcount, v)
1128 #define set_bright(s,v) set_cmd( s,(s)->hw->cmd->set_bright, v)
1129 #define mirror_image(s,v) set_cmd( s,(s)->hw->cmd->mirror_image, v)
1130 #define set_speed(s,v) set_cmd( s,(s)->hw->cmd->set_speed, v)
1131 #define set_outline_emphasis(s,v) set_cmd( s,(s)->hw->cmd->set_outline_emphasis, v)
1132 #define control_auto_area_segmentation(s,v) set_cmd( s,(s)->hw->cmd->control_auto_area_segmentation, v)
1133 #define set_film_type(s,v) set_cmd( s,(s)->hw->cmd->set_film_type, v)
1134 #define set_exposure_time(s,v) set_cmd( s,(s)->hw->cmd->set_exposure_time, v)
1135 #define set_bay(s,v) set_cmd( s,(s)->hw->cmd->set_bay, v)
1136 #define set_threshold(s,v) set_cmd( s,(s)->hw->cmd->set_threshold, v)
1137 #define control_extension(s,v) set_cmd( s,(s)->hw->cmd->control_an_extension, v)
1139 /*#define (s,v) set_cmd( s,(s)->hw->cmd->, v) */
1148 if (!s->hw->cmd->set_zoom)
1152 cmd[1] = s->hw->cmd->set_zoom;
1176 if (!s->hw->cmd->set_resolution)
1180 params[1] = s->hw->cmd->set_resolution;
1214 if (!s->hw->cmd->set_scan_area)
1225 params[1] = s->hw->cmd->set_scan_area;
1258 u_char cmd = s->hw->cmd->set_color_correction_coefficients;
1305 u_char cmd = s->hw->cmd->set_gamma_table;
1482 u_char cmd = s->hw->cmd->request_extended_status;
1517 if (s->hw->ADF && s->hw->use_extension && s->hw->cmd->feed)
1519 fix_up_extended_status_reply (s->hw->sane.model, buf);
1524 if (0 == strcmp ("ES-9000H", s->hw->sane.model)
1525 || 0 == strcmp ("GT-30000", s->hw->sane.model))
1581 if (s->hw->devtype == 3 && s->hw->use_extension == 0)
1585 *max_x = (int) (w * s->hw->dpi_range.max);
1586 *max_y = (int) (h * s->hw->dpi_range.max);
1610 if (!s->hw->cmd->initialize_scanner)
1614 param[1] = s->hw->cmd->initialize_scanner;
1659 param[1] = s->hw->cmd->request_status;
1681 if (s->hw->connection == SANE_EPSON_SCSI)
1685 else if (s->hw->connection == SANE_EPSON_PIO)
1689 else if (s->hw->connection == SANE_EPSON_USB)
1722 if ((s->hw->connection != SANE_EPSON_PIO)
1723 && (access (s->hw->sane.name, R_OK | W_OK) != 0))
1725 DBG (1, "sane_start: access(%s, R_OK | W_OK) failed\n", s->hw->sane.name);
1732 if (s->hw->connection == SANE_EPSON_SCSI)
1734 status = sanei_scsi_open (s->hw->sane.name, &s->fd,
1738 DBG (1, "sane_start: %s open failed: %s\n", s->hw->sane.name,
1743 else if (s->hw->connection == SANE_EPSON_PIO)
1745 status = sanei_pio_open (s->hw->sane.name, &s->fd);
1748 DBG (1, "sane_start: %s open failed: %s\n", s->hw->sane.name,
1753 else if (s->hw->connection == SANE_EPSON_USB)
1755 status = sanei_usb_open (s->hw->sane.name, &s->fd);
1773 u_char cmd = s->hw->cmd->feed;
1810 u_char cmd = s->hw->cmd->eject;
1884 if (s->hw->connection == SANE_EPSON_SCSI)
1889 else if (s->hw->connection == SANE_EPSON_USB)
1916 if (s->hw->connection == SANE_EPSON_SCSI)
1920 else if (s->hw->connection == SANE_EPSON_USB)
2034 s->hw = dev;
2035 s->hw->sane.name = NULL;
2036 s->hw->sane.type = "flatbed scanner";
2037 s->hw->sane.vendor = "Epson";
2038 s->hw->sane.model = NULL;
2039 s->hw->optical_res = 0; /* just to have it initialized */
2040 s->hw->color_shuffle = SANE_FALSE;
2041 s->hw->extension = SANE_FALSE;
2042 s->hw->use_extension = SANE_FALSE;
2044 s->hw->need_color_reorder = SANE_FALSE;
2045 s->hw->need_double_vertical = SANE_FALSE;
2047 s->hw->cmd = &epson_cmd[EPSON_LEVEL_DEFAULT]; /* default function level */
2048 s->hw->connection = type;
2052 s->hw->last_res = 0;
2053 s->hw->last_res_preview = 0; /* set resolution to safe values */
2063 if (s->hw->connection == SANE_EPSON_SCSI)
2109 else if (s->hw->connection == SANE_EPSON_PIO)
2119 else if (s->hw->connection == SANE_EPSON_USB)
2219 if (s->hw->cmd->request_identity != 0)
2232 if (s->hw->cmd->request_identity2 != 0)
2257 s->hw->maxDepth = 16;
2265 s->hw->maxDepth = 14;
2272 s->hw->maxDepth = 12;
2279 s->hw->maxDepth = 8;
2284 DBG (1, "Max. supported color depth = %d\n", s->hw->maxDepth);
2297 s->hw->focusSupport = SANE_TRUE;
2316 s->hw->focusSupport = SANE_FALSE;
2356 if (s->hw->cmd->request_extended_status != 0)
2363 params[1] = s->hw->cmd->request_extended_status;
2381 s->hw->devtype = buf[11] >> 6;
2561 s->hw->need_reset_on_source_change = SANE_FALSE;
2566 s->hw->cmd->set_focus_position = 0;
2567 s->hw->cmd->feed = 0x19;
2574 s->hw->cmd->feed = 0;
2575 s->hw->cmd->set_focus_position = 0;
2576 s->hw->need_reset_on_source_change = SANE_TRUE;
2849 if (s->hw->level >= 7)
2851 else if (s->hw->level >= 4)
2858 if (!s->hw->cmd->set_halftoning)
2883 s->opt[OPT_BRIGHTNESS].constraint.range = &s->hw->cmd->bright_range;
2886 if (!s->hw->cmd->set_bright)
2902 if (!s->hw->cmd->set_outline_emphasis)
2921 if (s->hw->cmd->level[0] == 'D')
2938 if (!s->hw->cmd->set_gamma)
2997 if (s->hw->cmd->set_gamma_table &&
3041 if (!s->hw->cmd->set_color_correction)
3054 s->opt[OPT_RESOLUTION].constraint.word_list = s->hw->resolution_list;
3055 s->val[OPT_RESOLUTION].w = s->hw->dpi_range.min;
3068 if (!s->hw->cmd->set_threshold)
3180 if (!s->hw->cmd->set_color_correction_coefficients)
3209 if (!s->hw->cmd->mirror_image)
3223 if (!s->hw->cmd->set_speed)
3236 if (!s->hw->cmd->set_speed)
3249 if (!s->hw->cmd->control_auto_area_segmentation)
3275 /* if( ! s->hw->cmd->set_zoom) */
3309 s->opt[OPT_TL_X].constraint.range = s->hw->x_range;
3320 s->opt[OPT_TL_Y].constraint.range = s->hw->y_range;
3331 s->opt[OPT_BR_X].constraint.range = s->hw->x_range;
3332 s->val[OPT_BR_X].w = s->hw->x_range->max;
3342 s->opt[OPT_BR_Y].constraint.range = s->hw->y_range;
3343 s->val[OPT_BR_Y].w = s->hw->y_range->max;
3375 if (!s->hw->extension)
3408 if (s->hw->focusSupport == SANE_TRUE)
3418 if ((!s->hw->TPU) && (!s->hw->cmd->set_bay))
3434 if ((!s->hw->ADF) && (!s->hw->cmd->set_bay))
3448 if (!s->hw->ADF)
3464 if ((!s->hw->ADF) || (s->hw->duplexSupport == SANE_FALSE))
3480 if (!s->hw->cmd->set_bay)
3496 if (!s->hw->cmd->request_push_button_status)
3560 s->hw = dev;
3800 if (!s->hw->cmd->control_auto_area_segmentation)
3838 if (s->hw->need_reset_on_source_change)
3848 if (s->val[OPT_TL_X].w == s->hw->x_range->min
3849 && s->val[OPT_TL_Y].w == s->hw->y_range->min
3850 && s->val[OPT_BR_X].w == s->hw->x_range->max
3851 && s->val[OPT_BR_Y].w == s->hw->y_range->max)
3857 s->hw->x_range = &s->hw->adf_x_range;
3858 s->hw->y_range = &s->hw->adf_y_range;
3859 s->hw->use_extension = SANE_TRUE;
3863 if (s->hw->duplexSupport)
3875 s->hw->x_range = &s->hw->tpu_x_range;
3876 s->hw->y_range = &s->hw->tpu_y_range;
3877 s->hw->use_extension = SANE_TRUE;
3879 if (s->hw->cmd->set_film_type != 0)
3888 if (s->hw->cmd->set_focus_position != 0)
3899 s->hw->x_range = &s->hw->fbf_x_range;
3900 s->hw->y_range = &s->hw->fbf_y_range;
3901 s->hw->use_extension = SANE_FALSE;
3908 qf_params[XtNumber (qf_params) - 1].tl_x = s->hw->x_range->min;
3909 qf_params[XtNumber (qf_params) - 1].tl_y = s->hw->y_range->min;
3910 qf_params[XtNumber (qf_params) - 1].br_x = s->hw->x_range->max;
3911 qf_params[XtNumber (qf_params) - 1].br_y = s->hw->y_range->max;
3913 s->opt[OPT_BR_X].constraint.range = s->hw->x_range;
3914 s->opt[OPT_BR_Y].constraint.range = s->hw->y_range;
3916 if (s->val[OPT_TL_X].w < s->hw->x_range->min || force_max)
3917 s->val[OPT_TL_X].w = s->hw->x_range->min;
3919 if (s->val[OPT_TL_Y].w < s->hw->y_range->min || force_max)
3920 s->val[OPT_TL_Y].w = s->hw->y_range->min;
3922 if (s->val[OPT_BR_X].w > s->hw->x_range->max || force_max)
3923 s->val[OPT_BR_X].w = s->hw->x_range->max;
3925 if (s->val[OPT_BR_Y].w > s->hw->y_range->max || force_max)
3926 s->val[OPT_BR_Y].w = s->hw->y_range->max;
3928 setOptionState (s, s->hw->ADF && s->hw->use_extension,
3930 setOptionState (s, s->hw->ADF && s->hw->use_extension, OPT_EJECT, &dummy);
3936 setOptionState (s, s->hw->ADF && s->hw->use_extension, OPT_BAY, &reload);
4039 if (s->hw->cmd->set_halftoning != 0)
4046 if (s->hw->cmd->set_color_correction)
4050 if (s->hw->cmd->set_color_correction_coefficients)
4160 if (s->val[OPT_TL_X].w < s->hw->x_range->min)
4161 s->val[OPT_TL_X].w = s->hw->x_range->min;
4163 if (s->val[OPT_TL_Y].w < s->hw->y_range->min)
4164 s->val[OPT_TL_Y].w = s->hw->y_range->min;
4166 if (s->val[OPT_BR_X].w > s->hw->x_range->max)
4167 s->val[OPT_BR_X].w = s->hw->x_range->max;
4169 if (s->val[OPT_BR_Y].w > s->hw->y_range->max)
4170 s->val[OPT_BR_Y].w = s->hw->y_range->max;
4283 if (s->hw->color_shuffle)
4401 if (s->hw->extension)
4406 extensionCtrl = (s->hw->use_extension ? 1 : 0);
4407 if (s->hw->use_extension && (s->val[OPT_ADF_MODE].w == 1))
4415 s->hw->use_extension ? "on" : "off");
4422 if (s->hw->cmd->request_extended_status != 0)
4433 if (s->hw->ADF && s->hw->use_extension && s->hw->cmd->feed)
4443 s->hw->adf_max_x = max_x;
4444 s->hw->adf_max_y = max_y;
4455 if (s->hw->focusSupport == SANE_TRUE)
4472 if (s->hw->devtype == 3 && s->hw->use_extension == 0)
4483 s->hw->fbf_max_x = max_x;
4484 s->hw->fbf_max_y = max_y;
4503 if ((s->hw->cmd->level[0] == 'D' ||
4504 (s->hw->cmd->level[0] == 'B' && s->hw->level >= 5)) &&
4525 if (s->hw->cmd->set_halftoning &&
4635 if (s->hw->cmd->set_gamma &&
4639 if (s->hw->cmd->level[0] == 'D')
4674 if (s->hw->cmd->set_gamma_table &&
4718 if (s->hw->cmd->set_threshold != 0
4748 if (s->hw->cmd->set_zoom != 0
4774 s->hw->wait_for_button = SANE_TRUE;
4776 while (s->hw->wait_for_button == SANE_TRUE)
4780 s->hw->wait_for_button = SANE_FALSE;
4788 s->hw->wait_for_button = SANE_FALSE;
4798 s->hw->wait_for_button = SANE_FALSE;
4825 s->hw->color_shuffle = SANE_FALSE;
4830 if ((s->hw->optical_res != 0) && (mparam->depth == 8)
4833 s->line_distance = s->hw->max_line_distance * ndpi / s->hw->optical_res;
4836 s->hw->color_shuffle = SANE_TRUE;
4839 s->hw->color_shuffle = SANE_FALSE;
4847 s->hw->color_shuffle = SANE_TRUE;
4859 if (s->hw->color_shuffle == SANE_TRUE)
4903 if (((s->hw->cmd->level[0] == 'B') &&
4904 ((s->hw->level >= 5) || ((s->hw->level >= 4) &&
4906 || (s->hw->cmd->level[0] == 'D'))
4916 if (s->hw->TPU && s->hw->use_extension && lcount > 32)
4927 if (s->hw->cmd->level[0] == 'D')
4951 if (s->hw->cmd->request_extended_status != 0
4952 && SANE_TRUE == s->hw->extension)
4959 params[1] = s->hw->cmd->request_extended_status;
4993 if (s->hw->cmd->request_condition != 0)
5000 params[1] = s->hw->cmd->request_condition;
5057 if (s->hw->color_shuffle == SANE_TRUE)
5082 params[1] = s->hw->cmd->start_scanning;
5111 if (s->hw->ADF && s->hw->use_extension && s->val[OPT_AUTO_EJECT].w)
5116 u_char cmd = s->hw->cmd->eject;
5208 param[1] = s->hw->cmd->start_scanning;
5246 if (SANE_STATUS_NO_DOCS == status && s->hw->ADF && s->hw->use_extension)
5281 if (s->hw->color_shuffle)
5493 (strstr (s->hw->sane.model, "GT-2200") ||
5494 ((strstr (s->hw->sane.model, "1640") &&
5495 strstr (s->hw->sane.model, "Perfection")) ||
5496 strstr (s->hw->sane.model, "GT-8700"))) &&
5503 * we also set the variable s->hw->need_color_reorder
5505 if (s->hw->need_color_reorder)
5557 if (s->hw->color_shuffle)
5674 if (s->hw->color_shuffle == SANE_TRUE)
5867 Epson_Device *dev = s->hw;
5875 if (!s->hw->cmd->request_identity)
5880 param[1] = s->hw->cmd->request_identity;
5951 s->hw->level = dev->cmd->level[1] - '0';
5958 s->hw->res_list_size = 0;
5959 s->hw->res_list =
5960 (SANE_Int *) calloc (s->hw->res_list_size, sizeof (SANE_Int));
5962 if (NULL == s->hw->res_list)
5984 s->hw->res_list_size++;
5985 s->hw->res_list =
5986 (SANE_Int *) realloc (s->hw->res_list,
5987 s->hw->res_list_size * sizeof (SANE_Int));
5989 if (NULL == s->hw->res_list)
5995 s->hw->res_list[s->hw->res_list_size - 1] = (SANE_Int) val;
6017 if (s->hw->cmd->request_extended_status != 0)
6024 params[1] = s->hw->cmd->request_extended_status;
6034 s->hw->res_list_size++;
6035 s->hw->res_list =
6036 (SANE_Int *) realloc (s->hw->res_list,
6037 s->hw->res_list_size * sizeof (SANE_Int));
6039 if (NULL == s->hw->res_list)
6045 s->hw->res_list[s->hw->res_list_size - 1] = (SANE_Int) val;
6064 dev->dpi_range.min = s->hw->res_list[0];
6065 dev->dpi_range.max = s->hw->res_list[s->hw->res_list_size - 1];
6088 s->hw->resolution_list =
6089 malloc ((s->hw->res_list_size + 1) * sizeof (SANE_Word));
6091 if (s->hw->resolution_list == NULL)
6096 *(s->hw->resolution_list) = s->hw->res_list_size;
6097 memcpy (&(s->hw->resolution_list[1]), s->hw->res_list,
6098 s->hw->res_list_size * sizeof (SANE_Word));
6128 if (s->hw->cmd->request_identity2 == 0)
6132 param[1] = s->hw->cmd->request_identity2;
6152 s->hw->optical_res = buf[1] << 8 | buf[0];
6163 s->hw->max_line_distance = buf[4];
6230 if (s->hw->cmd->request_focus_position == 0)
6234 param[1] = s->hw->cmd->request_focus_position;
6280 if (s->hw->cmd->request_push_button_status == 0)
6287 param[1] = s->hw->cmd->request_push_button_status;
6332 for (i = 1; i <= s->hw->res_list_size; i++)
6335 res = s->hw->res_list[i];
6341 s->hw->resolution_list[new_size] = s->hw->res_list[i];
6350 s->hw->resolution_list[0] = new_size;
6356 if (s->val[OPT_RESOLUTION].w < s->hw->resolution_list[i])
6358 s->val[OPT_RESOLUTION].w = s->hw->resolution_list[i];
6368 s->hw->resolution_list[0] = s->hw->res_list_size;
6369 memcpy (&(s->hw->resolution_list[1]), s->hw->res_list,
6370 s->hw->res_list_size * sizeof (SANE_Word));