from numpy import ndarray

from ._sdl import sdl2
from .Constants import ImageFormat, Colors
from .Color import Color

__all__ = ["Image", "Icon", "CreateAnimatedImage",
           "LoadImage", "LoadImageUrl", "LoadIcon",
           "SaveImagePNG", "SaveImageJPG",
           "NewImage",
           "DefaultIcon",
           "image_to_icon", "icon_to_image", "image_to_numpyArray", "compare_image"]

class Image:
    images: list
    delays: list
    _size: tuple|list
    _format: any

    def __init__(self): ...

    def __repr__(self) -> str: ...

    def fill(self, color: Color): ...

    @property
    def count(self) -> int: ...

    @property
    def size(self) -> tuple: ...

    @size.setter
    def size(self, size: list | tuple): ...

    @property
    def format(self) -> any: ...

    @format.setter
    def format(self, _format): ...

    @property
    def color(self) -> Color: ...

    @property
    def animated(self) -> bool: ...

    def crop(self, location: list | tuple, size: list | tuple): ...

    def copy(self) -> Image: ...

    def close(self): ...

class Icon:
    icon: any
    _size: tuple

    def __init__(self): ...

    def __repr__(self) -> str: ...

    @property
    def size(self) -> tuple: ...

    def close(self): ...

def LoadImage(path: str) -> Image: ...

def _loadImageUrl(url: str) -> Image: ...

def LoadImageUrl(url: str | list | tuple, mult: bool = False) -> Image | tuple | None: ...

def LoadIcon(path: str) -> Icon: ...

def NewImage(mode=ImageFormat.ARGB, size: list | tuple = (32, 32), color: Color = Colors.StandardColor) -> Image: ...

def CreateAnimatedImage(images: list[Image] | tuple[Image]) -> Image: ...

def SaveImagePNG(image: Image, path: str = "image.png"): ...

def SaveImageJPG(image: Image, path: str = "image.jpg", quality: int = 80): ...

#def SaveImageGIF(image: Image, path="image.GIF"):
#    pass

def image_to_icon(image: Image) -> Icon: ...

def icon_to_image(icon: Icon) -> Image: ...

def _sdl2_surface_to_numpy_array(surface: sdl2.SDL_Surface) -> ndarray: ...

def image_to_numpyArray(image: Image) -> ndarray: ...

def compare_image(image1: Image, image2: Image) -> bool: ...

def _test_RGBA_mod(surface1, surface2, mult, r, g, b, a): ...

DefaultIcon: Icon
