Add CropImage child of ImageManipulation
This commit is contained in:
39
src/ImageManipulation/CropImage.py
Normal file
39
src/ImageManipulation/CropImage.py
Normal 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"
|
||||
Reference in New Issue
Block a user