+
    Ai(                     ,    ^ RI tRR lt ! R R4      tR# )    Nc                   ^RI Hp \        P                  ! V P                  \        P
                  4      '       g   \        R4      hV P                  pV P                  R4      p Vf#   \        P                  ! WRP                  R7      pM-VP                  V8w  d   \        RV RVP                   R24      h VP                  4       pRVn        TP                  T P                  R	R
7      pTP                  TP                  R	R
7      pT! YY4       T#   \         d(    \        RTP                   RTP                   R24      hi ; i)a  Map values from input array from input_vals to output_vals.

Parameters
----------
input_arr : array of int, shape (M[, ...])
    The input label image.
input_vals : array of int, shape (K,)
    The values to map from.
output_vals : array, shape (K,)
    The values to map to.
out : array, same shape as `input_arr`
    The output array. Will be created if not provided. It should
    have the same dtype as `output_vals`.

Returns
-------
out : array, same shape as `input_arr`
    The array of mapped values.

Notes
-----
If `input_arr` contains values that aren't covered by `input_vals`, they
are set to 0.

Examples
--------
>>> import numpy as np
>>> import skimage as ski
>>> ski.util.map_array(
...    input_arr=np.array([[0, 2, 2, 0], [3, 4, 5, 0]]),
...    input_vals=np.array([1, 2, 3, 4, 6]),
...    output_vals=np.array([6, 7, 8, 9, 10]),
... )
array([[0, 7, 7, 0],
       [8, 9, 0, 0]])
)
_map_arrayz7The dtype of an array to be remapped should be integer.dtypezbIf out array is provided, it should have the same shape as the input array. Input array has shape z", provided output array has shape .z`If out array is provided, it should be either contiguous or 1-dimensional. Got array with shape z and strides Fcopy)r
   )_remapr   np
issubdtyper   integer	TypeErrorshapereshapeempty
ValueErrorviewAttributeErrorstridesastype)	input_arr
input_valsoutput_valsoutr   
orig_shapeout_views   &&&&   U/var/www/html/photoedit/myenv/lib/python3.14/site-packages/skimage/util/_map_array.py	map_arrayr      s6   J #=="**55QRRJ !!"%I
{hhz):):;	j	 66@\ B&&)ii[3
 	


88: ""9??"?J$$SYYU$;KyJ<J  
669ii[ A{{m1&
 	

s   8D 2Ec                   h   a  ] tR t^Lt o RtR tR tRR lt]R 4       t	R t
R tR	 tR
 tR tRtV tR# )ArrayMapu  Class designed to mimic mapping by NumPy array indexing.

This class is designed to replicate the use of NumPy arrays for mapping
values with indexing:

>>> values = np.array([0.25, 0.5, 1.0])
>>> indices = np.array([[0, 0, 1], [2, 2, 1]])
>>> values[indices]
array([[0.25, 0.25, 0.5 ],
       [1.  , 1.  , 0.5 ]])

The issue with this indexing is that you need a very large ``values``
array if the values in the ``indices`` array are large.

>>> values = np.array([0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0])
>>> indices = np.array([[0, 0, 10], [0, 10, 10]])
>>> values[indices]
array([[0.25, 0.25, 1.  ],
       [0.25, 1.  , 1.  ]])

Using this class, the approach is similar, but there is no need to
create a large values array:

>>> in_indices = np.array([0, 10])
>>> out_values = np.array([0.25, 1.0])
>>> values = ArrayMap(in_indices, out_values)
>>> values
ArrayMap(array([ 0, 10]), array([0.25, 1.  ]))
>>> print(values)
ArrayMap:
  0 → 0.25
  10 → 1.0
>>> indices = np.array([[0, 0, 10], [0, 10, 10]])
>>> values[indices]
array([[0.25, 0.25, 1.  ],
       [0.25, 1.  , 1.  ]])

Parameters
----------
in_values : array of int, shape (K,)
    The source values from which to map.
out_values : array, shape (K,)
    The destination values from which to map.
c                :    Wn         W n        ^V n        RV n        R# )   N)	in_values
out_values_max_str_lines_array)selfr$   r%   s   &&&r   __init__ArrayMap.__init__z   s    "$    c                P    \         P                  ! V P                  4      ^,           # )z<Return one more than the maximum label value being remapped.)r   maxr$   r(   s   &r   __len__ArrayMap.__len__   s    vvdnn%))r+   Nc                    Vf   V P                   P                  p\        P                  ! \        P                  ! V P
                  4      ^,           VR7      pV P                   W0P
                  &   V# )zReturn an array that behaves like the arraymap when indexed.

This array can be very large: it is the size of the largest value
in the ``in_vals`` array, plus one.
r   )r%   r   r   zerosr-   r$   )r(   r   r	   outputs   &&& r   	__array__ArrayMap.__array__   sO     =OO))E"&&014EB!%~~r+   c                .    V P                   P                  # N)r%   r   r.   s   &r   r   ArrayMap.dtype   s    $$$r+   c                `    R \        V P                  4       R\        V P                  4       R2# )z	ArrayMap(z, ))reprr$   r%   r.   s   &r   __repr__ArrayMap.__repr__   s+    4/043H2IKKr+   c                &   \        V P                  4      V P                  ^,           8:  dr   \        \        V P                  4      4      pRP	                  R.V Uu. uF-  pRV P                  V,           RV P
                  V,           2NK/  	  up,           4      pV# \        \        ^ V P                  ^,          4      4      p\        \        V P                  ) ^,          ^ 4      4      pRP	                  R.V Uu. uF-  pRV P                  V,           RV P
                  V,           2NK/  	  up,           R.,           V Uu. uF-  pRV P                  V,           RV P
                  V,           2NK/  	  up,           4      pV# u upi u upi u upi )   
