%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/PIL/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/PIL/__pycache__/ImageCms.cpython-312.pyc

�

��e=����ddlmZddlZddlmZddlmZ	ddlmZdZ
d	ZeZGd
�de�ZGd�d
e�Zidd�dd�dd�dd�dd�dd�dd�dd�dd�dd �d!d"�d#d$�d%d$�d&d'�d(d)�d*d+�d,d-�d.d/�i�ZdZej)�D]Zeee�s�
eezZ�Gd0�d1�ZGd2�d3ej2�ZdGd4�ZGd5�d6e�Zej<dd7dfd8�Zd9�Z ej<dfd:�Z!ej<ejDed(fd;�Z#e!Z$e#Z%dHd<�Z&dId=�Z'd>�Z(d?�Z)d@�Z*dA�Z+dB�Z,dC�Z-dD�Z.dE�Z/dF�Z0y#e$r#Z	ddl
mZeje	�ZYdZ	[	��8dZ	[	wwxYw)J�)�annotationsN)�IntEnum�)�Image)�_imagingcms)�
DeferredErrora|	
pyCMS

    a Python / PIL interface to the littleCMS ICC Color Management System
    Copyright (C) 2002-2003 Kevin Cazabon
    kevin@cazabon.com
    https://www.cazabon.com

    pyCMS home page:  https://www.cazabon.com/pyCMS
    littleCMS home page:  https://www.littlecms.com
    (littleCMS is Copyright (C) 1998-2001 Marti Maria)

    Originally released under LGPL.  Graciously donated to PIL in
    March 2009, for distribution under the standard PIL license

    The pyCMS.py module provides a "clean" interface between Python/PIL and
    pyCMSdll, taking care of some of the more complex handling of the direct
    pyCMSdll functions, as well as error-checking and making sure that all
    relevant data is kept together.

    While it is possible to call pyCMSdll functions directly, it's not highly
    recommended.

    Version History:

        1.0.0 pil       Oct 2013 Port to LCMS 2.

        0.1.0 pil mod   March 10, 2009

                        Renamed display profile to proof profile. The proof
                        profile is the profile of the device that is being
                        simulated, not the profile of the device which is
                        actually used to display/print the final simulation
                        (that'd be the output profile) - also see LCMSAPI.txt
                        input colorspace -> using 'renderingIntent' -> proof
                        colorspace -> using 'proofRenderingIntent' -> output
                        colorspace

                        Added LCMS FLAGS support.
                        Added FLAGS["SOFTPROOFING"] as default flag for
                        buildProofTransform (otherwise the proof profile/intent
                        would be ignored).

        0.1.0 pil       March 2009 - added to PIL, as PIL.ImageCms

        0.0.2 alpha     Jan 6, 2002

                        Added try/except statements around type() checks of
                        potential CObjects... Python won't let you use type()
                        on them, and raises a TypeError (stupid, if you ask
                        me!)

                        Added buildProofTransformFromOpenProfiles() function.
                        Additional fixes in DLL, see DLL code for details.

        0.0.1 alpha     first public release, Dec. 26, 2002

    Known to-do list with current version (of Python interface, not pyCMSdll):

        none

z	1.0.0 pilc��eZdZdZdZdZdZy)�Intentrr��N)�__name__�
__module__�__qualname__�
PERCEPTUAL�RELATIVE_COLORIMETRIC�
SATURATION�ABSOLUTE_COLORIMETRIC���./usr/lib/python3/dist-packages/PIL/ImageCms.pyr
r
js���J����J��rr
c��eZdZdZdZdZy)�	DirectionrrrN)r
rr�INPUT�OUTPUT�PROOFrrrrrqs��
�E�
�F�
�Err�MATRIXINPUT�MATRIXOUTPUTr�
MATRIXONLYr�NOWHITEONWHITEFIXUP��NOPRELINEARIZATION��GUESSDEVICECLASS� �NOTCACHE�@�
NOTPRECALC��
NULLTRANSFORMi�HIGHRESPRECALCi�
LOWRESPRECALCi�WHITEBLACKCOMPENSATIONi �BLACKPOINTCOMPENSATION�
GAMUTCHECKi�SOFTPROOFINGi@�
PRESERVEBLACKi��NODEFAULTRESOURCEDEFi�
GRIDPOINTSc��|dzdzS)N�r"r)�ns r�<lambda>r6�s��Q��X�"�,�rc� �eZdZd�Zdd�Zd�Zy)�ImageCmsProfilec��t|t�r[tjdk(r"|j	�}	|jd�|jtj|�|�yt|d�r3|jtj|j���yt|tj�r|j|�yd}t!|��#t$rWt|d�5}|jtj|j���ddd�Yy#1swYYyxYwwxYw)z�
        :param profile: Either a string representing a filename,
            a file like object containing a profile or a
            low-level profile object

        �win32�ascii�rbN�readzInvalid type for Profile)�
isinstance�str�sys�platform�encode�decode�UnicodeDecodeError�open�_set�core�profile_frombytesr=�profile_open�hasattrr�
CmsProfile�	TypeError)�self�profile�profile_bytes_path�f�msgs     r�__init__zImageCmsProfile.__init__�s����g�s�#��|�|�w�&�%,�^�^�%5�"��&�-�-�g�6�

