Skip to content

Commit 95a3098

Browse files
authored
fix: Remove exposure TODOs (#2177)
* fix: Remove exposure TODOs * fix: Make `exposure` a Double
1 parent ef58d13 commit 95a3098

File tree

5 files changed

+4
-4
lines changed

5 files changed

+4
-4
lines changed

package/android/src/main/java/com/mrousavy/camera/CameraView.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class CameraView(context: Context) :
7878
var isActive = false
7979
var torch: Torch = Torch.OFF
8080
var zoom: Float = 1f // in "factor"
81-
var exposure: Float = 1f // TODO: Implement exposure bias
81+
var exposure: Double = 1.0
8282
var orientation: Orientation = Orientation.PORTRAIT
8383
var enableZoomGesture: Boolean = false
8484
set(value) {

package/android/src/main/java/com/mrousavy/camera/CameraViewManager.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class CameraViewManager : ViewGroupManager<CameraView>() {
145145

146146
@ReactProp(name = "exposure")
147147
fun setExposure(view: CameraView, exposure: Double) {
148-
view.exposure = exposure.toFloat()
148+
view.exposure = exposure
149149
}
150150

151151
@ReactProp(name = "orientation")

package/android/src/main/java/com/mrousavy/camera/core/CameraConfiguration.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ data class CameraConfiguration(
3333
var enableLowLightBoost: Boolean = false,
3434
var torch: Torch = Torch.OFF,
3535
var videoStabilizationMode: VideoStabilizationMode = VideoStabilizationMode.OFF,
36-
var exposure: Float? = null,
36+
var exposure: Double? = null,
3737

3838
// Zoom
3939
var zoom: Float = 1f,

package/android/src/main/java/com/mrousavy/camera/core/CameraDeviceDetails.kt

-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ class CameraDeviceDetails(private val cameraManager: CameraManager, private val
177177
map.putInt("videoWidth", videoSize.width)
178178
map.putInt("minISO", isoRange.lower)
179179
map.putInt("maxISO", isoRange.upper)
180-
// TODO: Implement minExposureBias
181180
map.putDouble("minExposure", exposureRange.lower.toDouble() / exposureStep.toDouble())
182181
map.putDouble("maxExposure", exposureRange.upper.toDouble() / exposureStep.toDouble())
183182
map.putInt("minFps", fpsRange.lower)

package/android/src/main/java/com/mrousavy/camera/core/CameraSession.kt

+1
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ class CameraSession(private val context: Context, private val cameraManager: Cam
435435
}
436436

437437
// Set Exposure Bias
438+
// TODO: Check if that exposure value is even supported
438439
val exposure = config.exposure?.toInt()
439440
if (exposure != null) {
440441
captureRequest.set(CaptureRequest.CONTROL_AE_EXPOSURE_COMPENSATION, exposure)

0 commit comments

Comments
 (0)