genesys: Return errors as exceptions from genesys_load_lut()

merge-requests/104/head
Povilas Kanapickas 2019-07-20 11:02:39 +03:00
rodzic 7c70d30f63
commit 1ad6aca501
3 zmienionych plików z 10 dodań i 28 usunięć

Wyświetl plik

@ -3378,7 +3378,6 @@ static SANE_Status
genesys_start_scan (Genesys_Device * dev, SANE_Bool lamp_off)
{
DBG_HELPER(dbg);
SANE_Status status = SANE_STATUS_GOOD;
unsigned int steps, expected;
SANE_Bool empty;
@ -3467,14 +3466,8 @@ genesys_start_scan (Genesys_Device * dev, SANE_Bool lamp_off)
/* build look up table for dynamic lineart */
if(dev->settings.dynamic_lineart==SANE_TRUE)
{
status = sanei_genesys_load_lut(dev->lineart_lut, 8, 8, 50, 205,
dev->settings.threshold_curve,
dev->settings.threshold-127);
if (status != SANE_STATUS_GOOD)
{
DBG(DBG_error, "%s: failed to build lut\n", __func__);
return status;
}
sanei_genesys_load_lut(dev->lineart_lut, 8, 8, 50, 205, dev->settings.threshold_curve,
dev->settings.threshold-127);
}
if (dev->model->cmd_set->wait_for_motor_stop) {

Wyświetl plik

@ -1715,17 +1715,12 @@ int sanei_genesys_compute_max_shift(Genesys_Device *dev,
* @param slope slope of the generated data
* @param offset offset of the generated data
*/
SANE_Status
sanei_genesys_load_lut (unsigned char * lut,
int in_bits,
int out_bits,
int out_min,
int out_max,
int slope,
int offset)
void sanei_genesys_load_lut(unsigned char* lut,
int in_bits, int out_bits,
int out_min, int out_max,
int slope, int offset)
{
DBG_HELPER(dbg);
SANE_Status ret = SANE_STATUS_GOOD;
int i, j;
double shift, rise;
int max_in_val = (1 << in_bits) - 1;
@ -1776,8 +1771,6 @@ sanei_genesys_load_lut (unsigned char * lut,
lut_p16++;
}
}
return ret;
}
void sanei_genesys_usleep(unsigned int useconds)

Wyświetl plik

@ -2002,14 +2002,10 @@ int sanei_genesys_compute_max_shift(Genesys_Device *dev,
int yres,
int flags);
extern SANE_Status
sanei_genesys_load_lut (unsigned char * lut,
int in_bits,
int out_bits,
int out_min,
int out_max,
int slope,
int offset);
extern void sanei_genesys_load_lut(unsigned char* lut,
int in_bits, int out_bits,
int out_min, int out_max,
int slope, int offset);
extern void sanei_genesys_generate_gamma_buffer(Genesys_Device* dev,
const Genesys_Sensor& sensor,