�I�I�d�'�'��0�'�:�
�W�f�
%��I�I�d�,�,�W�\�\�^�<�=�
���!7�!7�
8��I�I�g��,�C��C�.� ��*���g�t�,�D���	�	�$�"8�"8�����"B�C�D��D����s)�C$�$E�93D6�,E�6E	�;E�ENc�<�||_||_d|_d|_y�N)rN�filename�product_name�product_info)rMrNrUs   rrFzImageCmsProfile._set�s ����� ��
� ��� ��rc�@�tj|j�S)z�
        Returns the profile in a format suitable for embedding in
        saved images.

        :returns: a bytes object containing the ICC profile.
        )rG�profile_tobytesrN)rMs r�tobyteszImageCmsProfile.tobytes�s���#�#�D�L�L�1�1rrT)r
rrrRrFrZrrrr8r8�s��!�4!�2rr8c�\�eZdZdZej
dejdfd�Zd�Zdd�Z	d�Z
y)	�ImageCmsTransformz�
    Transform.  This can be used with the procedural API, or with the standard
    :py:func:`~PIL.Image.Image.point` method.

    Will return the output profile in the ``output.info['icc_profile']``.
    Nrc	
�4�|�4tj|j|j||||�|_n?tj	|j|j|j|||||�|_|x|_|_|x|_|_||_	yrT)
rG�buildTransformrN�	transform�buildProofTransform�
input_mode�	inputMode�output_mode�
outputMode�output_profile)	rM�input�outputrarc�intent�proof�proof_intent�flagss	         rrRzImageCmsTransform.__init__�s����=�!�0�0��
�
�v�~�~�z�;��PU��D�N�"�5�5��
�
�����
�
������	�D�N�,6�5���$�.�-8�8���4�?�$��rc�$�|j|�SrT)�apply)rM�ims  r�pointzImageCmsTransform.point�s���z�z�"�~�rc�V�|j�|�+tj|j|jd�}|j
j
|jj|jj�|jj�|jd<|S)N�icc_profile)�loadr�newrc�sizer_rmrn�idrerZ�info)rMrn�imOuts   rrmzImageCmsTransform.apply�sr��
���	��=��I�I�d�.�.�����>�E������R�U�U�X�X�u�x�x�{�{�3�$(�$7�$7�$?�$?�$A��
�
�=�!��rc�H�|j�|j|jk7r
d}t|��|jj|jj|jj�|jj�|jd<|S)Nz
mode mismatchrq)rr�moderc�
ValueErrorr_rmrnrurerZrv)rMrnrQs   r�apply_in_placez ImageCmsTransform.apply_in_place�sr��
���	�
�7�7�d�&�&�&�!�C��S�/�!������R�U�U�X�X�r�u�u�x�x�0�!%�!4�!4�!<�!<�!>����
���	rrT)r
rr�__doc__r
rrrRrormr{rrrr\r\�s6���� � ���1�1��%�@��rr\c���tjdk7ryddlm}t	||j
�rtj|d�}ntj|xsd�}|�yt|�S)z�
    (experimental) Fetches the profile for the current display device.

    :returns: ``None`` if the profile is not known.
    r:Nr)�ImageWinr)	r@rA�r~r>�HDCrG�get_display_profile_win32r8)�handler~rNs   r�get_display_profiler�	s]���|�|�w�����&�(�,�,�'��0�0���;���0�0���1�=������7�#�#rc��eZdZdZy)�
PyCMSErrorzJ(pyCMS) Exception class.
    This is used for all errors in the pyCMS API.N)r
