package com.performancecoachlab.posedetection.camera

import androidx.compose.ui.graphics.ImageBitmap
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow

class FrameRepository {
    @OptIn(ExperimentalForeignApi::class)
    private val _frameFlow = MutableStateFlow<ImageBitmap?>(null)

    @OptIn(ExperimentalForeignApi::class)
    val frameFlow: StateFlow<ImageBitmap?> get() = _frameFlow

    @OptIn(ExperimentalForeignApi::class)
    fun updateFrame(frame: ImageBitmap) {
        _frameFlow.value = frame
    }
}