Skip to content

Commit

Permalink
Added type info
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Jan 2, 2024
1 parent d613965 commit 48744d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions textures/circle_moire_no_palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
# Vytvoreni textury s "kruznicovym moare"

from PIL import Image
import PIL.Image
from typing import Tuple

# textura by mela byt ctvercova a jeji sirka i vyska by mela byt
# mocninou cisla 2
IMAGE_WIDTH = 256
IMAGE_HEIGHT = 256


def recalc_circle_pattern(image, xmin, ymin, xmax, ymax):
def recalc_circle_pattern(image: PIL.Image.Image,
xmin: float, ymin: float,
xmax: float, ymax: float) -> None:
"""Funkce provadejici vypocet moare s kruznicovym vzorkem."""
width, height = image.size # rozmery obrazku
stepx = (xmax - xmin) / width
Expand All @@ -30,7 +34,7 @@ def recalc_circle_pattern(image, xmin, ymin, xmax, ymax):
y1 += stepy


def main():
def main() -> None:
"""Vypocet textur s jejich ulozenim do souboru."""
for i in range(0, 50, 10):
image = Image.new("RGB", (IMAGE_WIDTH, IMAGE_HEIGHT))
Expand Down

0 comments on commit 48744d0

Please sign in to comment.