rrr|rrrr�r�#s��5�	rr�Fc�&�|�|j}t|t�r
d|cxkrdksnd}t|��t|t�rd|cxkr	tksndt��}t|��	t|t
�st|�}t|t
�st|�}t
|||j|||��}|r|j|�d}	|	S|j|�}		|	S#tttf$r}
t|
�|
�d}
~
wwxYw)a�

    (pyCMS) Applies an ICC transformation to a given image, mapping from
    ``inputProfile`` to ``outputProfile``.

    If the input or output profiles specified are not valid filenames, a
    :exc:`PyCMSError` will be raised.  If ``inPlace`` is ``True`` and
    ``outputMode != im.mode``, a :exc:`PyCMSError` will be raised.
    If an error occurs during application of the profiles,
    a :exc:`PyCMSError` will be raised.
    If ``outputMode`` is not a mode supported by the ``outputProfile`` (or by pyCMS),
    a :exc:`PyCMSError` will be raised.

    This function applies an ICC transformation to im from ``inputProfile``'s
    color space to ``outputProfile``'s color space using the specified rendering
    intent to decide how to handle out-of-gamut colors.

    ``outputMode`` can be used to specify that a color mode conversion is to
    be done using these profiles, but the specified profiles must be able
    to handle that mode.  I.e., if converting im from RGB to CMYK using
    profiles, the input profile must handle RGB data, and the output
    profile must handle CMYK data.

    :param im: An open :py:class:`~PIL.Image.Image` object (i.e. Image.new(...)
        or Image.open(...), etc.)
    :param inputProfile: String, as a valid filename path to the ICC input
        profile you wish to use for this image, or a profile object
    :param outputProfile: String, as a valid filename path to the ICC output
        profile you wish to use for this image, or a profile object
    :param renderingIntent: Integer (0-3) specifying the rendering intent you
        wish to use for the transform

            ImageCms.Intent.PERCEPTUAL            = 0 (DEFAULT)
            ImageCms.Intent.RELATIVE_COLORIMETRIC = 1
            ImageCms.Intent.SATURATION            = 2
            ImageCms.Intent.ABSOLUTE_COLORIMETRIC = 3

        see the pyCMS documentation for details on rendering intents and what
        they do.
    :param outputMode: A valid PIL mode for the output image (i.e. "RGB",
        "CMYK", etc.).  Note: if rendering the image "inPlace", outputMode
        MUST be the same mode as the input, or omitted completely.  If
        omitted, the outputMode will be the same as the mode of the input
        image (im.mode)
    :param inPlace: Boolean.  If ``True``, the original image is modified in-place,
        and ``None`` is returned.  If ``False`` (default), a new
        :py:class:`~PIL.Image.Image` object is returned with the transform applied.
    :param flags: Integer (0-...) specifying additional flags
    :returns: Either None or a new :py:class:`~PIL.Image.Image` object, depending on
        the value of ``inPlace``
    :exception PyCMSError:
    Nrr�2renderingIntent must be an integer between 0 and 3z'flags must be an integer between 0 and �rk)ryr>�intr��	_MAX_FLAGr8r\r{rm�OSErrorrLrz)rn�inputProfile�
outputProfile�renderingIntentrd�inPlacerkrQr_rw�vs           r�profileToProfiler�+s
��z���W�W�
��o�s�+�A��4M�A�4M�B����o���e�S�!�!�u�*A�	�*A�7�	�{�C����o��#��,��8�*�<�8�L��-��9�+�M�:�M�%����G�G����

�	���$�$�R�(��E��L�	�O�O�B�'�E��L��
�Y�
�+�#���m��"��#�s�/A&C+�C+�+D�?D�Dc�j�	t|�S#tttf$r}t	|�|�d}~wwxYw)a�
    (pyCMS) Opens an ICC profile file.

    The PyCMSProfile object can be passed back into pyCMS for use in creating
    transforms and such (as in ImageCms.buildTransformFromOpenProfiles()).

    If ``profileFilename`` is not a valid filename for an ICC profile,
    a :exc:`PyCMSError` will be raised.

    :param profileFilename: String, as a valid filename path to the ICC profile
        you wish to open, or a file-like object.
    :returns: A CmsProfile class object.
    :exception PyCMSError:
    N)r8r�rLrzr�)�profileFilenamer�s  r�getOpenProfiler��s5�� #���/�/���Y�
�+�#���m��"��#�s�

