package com.example.livingai.camera

import android.graphics.Bitmap
import android.view.View
import android.widget.ImageView
import com.example.livingai.ui.overlay.MaskOverlay
import com.example.livingai.ui.overlay.SilhouetteOverlay

class OverlayManager(
    private val silhouetteOverlay: SilhouetteOverlay,
    private val segmentationOverlay: MaskOverlay,
    private val savedMaskOverlay: MaskOverlay
) {

    init {
        // Configure scaling types
        segmentationOverlay.scaleType = MaskOverlay.ScaleType.CENTER_CROP
        savedMaskOverlay.scaleType = MaskOverlay.ScaleType.FIT_CENTER
    }

    fun setSilhouette(silhouetteId: Int) {
        silhouetteOverlay.setSilhouette(silhouetteId)
    }

    fun showSegmentationMask(mask: Bitmap?, isEnabled: Boolean) {
        segmentationOverlay.updateMask(if (isEnabled) mask else null)
    }

    fun showSavedMask(mask: Bitmap?, isEnabled: Boolean) {
        savedMaskOverlay.updateMask(if (isEnabled) mask else null)
    }

}
