1
0

cute_png.pyi 911 B

1234567891011121314151617181920212223242526272829
  1. from array2d import array2d
  2. from vmath import color32, vec2i
  3. class Image:
  4. @property
  5. def width(self) -> int: ...
  6. @property
  7. def height(self) -> int: ...
  8. def __new__(cls, width: int, height: int) -> "Image": ...
  9. @staticmethod
  10. def from_bytes(data: bytes) -> "Image": ...
  11. @staticmethod
  12. def from_file(path: str) -> "Image": ...
  13. def setpixel(self, x: int, y: int, color: color32) -> None: ...
  14. def getpixel(self, x: int, y: int) -> color32: ...
  15. def clear(self, color: color32) -> None: ...
  16. def paste(self, src_img: "Image", src_pos: vec2i, dst_pos: vec2i, width: int, height: int, fg: color32, bg: color32) -> None: ...
  17. def to_png_bytes(self) -> bytes: ...
  18. def to_png_file(self, path: str) -> int: ...
  19. def to_rgb565_file(self, path: str) -> int: ...
  20. def loads(data: bytes) -> array2d[color32]: ...
  21. def dumps(image: array2d[color32]) -> bytes: ...