�2�-�2c��t|t�r
d|cxkrdksnd}t|��t|t�rd|cxkr	tksndtz}t|��	t|t�st	|�}t|t�st	|�}t||||||��S#tttf$r}t|�|�d}~wwxYw)a
    (pyCMS) Builds an ICC transform mapping from the ``inputProfile`` to the
    ``outputProfile``. Use applyTransform to apply the transform to a given
    image.

    If the input or output profiles specified are not valid filenames, a
    :exc:`PyCMSError` will be raised. If an error occurs during creation
    of the transform, a :exc:`PyCMSError` will be raised.

    If ``inMode`` or ``outMode`` are not a mode supported by the ``outputProfile``
    (or by pyCMS), a :exc:`PyCMSError` will be raised.

    This function builds and returns an ICC transform from the ``inputProfile``
    to the ``outputProfile`` using the ``renderingIntent`` to determine what to do
    with out-of-gamut colors.  It will ONLY work for converting images that
    are in ``inMode`` to images that are in ``outMode`` color format (PIL mode,
    i.e. "RGB", "RGBA", "CMYK", etc.).

    Building the transform is a fair part of the overhead in
    ImageCms.profileToProfile(), so if you're planning on converting multiple
    images using the same input/output settings, this can save you time.
    Once you have a transform object, it can be used with
    ImageCms.applyProfile() to convert images without the need to re-compute
    the lookup table for the transform.

    The reason pyCMS returns a class object rather than a handle directly
    to the transform is that it needs to keep track of the PIL input/output
    modes that the transform is meant for.  These attributes are stored in
    the ``inMode`` and ``outMode`` attributes of the object (which can be
    manually overridden if you really want to, but I don't know of any
    time that would be of use, or would even work).

    :param inputProfile: String, as a valid filename path to the ICC input
        profile you wish to use for this transform, or a profile object
    :param outputProfile: String, as a valid filename path to the ICC output
        profile you wish to use for this transform, or a profile object
    :param inMode: String, as a valid PIL mode that the appropriate profile
        also supports (i.e. "RGB", "RGBA", "CMYK", etc.)
    :param outMode: String, as a valid PIL mode that the appropriate profile
        also supports (i.e. "RGB", "RGBA", "CMYK", etc.)
    :param renderingIntent: Integer (0-3) specifying the rendering intent you
        wish to use for the transform

            ImageCms.Intent.PERCEPTUAL            = 0 (DEFAULT)
            ImageCms.Intent.RELATIVE_COLORIMETRIC = 1
            ImageCms.Intent.SATURATION            = 2
            ImageCms.Intent.ABSOLUTE_COLORIMETRIC = 3

        see the pyCMS documentation for details on rendering intents and what
        they do.
    :param flags: Integer (0-...) specifying additional flags
    :returns: A CmsTransform class object.
    :exception PyCMSError:
    rrr��)flags must be an integer between 0 and %sr�N�	r>r�r�r�r8r\r�rLrz)r�r��inMode�outModer�rkrQr�s        rr^r^�s���~�o�s�+�A��4M�A�4M�B����o���e�S�!�!�u�*A�	�*A�9�I�E����o��	#��,��8�*�<�8�L��-��9�+�M�:�M� ��-���/�QV�
