feat: capture settings retention
This commit is contained in:
1 parent
a08f6da347
commit
965d52b60f
18 files changed
+291
-21
No files matched your search
@@ -371,6 +371,12 @@ class Camera2Controller(private val context: Context) {
|
||||
private val _state = MutableStateFlow(CameraState())
|
||||
val state: StateFlow<CameraState> = _state.asStateFlow()
|
||||
|
||||
@Volatile
|
||||
var retainCaptureSettingsEnabled: Boolean = false
|
||||
private set
|
||||
private var retainedCaptureSettings: CustomCaptureSettings? = null
|
||||
private var pendingRetainedAwbTemperature: Int? = null
|
||||
|
||||
// Live Photo 录制器
|
||||
val livePhotoRecorder = LivePhotoRecorder(context)
|
||||
val realtimeStabilizationCoordinator = RealtimeStabilizationCoordinator(context)
|
||||
@@ -1206,10 +1212,14 @@ class Camera2Controller(private val context: Context) {
|
||||
// 关键修复:只在自动曝光模式下更新 ISO 和快门速度
|
||||
// 手动模式下保持用户设置不变(因为预览使用的是限制后的曝光时间,不是用户设置的值)
|
||||
_state.value = _state.value.copy(
|
||||
iso = if (isAutoExposure) actualIso ?: _state.value.iso else _state.value.iso,
|
||||
shutterSpeed = if (isAutoExposure) actualExposureTimeNs
|
||||
iso = if (isAutoExposure && _state.value.isIsoAuto) actualIso ?: _state.value.iso else _state.value.iso,
|
||||
shutterSpeed = if (isAutoExposure && _state.value.isShutterSpeedAuto) actualExposureTimeNs
|
||||
?: _state.value.shutterSpeed else _state.value.shutterSpeed,
|
||||
awbMode = awbMode,
|
||||
// In-flight results must not undo a user's WB mode change. A session without
|
||||
// a manual anchor still reports the automatic fallback used by the request.
|
||||
awbMode = if (_state.value.awbMode == CameraMetadata.CONTROL_AWB_MODE_OFF &&
|
||||
manualWhiteBalanceAnchor == null
|
||||
) awbMode else _state.value.awbMode,
|
||||
actualAwbTemperature = actualAwbTemperature,
|
||||
actualAwbTint = whiteBalanceResult.colorTint,
|
||||
actualAwbGains = actualAwbGains,
|
||||
@@ -1221,6 +1231,14 @@ class Camera2Controller(private val context: Context) {
|
||||
// 手动对焦保留用户目标值,避免镜头移动中的回报值改变后续拍摄和预览请求。
|
||||
focusDistance = if (_state.value.isAutoFocus) focusDistance else _state.value.focusDistance
|
||||
)
|
||||
pendingRetainedAwbTemperature?.let { temperature ->
|
||||
if (canAdjustManualWhiteBalance(whiteBalanceResult)) {
|
||||
setAwbTemperature(temperature)
|
||||
if (pendingRetainedAwbTemperature == null) {
|
||||
PLog.d(TAG, "Restored retained white balance: ${temperature}K")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2668,6 +2686,7 @@ class Camera2Controller(private val context: Context) {
|
||||
)
|
||||
}
|
||||
refreshHyperfocalFocusDistanceIfEnabled(updatePreview = false)
|
||||
applyRetainedCaptureSettings()
|
||||
} catch (e: Exception) {
|
||||
handleCameraOpenFailure(
|
||||
cameraId = openCameraId,
|
||||
@@ -5371,6 +5390,99 @@ class Camera2Controller(private val context: Context) {
|
||||
|
||||
// ==================== 曝光控制 ====================
|
||||
|
||||
/** Serialize user changes and their snapshots with the asynchronous focus controls. */
|
||||
fun updateUserCaptureSettings(
|
||||
update: Camera2Controller.() -> Unit,
|
||||
onUpdated: (CustomCaptureSettings) -> Unit,
|
||||
) {
|
||||
val handler = cameraHandler
|
||||
if (handler != null && Looper.myLooper() != handler.looper) {
|
||||
handler.post { updateUserCaptureSettings(update, onUpdated) }
|
||||
return
|
||||
}
|
||||
update(this)
|
||||
val settings = snapshotCustomCaptureSettings()
|
||||
if (retainCaptureSettingsEnabled) {
|
||||
retainedCaptureSettings = settings
|
||||
onUpdated(settings)
|
||||
}
|
||||
}
|
||||
|
||||
fun setCaptureSettingsRetention(
|
||||
enabled: Boolean,
|
||||
savedSettings: CustomCaptureSettings? = null,
|
||||
onConfigured: ((CustomCaptureSettings?) -> Unit)? = null,
|
||||
) {
|
||||
val handler = cameraHandler
|
||||
if (handler != null && Looper.myLooper() != handler.looper) {
|
||||
handler.post { setCaptureSettingsRetention(enabled, savedSettings, onConfigured) }
|
||||
return
|
||||
}
|
||||
retainCaptureSettingsEnabled = enabled
|
||||
retainedCaptureSettings = if (enabled) savedSettings ?: snapshotCustomCaptureSettings() else null
|
||||
if (!enabled) pendingRetainedAwbTemperature = null
|
||||
onConfigured?.invoke(retainedCaptureSettings)
|
||||
}
|
||||
|
||||
private fun snapshotCustomCaptureSettings(): CustomCaptureSettings {
|
||||
val current = _state.value
|
||||
return CustomCaptureSettings.fromState(current).copy(
|
||||
// Preserve the mode to return to when hyperfocal focus is turned off.
|
||||
isAutoFocus = focusModeBeforeHyperfocal ?: current.isAutoFocus,
|
||||
focusDistance = focusDistanceBeforeHyperfocal ?: current.focusDistance,
|
||||
awbMode = if (pendingRetainedAwbTemperature != null) {
|
||||
CameraMetadata.CONTROL_AWB_MODE_OFF
|
||||
} else current.awbMode,
|
||||
awbTemperature = pendingRetainedAwbTemperature ?: current.awbTemperature,
|
||||
)
|
||||
}
|
||||
|
||||
/** Apply after lens capabilities are loaded, before constructing the first preview request. */
|
||||
private fun applyRetainedCaptureSettings() {
|
||||
val settings = retainedCaptureSettings ?: return
|
||||
val current = _state.value
|
||||
val evStep = current.getExposureCompensationStep()
|
||||
val evRange = current.getExposureCompensationRange()
|
||||
val compensation = if (evStep > 0f) {
|
||||
(settings.exposureCompensationEv / evStep).roundToInt()
|
||||
.coerceIn(evRange.lower, evRange.upper)
|
||||
} else 0
|
||||
val supportsManualExposure = isManualSensorSupported &&
|
||||
availableAeModes.contains(CaptureRequest.CONTROL_AE_MODE_OFF)
|
||||
val isoAuto = settings.isIsoAuto || !supportsManualExposure
|
||||
val shutterAuto = settings.isShutterSpeedAuto || !supportsManualExposure
|
||||
val isoRange = current.getIsoRange()
|
||||
val restoredIso = settings.iso.coerceIn(isoRange.lower, isoRange.upper)
|
||||
val restoredShutter = coerceManualShutterSpeed(current, settings.shutterSpeedNs)
|
||||
val manualExposureAdjustment = if (!isoAuto && !shutterAuto) {
|
||||
(ln(restoredIso.toDouble() / settings.iso) +
|
||||
ln(restoredShutter.toDouble() / settings.shutterSpeedNs)) / ln(2.0)
|
||||
} else 0.0
|
||||
_state.value = current.copy(
|
||||
exposureCompensation = compensation,
|
||||
exposureBias = if (isoAuto || shutterAuto) {
|
||||
compensation * evStep
|
||||
} else settings.exposureBiasEv + manualExposureAdjustment.toFloat(),
|
||||
isIsoAuto = isoAuto,
|
||||
iso = restoredIso,
|
||||
isShutterSpeedAuto = shutterAuto,
|
||||
shutterSpeed = restoredShutter,
|
||||
)
|
||||
setAutoFocus(settings.isAutoFocus || current.minimumFocusDistance <= 0f)
|
||||
if (!settings.isAutoFocus) setFocusDistance(settings.focusDistance)
|
||||
if (settings.isHyperfocalFocusEnabled) setHyperfocalFocusEnabled(true)
|
||||
|
||||
// Manual WB needs a fresh CCT or gains/transform anchor from this camera session.
|
||||
manualWhiteBalanceAnchor = null
|
||||
if (settings.awbMode == CameraMetadata.CONTROL_AWB_MODE_OFF) {
|
||||
setAwbMode(CameraMetadata.CONTROL_AWB_MODE_AUTO)
|
||||
pendingRetainedAwbTemperature = settings.awbTemperature
|
||||
} else {
|
||||
setAwbMode(settings.awbMode)
|
||||
}
|
||||
PLog.d(TAG, "Restored custom capture settings for camera=${current.currentCameraId}: $settings")
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置曝光补偿
|
||||
*/
|
||||
@@ -5543,6 +5655,7 @@ class Camera2Controller(private val context: Context) {
|
||||
* 设置白平衡模式
|
||||
*/
|
||||
fun setAwbMode(mode: Int) {
|
||||
pendingRetainedAwbTemperature = null
|
||||
val normalizedMode = if (availableAwbModes.isEmpty() || mode in availableAwbModes) {
|
||||
mode
|
||||
} else {
|
||||
@@ -5623,6 +5736,8 @@ class Camera2Controller(private val context: Context) {
|
||||
return
|
||||
}
|
||||
|
||||
pendingRetainedAwbTemperature = null
|
||||
|
||||
_state.value = _state.value.copy(
|
||||
awbTemperature = clampedKelvin,
|
||||
awbMode = CameraMetadata.CONTROL_AWB_MODE_OFF,
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.hinnka.mycamera.camera
|
||||
|
||||
import org.json.JSONObject
|
||||
|
||||
/** User-selected capture controls; excludes transient metering, focus points and AF/AE locks. */
|
||||
data class CustomCaptureSettings(
|
||||
val exposureCompensationEv: Float,
|
||||
val exposureBiasEv: Float,
|
||||
val isIsoAuto: Boolean,
|
||||
val iso: Int,
|
||||
val isShutterSpeedAuto: Boolean,
|
||||
val shutterSpeedNs: Long,
|
||||
val isAutoFocus: Boolean,
|
||||
val focusDistance: Float,
|
||||
val isHyperfocalFocusEnabled: Boolean,
|
||||
val awbMode: Int,
|
||||
val awbTemperature: Int,
|
||||
) {
|
||||
fun toJson(): String = JSONObject().apply {
|
||||
put("exposureCompensationEv", exposureCompensationEv)
|
||||
put("exposureBiasEv", exposureBiasEv)
|
||||
put("isIsoAuto", isIsoAuto)
|
||||
put("iso", iso)
|
||||
put("isShutterSpeedAuto", isShutterSpeedAuto)
|
||||
put("shutterSpeedNs", shutterSpeedNs)
|
||||
put("isAutoFocus", isAutoFocus)
|
||||
put("focusDistance", focusDistance)
|
||||
put("isHyperfocalFocusEnabled", isHyperfocalFocusEnabled)
|
||||
put("awbMode", awbMode)
|
||||
put("awbTemperature", awbTemperature)
|
||||
}.toString()
|
||||
|
||||
companion object {
|
||||
fun fromState(state: CameraState): CustomCaptureSettings = CustomCaptureSettings(
|
||||
exposureCompensationEv = state.exposureCompensation * state.getExposureCompensationStep(),
|
||||
exposureBiasEv = state.exposureBias,
|
||||
isIsoAuto = state.isIsoAuto,
|
||||
iso = state.iso,
|
||||
isShutterSpeedAuto = state.isShutterSpeedAuto,
|
||||
shutterSpeedNs = state.shutterSpeed,
|
||||
isAutoFocus = state.isAutoFocus,
|
||||
focusDistance = state.focusDistance,
|
||||
isHyperfocalFocusEnabled = state.isHyperfocalFocusEnabled,
|
||||
awbMode = state.awbMode,
|
||||
awbTemperature = state.awbTemperature,
|
||||
)
|
||||
|
||||
fun fromJson(json: String?): CustomCaptureSettings? {
|
||||
if (json.isNullOrBlank()) return null
|
||||
return runCatching {
|
||||
val value = JSONObject(json)
|
||||
CustomCaptureSettings(
|
||||
exposureCompensationEv = value.getDouble("exposureCompensationEv").toFloat(),
|
||||
exposureBiasEv = value.getDouble("exposureBiasEv").toFloat(),
|
||||
isIsoAuto = value.getBoolean("isIsoAuto"),
|
||||
iso = value.getInt("iso"),
|
||||
isShutterSpeedAuto = value.getBoolean("isShutterSpeedAuto"),
|
||||
shutterSpeedNs = value.getLong("shutterSpeedNs"),
|
||||
isAutoFocus = value.getBoolean("isAutoFocus"),
|
||||
focusDistance = value.getDouble("focusDistance").toFloat(),
|
||||
isHyperfocalFocusEnabled = value.getBoolean("isHyperfocalFocusEnabled"),
|
||||
awbMode = value.getInt("awbMode"),
|
||||
awbTemperature = value.getInt("awbTemperature"),
|
||||
).also {
|
||||
require(it.exposureCompensationEv.isFinite() && it.exposureBiasEv.isFinite())
|
||||
require(it.focusDistance.isFinite() && it.focusDistance >= 0f)
|
||||
require(it.iso > 0 && it.shutterSpeedNs > 0 && it.awbTemperature > 0)
|
||||
}
|
||||
}.getOrNull()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import androidx.datastore.preferences.core.longPreferencesKey
|
||||
import androidx.datastore.preferences.core.stringPreferencesKey
|
||||
import androidx.datastore.preferences.preferencesDataStore
|
||||
import com.hinnka.mycamera.camera.AspectRatio
|
||||
import com.hinnka.mycamera.camera.CustomCaptureSettings
|
||||
import com.hinnka.mycamera.camera.GridStyle
|
||||
import com.hinnka.mycamera.camera.CustomFocalLengthValue
|
||||
import com.hinnka.mycamera.camera.CustomVendorKey
|
||||
@@ -162,6 +163,8 @@ data class UserPreferences(
|
||||
val burstSoundFileName: String? = null,
|
||||
val vibrationEnabled: Boolean = true, // 拍摄震动
|
||||
val keepScreenOn: Boolean = false, // 屏幕常亮
|
||||
val retainCaptureSettings: Boolean = false,
|
||||
val customCaptureSettings: CustomCaptureSettings? = null,
|
||||
val windowScreenBrightness: Float? = null, // Activity 窗口屏幕亮度,null 表示使用系统默认
|
||||
val volumeKeyAction: VolumeKeyAction = VolumeKeyAction.CAPTURE, // 音量键操作
|
||||
val autoSaveAfterCapture: Boolean = true, // 自动保存
|
||||
@@ -413,6 +416,8 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
private val BURST_SOUND_FILE_NAME = stringPreferencesKey("burst_sound_file_name")
|
||||
private val VIBRATION_ENABLED = booleanPreferencesKey("vibration_enabled")
|
||||
private val KEEP_SCREEN_ON = booleanPreferencesKey("keep_screen_on")
|
||||
private val RETAIN_CAPTURE_SETTINGS = booleanPreferencesKey("retain_capture_settings")
|
||||
private val CUSTOM_CAPTURE_SETTINGS = stringPreferencesKey("custom_capture_settings_v1")
|
||||
private val WINDOW_SCREEN_BRIGHTNESS = floatPreferencesKey("window_screen_brightness")
|
||||
private val VOLUME_KEY_ACTION = stringPreferencesKey("volume_key_action")
|
||||
private val AUTO_SAVE_AFTER_CAPTURE = booleanPreferencesKey("auto_save_after_capture")
|
||||
@@ -699,6 +704,8 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
burstSoundFileName = preferences[BURST_SOUND_FILE_NAME],
|
||||
vibrationEnabled = preferences[VIBRATION_ENABLED] ?: true,
|
||||
keepScreenOn = preferences[KEEP_SCREEN_ON] ?: false,
|
||||
retainCaptureSettings = preferences[RETAIN_CAPTURE_SETTINGS] ?: false,
|
||||
customCaptureSettings = CustomCaptureSettings.fromJson(preferences[CUSTOM_CAPTURE_SETTINGS]),
|
||||
windowScreenBrightness = preferences[WINDOW_SCREEN_BRIGHTNESS]?.coerceIn(0f, 1f),
|
||||
volumeKeyAction = VolumeKeyAction.valueOf(
|
||||
preferences[VOLUME_KEY_ACTION] ?: VolumeKeyAction.CAPTURE.name
|
||||
@@ -1546,9 +1553,27 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存是否保持屏幕常亮
|
||||
*/
|
||||
/** Save the switch and snapshot together so disabling also removes the saved controls. */
|
||||
suspend fun saveCaptureSettingsRetention(enabled: Boolean, settings: CustomCaptureSettings?) {
|
||||
context.dataStore.edit { preferences ->
|
||||
preferences[RETAIN_CAPTURE_SETTINGS] = enabled
|
||||
if (enabled && settings != null) {
|
||||
preferences[CUSTOM_CAPTURE_SETTINGS] = settings.toJson()
|
||||
} else {
|
||||
preferences.remove(CUSTOM_CAPTURE_SETTINGS)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun saveCustomCaptureSettings(settings: CustomCaptureSettings) {
|
||||
context.dataStore.edit { preferences ->
|
||||
if (preferences[RETAIN_CAPTURE_SETTINGS] == true) {
|
||||
preferences[CUSTOM_CAPTURE_SETTINGS] = settings.toJson()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 保存是否保持屏幕常亮 */
|
||||
suspend fun saveKeepScreenOn(enabled: Boolean) {
|
||||
context.dataStore.edit { preferences ->
|
||||
preferences[KEEP_SCREEN_ON] = enabled
|
||||
|
||||
@@ -1029,10 +1029,7 @@ fun CameraScreen(
|
||||
CameraParameter.EXPOSURE_COMPENSATION -> viewModel.setExposureCompensation((value / state.getExposureCompensationStep()).roundToInt())
|
||||
CameraParameter.SHUTTER_SPEED -> viewModel.setShutterSpeed(value.toLong())
|
||||
CameraParameter.ISO -> viewModel.setIso(value.toInt())
|
||||
CameraParameter.FOCUS -> {
|
||||
if (state.isAutoFocus) viewModel.setAutoFocus(false)
|
||||
viewModel.setFocusDistance(value)
|
||||
}
|
||||
CameraParameter.FOCUS -> viewModel.setFocusDistance(value)
|
||||
CameraParameter.WHITE_BALANCE -> viewModel.setAwbTemperature(value.toInt())
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2583,6 +2583,18 @@ fun SettingsScreen(
|
||||
title = stringResource(R.string.settings_section_system_control),
|
||||
showTitle = false
|
||||
) {
|
||||
SwitchSettingItem(
|
||||
title = stringResource(R.string.settings_retain_capture_settings),
|
||||
description = stringResource(R.string.settings_retain_capture_settings_description),
|
||||
checked = userPreferences.retainCaptureSettings,
|
||||
onCheckedChange = viewModel::setRetainCaptureSettings
|
||||
)
|
||||
|
||||
HorizontalDivider(
|
||||
color = Color.White.copy(alpha = 0.1f),
|
||||
modifier = Modifier.padding(vertical = 8.dp)
|
||||
)
|
||||
|
||||
SwitchSettingItem(
|
||||
title = stringResource(R.string.settings_shutter_sound),
|
||||
description = stringResource(R.string.settings_shutter_sound_description),
|
||||
|
||||
@@ -2336,6 +2336,10 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
viewModelScope.launch {
|
||||
val prefs = userPreferencesRepository.userPreferences.firstOrNull()
|
||||
if (prefs != null) {
|
||||
cameraController.setCaptureSettingsRetention(
|
||||
prefs.retainCaptureSettings,
|
||||
prefs.customCaptureSettings,
|
||||
)
|
||||
// 应用保存的画面比例
|
||||
try {
|
||||
val savedAspectRatio = AspectRatio.valueOf(prefs.aspectRatio)
|
||||
@@ -2733,6 +2737,7 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
cameraReopenJob?.cancel()
|
||||
cameraOpenInFlight = true
|
||||
cameraReopenJob = viewModelScope.launch {
|
||||
isInitialized.first { it }
|
||||
if (currentSurfaceTexture !== surfaceTexture) return@launch
|
||||
syncVendorCaptureSettingsToController()
|
||||
cameraController.openCamera(
|
||||
@@ -2916,6 +2921,7 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
}
|
||||
|
||||
private fun resetExposureCompensationForCameraRestart() {
|
||||
if (cameraController.retainCaptureSettingsEnabled) return
|
||||
if (state.value.exposureCompensation == 0) return
|
||||
PLog.d(TAG, "Reset exposure compensation for camera restart")
|
||||
cameraController.setExposureCompensation(0)
|
||||
@@ -3654,21 +3660,21 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
* 设置曝光补偿
|
||||
*/
|
||||
fun setExposureCompensation(value: Int) {
|
||||
cameraController.setExposureCompensation(value)
|
||||
updateUserCaptureSettings { setExposureCompensation(value) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 ISO
|
||||
*/
|
||||
fun setIso(value: Int) {
|
||||
cameraController.setIso(value)
|
||||
updateUserCaptureSettings { setIso(value) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置快门速度
|
||||
*/
|
||||
fun setShutterSpeed(value: Long) {
|
||||
cameraController.setShutterSpeed(value)
|
||||
updateUserCaptureSettings { setShutterSpeed(value) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3686,15 +3692,34 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
}
|
||||
|
||||
fun setAutoFocus(auto: Boolean) {
|
||||
cameraController.setAutoFocus(auto)
|
||||
updateUserCaptureSettings { setAutoFocus(auto) }
|
||||
}
|
||||
|
||||
fun setFocusDistance(distance: Float) {
|
||||
cameraController.setFocusDistance(distance)
|
||||
updateUserCaptureSettings {
|
||||
if (state.value.isAutoFocus) setAutoFocus(false)
|
||||
setFocusDistance(distance)
|
||||
}
|
||||
}
|
||||
|
||||
fun setHyperfocalFocusEnabled(enabled: Boolean) {
|
||||
cameraController.setHyperfocalFocusEnabled(enabled)
|
||||
updateUserCaptureSettings { setHyperfocalFocusEnabled(enabled) }
|
||||
}
|
||||
|
||||
private fun updateUserCaptureSettings(update: Camera2Controller.() -> Unit) {
|
||||
cameraController.updateUserCaptureSettings(update) { settings ->
|
||||
viewModelScope.launch {
|
||||
userPreferencesRepository.saveCustomCaptureSettings(settings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setRetainCaptureSettings(enabled: Boolean) {
|
||||
cameraController.setCaptureSettingsRetention(enabled) { settings ->
|
||||
viewModelScope.launch {
|
||||
userPreferencesRepository.saveCaptureSettingsRetention(enabled, settings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4007,35 +4032,35 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
* 设置曝光自动模式
|
||||
*/
|
||||
fun setAutoExposure(enabled: Boolean) {
|
||||
cameraController.setAutoExposure(enabled)
|
||||
updateUserCaptureSettings { setAutoExposure(enabled) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 ISO 自动模式
|
||||
*/
|
||||
fun setIsoAuto(enabled: Boolean) {
|
||||
cameraController.setIsoAuto(enabled)
|
||||
updateUserCaptureSettings { setIsoAuto(enabled) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置快门自动模式
|
||||
*/
|
||||
fun setShutterSpeedAuto(enabled: Boolean) {
|
||||
cameraController.setShutterSpeedAuto(enabled)
|
||||
updateUserCaptureSettings { setShutterSpeedAuto(enabled) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置白平衡模式
|
||||
*/
|
||||
fun setAwbMode(mode: Int) {
|
||||
cameraController.setAwbMode(mode)
|
||||
updateUserCaptureSettings { setAwbMode(mode) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置白平衡色温
|
||||
*/
|
||||
fun setAwbTemperature(kelvin: Int) {
|
||||
cameraController.setAwbTemperature(kelvin)
|
||||
updateUserCaptureSettings { setAwbTemperature(kelvin) }
|
||||
}
|
||||
|
||||
fun setMeteringMode(mode: MeteringMode) {
|
||||
|
||||
@@ -1246,4 +1246,6 @@
|
||||
<string name="settings_raw_canon_style_monochrome">單色</string>
|
||||
<string name="settings_raw_canon_exposure_compensation">Canon 曝光補償(EV)</string>
|
||||
<string name="settings_raw_canon_exposure_compensation_description">在一般曝光補償的基礎上,額外調整 Canon 算圖曝光。</string>
|
||||
<string name="settings_retain_capture_settings">保留自訂拍攝設定</string>
|
||||
<string name="settings_retain_capture_settings_description">重新開啟相機時還原曝光補償、快門、ISO、對焦和白平衡及其自動/手動模式。關閉後會清除已儲存的設定。</string>
|
||||
</resources>
|
||||
@@ -324,4 +324,6 @@
|
||||
<string name="settings_shutter_sound_import_failed">Audio kann nicht importiert werden. Wählen Sie einen abspielbaren Clip mit bis zu 3 Sekunden, 48 kHz, mono oder stereo (maximal 10 MB).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Toneinstellungen können nicht gespeichert werden. Bitte versuchen Sie es erneut.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Ton kann nicht wiedergegeben werden. Bitte importieren Sie ihn erneut oder stellen Sie den Standard wieder her.</string>
|
||||
<string name="settings_retain_capture_settings">Benutzerdefinierte Kameraeinstellungen beibehalten</string>
|
||||
<string name="settings_retain_capture_settings_description">Belichtungskorrektur, Verschlusszeit, ISO, Fokus und Weißabgleich einschließlich der jeweiligen Automatik-/Manuell-Modi beim erneuten Öffnen der Kamera wiederherstellen. Beim Ausschalten werden gespeicherte Einstellungen gelöscht.</string>
|
||||
</resources>
|
||||
@@ -324,4 +324,6 @@
|
||||
<string name="settings_shutter_sound_import_failed">Impossible d’importer cet audio. Choisissez un clip lisible de 3 secondes maximum, en 48 kHz, mono ou stéréo (10 Mo maximum).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Impossible d’enregistrer les réglages du son. Veuillez réessayer.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Impossible de lire ce son. Veuillez le réimporter ou rétablir la valeur par défaut.</string>
|
||||
<string name="settings_retain_capture_settings">Conserver les réglages personnalisés de l’appareil photo</string>
|
||||
<string name="settings_retain_capture_settings_description">Restaure la compensation d’exposition, la vitesse d’obturation, l’ISO, la mise au point et la balance des blancs, ainsi que leurs modes automatique/manuel, à la réouverture de l’appareil photo. La désactivation efface les réglages enregistrés.</string>
|
||||
</resources>
|
||||
@@ -324,4 +324,6 @@
|
||||
<string name="settings_shutter_sound_import_failed">Audio ini tidak dapat diimpor. Pilih klip yang dapat diputar hingga 3 detik, 48 kHz, mono atau stereo (maksimal 10 MB).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Setelan suara tidak dapat disimpan. Silakan coba lagi.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Suara ini tidak dapat diputar. Silakan impor ulang atau pulihkan default.</string>
|
||||
<string name="settings_retain_capture_settings">Pertahankan pengaturan kamera kustom</string>
|
||||
<string name="settings_retain_capture_settings_description">Pulihkan kompensasi eksposur, kecepatan rana, ISO, fokus, dan keseimbangan putih beserta mode otomatis/manual masing-masing saat kamera dibuka kembali. Menonaktifkan opsi ini akan menghapus pengaturan yang tersimpan.</string>
|
||||
</resources>
|
||||
@@ -1144,4 +1144,6 @@
|
||||
<string name="settings_raw_canon_style_monochrome">モノクロ</string>
|
||||
<string name="settings_raw_canon_exposure_compensation">Canon 露出補正(EV)</string>
|
||||
<string name="settings_raw_canon_exposure_compensation_description">通常の露出補正に加えて、Canonレンダリングの露出を調整します。</string>
|
||||
<string name="settings_retain_capture_settings">カスタム撮影設定を保持</string>
|
||||
<string name="settings_retain_capture_settings_description">カメラを再度開いたときに、露出補正、シャッタースピード、ISO、フォーカス、ホワイトバランスと、それぞれの自動/手動モードを復元します。オフにすると保存済みの設定を消去します。</string>
|
||||
</resources>
|
||||
@@ -325,4 +325,6 @@
|
||||
<string name="settings_shutter_sound_import_failed">이 오디오를 가져올 수 없습니다. 최대 3초, 48kHz, 모노 또는 스테레오이며 재생 가능한 클립을 선택하세요(최대 10MB).</string>
|
||||
<string name="settings_shutter_sound_save_failed">사운드 설정을 저장할 수 없습니다. 다시 시도해 주세요.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">이 사운드를 재생할 수 없습니다. 다시 가져오거나 기본값을 복원해 주세요.</string>
|
||||
<string name="settings_retain_capture_settings">사용자 지정 카메라 설정 유지</string>
|
||||
<string name="settings_retain_capture_settings_description">카메라를 다시 열 때 노출 보정, 셔터 속도, ISO, 초점, 화이트 밸런스와 각 항목의 자동/수동 모드를 복원합니다. 이 옵션을 끄면 저장된 설정이 삭제됩니다.</string>
|
||||
</resources>
|
||||
@@ -325,4 +325,6 @@
|
||||
<string name="settings_shutter_sound_import_failed">Não é possível importar este áudio. Escolha um clipe reproduzível de até 3 segundos, 48 kHz, mono ou estéreo (máximo de 10 MB).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Não é possível salvar as configurações de som. Tente novamente.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Não é possível reproduzir este som. Importe-o novamente ou restaure o padrão.</string>
|
||||
<string name="settings_retain_capture_settings">Manter configurações personalizadas da câmera</string>
|
||||
<string name="settings_retain_capture_settings_description">Restaura a compensação de exposição, a velocidade do obturador, o ISO, o foco e o balanço de branco, incluindo os modos automático/manual, ao reabrir a câmera. Desativar esta opção apaga as configurações salvas.</string>
|
||||
</resources>
|
||||
@@ -942,4 +942,6 @@
|
||||
<string name="settings_shutter_sound_import_failed">นำเข้าเสียงนี้ไม่ได้ โปรดเลือกคลิปที่เล่นได้ ความยาวไม่เกิน 3 วินาที, 48 kHz, โมโนหรือสเตอริโอ (ขนาดสูงสุด 10 MB)</string>
|
||||
<string name="settings_shutter_sound_save_failed">บันทึกการตั้งค่าเสียงไม่ได้ โปรดลองอีกครั้ง</string>
|
||||
<string name="settings_shutter_sound_preview_failed">เล่นเสียงนี้ไม่ได้ โปรดนำเข้าอีกครั้งหรือคืนค่าเริ่มต้น</string>
|
||||
<string name="settings_retain_capture_settings">เก็บการตั้งค่ากล้องที่กำหนดเอง</string>
|
||||
<string name="settings_retain_capture_settings_description">คืนค่าการชดเชยแสง ความเร็วชัตเตอร์ ISO โฟกัส และสมดุลแสงขาว รวมถึงโหมดอัตโนมัติ/แมนนวลของแต่ละรายการ เมื่อเปิดกล้องอีกครั้ง การปิดตัวเลือกนี้จะล้างการตั้งค่าที่บันทึกไว้</string>
|
||||
</resources>
|
||||
@@ -1267,4 +1267,6 @@
|
||||
<string name="settings_raw_canon_style_monochrome">单色</string>
|
||||
<string name="settings_raw_canon_exposure_compensation">Canon 曝光补偿(EV)</string>
|
||||
<string name="settings_raw_canon_exposure_compensation_description">在常规曝光补偿基础上,额外调整 Canon 渲染曝光。</string>
|
||||
<string name="settings_retain_capture_settings">保留自定义拍摄设置</string>
|
||||
<string name="settings_retain_capture_settings_description">重新打开相机时恢复曝光补偿、快门、ISO、对焦和白平衡及其自动/手动模式。关闭后清除已保存的设置。</string>
|
||||
</resources>
|
||||
@@ -1242,4 +1242,6 @@
|
||||
<string name="settings_raw_canon_style_monochrome">單色</string>
|
||||
<string name="settings_raw_canon_exposure_compensation">Canon 曝光補償(EV)</string>
|
||||
<string name="settings_raw_canon_exposure_compensation_description">在一般曝光補償的基礎上,額外調整 Canon 渲染曝光。</string>
|
||||
<string name="settings_retain_capture_settings">保留自訂拍攝設定</string>
|
||||
<string name="settings_retain_capture_settings_description">重新開啟相機時還原曝光補償、快門、ISO、對焦和白平衡及其自動/手動模式。關閉後會清除已儲存的設定。</string>
|
||||
</resources>
|
||||
@@ -1246,4 +1246,6 @@
|
||||
<string name="settings_raw_canon_style_monochrome">單色</string>
|
||||
<string name="settings_raw_canon_exposure_compensation">Canon 曝光補償(EV)</string>
|
||||
<string name="settings_raw_canon_exposure_compensation_description">在一般曝光補償的基礎上,額外調整 Canon 算圖曝光。</string>
|
||||
<string name="settings_retain_capture_settings">保留自訂拍攝設定</string>
|
||||
<string name="settings_retain_capture_settings_description">重新開啟相機時還原曝光補償、快門、ISO、對焦和白平衡及其自動/手動模式。關閉後會清除已儲存的設定。</string>
|
||||
</resources>
|
||||
@@ -1291,4 +1291,6 @@
|
||||
<string name="settings_raw_canon_style_monochrome">Monochrome</string>
|
||||
<string name="settings_raw_canon_exposure_compensation">Canon exposure compensation (EV)</string>
|
||||
<string name="settings_raw_canon_exposure_compensation_description">Additional exposure adjustment for Canon rendering.</string>
|
||||
<string name="settings_retain_capture_settings">Keep custom camera settings</string>
|
||||
<string name="settings_retain_capture_settings_description">Restore exposure compensation, shutter speed, ISO, focus and white balance, including auto/manual modes, when reopening the camera. Turning this off clears saved settings.</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user