+
     i  c                   s2    ^ RI t ^ RIHtHt  ! R R4      tR# )    N)DictUnionc                   s   a  ] tR t^t o RtRV 3R lR lltV 3R lR ltR tV 3R lR ltV 3R	 lR
 lt	V 3R lR lt
RtV tR# )Transformationz3Callable that returns the axis transformation at x.c                sh   < V ^8  d   QhRS[ S[S[3,          RS[ S[S[3,          RS[RS[RS[RR/# )   max_min_deadzonegainexporeturnNr   ZintfloatZformat__classdict__   "\/usr/lib/python3.14/site-packages/inputremapper/injection/mapping_handlers/axis_transform.py__annotate__Transformation.__annotate__   s[     - - CJ- CJ	-
 - - - 
-    c                sP    Wn         W n        W0n        W@n        WPn        / V n        R # N)_max_min	_deadzone_gain_expo_cache)selfr   r   r   r   r	   s   &&&&&&r   __init__ZTransformation.__init__   s$     		!

*,r   c                <   < V ^8  d   QhRS[ S[S[3,          RS[/# r   xr
   r   r   r   r   r   r   +   s$      U3:. 5 r   c               s    WP                   9  dO   V P                  V P                  V P                  V4      4      4      V P                  ,          pW P                   V&   V P                   V,          # r   )r   _calc_qubic_flatten_deadzone
_normalizer   )r   r   ys   "& r   __call__ZTransformation.__call__+   sZ    KK  !7!78J!KL**  KKN{{1~r   c                sl    WP                   8w  g   W P                  8w  d   / V n        Wn         W n        R # r   )r   r   r   )r   r   r   s   &&&r   	set_rangeZTransformation.set_range5   s&    99		 1DK		r   c                r   r   r   r   r   r   r   r   =   s$     	) 	)E#u*- 	)% 	)r   c                s    V P                   R8X  d   V P                  ^8X  d   V# V P                  V P                   ,
          ^,          pW P                   ,           pW,
          V,          # )z2Move and scale x to be between -1 and 1
return: x
)r   r   )r   r   Z
half_rangeZmiddles   &&  r   r"   ZTransformation._normalize=   sN     99?tyyA~Hii$))+q0
ii'
j((r   c                &   < V ^8  d   QhRS[ RS[ /# r   r   r   r   r   r   r   H   s     H H5 HU Hr   c                s    \        V4      V P                  8:  d   ^ # WP                  V,          \        V4      ,          ,
          ^V P                  ,
          ,          # )a?  
 y ^                     y ^
   |                       |
 1 |         /           1 |         /
   |       /               |        /
   |     /         ==>     |    ---
   |   /                   |  /
-1 | /                  -1 | /
   |------------>          |------------>
    -1       1  x           -1       1  x
)absr   )r   r   s   &&r   r!   Z Transformation._flatten_deadzoneH   s@     q6T^^#NNQ&Q//A4FGGr   c                r'   r   r(   r   r   r   r   r   Y   s     37 37U 37u 37r   c                s   V P                   pV^ 8X  g   V^ 8X  d   V# ^ Tu;8  d   ^8:  d1   M M-^V,
          pW1,          ^V,
          V^,          ,          ,           # RTu;8:  d	   ^ 8  Ed   M EM	V\        V4      ,          p\        P                  ! V4      p^V,           p^V,
          pTp\        P                  ! ^V^,          ,          ^V^,          ,          V,          ,           4      RV,          ,           R,          pVR\        P                  ! ^4      ,          VR,          ,          ,          RV,          \        P                  ! ^4      VR,          ,          V,          ,          ,
          pW,          # \        R4      h)us  Transforms an x value by applying a qubic function

k = 0 : will yield no transformation f(x) = x
1 > k > 0 : will yield low sensitivity for low x values
    and high sensitivity for high x values
-1 < k < 0 : will yield high sensitivity for low x values
    and low sensitivity for high x values

see also: https://www.geogebra.org/calculator/mkdqueky

Mathematical definition:
f(x,d) = d * x + (1 - d) * x ** 3 | d = 1 - k | k ∈ [0,1]
the function is designed such that if follows these constraints:
f'(0, d) = d and f(1, d) = 1 and f(-x,d) = -f(x,d)

for k ∈ [-1,0) the above function is mirrored at y = x
and d = 1 + k
zk must be between -1 and 1r&   g9B.@gUUUUUU?gr(?gUUUUUU?)r   r)   mathZfabsZsqrtZ
ValueError)	r   r   ZkZdZsignZaZbZcr#   s	   &&       r   r    ZTransformation._calc_qubicY   s#   & JJ6Q!VHq:A:AA5AEQT>));Q;; s1v:D		!AAAAAA219AqDA~569IIuUA\DIIaL01<?@q 1e,q0D2 2A 8O566r   )r   r   r   r   r   r   N)i   r    )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r$   r%   r"   r!   r    Z__static_attributes__Z__classdictcell__)r   s   @r   r   r      sA     =- -  	) 	)H H"37 37r   r   )r*   Ztypingr   r   r   ) r   r   <module>r+      s   (  t7 t7r   