�	
��
�Y�
�+�#���m��"��#�s�!AB(�(C
�<C�C
c
���t|t�r
d|cxkrdksnd}t|��t|t�rd|cxkr	tksndtz}t|��	t|t�st	|�}t|t�st	|�}t|t�st	|�}t||||||||�S#tttf$r}	t|	�|	�d}	~	wwxYw)a�
    (pyCMS) Builds an ICC transform mapping from the ``inputProfile`` to the
    ``outputProfile``, but tries to simulate the result that would be
    obtained on the ``proofProfile`` device.

    If the input, output, or proof profiles specified are not valid
    filenames, a :exc:`PyCMSError` will be raised.

    If an error occurs during creation of the transform,
    a :exc:`PyCMSError` will be raised.

    If ``inMode`` or ``outMode`` are not a mode supported by the ``outputProfile``
    (or by pyCMS), a :exc:`PyCMSError` will be raised.

    This function builds and returns an ICC transform from the ``inputProfile``
    to the ``outputProfile``, but tries to simulate the result that would be
    obtained on the ``proofProfile`` device using ``renderingIntent`` and
    ``proofRenderingIntent`` to determine what to do with out-of-gamut
    colors.  This is known as "soft-proofing".  It will ONLY work for
    converting images that are in ``inMode`` to images that are in outMode
    color format (PIL mode, i.e. "RGB", "RGBA", "CMYK", etc.).

    Usage of the resulting transform object is exactly the same as with
    ImageCms.buildTransform().

    Proof profiling is generally used when using an output device to get a
    good idea of what the final printed/displayed image would look like on
    the ``proofProfile`` device when it's quicker and easier to use the
    output device for judging color.  Generally, this means that the
    output device is a monitor, or a dye-sub printer (etc.), and the simulated
    device is something more expensive, complicated, or time consuming
    (making it difficult to make a real print for color judgement purposes).

    Soft-proofing basically functions by adjusting the colors on the
    output device to match the colors of the device being simulated. However,
    when the simulated device has a much wider gamut than the output
    device, you may obtain marginal results.

    :param inputProfile: String, as a valid filename path to the ICC input
        profile you wish to use for this transform, or a profile object
    :param outputProfile: String, as a valid filename path to the ICC output
        (monitor, usually) profile you wish to use for this transform, or a
        profile object
    :param proofProfile: String, as a valid filename path to the ICC proof
        profile you wish to use for this transform, or a profile object
    :param inMode: String, as a valid PIL mode that the appropriate profile
        also supports (i.e. "RGB", "RGBA", "CMYK", etc.)
    :param outMode: String, as a valid PIL mode that the appropriate profile
        also supports (i.e. "RGB", "RGBA", "CMYK", etc.)
    :param renderingIntent: Integer (0-3) specifying the rendering intent you
        wish to use for the input->proof (simulated) transform

            ImageCms.Intent.PERCEPTUAL            = 0 (DEFAULT)
            ImageCms.Intent.RELATIVE_COLORIMETRIC = 1
            ImageCms.Intent.SATURATION            = 2
            ImageCms.Intent.ABSOLUTE_COLORIMETRIC = 3

        see the pyCMS documentation for details on rendering intents and what
        they do.
    :param proofRenderingIntent: Integer (0-3) specifying the rendering intent
        you wish to use for proof->output transform

            ImageCms.Intent.PERCEPTUAL            = 0 (DEFAULT)
            ImageCms.Intent.RELATIVE_COLORIMETRIC = 1
            ImageCms.Intent.SATURATION            = 2
            ImageCms.Intent.ABSOLUTE_COLORIMETRIC = 3

        see the pyCMS documentation for details on rendering intents and what
        they do.
    :param flags: Integer (0-...) specifying additional flags
    :returns: A CmsTransform class object.
    :exception PyCMSError:
    rrr�r�Nr�)
r�r��proofProfiler�r�r��proofRenderingIntentrkrQr�s
          rr`r`�s���h�o�s�+�A��4M�A�4M�B����o���e�S�!�!�u�*A�	�*A�9�I�E����o��#��,��8�*�<�8�L��-��9�+�M�:�M��,��8�*�<�8�L� ������� ��	
�		
��
�Y�
�+�#���m��"��#�s�!A"C�C)�C$�$C)c��	|r|j|�d}|S|j|�}	|S#ttf$r}t	|�|�d}~wwxYw)a�
    (pyCMS) Applies a transform to a given image.

    If ``im.mode != transform.inMode``, a :exc:`PyCMSError` is raised.

    If ``inPlace`` is ``True`` and ``transform.inMode != transform.outMode``, a
    :exc:`PyCMSError` is raised.

    If ``im.mode``, ``transform.inMode`` or ``transform.outMode`` is not
    supported by pyCMSdll or the profiles you used for the transform, a
    :exc:`PyCMSError` is raised.

    If an error occurs while the transform is being applied,
    a :exc:`PyCMSError` is raised.

    This function applies a pre-calculated transform (from
    ImageCms.buildTransform() or ImageCms.buildTransformFromOpenProfiles())
    to an image. The transform can be used for multiple images, saving
    considerable calculation time if doing the same conversion multiple times.

    If you want to modify im in-place instead of receiving a new image as
    the return value, set ``inPlace`` to ``True``.  This can only be done if
    ``transform.inMode`` and ``transform.outMode`` are the same, because we can't
    change the mode in-place (the buffer sizes for some modes are
    different).  The default behavior is to return a new :py:class:`~PIL.Image.Image`
    object of the same dimensions in mode ``transform.outMode``.

    :param im: An :py:class:`~PIL.Image.Image` object, and im.mode must be the same
        as the ``inMode`` supported by the transform.
    :param transform: A valid CmsTransform class object
    :param inPlace: Bool.  If ``True``, ``im`` is modified in place and ``None`` is
        returned, if ``False``, a new :py:class:`~PIL.Image.Image` object with the
        transform applied is returned (and ``im`` is not changed). The default is
        ``False``.
    :returns: Either ``None``, or a new :py:class:`~PIL.Image.Image` object,
        depending on the value of ``inPlace``. The profile will be returned in
        the image's ``info['icc_profile']``.
    :exception PyCMSError:
    N)r{rmrLrzr�)rnr_r�rwr�s     r�applyTransformr�is_��R#���$�$�R�(��E��L�	�O�O�B�'�E��L��
