summaryrefslogtreecommitdiffstats
path: root/venv/Lib/site-packages/pygame/pixelarray.pyi
blob: a7a3a4d4acdc84fdcd761b125e952c4b7a9b0009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from typing import Tuple, Union, List, Optional, TypeVar, Sequence

from pygame.color import Color
from pygame.surface import Surface

_ColorValue = Union[
    Color, Tuple[int, int, int], List[int], int, Tuple[int, int, int, int]
]

class PixelArray:
    surface: Surface
    itemsize: int
    ndim: int
    shape: Tuple[int, ...]
    strides: Tuple[int, ...]
    def __init__(self, surface: Surface) -> None: ...
    def make_surface(self) -> Surface: ...
    def replace(
        self,
        color: _ColorValue,
        repcolor: _ColorValue,
        distance: Optional[float] = 0,
        weights: Optional[Sequence[float]] = (0.299, 0.587, 0.114),
    ) -> None: ...
    def extract(
        self,
        color: _ColorValue,
        distance: Optional[float] = 0,
        weights: Optional[Sequence[float]] = (0.299, 0.587, 0.114),
    ) -> PixelArray: ...
    def compare(
        self,
        array: PixelArray,
        distance: Optional[float] = 0,
        weights: Optional[Sequence[float]] = (0.299, 0.587, 0.114),
    ) -> PixelArray: ...
    def transpose(self) -> PixelArray: ...
    def close(self) -> PixelArray: ...