z	ArrayMap:z  u    → z  ...)lenr$   r&   rangejoinr%   list)r(   rowsistringrows0rows1s   &     r   __str__ArrayMap.__str__   sj   t~~$"5"5"99T^^,-DYYNRSdRq)*%0B/CDdSTF  q$"5"5":;<E 3 33q8!<=EYYNSTeRq)*%0B/CDeTU) OTTeRq)*%0B/CDeTUF  T UTs   3F
;3F	
3F
c                $    V P                  V4      # r7   )__getitem__)r(   arrs   &&r   __call__ArrayMap.__call__   s    $$r+   c                J   \         P                  ! V4      pV'       d   \         P                  ! V.4      pMt\        V\        4      '       d_   VP
                  ;'       g    ^ pVP                  e   VP                  M
\        V 4      pVP                  p\         P                  ! W4V4      pVP                  \        8X  d   \         P                  ! V4      p\        VV P                  P                  VP                  RR7      V P                   4      pV'       d
   V^ ,          pV# )r   Fr   )r   isscalararray
isinstanceslicestartstoprA   steparanger   boolflatnonzeror   r$   r   r%   )r(   indexscalarrV   rW   rX   r   s   &&     r   rM   ArrayMap.__getitem__   s    U#HHeW%Eu%%KK$$1E!&!75::SYD::DIIe40E;;$NN5)ENN!!%++E!:OO
 a&C
r+   c                    V P                   f   V P                  4       V n         W P                   V&   \        P                  ! V P                   4      V n        V P                   V P                  ,          V n        R # r7   )r'   r4   r   r[   r$   r%   )r(   indicesvaluess   &&&r   __setitem__ArrayMap.__setitem__   sN    ;;..*DK%G4++dnn5r+   )r'   r&   r$   r%   )NN)__name__
__module____qualname____firstlineno____doc__r)   r/   r4   propertyr   r<   rJ   rO   rM   rb   __static_attributes____classdictcell__)__classdict__s   @r   r!   r!   L   sM     +Z*
 % %L$%,6 6r+   r!   r7   )numpyr   r   r!    r+   r   <module>ro      s    EP{6 {6r+   