�z�"�#���m��"��#�s�-�-�A
�A�A
c��|dvrd|�d�}t|��|dk(r	t|�}	tj||�S#ttf$r}d|�d�}t|�|�d}~wwxYw#ttf$r}t|�|�d}~wwxYw)aS
    (pyCMS) Creates a profile.

    If colorSpace not in ``["LAB", "XYZ", "sRGB"]``,
    a :exc:`PyCMSError` is raised.

    If using LAB and ``colorTemp`` is not a positive integer,
    a :exc:`PyCMSError` is raised.

    If an error occurs while creating the profile,
    a :exc:`PyCMSError` is raised.

    Use this function to create common profiles on-the-fly instead of
    having to supply a profile on disk and knowing the path to it.  It
    returns a normal CmsProfile object that can be passed to
    ImageCms.buildTransformFromOpenProfiles() to create a transform to apply
    to images.

    :param colorSpace: String, the color space of the profile you wish to
        create.
        Currently only "LAB", "XYZ", and "sRGB" are supported.
    :param colorTemp: Positive integer for the white point for the profile, in
        degrees Kelvin (i.e. 5000, 6500, 9600, etc.).  The default is for D50
        illuminant if omitted (5000k).  colorTemp is ONLY applied to LAB
        profiles, and is ignored for XYZ and sRGB.
    :returns: A CmsProfile class object
    :exception PyCMSError:
    )�LAB�XYZ�sRGBz;Color space not supported for on-the-fly profile creation (�)r�z$Color temperature must be numeric, "z" not validN)r��floatrLrzrG�
createProfile)�
colorSpace�	colorTemprQ�er�s     rr�r��s���<�/�/�I�*��UV�W�	���o���U��	)��i�(�I�
#��!�!�*�i�8�8���:�&�	)�8���;�O�C��S�/�q�(��	)��
�z�"�#���m��"��#�s,�>�A'�A$�
A�A$�'B�6B�Bc�h�	t|t�st|�}|jj}|jj}|s|s|jj
xsddzS|rt
|�dkDr|dzS|�d|�d�S#ttttf$r}t|�|�d}~wwxYw)a

    (pyCMS) Gets the internal product name for the given profile.

    If ``profile`` isn't a valid CmsProfile object or filename to a profile,
    a :exc:`PyCMSError` is raised If an error occurs while trying
    to obtain the name tag, a :exc:`PyCMSError` is raised.

    Use this function to obtain the INTERNAL name of the profile (stored
    in an ICC tag in the profile itself), usually the one used when the
    profile was originally created.  Sometimes this tag also contains
    additional information supplied by the creator.

    :param profile: EITHER a valid CmsProfile object, OR a string of the
        filename of an ICC profile.
    :returns: A string containing the internal name of the profile as stored
        in an ICC tag.
    :exception PyCMSError:
    r�
�z - N)r>r8rN�model�manufacturer�profile_description�len�AttributeErrorr�rLrzr�)rNr�r�r�s    r�getProfileNamer��s���*#��'�?�3�%�g�.�G�
���%�%�����3�3�����O�O�7�7�=�2��E�E��s�5�z�B���4�<�����L�>��,�,���G�Y�
�;�#���m��"��#�s$�A'B�*B�?B�B1� B,�,B1c�F�	t|t�st|�}|jj}|jj}||fD�cgc]}|s�|��	}}dj|�dzScc}w#ttttf$r}t|�|�d}~wwxYw)a�
    (pyCMS) Gets the internal product information for the given profile.

    If ``profile`` isn't a valid CmsProfile object or filename to a profile,
    a :exc:`PyCMSError` is raised.

    If an error occurs while trying to obtain the info tag,
    a :exc:`PyCMSError` is raised.

    Use this function to obtain the information stored in the profile's
    info tag.  This often contains details about the profile, and how it
    was created, as supplied by the creator.

    :param profile: EITHER a valid CmsProfile object, OR a string of the
        filename of an ICC profile.
    :returns: A string containing the internal profile information stored in
        an ICC tag.
    :exception PyCMSError:
    z

