Skip to content

Commit

Permalink
feat(core): camera: add a setting to lock auto exposure
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Jan 10, 2025
1 parent 21d38ef commit b6e34dd
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class WhiteBalance(private val context: Context, private val cameraController: C
}

/**
* Get or set auto white balance lock.
* Gets or sets auto white balance lock.
*/
var lock: Boolean
get() = cameraController.getSetting(CaptureRequest.CONTROL_AWB_LOCK) ?: false
Expand Down Expand Up @@ -377,6 +377,18 @@ class Exposure(private val context: Context, private val cameraController: Camer
)
}

/**
* Gets or sets auto exposure lock.
*/
var lock: Boolean
get() = cameraController.getSetting(CaptureRequest.CONTROL_AE_LOCK) ?: false
set(value) {
cameraController.setRepeatingSetting(
CaptureRequest.CONTROL_AE_LOCK,
value
)
}

companion object {
const val DEFAULT_COMPENSATION = 0
val DEFAULT_COMPENSATION_RANGE = Range(DEFAULT_COMPENSATION, DEFAULT_COMPENSATION)
Expand Down

0 comments on commit b6e34dd

Please sign in to comment.