1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// SPDX-License-Identifier: MIT OR Apache-2.0
//! LVGL math utility wrappers.
use *;
/// Cubic Bezier calculation with 4 control points.
///
/// `t` is the time parameter in `[0..1024]`.
/// `u0` must be 0, `u3` must be 1024 (fixed endpoints).
/// `u1` and `u2` are the control values in `[0..1024]`.
/// Returns a value in `[0..1024]`.
/// Linear mapping from input range to output range.
///
/// Maps `x` from `[min_in..max_in]` to `[min_out..max_out]`.
/// Maximum value for Bezier control points and time parameter (1024).
pub const BEZIER_VAL_MAX: i32 = 1024;
/// LVGL fixed-point cosine. Angle in degrees (0–359).
/// Returns a value in `[-32767..32767]` (`LV_TRIGO_SIN_MAX`).
/// LVGL fixed-point sine. Angle in degrees (0–359).
/// Returns a value in `[-32767..32767]` (`LV_TRIGO_SIN_MAX`).
/// Bit shift for LVGL trigonometry results (`LV_TRIGO_SHIFT = 15`).
pub const TRIGO_SHIFT: i32 = LV_TRIGO_SHIFT as i32;
/// Integer arctangent. Returns angle in tenths of a degree (0–3599).
///
/// Note: LVGL binding argument order is `(x, y)` (not the conventional `(y,
/// x)`).