from .ImageManipulation import ImageManipulation
from ImageContainer import ImageContainer
from typing import Any, List
from utils.image_utils import pil_to_cv2, cv2_to_pil
import numpy as np


class CopyImage(ImageManipulation):
    def getManipulationName(self) -> str:
        return "Copy"

    def getParameters(self) -> List[str]:
        return []

    def manipulateImage(self, image: ImageContainer, parameters: Any) -> None:
        if image is None or image.getImage() is None:
            return
        # Deep copy using numpy array roundtrip to ensure a new buffer
        pil_img = image.getImage()
        arr = np.array(pil_img)
        image._imageData = pil_img.copy()


