package com.example.livingai.analysis

import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.Matrix
import android.util.Log
import androidx.camera.core.ExperimentalGetImage
import androidx.camera.core.ImageProxy
import com.example.livingai.commons.Constants
import com.google.android.gms.tasks.Task
import com.google.android.gms.tasks.TaskCompletionSource
import com.google.mlkit.vision.common.InputImage
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicBoolean

/**
 * Responsible for processing frames from the camera.
 * It prepares the frame (e.g. orientation) and passes it to SegmentProcessor.
 */
class FrameProcessor {
    fun prepareInputImage(imageProxy: ImageProxy, rotationDegrees: Int): InputImage? {
        val mediaImage = imageProxy.image ?: return null
        return InputImage.fromMediaImage(mediaImage, rotationDegrees)
    }
}
