Begin refactor

This commit is contained in:
Kim André Bjørkede
2025-10-11 17:43:49 +02:00
parent 79f4313cc6
commit a32cc51fb6
6 changed files with 377 additions and 11 deletions

25
src/ImageContainer.py Normal file
View File

@@ -0,0 +1,25 @@
import cv2
from PIL import Image, ImageTk
class ImageContainer:
_imageData = None
_path = None
def loadImage(self, path: str) -> None:
""" Load image file from the path.
:param path: Path to the image file.
"""
imgcv2 = cv2.imread(path)
height, width, channels = imgcv2.shape
# Open and resize image (optional)
_imageData = Image.open(path)
_imageData = _imageData.resize((height, width), Image.LANCZOS) # Resize to fit frame
_path = path
print("Opened image:", path)
def getDimensions(self) -> tuple[int,int]:
return self._imageData.shape