genesys: Remove no longer used final_exposure

merge-requests/213/head
Povilas Kanapickas 2019-12-14 10:20:25 +02:00
rodzic 35385625de
commit 69067f2f7f
6 zmienionych plików z 9 dodań i 34 usunięć

Wyświetl plik

@ -320,8 +320,7 @@ void sanei_genesys_init_structs (Genesys_Device * dev)
/**
* This function generates a slope table using the slope from the motor struct
* truncated at the given exposure time or step count, whichever comes first.
* The reached step time is then stored in final_exposure and used for the rest
* of the table. The summed time of the acceleration steps is returned, and the
* The summed time of the acceleration steps is returned, and the
* number of accerelation steps is put into used_steps.
*
* @param dev Device struct
@ -331,7 +330,6 @@ void sanei_genesys_init_structs (Genesys_Device * dev)
* @param exposure_time Minimum exposure time of a scan line
* @param yres Resolution of a scan line
* @param used_steps Final number of steps is stored here
* @param final_exposure Final step time is stored here
* @return Motor slope table
* @note all times in pixel time
*/
@ -341,11 +339,8 @@ MotorSlopeTable sanei_genesys_create_slope_table3(AsicType asic_type, const Gene
{
unsigned target_speed_w = (exposure_time * yres) / motor.base_ydpi;
auto table = create_slope_table(motor.get_slope(step_type), target_speed_w, step_type, 1, 1,
get_slope_table_max_size(asic_type));
table.final_exposure = (table.final_exposure * motor.base_ydpi) / yres;
return table;
return create_slope_table(motor.get_slope(step_type), target_speed_w, step_type, 1, 1,
get_slope_table_max_size(asic_type));
}
/** @brief computes gamma table

Wyświetl plik

@ -1768,20 +1768,16 @@ MotorSlopeTable sanei_genesys_slope_table(AsicType asic_type, int dpi, int expos
auto table = create_slope_table(motor_profile.slope, target_speed_w, motor_profile.step_type,
step_multiplier, 2 * step_multiplier,
get_slope_table_max_size(asic_type));
table.final_exposure = (table.final_exposure * base_dpi) / dpi;
return table;
}
MotorSlopeTable create_slope_table_fastest(AsicType asic_type, int dpi, int base_dpi,
unsigned step_multiplier,
MotorSlopeTable create_slope_table_fastest(AsicType asic_type, unsigned step_multiplier,
const Motor_Profile& motor_profile)
{
auto table = create_slope_table(motor_profile.slope, motor_profile.slope.max_speed_w,
motor_profile.step_type,
step_multiplier, 2 * step_multiplier,
get_slope_table_max_size(asic_type));
table.final_exposure = (table.final_exposure * base_dpi) / dpi;
return table;
return create_slope_table(motor_profile.slope, motor_profile.slope.max_speed_w,
motor_profile.step_type,
step_multiplier, 2 * step_multiplier,
get_slope_table_max_size(asic_type));
}
/** @brief returns the lowest possible ydpi for the device

Wyświetl plik

@ -411,8 +411,7 @@ MotorSlopeTable sanei_genesys_slope_table(AsicType asic_type, int dpi, int expos
unsigned step_multiplier,
const Motor_Profile& motor_profile);
MotorSlopeTable create_slope_table_fastest(AsicType asic_type, int dpi, int base_dpi,
unsigned step_multiplier,
MotorSlopeTable create_slope_table_fastest(AsicType asic_type, unsigned step_multiplier,
const Motor_Profile& motor_profile);
/** @brief find lowest motor resolution for the device.

Wyświetl plik

@ -85,11 +85,7 @@ void MotorSlopeTable::slice_steps(unsigned count)
if (count >= table.size() || count > steps_count) {
throw SaneException("Excepssive steps count");
}
unsigned old_step = table[steps_count - 1];
unsigned new_step = table[count - 1];
steps_count = count;
final_exposure = final_exposure * (static_cast<float>(new_step) / old_step);
}
unsigned get_slope_table_max_size(AsicType asic_type)
@ -155,8 +151,6 @@ MotorSlopeTable create_slope_table(const MotorSlope& slope, unsigned target_spee
// fill the rest of the table with the final speed
table.table.resize(max_size, final_speed);
table.final_exposure = final_speed;
return table;
}

Wyświetl plik

@ -126,9 +126,6 @@ struct MotorSlopeTable
unsigned steps_count = 0;
unsigned pixeltime_sum = 0;
// table.back() adjusted to the scan dpi
unsigned final_exposure = 0;
void slice_steps(unsigned count);
};

Wyświetl plik

@ -49,7 +49,6 @@ void test_create_slope_table3()
ASSERT_EQ(table.pixeltime_sum, 10000u);
ASSERT_EQ(table.steps_count, 1u);
ASSERT_EQ(table.final_exposure, 10000u);
std::vector<std::uint16_t> expected_steps = {
10000,
@ -63,7 +62,6 @@ void test_create_slope_table3()
ASSERT_EQ(table.pixeltime_sum, 33830u);
ASSERT_EQ(table.steps_count, 7u);
ASSERT_EQ(table.final_exposure, 2000u);
expected_steps = {
10000, 10000, 4099, 3028, 2511, 2192, 2000
@ -77,7 +75,6 @@ void test_create_slope_table3()
ASSERT_EQ(table.pixeltime_sum, 5000u);
ASSERT_EQ(table.steps_count, 1u);
ASSERT_EQ(table.final_exposure, 5000u);
expected_steps = {
5000,
@ -92,7 +89,6 @@ void test_create_slope_table3()
ASSERT_EQ(table.pixeltime_sum, 16914u);
ASSERT_EQ(table.steps_count, 7u);
ASSERT_EQ(table.final_exposure, 1000u);
expected_steps = {
5000, 5000, 2049, 1514, 1255, 1096, 1000
@ -106,7 +102,6 @@ void test_create_slope_table3()
ASSERT_EQ(table.pixeltime_sum, 2500u);
ASSERT_EQ(table.steps_count, 1u);
ASSERT_EQ(table.final_exposure, 2500u);
expected_steps = {
2500,
@ -121,7 +116,6 @@ void test_create_slope_table3()
ASSERT_EQ(table.pixeltime_sum, 7680u);
ASSERT_EQ(table.steps_count, 6u);
ASSERT_EQ(table.final_exposure, 500u);
expected_steps = {
2500, 2500, 932, 683, 565, 500