fix: Remove exposure TODOs (#2177)
* fix: Remove exposure TODOs * fix: Make `exposure` a Double
This commit is contained in:
parent
ef58d13b87
commit
95a309808e
@ -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) {
|
||||
|
@ -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")
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user