Lines Matching refs:val

2789   unsigned int x, i, j, br, dk, res, avgpixels, basepixels, val;
2887 val = 0;
2890 val = 65535;
2893 val = (dk * target_bright - br * target_dark) / (target_bright - target_dark);
2899 shading_data[(x/factor + o + i) * 2 * 2 + words_per_color * 2 * j] = val & 0xff;
2900 shading_data[(x/factor + o + i) * 2 * 2 + words_per_color * 2 * j + 1] = val >> 8;
2903 val = br - dk;
2905 if (65535 * val > (target_bright - target_dark) * coeff)
2907 val = (coeff * (target_bright - target_dark)) / val;
2911 val = 65535;
2917 shading_data[(x/factor + o + i) * 2 * 2 + words_per_color * 2 * j + 2] = val & 0xff;
2918 shading_data[(x/factor + o + i) * 2 * 2 + words_per_color * 2 * j + 3] = val >> 8;
2969 unsigned int val, br, dk;
3003 val=compute_coefficient(coeff,target,br-dk);
3008 ptr[2] = val & 0xff;
3009 ptr[3] = val / 256;
3043 std::uint32_t val, dk, br;
3069 val = compute_coefficient (coeff, target, br - dk);
3075 ptr[2 + 4 * i] = val & 0xff;
3076 ptr[3 + 4 * i] = val / 256;
5601 static void print_option(DebugMessageHelper& dbg, const Genesys_Scanner& s, int option, void* val)
5605 dbg.vlog(DBG_proc, "value: %d", *reinterpret_cast<SANE_Word*>(val));
5609 dbg.vlog(DBG_proc, "value: %s", *reinterpret_cast<SANE_Bool*>(val) ? "true" : "false");
5613 dbg.vlog(DBG_proc, "value: %f", fixed_to_float(*reinterpret_cast<SANE_Word*>(val)));
5617 dbg.vlog(DBG_proc, "value: %s", reinterpret_cast<char*>(val));
5625 static void get_option_value(Genesys_Scanner* s, int option, void* val)
5647 *reinterpret_cast<SANE_Word*>(val) = s->pos_top_left_x;
5650 *reinterpret_cast<SANE_Word*>(val) = s->pos_top_left_y;
5653 *reinterpret_cast<SANE_Word*>(val) = s->pos_bottom_right_x;
5656 *reinterpret_cast<SANE_Word*>(val) = s->pos_bottom_right_y;
5660 *reinterpret_cast<SANE_Word*>(val) = NUM_OPTIONS;
5663 *reinterpret_cast<SANE_Word*>(val) = s->resolution;
5666 *reinterpret_cast<SANE_Word*>(val) = s->bit_depth;
5669 *reinterpret_cast<SANE_Word*>(val) = s->preview;
5672 *reinterpret_cast<SANE_Word*>(val) = s->lamp_off;
5675 *reinterpret_cast<SANE_Word*>(val) = s->lamp_off_time;
5678 *reinterpret_cast<SANE_Word*>(val) = s->contrast;
5681 *reinterpret_cast<SANE_Word*>(val) = s->brightness;
5684 *reinterpret_cast<SANE_Word*>(val) = s->expiration_time;
5687 *reinterpret_cast<SANE_Word*>(val) = s->custom_gamma;
5692 std::strcpy(reinterpret_cast<char*>(val), s->mode.c_str());
5695 std::strcpy(reinterpret_cast<char*>(val), s->color_filter.c_str());
5698 std::strcpy(reinterpret_cast<char*>(val), s->calibration_file.c_str());
5701 std::strcpy(reinterpret_cast<char*>(val), scan_method_to_option_string(s->scan_method));
5709 table = reinterpret_cast<SANE_Word*>(val);
5729 table = reinterpret_cast<SANE_Word*>(val);
5743 table = reinterpret_cast<SANE_Word*>(val);
5757 table = reinterpret_cast<SANE_Word*>(val);
5782 *reinterpret_cast<SANE_Bool*>(val) = s->buttons[genesys_option_to_button(option)].read();
5799 *reinterpret_cast<SANE_Bool*>(val) = SANE_FALSE;
5802 *reinterpret_cast<SANE_Bool*>(val) = result;
5808 print_option(dbg, *s, option, val);
5814 static void set_calibration_value(Genesys_Scanner* s, const char* val)
5819 std::string new_calib_path = val;
5839 static void set_option_value(Genesys_Scanner* s, int option, void *val, SANE_Int* myinfo)
5842 print_option(dbg, *s, option, val);
5852 s->pos_top_left_x = *reinterpret_cast<SANE_Word*>(val);
5857 s->pos_top_left_y = *reinterpret_cast<SANE_Word*>(val);
5862 s->pos_bottom_right_x = *reinterpret_cast<SANE_Word*>(val);
5867 s->pos_bottom_right_y = *reinterpret_cast<SANE_Word*>(val);
5872 s->resolution = *reinterpret_cast<SANE_Word*>(val);
5877 s->lamp_off = *reinterpret_cast<SANE_Word*>(val);
5882 s->preview = *reinterpret_cast<SANE_Word*>(val);
5887 s->brightness = *reinterpret_cast<SANE_Word*>(val);
5892 s->contrast = *reinterpret_cast<SANE_Word*>(val);
5898 s->bit_depth = *reinterpret_cast<SANE_Word*>(val);
5911 auto scan_method = option_string_to_scan_method(reinterpret_cast<const char*>(val));
5923 s->mode = reinterpret_cast<const char*>(val);
5962 s->color_filter = reinterpret_cast<const char*>(val);
5967 set_calibration_value(s, reinterpret_cast<const char*>(val));
5972 if (*reinterpret_cast<SANE_Word*>(val) != s->lamp_off_time) {
5973 s->lamp_off_time = *reinterpret_cast<SANE_Word*>(val);
5979 if (*reinterpret_cast<SANE_Word*>(val) != s->expiration_time) {
5980 s->expiration_time = *reinterpret_cast<SANE_Word*>(val);
5986 s->custom_gamma = *reinterpret_cast<SANE_Bool*>(val);
6018 table = reinterpret_cast<SANE_Word*>(val);
6032 table = reinterpret_cast<SANE_Word*>(val);
6041 table = reinterpret_cast<SANE_Word*>(val);
6050 table = reinterpret_cast<SANE_Word*>(val);
6106 SANE_Action action, void *val, SANE_Int * info)
6139 get_option_value(s, option, val);
6147 TIE(sanei_constrain_value(s->opt + option, val, &myinfo));
6149 set_option_value(s, option, val, &myinfo);
6165 SANE_Action action, void *val, SANE_Int * info)
6169 sane_control_option_impl(handle, option, action, val, info);