Function input_sys::libinput_device_config_calibration_set_matrix [] [src]

pub unsafe extern "C" fn libinput_device_config_calibration_set_matrix(
    device: *mut libinput_device,
    matrix: *const f32
) -> libinput_config_status

@ingroup config

Apply the 3x3 transformation matrix to absolute device coordinates. This matrix has no effect on relative events.

Given a 6-element array [a, b, c, d, e, f], the matrix is applied as @code [ a b c ] [ x ] [ d e f ] * [ y ] [ 0 0 1 ] [ 1 ] @endcode

The translation component (c, f) is expected to be normalized to the device coordinate range. For example, the matrix @code [ 1 0 1 ] [ 0 1 -1 ] [ 0 0 1 ] @endcode moves all coordinates by 1 device-width to the right and 1 device-height up.

The rotation matrix for rotation around the origin is defined as @code [ cos(a) -sin(a) 0 ] [ sin(a) cos(a) 0 ] [ 0 0 1 ] @endcode Note that any rotation requires an additional translation component to translate the rotated coordinates back into the original device space. The rotation matrixes for 90, 180 and 270 degrees clockwise are: @code 90 deg cw: 180 deg cw: 270 deg cw: [ 0 -1 1] [ -1 0 1] [ 0 1 0 ] [ 1 0 0] [ 0 -1 1] [ -1 0 1 ] [ 0 0 1] [ 0 0 1] [ 0 0 1 ] @endcode

@param device The device to configure @param matrix An array representing the first two rows of a 3x3 matrix as described above.

@return A config status code.

@see libinput_device_config_calibration_has_matrix @see libinput_device_config_calibration_get_matrix @see libinput_device_config_calibration_get_default_matrix