39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
from ImageManipulation.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" |