fix: Remove exposure TODOs (#2177)

* fix: Remove exposure TODOs

* fix: Make `exposure` a Double
This commit is contained in:
Marc Rousavy 2023-11-19 15:38:36 +01:00 committed by GitHub
parent ef58d13b87
commit 95a309808e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 4 deletions

View File

@ -78,7 +78,7 @@ class CameraView(context: Context) :
var isActive = false
var torch: Torch = Torch.OFF
var zoom: Float = 1f // in "factor"
var exposure: Float = 1f // TODO: Implement exposure bias
var exposure: Double = 1.0
var orientation: Orientation = Orientation.PORTRAIT
var enableZoomGesture: Boolean = false
set(value) {

View File

@ -145,7 +145,7 @@ class CameraViewManager : ViewGroupManager<CameraView>() {
@ReactProp(name = "exposure")
fun setExposure(view: CameraView, exposure: Double) {
view.exposure = exposure.toFloat()
view.exposure = exposure
}
@ReactProp(name = "orientation")

View File

@ -33,7 +33,7 @@ data class CameraConfiguration(
var enableLowLightBoost: Boolean = false,
var torch: Torch = Torch.OFF,
var videoStabilizationMode: VideoStabilizationMode = VideoStabilizationMode.OFF,
var exposure: Float? = null,
var exposure: Double? = null,
// Zoom
var zoom: Float = 1f,

View File

@ -177,7 +177,6 @@ class CameraDeviceDetails(private val cameraManager: CameraManager, private val
map.putInt("videoWidth", videoSize.width)
map.putInt("minISO", isoRange.lower)
map.putInt("maxISO", isoRange.upper)
// TODO: Implement minExposureBias
map.putDouble("minExposure", exposureRange.lower.toDouble() / exposureStep.toDouble())
map.putDouble("maxExposure", exposureRange.upper.toDouble() / exposureStep.toDouble())
map.putInt("minFps", fpsRange.lower)

View File

@ -435,6 +435,7 @@ class CameraSession(private val context: Context, private val cameraManager: Cam
}
// Set Exposure Bias
// TODO: Check if that exposure value is even supported
val exposure = config.exposure?.toInt()
if (exposure != null) {
captureRequest.set(CaptureRequest.CONTROL_AE_EXPOSURE_COMPENSATION, exposure)