mirror of
https://github.com/pocketpy/pocketpy
synced 2025-12-16 15:00:19 +00:00
27 lines
734 B
Python
27 lines
734 B
Python
from array2d import array2d
|
|
from vmath import color32
|
|
from io import FileIO
|
|
|
|
class Image:
|
|
@property
|
|
def width(self) -> int: ...
|
|
@property
|
|
def height(self) -> int: ...
|
|
|
|
def __new__(cls, width: int, height: int) -> "Image": ...
|
|
|
|
@staticmethod
|
|
def from_bytes(data: bytes) -> "Image": ...
|
|
|
|
def setpixel(self, x: int, y: int, color: color32) -> None: ...
|
|
def getpixel(self, x: int, y: int) -> color32: ...
|
|
def clear(self, color: color32) -> None: ...
|
|
|
|
def to_png_bytes(self) -> bytes: ...
|
|
def to_png_file(self, file: FileIO) -> int: ...
|
|
def to_rgb565_file(self, file: FileIO) -> int: ...
|
|
|
|
|
|
def loads(data: bytes) -> array2d[color32]: ...
|
|
def dumps(image: array2d[color32]) -> bytes: ...
|