feat: High quality mode (enableHighQualityPhotos) (#194)

* feat: High Quality photo capture

* prepare photo output for re-used settings

* use high quality captures

* Remove `enableVirtualDeviceFusion` as that is enabled by default

* Clean up configuration, remove default

* format

* Update CameraViewManager.kt

* rename

* Update CameraProps.ts

* Fix overriding `photoSettings`

* Update CameraView+TakePhoto.swift

* Update CameraView+TakePhoto.swift
This commit is contained in:
Marc Rousavy
2021-06-10 13:49:34 +02:00
committed by GitHub
parent 88a30e5723
commit 0e606affce
9 changed files with 68 additions and 48 deletions

View File

@@ -49,9 +49,6 @@ suspend fun CameraView.takePhoto(options: ReadableMap): WritableMap = coroutineS
if (options.hasKey("enableDualCameraFusion")) {
// TODO enableDualCameraFusion
}
if (options.hasKey("enableVirtualDeviceFusion")) {
// TODO enableVirtualDeviceFusion
}
if (options.hasKey("enableAutoStabilization")) {
// TODO enableAutoStabilization
}

View File

@@ -39,7 +39,7 @@ import kotlin.math.min
// TODO: Configurable FPS higher than 30
// TODO: High-speed video recordings (export in CameraViewModule::getAvailableVideoDevices(), and set in CameraView::configurePreview()) (120FPS+)
// TODO: configureSession() enableDepthData
// TODO: configureSession() enableHighResolutionCapture
// TODO: configureSession() enableHighQualityPhotos
// TODO: configureSession() enablePortraitEffectsMatteDelivery
// TODO: configureSession() colorSpace
@@ -55,7 +55,6 @@ import kotlin.math.min
// TODO: takePhoto() photoCodec ("hevc" | "jpeg" | "raw")
// TODO: takePhoto() qualityPrioritization
// TODO: takePhoto() enableAutoRedEyeReduction
// TODO: takePhoto() enableVirtualDeviceFusion
// TODO: takePhoto() enableAutoStabilization
// TODO: takePhoto() enableAutoDistortionCorrection
// TODO: takePhoto() return with jsi::Value Image reference for faster capture
@@ -66,7 +65,7 @@ class CameraView(context: Context) : FrameLayout(context), LifecycleOwner {
// props that require reconfiguring
var cameraId: String? = null // this is actually not a react prop directly, but the result of setting device={}
var enableDepthData = false
var enableHighResolutionCapture: Boolean? = null
var enableHighQualityPhotos: Boolean? = null
var enablePortraitEffectsMatteDelivery = false
// use-cases
var photo: Boolean? = null

View File

@@ -51,11 +51,11 @@ class CameraViewManager : SimpleViewManager<CameraView>() {
view.enableDepthData = enableDepthData
}
@ReactProp(name = "enableHighResolutionCapture")
fun setEnableHighResolutionCapture(view: CameraView, enableHighResolutionCapture: Boolean?) {
if (view.enableHighResolutionCapture != enableHighResolutionCapture)
addChangedPropToTransaction(view, "enableHighResolutionCapture")
view.enableHighResolutionCapture = enableHighResolutionCapture
@ReactProp(name = "enableHighQualityPhotos")
fun setEnableHighQualityPhotos(view: CameraView, enableHighQualityPhotos: Boolean?) {
if (view.enableHighQualityPhotos != enableHighQualityPhotos)
addChangedPropToTransaction(view, "enableHighQualityPhotos")
view.enableHighQualityPhotos = enableHighQualityPhotos
}
@ReactProp(name = "enablePortraitEffectsMatteDelivery")