Lines Matching defs:gain
627 fn get_speed_gain_mouse(vin: f64, gain: *mut f64, speed: i32, device_type: i32) -> bool {
651 *gain = (item.slopes[i] * vin + item.diff_nums[i]) / vin;
652 debug!(LOG_LABEL, "slope is set to {}, gain is {}", @public(item.slopes[i]), @public(*gain));
656 *gain = (item.slopes[len - 1] * vin + item.diff_nums[len - 1]) / vin;
657 debug!(LOG_LABEL, "slope is set to {}, gain is {}", @public(item.slopes[len - 1]), @public(*gain));
664 fn get_speed_gain_touchpad(vin: f64, gain: *mut f64, speed: i32, device_type: i32) -> bool {
688 *gain = (item.slopes[i] * vin + item.diff_nums[i]) / vin;
689 debug!(LOG_LABEL, "gain is set to {}", @public((*gain * vin - item.diff_nums[i])/ vin));
693 *gain = (item.slopes[3] * vin + item.diff_nums[3]) / vin;
694 debug!(LOG_LABEL, "gain is set to {}", @public((*gain * vin - item.diff_nums[3])/ vin));
700 fn get_axis_gain_touchpad(gain: *mut f64, axis_speed: f64, device_type: i32) -> bool {
713 *gain = item.slopes[i] * num + item.diff_nums[i];
714 debug!(LOG_LABEL, "gain is set to {}", @public((*gain - item.diff_nums[i]) / num));
718 *gain = item.slopes[len - 1] * num + item.diff_nums[len - 1];
719 debug!(LOG_LABEL, "gain is set to {}", @public((*gain - item.diff_nums[len - 1]) / num));
746 let mut gain = 0.0;
756 "output the abs_x {} and abs_y {} captureMode {} dx {} dy {} gain {}",
762 @public(gain)
764 if !get_speed_gain_mouse(vin, &mut gain as *mut f64, speed, device_type) {
769 *abs_x += dx * gain;
770 *abs_y += dy * gain;
792 let mut gain = 0.0;
804 "output the abs_x {} and abs_y {} captureMode {} dx {} dy {} gain {}",
810 @public(gain)
812 if !get_speed_gain_touchpad(vin, &mut gain as *mut f64, speed, device_type) {
817 deltax = (dx * gain + COMPENSATE_VALUEX).trunc();
818 deltay = (dy * gain + COMPENSATE_VALUEY).trunc();
819 COMPENSATE_VALUEX = (dx * gain + COMPENSATE_VALUEX).fract();
820 COMPENSATE_VALUEY = (dy * gain + COMPENSATE_VALUEY).fract();
841 let mut gain = 0.0;
845 "input the abs_axis {} and captureMode {} gain {}",
848 @public(gain)
850 if !get_axis_gain_touchpad(&mut gain as *mut f64, *abs_axis, device_type) {
855 *abs_axis = if *abs_axis >= 0.0 { gain } else { -gain };