o
    i                     @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZ zddl	Z	W n	 e
y)   Y nw ejdejdiZded	efd
dZdeded	efddZdS )zUse pyjpegls <https://github.com/pydicom/pyjpegls> to decompress encoded
*Pixel Data*.

This module is not intended to be used directly.
    )castuid_passes_version_check)DecodeRunnerN)numpyzpyjpegls>=1.2r   returnc                 C   s
   t ddS )zLReturn ``True`` if the decoder has its dependencies met, ``False`` otherwisejpeg_ls)      r   r    r   V/mnt/sdb/aimis/docanh/lib/python3.10/site-packages/pydicom/pixels/decoders/pyjpegls.pyis_available   s   
r   srcrunnerc                 C   s   t | \}}|d dkr |d dkr|dd n|dd |d }d|  k r.dkr7n n|dd nd|  k rAd	krIn n|dd	 tt|S )
z?Return the decoded image data in `src` as a :class:`bytearray`.
componentsr   interleave_moder   planar_configurationbits_per_sample   bits_allocated   )r
   decode_pixel_data
set_optionr   	bytearray)r   r   bufferinfo	precisionr   r   r   _decode_frame   s   
r   )__doc__typingr   pydicomr   pydicom.pixels.utilsr   pydicom.pixels.decoders.baser   r
   ImportErrorJPEGLSLosslessJPEGLSNearLosslessDECODER_DEPENDENCIESstrboolr   bytesr   r   r   r   r   r   <module>   s   