_S_C_S_e_t_u_p transfers scanning parameters to the scanner driver, in
preparation for a subsequent call to _S_C_S_c_a_n or _S_C_S_c_a_n_F_D.
_s specifies a connection to a scanner driver obtained from a call to
_S_C_O_p_e_n(3), _S_C_O_p_e_n_F_i_l_e(3), or _S_C_O_p_e_n_S_c_r_e_e_n(3).
_p_r_e_v_i_e_w should be non-zero if these are parameters are for a preview, or
0 if they are for a final scan. If set, this flag is an indication to
the driver to prefer speed over image quality in order to enable a fast
preview mode. If _p_r_e_v_i_e_w is zero, the scanner driver is instructed to
prefer image quality over speed.
_t_y_p_e is the type of data to be scanned. It must be one of the types
supported by the scanner. See _S_C_G_e_t_D_a_t_a_T_y_p_e_s(3) for information on
determining which types are supported by a scanner.
_r_m_e_t_r_i_c is set to either SSSSCCCC____IIIINNNNCCCCHHHHEEEESSSS or SSSSCCCC____CCCCEEEENNNNTTTTIIIIMMMM, depending on whether the
resolution is specified in inches or centimeters. _x_r_e_s specifies the
horizontal scanning resolution, and _y_r_e_s specifies the vertical scanning
resolution. _x_r_e_s and _y_r_e_s must be within the limits supported by the
scanner driver. See _S_C_G_e_t_M_i_n_M_a_x_R_e_s(3) for information about getting
these limits.
_w_m_e_t_r_i_c is set to either SSSSCCCC____PPPPIIIIXXXXEEEELLLLSSSS, SSSSCCCC____IIIINNNNCCCCHHHHEEEESSSS, or SSSSCCCC____CCCCEEEENNNNTTTTIIIIMMMM, depending on
whether the scan area is specified in pixels, inches, or centimeters. _x
and _y specify the coordinates of the upper left corner of the scan area,
and _w_i_d_t_h and _h_e_i_g_h_t specify the size of the scanning area. The scanning
area must lie within the scannable area supported by the scanner. See
_S_C_G_e_t_P_a_g_e_S_i_z_e(3) for information about getting the scannable area.
If _w_m_e_t_r_i_c is set to SSSSCCCC____PPPPIIIIXXXXEEEELLLLSSSS, the scanner driver is required to return
exactly _w_i_d_t_h pixels per scan line and exactly _h_e_i_g_h_t scan lines when
scanning.
After calling _S_C_S_e_t_u_p, _S_C_G_e_t_S_c_a_n_S_i_z_e(_3) should be called to determine the
actual size in pixels of the scanning area, and then _S_C_S_c_a_n(3) or
_S_C_S_c_a_n_F_D(3) should be called to start scanning.