Add CropImage child of ImageManipulation

This commit is contained in:
Kim André Bjørkede
2025-10-11 20:48:28 +02:00
parent 3024756b9c
commit 8f1ae488eb
6 changed files with 52 additions and 48 deletions

View File

@@ -0,0 +1,39 @@
from .ImageManipulation import ImageManipulation
from ..ImageContainer import ImageContainer
from typing import Any, List
class CropImage(ImageManipulation):
"""Concrete implementation for cropping images."""
def __init__(self):
# You can initialize any instance variables here
self.manipulation_name = "Crop"
def manipulateImage(self, image: ImageContainer, parameters: Any) -> None:
"""
Manipulate the given image using the provided parameters.
Args:
image: The image to manipulate
parameters: Parameters for the manipulation (e.g., crop coordinates)
"""
pass
def getParameters(self) -> List[str]:
"""
Get the list of parameters required for cropping.
Returns:
List of parameter names
"""
return ["width", "height"]
def getManipulationName(self) -> str:
"""
Get the name of this manipulation operation.
Returns:
The name of the manipulation
"""
return "Crop Image"