Remove unused high-resolution capture option
The feature provided no benefit on Pixel 7 Pro — both standard and hi-res modes produced 12MP images since CameraX's standard resolution list doesn't include the full sensor output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5cba2fefc9
commit
7abb2ea5a0
2 changed files with 1 additions and 22 deletions
|
|
@ -12,7 +12,6 @@ import androidx.camera.core.Preview
|
||||||
import androidx.camera.core.SurfaceRequest
|
import androidx.camera.core.SurfaceRequest
|
||||||
import androidx.camera.core.resolutionselector.AspectRatioStrategy
|
import androidx.camera.core.resolutionselector.AspectRatioStrategy
|
||||||
import androidx.camera.core.resolutionselector.ResolutionSelector
|
import androidx.camera.core.resolutionselector.ResolutionSelector
|
||||||
import androidx.camera.core.resolutionselector.ResolutionStrategy
|
|
||||||
import androidx.camera.lifecycle.ProcessCameraProvider
|
import androidx.camera.lifecycle.ProcessCameraProvider
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
|
|
@ -38,20 +37,6 @@ class CameraManager(private val context: Context) {
|
||||||
|
|
||||||
val lensController = LensController()
|
val lensController = LensController()
|
||||||
|
|
||||||
private val _useHighResCapture = MutableStateFlow(false)
|
|
||||||
val useHighResCapture: StateFlow<Boolean> = _useHighResCapture.asStateFlow()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Toggles between CameraX default resolution and highest available.
|
|
||||||
* Rebinds camera use cases to apply the change.
|
|
||||||
*/
|
|
||||||
fun setHighResCapture(enabled: Boolean) {
|
|
||||||
if (_useHighResCapture.value != enabled) {
|
|
||||||
_useHighResCapture.value = enabled
|
|
||||||
lifecycleOwnerRef?.let { bindCameraUseCases(it) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private val _error = MutableStateFlow<String?>(null)
|
private val _error = MutableStateFlow<String?>(null)
|
||||||
val error: StateFlow<String?> = _error.asStateFlow()
|
val error: StateFlow<String?> = _error.asStateFlow()
|
||||||
|
|
||||||
|
|
@ -113,13 +98,6 @@ class CameraManager(private val context: Context) {
|
||||||
val captureBuilder = ImageCapture.Builder()
|
val captureBuilder = ImageCapture.Builder()
|
||||||
.setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
|
.setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
|
||||||
|
|
||||||
if (_useHighResCapture.value) {
|
|
||||||
val captureResolutionSelector = ResolutionSelector.Builder()
|
|
||||||
.setResolutionStrategy(ResolutionStrategy.HIGHEST_AVAILABLE_STRATEGY)
|
|
||||||
.build()
|
|
||||||
captureBuilder.setResolutionSelector(captureResolutionSelector)
|
|
||||||
}
|
|
||||||
|
|
||||||
imageCapture = captureBuilder.build()
|
imageCapture = captureBuilder.build()
|
||||||
|
|
||||||
// Select camera based on front/back preference
|
// Select camera based on front/back preference
|
||||||
|
|
|
||||||
|
|
@ -495,6 +495,7 @@ private fun ControlPanel(
|
||||||
onValueChange = { currentOnParamsChange(currentParams.copy(aspectRatio = it)) }
|
onValueChange = { currentOnParamsChange(currentParams.copy(aspectRatio = it)) }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue