+
    åûj  ã                  ó  € ^ RI Ht ^ RIHt ^ RIHt ^ RIt^ RIHtH	t	 ]! RR7       ! R R	4      4       t
 ! R
 R]4      t]! RR7       ! R R4      4       t ! R R]4      t]! RR7       ! R R4      4       tRR R lltR# )é    )Úannotations)Ú	dataclass)ÚEnumN)ÚKORNIA_CHECK_SIZESÚCheckMessageT)Úfrozenc                  ó0   € ] tR t^t$ RtR]R&   R]R&   RtR# )Ú	ImageSizea÷  Hold the height and width of an image, without its channels.

``size = ImageSize(height, width)`` stores the two sizes of one image in a frozen data class, read back as
``size.height`` and ``size.width``. The positional order is ``(height, width)``, kornia's order for sizes and the
reverse of :math:`(x, y)` points.

Args:
    height: image height in pixels, an ``int``, a ``float`` or a one-element tensor.
    width: image width in pixels, an ``int``, a ``float`` or a one-element tensor.

See Also:
    - :class:`ImageLayout`: holds an ``ImageSize`` together with the channel count and order.
    - :class:`Image`: checks the size against the shape of its data.

Example:
    >>> size = ImageSize(3, 4)
    >>> size.height
    3
    >>> size.width
    4

zint | torch.TensorÚheightÚwidth© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__Ú__static_attributes__r   ó    ÚMC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\image\base.pyr
   r
      s   ‡ ñð. ÓØ×r   r
   c                  ó*   € ] tR t^9tRt^ t^t^t^tRt	R# )Ú
ColorSpacea7  Name the color space of an image: unknown, gray, RGB or BGR.

``ColorSpace.RGB`` and its siblings label the channels of an :class:`Image` through :class:`PixelFormat`.
:class:`Image` checks the label against the channel count: ``GRAY`` needs 1 channel, ``RGB`` and ``BGR`` need 3,
and ``UNKNOWN`` takes any count. No member has alpha, so a 4-channel image is ``UNKNOWN``.

See Also:
    - :class:`PixelFormat`: pairs the color space with the bit depth.
    - :class:`Image`: converts between ``GRAY``, ``RGB`` and ``BGR`` with ``to_gray``, ``to_rgb`` and ``to_bgr``.
r   N)
r   r   r   r   r   ÚUNKNOWNÚGRAYÚRGBÚBGRr   r   r   r   r   r   9   s   † ñ	ð €GØ€DØ
€CØ
„Cr   r   c                  ó0   € ] tR t^Kt$ RtR]R&   R]R&   RtR# )ÚPixelFormataV  Hold the color space of an image and the storage size of one channel value.

``pixel_format = PixelFormat(color_space, bit_depth)`` describes the values of an :class:`Image`: their
:class:`ColorSpace` and the bits that store one channel value. The data class checks nothing; :class:`Image`
raises when either field does not fit its data.

Args:
    color_space: color space.
    bit_depth: the storage size of one channel value in bits, ``8 * element_size()`` of the data: 8 for
        ``uint8``, 32 for ``float32``.

See Also:
    - :class:`ColorSpace`: the values of ``color_space``.
    - :class:`ImageLayout`: describes the arrangement of the values instead: size, channel count and order.

Example:
    >>> pixel_format = PixelFormat(ColorSpace.RGB, 8)
    >>> pixel_format.color_space
    <ColorSpace.RGB: 2>
    >>> pixel_format.bit_depth
    8

r   Úcolor_spaceÚintÚ	bit_depthr   Nr   r   r   r   r   r   K   s   ‡ ñð0 ÓØ‡Nr   r   c                  ó"   € ] tR t^itRt^ t^tRtR# )ÚChannelsOrdera´  Name where an image keeps its channels: first, ``(C, H, W)``, or last, ``(H, W, C)``.

``ChannelsOrder.CHANNELS_FIRST`` is the order of kornia tensors, ``(C, H, W)``, and ``CHANNELS_LAST`` the order of
NumPy and OpenCV arrays, ``(H, W, C)``. :class:`ImageLayout` carries it, and :class:`Image` checks the shape of its
data against it.

See Also:
    - :class:`ImageLayout`: holds the order together with the size and the channel count.
r   N)r   r   r   r   r   ÚCHANNELS_FIRSTÚCHANNELS_LASTr   r   r   r   r$   r$   i   s   † ñð €NØ„Mr   r$   c                  ó:   € ] tR t^xt$ RtR]R&   R]R&   R]R&   RtR	# )
ÚImageLayouta[  Hold the size, channel count and channel order of an image.

``layout = ImageLayout(ImageSize(H, W), C, ChannelsOrder.CHANNELS_FIRST)`` describes the shape of an
:class:`Image`'s data. The data class checks nothing; :class:`Image` raises ``ShapeError`` when its data does not
have this shape.

Args:
    image_size: image size.
    channels: number of channels.
    channels_order: channels order.

See Also:
    - :class:`ImageSize`: the ``image_size`` field.
    - :class:`ChannelsOrder`: the ``channels_order`` field.
    - :class:`PixelFormat`: describes the values of the pixels instead of their arrangement.

Example:
    >>> layout = ImageLayout(ImageSize(3, 4), 3, ChannelsOrder.CHANNELS_LAST)
    >>> layout.image_size
    ImageSize(height=3, width=4)
    >>> layout.channels
    3
    >>> layout.channels_order
    <ChannelsOrder.CHANNELS_LAST: 1>

r
   Ú
image_sizer!   Úchannelsr$   Úchannels_orderr   Nr   r   r   r   r(   r(   x   s   ‡ ñð6 ÓØƒMØ!×!r   r(   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R/# )
é   Úxztorch.TensorÚlayoutr(   ÚmsgzCheckMessage | NoneÚraisesÚboolÚreturnr   )Úformats   "r   Ú__annotate__r5   š   s:   € ÷ !5ñ !5Øð!5àð!5ð 
ð!5ð ð	!5ð
 
ñ!5r   c                ó¼  € VP                   \        P                  8X  d9   VP                  VP                  P
                  VP                  P                  .pMzVP                   \        P                  8X  d9   VP                  P
                  VP                  P                  VP                  .pM#V'       d   \        RVP                    R24      hR# \        WW#4      # )a<  Check tensor shape matches the expected ImageLayout.

The sizes are compared as numbers, so an int, float or one-element tensor size is checked the same way, and a
symbolic size under ``torch.compile`` is related to the tensor's size without being turned into a string.

Args:
    x: tensor to validate.
    layout: expected image layout.
    msg: custom error message, or a function that returns it; see :func:`~kornia.core.check.KORNIA_CHECK`.
    raises: if True, raise ShapeError on mismatch.

Returns:
    True if shape matches, False otherwise (when raises=False).

zLayout z not implemented.F)
r+   r$   r%   r*   r)   r   r   r&   ÚNotImplementedErrorr   )r.   r/   r0   r1   Úsizess   &&&& r   ÚKORNIA_CHECK_IMAGE_LAYOUTr9   š   s«   € ð0 ×Ñ¤× <Ñ <Ô<Ø—‘ &×"3Ñ"3×":Ñ":¸F×<MÑ<M×<SÑ<SÐT‰Ø	×	Ñ	¤-×"=Ñ"=Ô	=Ø×"Ñ"×)Ñ)¨6×+<Ñ+<×+BÑ+BÀFÇOÁOÐT‰çÜ%¨°×0EÑ0EÐ/FÐFWÐ&XÓYÐYÙä˜a¨Ó4Ð4r   )NT)Ú
__future__r   Údataclassesr   Úenumr   ÚtorchÚkornia.core.checkr   r   r
   r   r   r$   r(   r9   r   r   r   Ú<module>r?      s“   ðõ$ #å !Ý ã ç >ñ �$Ô÷ð ó ðô8�ô ñ$ �$Ô÷ð ó ðô:�Dô ñ �$Ô÷"ð "ó ð"÷B!5ñ !5r   