N)r>r8rNr��	copyright�joinr�r�rLrzr�)rN�description�cpright�element�elementsr�s      r�getProfileInfor��s���*
#��'�?�3�%�g�.�G�
�o�o�9�9���/�/�+�+��,7��+A�M��W�G�M��M����x�(�:�5�5��N��
�G�Y�
�;�#���m��"��#�s0�A
A6�A1�A1�A6�1A6�6B �B�B c���	t|t�st|�}|jjxsddzS#tt
ttf$r}t|�|�d}~wwxYw)aW
    (pyCMS) Gets the copyright for the given profile.

    If ``profile`` isn't a valid CmsProfile object or filename to a profile, a
    :exc:`PyCMSError` is raised.

    If an error occurs while trying to obtain the copyright tag,
    a :exc:`PyCMSError` is raised.

    Use this function to obtain the information stored in the profile's
    copyright tag.

    :param profile: EITHER a valid CmsProfile object, OR a string of the
        filename of an ICC profile.
    :returns: A string containing the internal profile information stored in
        an ICC tag.
    :exception PyCMSError:
    rr�N)	r>r8rNr�r�r�rLrzr��rNr�s  r�getProfileCopyrightr�sZ��&#��'�?�3�%�g�.�G����)�)�/�R�4�7�7���G�Y�
�;�#���m��"��#���7:�A$�A�A$c���	t|t�st|�}|jjxsddzS#tt
ttf$r}t|�|�d}~wwxYw)a`
    (pyCMS) Gets the manufacturer for the given profile.

    If ``profile`` isn't a valid CmsProfile object or filename to a profile, a
    :exc:`PyCMSError` is raised.

    If an error occurs while trying to obtain the manufacturer tag, a
    :exc:`PyCMSError` is raised.

    Use this function to obtain the information stored in the profile's
    manufacturer tag.

    :param profile: EITHER a valid CmsProfile object, OR a string of the
        filename of an ICC profile.
    :returns: A string containing the internal profile information stored in
        an ICC tag.
    :exception PyCMSError:
    rr�N)	r>r8rNr�r�r�rLrzr�r�s  r�getProfileManufacturerr�:sZ��&#��'�?�3�%�g�.�G����,�,�2��d�:�:���G�Y�
�;�#���m��"��#�r�c���	t|t�st|�}|jjxsddzS#tt
ttf$r}t|�|�d}~wwxYw)aK
    (pyCMS) Gets the model for the given profile.

    If ``profile`` isn't a valid CmsProfile object or filename to a profile, a
    :exc:`PyCMSError` is raised.

    If an error occurs while trying to obtain the model tag,
    a :exc:`PyCMSError` is raised.

    Use this function to obtain the information stored in the profile's
    model tag.

    :param profile: EITHER a valid CmsProfile object, OR a string of the
        filename of an ICC profile.
    :returns: A string containing the internal profile information stored in
        an ICC tag.
    :exception PyCMSError:
    rr�N)	r>r8rNr�r�r�rLrzr�r�s  r�getProfileModelr�VsZ��(#��'�?�3�%�g�.�G����%�%�+��t�3�3���G�Y�
�;�#���m��"��#�r�c���	t|t�st|�}|jjxsddzS#tt
ttf$r}t|�|�d}~wwxYw)a]
    (pyCMS) Gets the description for the given profile.

    If ``profile`` isn't a valid CmsProfile object or filename to a profile, a
    :exc:`PyCMSError` is raised.

    If an error occurs while trying to obtain the description tag,
    a :exc:`PyCMSError` is raised.

    Use this function to obtain the information stored in the profile's
    description tag.

    :param profile: EITHER a valid CmsProfile object, OR a string of the
        filename of an ICC profile.
    :returns: A string containing the internal profile information stored in an
        ICC tag.
    :exception PyCMSError:
    rr�N)	r>r8rNr�r�r�rLrzr�r�s  r�getProfileDescriptionr�ssZ��(#��'�?�3�%�g�.�G����3�3�9�r�T�A�A���G�Y�
�;�#���m��"��#�r�c��	t|t�st|�}|jjS#tt
ttf$r}t|�|�d}~wwxYw)a�
    (pyCMS) Gets the default intent name for the given profile.

    If ``profile`` isn't a valid CmsProfile object or filename to a profile, a
    :exc:`PyCMSError` is raised.

    If an error occurs while trying to obtain the default intent, a
    :exc:`PyCMSError` is raised.

    Use this function to determine the default (and usually best optimized)
    rendering intent for this profile.  Most profiles support multiple
    rendering intents, but are intended mostly for one type of conversion.
    If you wish to use a different intent than returned, use
    ImageCms.isIntentSupported() to verify it will work first.

    :param profile: EITHER a valid CmsProfile object, OR a string of the
        filename of an ICC profile.
    :returns: Integer 0-3 specifying the default rendering intent for this
        profile.

            ImageCms.Intent.PERCEPTUAL            = 0 (DEFAULT)
            ImageCms.Intent.RELATIVE_COLORIMETRIC = 1
            ImageCms.Intent.SATURATION            = 2
            ImageCms.Intent.ABSOLUTE_COLORIMETRIC = 3

        see the pyCMS documentation for details on rendering intents and what
            they do.
    :exception PyCMSError:
    N)	r>r8rN�rendering_intentr�r�rLrzr�r�s  r�getDefaultIntentr��sP��>#��'�?�3�%�g�.�G����/�/�/���G�Y�
�;�#���m��"��#�s�03�A�A�Ac���	t|t�st|�}|jj||�ryy#tt
ttf$r}t|�|�d}~wwxYw)a
    (pyCMS) Checks if a given intent is supported.

    Use this function to verify that you can use your desired
    ``intent`` with ``profile``, and that ``profile`` can be used for the
    input/output/proof profile as you desire.

    Some profiles are created specifically for one "direction", can cannot
    be used for others. Some profiles can only be used for certain
    rendering intents, so it's best to either verify this before trying
    to create a transform with them (using this function), or catch the
    potential :exc:`PyCMSError` that will occur if they don't
    support the modes you select.

    :param profile: EITHER a valid CmsProfile object, OR a string of the
        filename of an ICC profile.
    :param intent: Integer (0-3) specifying the rendering intent you wish to
        use with this profile

            ImageCms.Intent.PERCEPTUAL            = 0 (DEFAULT)
            ImageCms.Intent.RELATIVE_COLORIMETRIC = 1
            ImageCms.Intent.SATURATION            = 2
            ImageCms.Intent.ABSOLUTE_COLORIMETRIC = 3

        see the pyCMS documentation for details on rendering intents and what
            they do.
    :param direction: Integer specifying if the profile is to be used for
        input, output, or proof

            INPUT  = 0 (or use ImageCms.Direction.INPUT)
            OUTPUT = 1 (or use ImageCms.Direction.OUTPUT)
            PROOF  = 2 (or use ImageCms.Direction.PROOF)

    :returns: 1 if the intent/direction are supported, -1 if they are not.
    :exception PyCMSError:
    r���N)	r>r8rN�is_intent_supportedr�r�rLrzr�)rNrh�	directionr�s    r�isIntentSupportedr��s]��L
#��'�?�3�%�g�.�G��?�?�.�.�v�y�A�����G�Y�
�;�#���m��"��#�s�7;�A%�A � A%c��ttjtjj�dtjfS)z#
    (pyCMS) Fetches versions.
    r)�VERSIONrG�littlecms_versionr@�version�splitr�__version__rrr�versionsr��s1��
�D�*�*�C�K�K�,=�,=�,?��,B�E�DU�DU�U�UrrT)F)r�)1�
__future__rr@�enumrrrr�ImportError�ex�_utilrrs�DESCRIPTIONr�rGr
r�FLAGSr��values�flagr>r�r8�ImagePointHandlerr\r��	Exceptionr�rr�r�r^rr`�buildTransformFromOpenProfiles�#buildProofTransformFromOpenProfilesr�r�r�r�r�r�r�r�r�r�r�rrr�<module>r�sR��"#�
���(��=��~�����W�����	��1�	��A�	��5�	��1�		��"�	���	���	��#�	��S�	��d�	��T�	��d�	��d�	� �$�!	�"�E�#	�$�U�%	�&�H�'	�(�,�)	��.
�	��L�L�N�%�D��$�����$�	�%�)2�)2�X;��/�/�;�|$�4	��	��%�%���
�]�@#�6�%�%�
�
P#�r�%�%��5�5�
��
�n#�b"0��&9�#�2�j.#�b'#�T"#�J#�8#�8#�:#�:$#�N0#�fV��a�(�%�#�-�#�#�B�'�K��(�s�D3�3E�8E�E

Zerion Mini Shell 1.0