feat: remove jpg/phantom baseline lut
This commit is contained in:
1 parent
bdfe099f53
commit
086469604d
18 files changed
+50
-454
No files matched your search
@@ -299,8 +299,6 @@ class MainActivity : AppCompatActivity() {
|
||||
val currentRecipeParams by cameraViewModel.currentRecipeParams.collectAsState()
|
||||
val phantomPipCrop by cameraViewModel.phantomPipCrop.collectAsState()
|
||||
ScreenCaptureRenderConfigStore.save(
|
||||
baselineLutConfig = cameraViewModel.currentBaselineLutConfig,
|
||||
baselineColorRecipeParams = cameraViewModel.currentBaselineRecipeParams.value,
|
||||
creativeLutConfig = cameraViewModel.currentLutConfig,
|
||||
creativeColorRecipeParams = currentRecipeParams,
|
||||
crop = phantomPipCrop
|
||||
|
||||
@@ -6441,8 +6441,6 @@ class Camera2Controller(private val context: Context) {
|
||||
fun startVideoRecording(
|
||||
creativeLutConfig: LutConfig? = null,
|
||||
creativeRecipeParams: ColorRecipeParams? = null,
|
||||
baselineLutConfig: LutConfig? = null,
|
||||
baselineRecipeParams: ColorRecipeParams? = null,
|
||||
orientationOffsetDegrees: Int = 0
|
||||
) {
|
||||
if (_state.value.captureMode != CaptureMode.VIDEO ||
|
||||
@@ -6471,11 +6469,6 @@ class Camera2Controller(private val context: Context) {
|
||||
} ?: _state.value.currentPreviewSize
|
||||
val shouldFlipEncodedFrame = isFrontCamera && mirrorFrontCameraEnabled
|
||||
val colorLayers = buildList {
|
||||
if (!_state.value.videoConfig.logProfile.isEnabled &&
|
||||
(baselineLutConfig != null || baselineRecipeParams?.isDefault() == false)
|
||||
) {
|
||||
add(VideoColorEffectLayer(baselineLutConfig, baselineRecipeParams))
|
||||
}
|
||||
if (creativeLutConfig != null || creativeRecipeParams?.isDefault() == false) {
|
||||
add(VideoColorEffectLayer(creativeLutConfig, creativeRecipeParams))
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.hinnka.mycamera.camera.NoiseReductionLevel
|
||||
import com.hinnka.mycamera.camera.VendorCaptureSettings
|
||||
import com.hinnka.mycamera.camera.VendorCaptureSettingsByLens
|
||||
import com.hinnka.mycamera.gallery.PhotoSavePath
|
||||
import com.hinnka.mycamera.lut.BaselineColorCorrectionTarget
|
||||
import com.hinnka.mycamera.raw.ColorSpace
|
||||
import com.hinnka.mycamera.raw.HncsFilmCurveMode
|
||||
import com.hinnka.mycamera.raw.HncsRenderIntent
|
||||
@@ -106,10 +105,8 @@ data class UserPreferences(
|
||||
val lutId: String? = null, // 默认为 null,由 CameraViewModel 根据配置文件设置
|
||||
val separateVideoLutEnabled: Boolean = false,
|
||||
val videoLutId: String? = null,
|
||||
val jpgBaselineLutId: String? = null,
|
||||
val rawBaselineLutId: String? = null,
|
||||
val rawBaselineLutConfigured: Boolean = false,
|
||||
val phantomBaselineLutId: String? = null,
|
||||
val rawDcpId: String? = null,
|
||||
val rawDcpIdsByLens: Map<String, String?> = emptyMap(),
|
||||
val rawNoiseProfileId: String = RawNoiseProfileManager.DEFAULT_PROFILE_ID,
|
||||
@@ -305,9 +302,7 @@ data class CameraFeaturePreferencesUpdate(
|
||||
val rawSpectralFilmStock: PreferenceUpdateValue<String?>? = null,
|
||||
val rawSpectralFilmPrint: PreferenceUpdateValue<String?>? = null,
|
||||
val droMode: PreferenceUpdateValue<String>? = null,
|
||||
val jpgBaselineLutId: PreferenceUpdateValue<String?>? = null,
|
||||
val rawBaselineLutId: PreferenceUpdateValue<String?>? = null,
|
||||
val phantomBaselineLutId: PreferenceUpdateValue<String?>? = null,
|
||||
val activePresetId: PreferenceUpdateValue<String?>? = null
|
||||
)
|
||||
|
||||
@@ -329,7 +324,6 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
private val SEPARATE_VIDEO_LUT_ENABLED_KEY = booleanPreferencesKey("separate_video_lut_enabled")
|
||||
private val VIDEO_LUT_ID_KEY = stringPreferencesKey("video_lut_id")
|
||||
private val LEGACY_PHANTOM_LUT_ID_KEY = stringPreferencesKey("phantom_lut_id")
|
||||
private val JPG_BASELINE_LUT_ID_KEY = stringPreferencesKey("jpg_baseline_lut_id")
|
||||
private val RAW_BASELINE_LUT_ID_KEY = stringPreferencesKey("raw_baseline_lut_id")
|
||||
private val RAW_BASELINE_LUT_CONFIGURED_KEY = booleanPreferencesKey("raw_baseline_lut_configured")
|
||||
private val RAW_DCP_ID_KEY = stringPreferencesKey("raw_dcp_id")
|
||||
@@ -374,7 +368,6 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
private val RAW_MAX_CHROMA_NOISE_REDUCTION_KEY =
|
||||
floatPreferencesKey("raw_max_chroma_noise_reduction")
|
||||
private val EXPORT_DNG_WITH_RAW_EXPORT_KEY = booleanPreferencesKey("export_dng_with_raw_export")
|
||||
private val PHANTOM_BASELINE_LUT_ID_KEY = stringPreferencesKey("phantom_baseline_lut_id")
|
||||
private val FRAME_ID_KEY = stringPreferencesKey("frame_id")
|
||||
private val PHANTOM_FRAME_ID_KEY = stringPreferencesKey("phantom_frame_id")
|
||||
private val SHOW_HISTOGRAM = booleanPreferencesKey("show_histogram")
|
||||
@@ -568,7 +561,6 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
?: preferences[LEGACY_PHANTOM_LUT_ID_KEY], // 不提供默认值,由 CameraViewModel 处理
|
||||
separateVideoLutEnabled = preferences[SEPARATE_VIDEO_LUT_ENABLED_KEY] ?: false,
|
||||
videoLutId = preferences[VIDEO_LUT_ID_KEY],
|
||||
jpgBaselineLutId = preferences[JPG_BASELINE_LUT_ID_KEY],
|
||||
rawBaselineLutId = preferences[RAW_BASELINE_LUT_ID_KEY],
|
||||
rawBaselineLutConfigured = rawBaselineLutConfigured,
|
||||
rawDcpId = preferences[RAW_DCP_ID_KEY],
|
||||
@@ -637,7 +629,6 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
?: RawDenoiseDefaults.RAW_MAX_CHROMA_STRENGTH
|
||||
),
|
||||
exportDngWithRawExport = preferences[EXPORT_DNG_WITH_RAW_EXPORT_KEY] ?: false,
|
||||
phantomBaselineLutId = preferences[PHANTOM_BASELINE_LUT_ID_KEY],
|
||||
frameId = preferences[FRAME_ID_KEY],
|
||||
phantomFrameId = preferences[PHANTOM_FRAME_ID_KEY],
|
||||
showHistogram = preferences[SHOW_HISTOGRAM] ?: true,
|
||||
@@ -1092,27 +1083,6 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun saveBaselineLutConfig(
|
||||
target: BaselineColorCorrectionTarget,
|
||||
lutId: String?
|
||||
) {
|
||||
val key = when (target) {
|
||||
BaselineColorCorrectionTarget.JPG -> JPG_BASELINE_LUT_ID_KEY
|
||||
BaselineColorCorrectionTarget.RAW -> RAW_BASELINE_LUT_ID_KEY
|
||||
BaselineColorCorrectionTarget.PHANTOM -> PHANTOM_BASELINE_LUT_ID_KEY
|
||||
}
|
||||
context.dataStore.edit { preferences ->
|
||||
if (lutId != null) {
|
||||
preferences[key] = lutId
|
||||
} else {
|
||||
preferences.remove(key)
|
||||
}
|
||||
if (target == BaselineColorCorrectionTarget.RAW) {
|
||||
preferences[RAW_BASELINE_LUT_CONFIGURED_KEY] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun saveRawDcpId(dcpId: String?) {
|
||||
context.dataStore.edit { preferences ->
|
||||
if (dcpId != null) {
|
||||
@@ -2446,13 +2416,6 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
preferences[DRO_MODE] = resolvedMode.name
|
||||
preferences[RAW_DRO_ENABLED_KEY] = resolvedMode.isEnabled
|
||||
}
|
||||
update.jpgBaselineLutId?.let {
|
||||
if (it.value != null) {
|
||||
preferences[JPG_BASELINE_LUT_ID_KEY] = it.value
|
||||
} else {
|
||||
preferences.remove(JPG_BASELINE_LUT_ID_KEY)
|
||||
}
|
||||
}
|
||||
update.rawBaselineLutId?.let {
|
||||
if (it.value != null) {
|
||||
preferences[RAW_BASELINE_LUT_ID_KEY] = it.value
|
||||
@@ -2461,13 +2424,6 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
}
|
||||
preferences[RAW_BASELINE_LUT_CONFIGURED_KEY] = true
|
||||
}
|
||||
update.phantomBaselineLutId?.let {
|
||||
if (it.value != null) {
|
||||
preferences[PHANTOM_BASELINE_LUT_ID_KEY] = it.value
|
||||
} else {
|
||||
preferences.remove(PHANTOM_BASELINE_LUT_ID_KEY)
|
||||
}
|
||||
}
|
||||
update.activePresetId?.let {
|
||||
if (it.value != null) {
|
||||
preferences[ACTIVE_PRESET_ID] = it.value
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.hinnka.mycamera.hdr.LuminanceGainMap
|
||||
import com.hinnka.mycamera.hdr.LuminanceGainMapEncoding
|
||||
import com.hinnka.mycamera.hdr.RawGainmapMath
|
||||
import com.hinnka.mycamera.hdr.SourceKind
|
||||
import com.hinnka.mycamera.lut.BaselineColorCorrectionTarget
|
||||
import com.hinnka.mycamera.lut.ColorCorrectionPipelineResolver
|
||||
import com.hinnka.mycamera.lut.LutImageProcessor
|
||||
import com.hinnka.mycamera.lut.LutManager
|
||||
@@ -270,10 +269,7 @@ class PhotoProcessor(
|
||||
): GainmapSourceSet? = withContext(Dispatchers.IO) {
|
||||
val displayHdrSdrRatio = readDisplayHdrSdrRatio()
|
||||
|
||||
val colorCorrection = resolveColorCorrection(
|
||||
metadata = metadata,
|
||||
fallbackTarget = BaselineColorCorrectionTarget.RAW
|
||||
)
|
||||
val colorCorrection = resolveColorCorrection(metadata)
|
||||
|
||||
var sdrBitmap = preparedSdrBitmap ?: rawResult.sdrBitmap
|
||||
var hdrReferenceBitmap = normalizeRawHdrReferenceForGainmap(
|
||||
@@ -654,10 +650,7 @@ class PhotoProcessor(
|
||||
val finalChromaNoiseReduction = resolveChromaNoiseReduction(metadata, chromaNoiseReduction)
|
||||
|
||||
// 1. 应用 LUT
|
||||
val colorCorrection = resolveColorCorrection(
|
||||
metadata = metadata,
|
||||
fallbackTarget = BaselineColorCorrectionTarget.RAW
|
||||
)
|
||||
val colorCorrection = resolveColorCorrection(metadata)
|
||||
val cropRegion = metadata.cropRegion
|
||||
|
||||
val bitmap = RawDemosaicProcessor.getInstance().process(
|
||||
@@ -758,10 +751,7 @@ class PhotoProcessor(
|
||||
val finalChromaNoiseReduction =
|
||||
metadata.chromaNoiseReduction ?: (if (metadata.isImported) 0f else chromaNoiseReduction)
|
||||
|
||||
val colorCorrection = resolveColorCorrection(
|
||||
metadata = metadata,
|
||||
fallbackTarget = BaselineColorCorrectionTarget.JPG
|
||||
)
|
||||
val colorCorrection = resolveColorCorrection(metadata)
|
||||
|
||||
if (useComputationalAperture) {
|
||||
metadata.computationalAperture?.let { aperture ->
|
||||
@@ -923,13 +913,8 @@ class PhotoProcessor(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun resolveColorCorrection(
|
||||
metadata: MediaMetadata,
|
||||
fallbackTarget: BaselineColorCorrectionTarget
|
||||
) = colorCorrectionPipelineResolver.resolveFromMetadata(
|
||||
fallbackTarget = fallbackTarget,
|
||||
metadata = metadata
|
||||
)
|
||||
private suspend fun resolveColorCorrection(metadata: MediaMetadata) =
|
||||
colorCorrectionPipelineResolver.resolveFromMetadata(metadata)
|
||||
|
||||
private suspend fun applyFrame(
|
||||
input: Bitmap,
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
package com.hinnka.mycamera.lut
|
||||
|
||||
import com.hinnka.mycamera.data.UserPreferences
|
||||
import com.hinnka.mycamera.gallery.MediaMetadata
|
||||
import com.hinnka.mycamera.model.ColorRecipeParams
|
||||
|
||||
enum class BaselineColorCorrectionTarget {
|
||||
JPG,
|
||||
RAW,
|
||||
PHANTOM
|
||||
RAW
|
||||
}
|
||||
|
||||
data class BaselineColorCorrectionConfig(
|
||||
val lutId: String? = null
|
||||
)
|
||||
|
||||
data class LutRenderLayer(
|
||||
val lutConfig: LutConfig?,
|
||||
val colorRecipeParams: ColorRecipeParams?
|
||||
)
|
||||
|
||||
data class ResolvedColorCorrectionStack(
|
||||
val target: BaselineColorCorrectionTarget,
|
||||
val target: BaselineColorCorrectionTarget?,
|
||||
val baselineLutId: String? = null,
|
||||
val creativeLutId: String? = null,
|
||||
val baselineLayer: LutRenderLayer? = null,
|
||||
@@ -33,58 +26,20 @@ data class ResolvedColorCorrectionStack(
|
||||
get() = baselineLayer != null && creativeLayer != null
|
||||
}
|
||||
|
||||
fun UserPreferences.getBaselineColorCorrectionConfig(
|
||||
target: BaselineColorCorrectionTarget
|
||||
): BaselineColorCorrectionConfig {
|
||||
val lutId = when (target) {
|
||||
BaselineColorCorrectionTarget.JPG -> jpgBaselineLutId
|
||||
BaselineColorCorrectionTarget.RAW -> rawBaselineLutId
|
||||
BaselineColorCorrectionTarget.PHANTOM -> phantomBaselineLutId
|
||||
}
|
||||
return BaselineColorCorrectionConfig(lutId = lutId)
|
||||
}
|
||||
|
||||
fun UserPreferences.getPrimaryLutId(
|
||||
target: BaselineColorCorrectionTarget
|
||||
): String? {
|
||||
return when (target) {
|
||||
BaselineColorCorrectionTarget.PHANTOM,
|
||||
BaselineColorCorrectionTarget.JPG,
|
||||
BaselineColorCorrectionTarget.RAW -> lutId
|
||||
}
|
||||
}
|
||||
|
||||
class ColorCorrectionPipelineResolver(
|
||||
private val lutManager: LutManager
|
||||
) {
|
||||
suspend fun resolveFromPreferences(
|
||||
target: BaselineColorCorrectionTarget,
|
||||
preferences: UserPreferences,
|
||||
creativeRecipeParams: ColorRecipeParams? = null,
|
||||
): ResolvedColorCorrectionStack {
|
||||
val creativeLutId = preferences.getPrimaryLutId(target)
|
||||
val baselineLutId = preferences.getBaselineColorCorrectionConfig(target).lutId
|
||||
return resolve(
|
||||
target = target,
|
||||
baselineLutId = baselineLutId,
|
||||
baselineRecipeParams = baselineLutId?.let { lutManager.loadColorRecipeParams(it, target) },
|
||||
creativeLutId = creativeLutId,
|
||||
creativeRecipeParams = creativeRecipeParams
|
||||
?: creativeLutId?.let { lutManager.loadColorRecipeParams(it) }
|
||||
)
|
||||
}
|
||||
|
||||
suspend fun resolveFromMetadata(
|
||||
fallbackTarget: BaselineColorCorrectionTarget,
|
||||
metadata: MediaMetadata
|
||||
): ResolvedColorCorrectionStack {
|
||||
val target = metadata.baselineTarget ?: fallbackTarget
|
||||
val target = metadata.baselineTarget
|
||||
val creativeLutId = metadata.lutId
|
||||
val baselineLutId = metadata.baselineLutId
|
||||
val baselineLutId = metadata.baselineLutId.takeIf { target == BaselineColorCorrectionTarget.RAW }
|
||||
return resolve(
|
||||
target = target,
|
||||
baselineLutId = baselineLutId,
|
||||
baselineRecipeParams = metadata.baselineColorRecipeParams
|
||||
.takeIf { target == BaselineColorCorrectionTarget.RAW }
|
||||
?: baselineLutId?.let { lutManager.loadColorRecipeParams(it, target) },
|
||||
creativeLutId = creativeLutId,
|
||||
creativeRecipeParams = metadata.colorRecipeParams
|
||||
@@ -93,7 +48,7 @@ class ColorCorrectionPipelineResolver(
|
||||
}
|
||||
|
||||
suspend fun resolve(
|
||||
target: BaselineColorCorrectionTarget,
|
||||
target: BaselineColorCorrectionTarget?,
|
||||
baselineLutId: String?,
|
||||
baselineRecipeParams: ColorRecipeParams?,
|
||||
creativeLutId: String?,
|
||||
|
||||
@@ -98,7 +98,6 @@ import com.hinnka.mycamera.gallery.GalleryManager.saveMetadata
|
||||
import com.hinnka.mycamera.livephoto.GoogleLivePhotoCreator
|
||||
import com.hinnka.mycamera.livephoto.MotionPhotoWriter
|
||||
import com.hinnka.mycamera.livephoto.VivoLivePhotoCreator
|
||||
import com.hinnka.mycamera.lut.BaselineColorCorrectionTarget
|
||||
import com.hinnka.mycamera.model.ColorPaletteMapper
|
||||
import com.hinnka.mycamera.model.ColorPaletteState
|
||||
import com.hinnka.mycamera.model.ColorRecipeParams
|
||||
@@ -602,12 +601,6 @@ class PhantomService(val context: Context) : LifecycleOwner, SavedStateRegistryO
|
||||
) ?: run {
|
||||
return@withContext
|
||||
}
|
||||
val phantomBaselineLutId = preferences?.phantomBaselineLutId
|
||||
val baselineTarget = if (phantomBaselineLutId != null) BaselineColorCorrectionTarget.PHANTOM else null
|
||||
val baselineLutId = phantomBaselineLutId
|
||||
val baselineColorRecipeParams = phantomBaselineLutId?.let {
|
||||
ContentRepository.getInstance(context).lutManager.loadColorRecipeParams(it, BaselineColorCorrectionTarget.PHANTOM)
|
||||
}
|
||||
val creativeColorRecipeParams = lutId?.let {
|
||||
ContentRepository.getInstance(context).lutManager.loadColorRecipeParams(it)
|
||||
} ?: ColorRecipeParams.DEFAULT
|
||||
@@ -619,25 +612,14 @@ class PhantomService(val context: Context) : LifecycleOwner, SavedStateRegistryO
|
||||
.takeUnless { it.isDefault() }
|
||||
|
||||
var updatedMetadata = GalleryManager.updateMetadata(context, photoId) { current ->
|
||||
if (baselineTarget != null) {
|
||||
current.copy(
|
||||
lutId = lutId,
|
||||
frameId = phantomFrameId,
|
||||
colorRecipeParams = metadataCreativeColorRecipeParams,
|
||||
baselineTarget = baselineTarget,
|
||||
baselineLutId = baselineLutId,
|
||||
baselineColorRecipeParams = baselineColorRecipeParams,
|
||||
)
|
||||
} else {
|
||||
current.copy(
|
||||
lutId = lutId,
|
||||
frameId = phantomFrameId,
|
||||
colorRecipeParams = metadataCreativeColorRecipeParams,
|
||||
baselineTarget = null,
|
||||
baselineLutId = null,
|
||||
baselineColorRecipeParams = null,
|
||||
)
|
||||
}
|
||||
current.copy(
|
||||
lutId = lutId,
|
||||
frameId = phantomFrameId,
|
||||
colorRecipeParams = metadataCreativeColorRecipeParams,
|
||||
baselineTarget = null,
|
||||
baselineLutId = null,
|
||||
baselineColorRecipeParams = null,
|
||||
)
|
||||
} ?: return@withContext
|
||||
if (!isActive) return@withContext
|
||||
|
||||
|
||||
@@ -320,10 +320,6 @@ private fun ScreenCapturePipContent(
|
||||
glSurfaceView.setLensFacing(1)
|
||||
glSurfaceView.setDeviceRotation(0)
|
||||
glSurfaceView.setCalibrationOffset(0)
|
||||
glSurfaceView.setBaselineLut(renderConfig.baselineLutConfig)
|
||||
glSurfaceView.setBaselineLutEnabled(renderConfig.baselineLutConfig != null)
|
||||
glSurfaceView.setBaselineColorRecipeEnabled(!renderConfig.baselineColorRecipeParams.isDefault())
|
||||
glSurfaceView.setBaselineParams(renderConfig.baselineColorRecipeParams)
|
||||
glSurfaceView.setLut(renderConfig.creativeLutConfig)
|
||||
glSurfaceView.setLutEnabled(renderConfig.creativeLutConfig != null)
|
||||
glSurfaceView.setColorRecipeEnabled(!renderConfig.creativeColorRecipeParams.isDefault())
|
||||
|
||||
+3
-22
@@ -1,8 +1,6 @@
|
||||
package com.hinnka.mycamera.screencapture
|
||||
|
||||
import android.content.Context
|
||||
import com.hinnka.mycamera.lut.BaselineColorCorrectionTarget
|
||||
import com.hinnka.mycamera.lut.ColorCorrectionPipelineResolver
|
||||
import com.hinnka.mycamera.data.ContentRepository
|
||||
import com.hinnka.mycamera.lut.LutConfig
|
||||
import com.hinnka.mycamera.model.ColorRecipeParams
|
||||
@@ -14,8 +12,6 @@ import kotlinx.coroutines.flow.firstOrNull
|
||||
|
||||
object ScreenCaptureRenderConfigStore {
|
||||
data class RenderConfig(
|
||||
val baselineLutConfig: LutConfig?,
|
||||
val baselineColorRecipeParams: ColorRecipeParams,
|
||||
val creativeLutConfig: LutConfig?,
|
||||
val creativeColorRecipeParams: ColorRecipeParams,
|
||||
val crop: PhantomPipCrop
|
||||
@@ -23,8 +19,6 @@ object ScreenCaptureRenderConfigStore {
|
||||
|
||||
private val _config = MutableStateFlow(
|
||||
RenderConfig(
|
||||
baselineLutConfig = null,
|
||||
baselineColorRecipeParams = ColorRecipeParams.DEFAULT,
|
||||
creativeLutConfig = null,
|
||||
creativeColorRecipeParams = ColorRecipeParams.DEFAULT,
|
||||
crop = PhantomPipCrop()
|
||||
@@ -33,15 +27,11 @@ object ScreenCaptureRenderConfigStore {
|
||||
val config: StateFlow<RenderConfig> = _config.asStateFlow()
|
||||
|
||||
fun save(
|
||||
baselineLutConfig: LutConfig?,
|
||||
baselineColorRecipeParams: ColorRecipeParams,
|
||||
creativeLutConfig: LutConfig?,
|
||||
creativeColorRecipeParams: ColorRecipeParams,
|
||||
crop: PhantomPipCrop
|
||||
) {
|
||||
_config.value = RenderConfig(
|
||||
baselineLutConfig = baselineLutConfig,
|
||||
baselineColorRecipeParams = baselineColorRecipeParams,
|
||||
creativeLutConfig = creativeLutConfig,
|
||||
creativeColorRecipeParams = creativeColorRecipeParams,
|
||||
crop = crop.normalized()
|
||||
@@ -64,25 +54,16 @@ object ScreenCaptureRenderConfigStore {
|
||||
it.copy(lutId = lutIdOverride)
|
||||
}
|
||||
}
|
||||
val colorCorrection = effectivePreferences?.let {
|
||||
ColorCorrectionPipelineResolver(repository.lutManager).resolveFromPreferences(
|
||||
target = BaselineColorCorrectionTarget.PHANTOM,
|
||||
preferences = it
|
||||
)
|
||||
}
|
||||
val baselineLayer = colorCorrection?.baselineLayer
|
||||
val creativeLayer = colorCorrection?.creativeLayer
|
||||
val creativeLutId = effectivePreferences?.lutId
|
||||
val creativeRecipeParams = creativeRecipeParamsOverride
|
||||
?: creativeLayer?.colorRecipeParams
|
||||
?: creativeLutId?.let { repository.lutManager.loadColorRecipeParams(it) }
|
||||
?: ColorRecipeParams.DEFAULT
|
||||
val effectParams = effectParamsOverride
|
||||
?: effectivePreferences?.activeEffectParams
|
||||
?: EffectParams.DEFAULT
|
||||
|
||||
save(
|
||||
baselineLutConfig = baselineLayer?.lutConfig,
|
||||
baselineColorRecipeParams = baselineLayer?.colorRecipeParams ?: ColorRecipeParams.DEFAULT,
|
||||
creativeLutConfig = creativeLayer?.lutConfig,
|
||||
creativeLutConfig = creativeLutId?.let { repository.lutManager.loadLut(it) },
|
||||
creativeColorRecipeParams = effectParams.applyTo(creativeRecipeParams),
|
||||
crop = cropOverride ?: preferences?.phantomPipCrop ?: _config.value.crop
|
||||
)
|
||||
|
||||
@@ -67,7 +67,6 @@ import com.hinnka.mycamera.camera.AspectRatio
|
||||
import com.hinnka.mycamera.camera.CameraState
|
||||
import com.hinnka.mycamera.camera.FocusPointSource
|
||||
import com.hinnka.mycamera.data.CaptureButtonStyle
|
||||
import com.hinnka.mycamera.lut.BaselineColorCorrectionTarget
|
||||
import com.hinnka.mycamera.model.CameraPreset
|
||||
import com.hinnka.mycamera.model.ColorRecipeParams
|
||||
import com.hinnka.mycamera.model.LutSelectorMode
|
||||
@@ -252,9 +251,6 @@ fun CameraScreen(
|
||||
val rawDcpIdsByLens by viewModel.rawDcpIdsByLens.collectAsState()
|
||||
val rawHncsProfileId by viewModel.rawHncsProfileId.collectAsState()
|
||||
val rawHncsFilmCurveMode by viewModel.rawHncsFilmCurveMode.collectAsState()
|
||||
val jpgBaselineLutId by viewModel.jpgBaselineLutId.collectAsState()
|
||||
val rawBaselineLutId by viewModel.rawBaselineLutId.collectAsState()
|
||||
val phantomBaselineLutId by viewModel.phantomBaselineLutId.collectAsState()
|
||||
val rawColorEngine by viewModel.rawRenderingEngine.collectAsState()
|
||||
val rawToneMappingParameters by viewModel.rawToneMappingParameters.collectAsState()
|
||||
val availableHncsProfiles = remember(context) {
|
||||
@@ -284,8 +280,6 @@ fun CameraScreen(
|
||||
var previewTransitionSawPause by remember { mutableStateOf(false) }
|
||||
var hasPlayedInitialPreviewTransition by remember { mutableStateOf(false) }
|
||||
var rawCaptureTapLocked by remember { mutableStateOf(false) }
|
||||
var baselineEditLutId by remember { mutableStateOf<String?>(null) }
|
||||
var baselineEditTarget by remember { mutableStateOf<BaselineColorCorrectionTarget?>(null) }
|
||||
var zoomStopAnimationJob by remember { mutableStateOf<Job?>(null) }
|
||||
|
||||
fun discardTransientLookEdits() {
|
||||
@@ -322,18 +316,6 @@ fun CameraScreen(
|
||||
var selectedParameter by remember { mutableStateOf(CameraParameter.EXPOSURE_COMPENSATION) }
|
||||
var showVideoParameterRuler by remember { mutableStateOf(false) }
|
||||
val isXpan = state.aspectRatio == AspectRatio.XPAN
|
||||
val activeBaselineTarget = when {
|
||||
phantomMode -> BaselineColorCorrectionTarget.PHANTOM
|
||||
useRaw && state.captureMode == CaptureMode.PHOTO && state.isRawSupported -> BaselineColorCorrectionTarget.RAW
|
||||
else -> BaselineColorCorrectionTarget.JPG
|
||||
}
|
||||
val activeBaselineLutId = when (activeBaselineTarget) {
|
||||
BaselineColorCorrectionTarget.JPG -> jpgBaselineLutId
|
||||
BaselineColorCorrectionTarget.RAW -> rawBaselineLutId
|
||||
BaselineColorCorrectionTarget.PHANTOM -> phantomBaselineLutId
|
||||
}
|
||||
|
||||
|
||||
val burstCapturingCount = viewModel.burstImageCount
|
||||
|
||||
var isGhostPermissionFlowActive by remember { mutableStateOf(false) }
|
||||
@@ -1817,21 +1799,6 @@ fun CameraScreen(
|
||||
)
|
||||
}
|
||||
|
||||
if (baselineEditLutId != null && baselineEditTarget != null) {
|
||||
LutEditBottomSheet(
|
||||
lutId = baselineEditLutId!!,
|
||||
editorTarget = when (baselineEditTarget!!) {
|
||||
BaselineColorCorrectionTarget.JPG -> LutEditorTarget.BASELINE_JPG
|
||||
BaselineColorCorrectionTarget.RAW -> LutEditorTarget.BASELINE_RAW
|
||||
BaselineColorCorrectionTarget.PHANTOM -> LutEditorTarget.BASELINE_PHANTOM
|
||||
},
|
||||
onDismiss = {
|
||||
baselineEditLutId = null
|
||||
baselineEditTarget = null
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
captureAnimationSnapshot?.let { snapshot ->
|
||||
CaptureAnimationOverlay(
|
||||
snapshot = snapshot,
|
||||
|
||||
@@ -23,9 +23,7 @@ import kotlinx.coroutines.launch
|
||||
|
||||
enum class LutEditorTarget(val baselineTarget: BaselineColorCorrectionTarget? = null) {
|
||||
CREATIVE_GLOBAL(),
|
||||
BASELINE_JPG(BaselineColorCorrectionTarget.JPG),
|
||||
BASELINE_RAW(BaselineColorCorrectionTarget.RAW),
|
||||
BASELINE_PHANTOM(BaselineColorCorrectionTarget.PHANTOM)
|
||||
BASELINE_RAW(BaselineColorCorrectionTarget.RAW)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -128,8 +128,6 @@ import com.hinnka.mycamera.frame.FrameInfo
|
||||
import com.hinnka.mycamera.gallery.PhotoSavePath
|
||||
import com.hinnka.mycamera.gallery.HeicExportEncoder
|
||||
import com.hinnka.mycamera.gallery.Jpeg444ExportEncoder
|
||||
import com.hinnka.mycamera.lut.BaselineColorCorrectionTarget
|
||||
import com.hinnka.mycamera.lut.LutInfo
|
||||
import com.hinnka.mycamera.lut.creator.OpenAIApiClient
|
||||
import com.hinnka.mycamera.ml.DepthModelDownloadState
|
||||
import com.hinnka.mycamera.ml.DepthModelManager
|
||||
@@ -156,7 +154,6 @@ import com.hinnka.mycamera.ui.components.LogViewerDialog
|
||||
import com.hinnka.mycamera.ui.components.PaymentDialog
|
||||
import com.hinnka.mycamera.ui.components.DepthModelDownloadDialog
|
||||
import com.hinnka.mycamera.ui.components.SliderSettingItem
|
||||
import com.hinnka.mycamera.ui.components.LutSelector
|
||||
import com.hinnka.mycamera.ui.components.RawEditPanel
|
||||
import com.hinnka.mycamera.ui.components.RawEditPanelContentMode
|
||||
import com.hinnka.mycamera.ui.components.RawDngMetadataCorrectionSettings
|
||||
@@ -379,9 +376,7 @@ fun SettingsScreen(
|
||||
val phantomSaveAsNew by viewModel.phantomSaveAsNew.collectAsState()
|
||||
val phantomFrameId by viewModel.phantomFrameId.collectAsState()
|
||||
val defaultVirtualAperture by viewModel.defaultVirtualAperture.collectAsState(initial = 0f)
|
||||
val jpgBaselineLutId by viewModel.jpgBaselineLutId.collectAsState()
|
||||
val rawBaselineLutId by viewModel.rawBaselineLutId.collectAsState()
|
||||
val phantomBaselineLutId by viewModel.phantomBaselineLutId.collectAsState()
|
||||
val rawDcpId by viewModel.rawDcpId.collectAsState()
|
||||
val rawDcpIdsByLens by viewModel.rawDcpIdsByLens.collectAsState()
|
||||
val rawNoiseProfileId by viewModel.rawNoiseProfileId.collectAsState()
|
||||
@@ -768,8 +763,7 @@ fun SettingsScreen(
|
||||
var isCheckingUpdate by remember { mutableStateOf(false) }
|
||||
var downloadedUpdateApk by remember { mutableStateOf<File?>(null) }
|
||||
var showInstallUpdateDialog by remember { mutableStateOf(false) }
|
||||
var baselinePickerTarget by remember { mutableStateOf<BaselineColorCorrectionTarget?>(null) }
|
||||
var baselineRecipeEditorTarget by remember { mutableStateOf<BaselineColorCorrectionTarget?>(null) }
|
||||
var showRawBaselineRecipeEditor by remember { mutableStateOf(false) }
|
||||
var jpgMultiFrameDenoiseCountSliderValue by remember(jpgMultiFrameDenoiseFrameCount) {
|
||||
mutableStateOf(jpgMultiFrameDenoiseFrameCount.toFloat())
|
||||
}
|
||||
@@ -1853,18 +1847,6 @@ fun SettingsScreen(
|
||||
onLevelSelected = { viewModel.setEdgeLevel(it) }
|
||||
)
|
||||
|
||||
HorizontalDivider(
|
||||
color = Color.White.copy(alpha = 0.1f),
|
||||
modifier = Modifier.padding(vertical = 12.dp)
|
||||
)
|
||||
|
||||
BaselineColorCorrectionSettingItem(
|
||||
title = stringResource(R.string.settings_baseline_jpg_title),
|
||||
description = stringResource(R.string.settings_baseline_jpg_description),
|
||||
selectedLut = availableLuts.find { it.id == jpgBaselineLutId },
|
||||
onClick = { baselinePickerTarget = BaselineColorCorrectionTarget.JPG }
|
||||
)
|
||||
|
||||
if (state.isP010Supported) {
|
||||
HorizontalDivider(
|
||||
color = Color.White.copy(alpha = 0.1f),
|
||||
@@ -2060,8 +2042,8 @@ fun SettingsScreen(
|
||||
dcpLensOptions = rawDcpLensOptions(state.availableCameras),
|
||||
availableDcps = availableDcps,
|
||||
selectedBaselineLutId = rawBaselineLutId,
|
||||
onSelectBaselineLut = { viewModel.setBaselineLut(BaselineColorCorrectionTarget.RAW, it) },
|
||||
onEditBaselineRecipe = { baselineRecipeEditorTarget = BaselineColorCorrectionTarget.RAW },
|
||||
onSelectBaselineLut = viewModel::setRawBaselineLutId,
|
||||
onEditBaselineRecipe = { showRawBaselineRecipeEditor = true },
|
||||
availableLuts = availableLuts,
|
||||
thumbnail = previewThumbnail,
|
||||
rawExposureCompensation = rawExposureCompensationUi,
|
||||
@@ -2284,17 +2266,6 @@ fun SettingsScreen(
|
||||
onFrameSelected = viewModel::setPhantomFrame
|
||||
)
|
||||
|
||||
HorizontalDivider(
|
||||
color = Color.White.copy(alpha = 0.1f),
|
||||
modifier = Modifier.padding(vertical = 12.dp)
|
||||
)
|
||||
|
||||
BaselineColorCorrectionSettingItem(
|
||||
title = stringResource(R.string.settings_baseline_phantom_title),
|
||||
description = stringResource(R.string.settings_baseline_phantom_description),
|
||||
selectedLut = availableLuts.find { it.id == phantomBaselineLutId },
|
||||
onClick = { baselinePickerTarget = BaselineColorCorrectionTarget.PHANTOM }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2835,93 +2806,17 @@ fun SettingsScreen(
|
||||
)
|
||||
}
|
||||
|
||||
baselinePickerTarget?.let { target ->
|
||||
val currentBaselineLutId = when (target) {
|
||||
BaselineColorCorrectionTarget.JPG -> jpgBaselineLutId
|
||||
BaselineColorCorrectionTarget.RAW -> rawBaselineLutId
|
||||
BaselineColorCorrectionTarget.PHANTOM -> phantomBaselineLutId
|
||||
LaunchedEffect(rawBaselineLutId) {
|
||||
if (rawBaselineLutId == null) {
|
||||
showRawBaselineRecipeEditor = false
|
||||
}
|
||||
AlertDialog(
|
||||
onDismissRequest = { baselinePickerTarget = null },
|
||||
title = {
|
||||
Text(
|
||||
text = when (target) {
|
||||
BaselineColorCorrectionTarget.JPG -> stringResource(R.string.settings_baseline_jpg_title)
|
||||
BaselineColorCorrectionTarget.RAW -> stringResource(R.string.settings_baseline_raw_title)
|
||||
BaselineColorCorrectionTarget.PHANTOM -> stringResource(R.string.settings_baseline_phantom_title)
|
||||
}
|
||||
)
|
||||
},
|
||||
text = {
|
||||
Column {
|
||||
Text(
|
||||
text = stringResource(R.string.settings_baseline_dialog_description),
|
||||
color = Color.White.copy(alpha = 0.7f),
|
||||
fontSize = 13.sp,
|
||||
modifier = Modifier.padding(bottom = 12.dp)
|
||||
)
|
||||
LutSelector(
|
||||
availableLuts = availableLuts,
|
||||
currentLutId = currentBaselineLutId,
|
||||
thumbnail = previewThumbnail,
|
||||
onLutSelected = { selected ->
|
||||
viewModel.setBaselineLut(target, selected)
|
||||
baselinePickerTarget = null
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(
|
||||
onClick = {
|
||||
baselinePickerTarget = null
|
||||
if (currentBaselineLutId != null) {
|
||||
baselineRecipeEditorTarget = target
|
||||
}
|
||||
},
|
||||
enabled = currentBaselineLutId != null
|
||||
) {
|
||||
Text(stringResource(R.string.settings_baseline_edit_recipe))
|
||||
}
|
||||
},
|
||||
dismissButton = {
|
||||
Row {
|
||||
TextButton(
|
||||
onClick = {
|
||||
viewModel.setBaselineLut(target, null)
|
||||
baselinePickerTarget = null
|
||||
}
|
||||
) {
|
||||
Text(stringResource(R.string.settings_baseline_clear))
|
||||
}
|
||||
TextButton(onClick = { baselinePickerTarget = null }) {
|
||||
Text(stringResource(R.string.cancel))
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
baselineRecipeEditorTarget?.let { target ->
|
||||
val currentBaselineLutId = when (target) {
|
||||
BaselineColorCorrectionTarget.JPG -> jpgBaselineLutId
|
||||
BaselineColorCorrectionTarget.RAW -> rawBaselineLutId
|
||||
BaselineColorCorrectionTarget.PHANTOM -> phantomBaselineLutId
|
||||
}
|
||||
LaunchedEffect(target, currentBaselineLutId) {
|
||||
if (currentBaselineLutId == null) {
|
||||
baselineRecipeEditorTarget = null
|
||||
}
|
||||
}
|
||||
currentBaselineLutId?.let { lutId ->
|
||||
if (showRawBaselineRecipeEditor) {
|
||||
rawBaselineLutId?.let { lutId ->
|
||||
LutEditBottomSheet(
|
||||
lutId = lutId,
|
||||
editorTarget = when (target) {
|
||||
BaselineColorCorrectionTarget.JPG -> LutEditorTarget.BASELINE_JPG
|
||||
BaselineColorCorrectionTarget.RAW -> LutEditorTarget.BASELINE_RAW
|
||||
BaselineColorCorrectionTarget.PHANTOM -> LutEditorTarget.BASELINE_PHANTOM
|
||||
},
|
||||
onDismiss = { baselineRecipeEditorTarget = null }
|
||||
editorTarget = LutEditorTarget.BASELINE_RAW,
|
||||
onDismiss = { showRawBaselineRecipeEditor = false }
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -3002,8 +2897,7 @@ private fun SettingsCategoryOverview(
|
||||
description = listOf(
|
||||
stringResource(R.string.settings_multi_frame_denoise_frame_count),
|
||||
stringResource(R.string.settings_nr_level),
|
||||
stringResource(R.string.settings_edge_level),
|
||||
stringResource(R.string.settings_baseline_jpg_title)
|
||||
stringResource(R.string.settings_edge_level)
|
||||
).joinToString(" · "),
|
||||
onClick = { onPageSelected(SettingsPage.PHOTO_MODE) }
|
||||
)
|
||||
@@ -3030,8 +2924,7 @@ private fun SettingsCategoryOverview(
|
||||
description = listOf(
|
||||
stringResource(R.string.settings_phantom_pip_preview),
|
||||
stringResource(R.string.settings_phantom_save_as_new),
|
||||
stringResource(R.string.settings_phantom_frame_title),
|
||||
stringResource(R.string.settings_baseline_phantom_title)
|
||||
stringResource(R.string.settings_phantom_frame_title)
|
||||
).joinToString(" · "),
|
||||
onClick = { onPageSelected(SettingsPage.PHANTOM) }
|
||||
)
|
||||
@@ -3783,56 +3676,6 @@ fun DropdownSettingItem(
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun BaselineColorCorrectionSettingItem(
|
||||
title: String,
|
||||
description: String,
|
||||
selectedLut: LutInfo?,
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
Row(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.clickable(onClick = onClick)
|
||||
.padding(vertical = 8.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
text = title,
|
||||
color = Color.White,
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Normal
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = description,
|
||||
color = Color.White.copy(alpha = 0.6f),
|
||||
fontSize = 13.sp,
|
||||
lineHeight = 18.sp
|
||||
)
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
Text(
|
||||
text = selectedLut?.getName() ?: stringResource(R.string.none),
|
||||
color = if (selectedLut != null) Color(0xFFE5A324) else Color.White.copy(alpha = 0.45f),
|
||||
fontSize = 14.sp,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
|
||||
Icon(
|
||||
imageVector = AppIcons.ChevronRight,
|
||||
contentDescription = null,
|
||||
tint = Color.White.copy(alpha = 0.6f)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导航设置项(点击后跳转到其他页面)
|
||||
|
||||
@@ -39,7 +39,6 @@ import com.hinnka.mycamera.lut.BakedLutExporter
|
||||
import com.hinnka.mycamera.lut.LutConfig
|
||||
import com.hinnka.mycamera.lut.LutConverter
|
||||
import com.hinnka.mycamera.lut.LutInfo
|
||||
import com.hinnka.mycamera.lut.getBaselineColorCorrectionConfig
|
||||
import com.hinnka.mycamera.lut.creator.LutGenerator
|
||||
import com.hinnka.mycamera.lut.creator.OpenAIApiClient
|
||||
import com.hinnka.mycamera.model.CameraPreset
|
||||
@@ -133,11 +132,9 @@ data class MultipleExposureSessionState(
|
||||
}
|
||||
|
||||
private fun resolvePreviewBaselineTarget(prefs: UserPreferences): BaselineColorCorrectionTarget? {
|
||||
return if (prefs.useRaw) null else BaselineColorCorrectionTarget.JPG
|
||||
}
|
||||
|
||||
private fun UserPreferences.getBaselineLutId(target: BaselineColorCorrectionTarget): String? {
|
||||
return getBaselineColorCorrectionConfig(target).lutId
|
||||
return BaselineColorCorrectionTarget.RAW.takeIf {
|
||||
prefs.captureMode == CaptureMode.PHOTO && prefs.useRaw && !prefs.phantomMode
|
||||
}
|
||||
}
|
||||
|
||||
private data class RawSpectralFilmSettings(
|
||||
@@ -394,9 +391,7 @@ private data class CameraFeatureUpdate(
|
||||
val rawSpectralFilmStock: SettingValue<String?>? = null,
|
||||
val rawSpectralFilmPrint: SettingValue<String?>? = null,
|
||||
val droMode: SettingValue<String>? = null,
|
||||
val jpgBaselineLutId: SettingValue<String?>? = null,
|
||||
val rawBaselineLutId: SettingValue<String?>? = null,
|
||||
val phantomBaselineLutId: SettingValue<String?>? = null,
|
||||
val activePresetId: SettingValue<String?>? = null,
|
||||
val useMultipleExposure: SettingValue<Boolean>? = null
|
||||
)
|
||||
@@ -904,9 +899,7 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
droMode = update.droMode?.let {
|
||||
PreferenceUpdateValue(RawProcessingPreferences.DROMode.fromPersistedName(it.value).name)
|
||||
},
|
||||
jpgBaselineLutId = update.jpgBaselineLutId?.let { PreferenceUpdateValue(it.value) },
|
||||
rawBaselineLutId = update.rawBaselineLutId?.let { PreferenceUpdateValue(it.value) },
|
||||
phantomBaselineLutId = update.phantomBaselineLutId?.let { PreferenceUpdateValue(it.value) },
|
||||
activePresetId = update.activePresetId?.let { PreferenceUpdateValue(it.value) }
|
||||
)
|
||||
)
|
||||
@@ -1144,7 +1137,7 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
val currentBaselineRecipeParams: StateFlow<ColorRecipeParams> =
|
||||
userPreferencesRepository.userPreferences.flatMapLatest { prefs ->
|
||||
val target = resolvePreviewBaselineTarget(prefs)
|
||||
val lutId = target?.let { prefs.getBaselineLutId(it) }
|
||||
val lutId = prefs.rawBaselineLutId.takeIf { target != null }
|
||||
if (target == null || lutId == null) {
|
||||
flowOf(ColorRecipeParams.DEFAULT)
|
||||
} else {
|
||||
@@ -1311,15 +1304,9 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
val videoLutId: StateFlow<String?> = userPreferencesRepository.userPreferences
|
||||
.map { it.videoLutId }
|
||||
.stateIn(viewModelScope, SharingStarted.Eagerly, null)
|
||||
val jpgBaselineLutId: StateFlow<String?> = userPreferencesRepository.userPreferences
|
||||
.map { it.jpgBaselineLutId }
|
||||
.stateIn(viewModelScope, SharingStarted.Eagerly, null)
|
||||
val rawBaselineLutId: StateFlow<String?> = userPreferencesRepository.userPreferences
|
||||
.map { it.rawBaselineLutId }
|
||||
.stateIn(viewModelScope, SharingStarted.Eagerly, null)
|
||||
val phantomBaselineLutId: StateFlow<String?> = userPreferencesRepository.userPreferences
|
||||
.map { it.phantomBaselineLutId }
|
||||
.stateIn(viewModelScope, SharingStarted.Eagerly, null)
|
||||
val phantomFrameId: StateFlow<String?> = userPreferencesRepository.userPreferences
|
||||
.map { it.phantomFrameId }
|
||||
.stateIn(viewModelScope, SharingStarted.Eagerly, null)
|
||||
@@ -2775,7 +2762,7 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
chromaNoiseReductionValue: Float = 0f,
|
||||
captureMode: String? = null,
|
||||
multipleExposureFrameCount: Int? = null,
|
||||
baselineTarget: BaselineColorCorrectionTarget = BaselineColorCorrectionTarget.JPG,
|
||||
baselineTarget: BaselineColorCorrectionTarget? = null,
|
||||
): MediaMetadata {
|
||||
val lutIdToSave = currentLutId.value
|
||||
val aspectRatio = state.value.aspectRatio
|
||||
@@ -2892,21 +2879,18 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
}
|
||||
|
||||
private fun resolvePreviewBaselineLut(userPrefs: UserPreferences): LutConfig? {
|
||||
val baselineLutId = resolvePreviewBaselineTarget(userPrefs)
|
||||
?.let { userPrefs.getBaselineLutId(it) }
|
||||
val baselineLutId = userPrefs.rawBaselineLutId
|
||||
.takeIf { resolvePreviewBaselineTarget(userPrefs) != null }
|
||||
return baselineLutId?.let { contentRepository.lutManager.loadLut(it) }
|
||||
}
|
||||
|
||||
private suspend fun resolveBaselineMetadata(
|
||||
target: BaselineColorCorrectionTarget,
|
||||
target: BaselineColorCorrectionTarget?,
|
||||
userPrefs: UserPreferences? = null
|
||||
): Triple<BaselineColorCorrectionTarget, String, ColorRecipeParams>? {
|
||||
if (target != BaselineColorCorrectionTarget.RAW) return null
|
||||
val preferences = userPrefs ?: userPreferencesRepository.userPreferences.firstOrNull() ?: return null
|
||||
val baselineLutId = when (target) {
|
||||
BaselineColorCorrectionTarget.JPG -> preferences.jpgBaselineLutId
|
||||
BaselineColorCorrectionTarget.RAW -> preferences.rawBaselineLutId
|
||||
BaselineColorCorrectionTarget.PHANTOM -> preferences.phantomBaselineLutId
|
||||
} ?: return null
|
||||
val baselineLutId = preferences.rawBaselineLutId ?: return null
|
||||
val params = contentRepository.lutManager.loadColorRecipeParams(baselineLutId, target)
|
||||
return Triple(target, baselineLutId, params)
|
||||
}
|
||||
@@ -3123,8 +3107,6 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
cameraController.startVideoRecording(
|
||||
creativeLutConfig = currentLutConfig.takeIf { currentState.lutEnabled },
|
||||
creativeRecipeParams = getMergedRecipeParams(),
|
||||
baselineLutConfig = currentBaselineLutConfig,
|
||||
baselineRecipeParams = currentBaselineRecipeParams.value,
|
||||
orientationOffsetDegrees = orientationOffset
|
||||
)
|
||||
}
|
||||
@@ -4951,17 +4933,6 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
}
|
||||
}
|
||||
|
||||
fun setBaselineLut(target: BaselineColorCorrectionTarget, lutId: String?) {
|
||||
viewModelScope.launch {
|
||||
val update = when (target) {
|
||||
BaselineColorCorrectionTarget.JPG -> CameraFeatureUpdate(jpgBaselineLutId = SettingValue(lutId))
|
||||
BaselineColorCorrectionTarget.RAW -> CameraFeatureUpdate(rawBaselineLutId = SettingValue(lutId))
|
||||
BaselineColorCorrectionTarget.PHANTOM -> CameraFeatureUpdate(phantomBaselineLutId = SettingValue(lutId))
|
||||
}
|
||||
applyCameraFeatureUpdate(update)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 为指定颜色推荐最合适的 LUT 列表
|
||||
*/
|
||||
@@ -5272,10 +5243,10 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
(userPreferencesRepository.userPreferences.firstOrNull()?.mirrorFrontCamera ?: true)
|
||||
|
||||
val aperture = if (state.value.isVirtualApertureEnabled) state.value.virtualAperture else null
|
||||
val baselineTarget = if (isRawCaptureFormat(image.format)) {
|
||||
val baselineTarget = if (isRawCapture) {
|
||||
BaselineColorCorrectionTarget.RAW
|
||||
} else {
|
||||
BaselineColorCorrectionTarget.JPG
|
||||
null
|
||||
}
|
||||
val rawToneMappingParameters = resolveCaptureRawToneMappingParameters(userPrefs)
|
||||
val defaultHdrEffectEnabled = defaultHdrEffectEnabled(
|
||||
@@ -5449,7 +5420,6 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
val userPrefs = userPreferencesRepository.userPreferences.firstOrNull()
|
||||
val shouldMirror = cameraController.getLensFacing() == CameraCharacteristics.LENS_FACING_FRONT &&
|
||||
(userPrefs?.mirrorFrontCamera ?: true)
|
||||
val baselineMetadata = resolveBaselineMetadata(BaselineColorCorrectionTarget.JPG, userPrefs)
|
||||
val currentCameraId = cameraController.getCurrentCameraId()
|
||||
val effectiveRawAutoExposure = resolveEffectiveRawAutoExposure()
|
||||
val spectralFilmSettings = resolveRawSpectralFilmSettings(userPrefs)
|
||||
@@ -5470,9 +5440,6 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
lutId = currentLutId.value,
|
||||
frameId = currentFrameId,
|
||||
colorRecipeParams = getMergedRecipeParams(),
|
||||
baselineTarget = baselineMetadata?.first,
|
||||
baselineLutId = baselineMetadata?.second,
|
||||
baselineColorRecipeParams = baselineMetadata?.third,
|
||||
sharpening = sharpeningValue,
|
||||
noiseReduction = noiseReductionValue,
|
||||
chromaNoiseReduction = chromaNoiseReductionValue,
|
||||
@@ -5713,7 +5680,7 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
val baselineTarget = if (isRawStack) {
|
||||
BaselineColorCorrectionTarget.RAW
|
||||
} else {
|
||||
BaselineColorCorrectionTarget.JPG
|
||||
null
|
||||
}
|
||||
val rawToneMappingParameters = resolveCaptureRawToneMappingParameters(userPrefs)
|
||||
val defaultHdrEffectEnabled = defaultHdrEffectEnabled(
|
||||
@@ -5958,7 +5925,6 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
chromaNoiseReductionValue = chromaNoiseReductionValue,
|
||||
captureMode = captureMode,
|
||||
multipleExposureFrameCount = expectedFrameCount,
|
||||
baselineTarget = BaselineColorCorrectionTarget.JPG,
|
||||
)
|
||||
|
||||
val photoId = GalleryManager.preparePhoto(
|
||||
@@ -6140,10 +6106,10 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
(userPreferencesRepository.userPreferences.firstOrNull()?.mirrorFrontCamera ?: true)
|
||||
|
||||
val aperture = if (state.value.isVirtualApertureEnabled) state.value.virtualAperture else null
|
||||
val baselineTarget = if (isRawCaptureFormat(image.format)) {
|
||||
val baselineTarget = if (isRawCapture) {
|
||||
BaselineColorCorrectionTarget.RAW
|
||||
} else {
|
||||
BaselineColorCorrectionTarget.JPG
|
||||
null
|
||||
}
|
||||
val rawToneMappingParameters = resolveCaptureRawToneMappingParameters(userPrefs)
|
||||
val defaultHdrEffectEnabled = defaultHdrEffectEnabled(
|
||||
|
||||
@@ -270,8 +270,6 @@
|
||||
<string name="settings_frame_style">邊框樣式</string>
|
||||
<string name="settings_frame_description">為拍攝的相片添加裝飾性邊框和水印</string>
|
||||
<string name="settings_section_software_processing">細節微調</string>
|
||||
<string name="settings_baseline_jpg_title">基準色彩校正</string>
|
||||
<string name="settings_baseline_jpg_description">選擇創意 LUT 之前先應用的基準 LUT 與基準配方。</string>
|
||||
<string name="settings_baseline_raw_title">基準色彩校正</string>
|
||||
<string name="raw_dcp_title">DCP</string>
|
||||
<string name="raw_dcp_import">匯入 DCP</string>
|
||||
@@ -292,8 +290,6 @@
|
||||
<string name="raw_dcp_lens_override_title">當前鏡頭單獨使用 DCP</string>
|
||||
<string name="raw_dcp_lens_override_description">關閉時所有鏡頭共用統一 DCP。打開后僅覆蓋 %1$s。</string>
|
||||
<string name="raw_dcp_non_adobe_curve_warning">非 Adobe 色彩引擎仍會應用 DCP 色彩渲染和曝光偏移,但不會使用 DCP 內置曲線。</string>
|
||||
<string name="settings_baseline_phantom_title">幻影模式基準色彩校正</string>
|
||||
<string name="settings_baseline_phantom_description">選擇幻影模式創意 LUT 之前先應用的基準 LUT 與基準配方。</string>
|
||||
<string name="settings_baseline_dialog_description">為當前目標選擇一個基準 LUT。它會在普通創意 LUT 之前應用。</string>
|
||||
<string name="settings_baseline_edit_recipe">編輯配方</string>
|
||||
<string name="settings_baseline_clear">清除</string>
|
||||
|
||||
@@ -198,8 +198,6 @@
|
||||
<string name="settings_frame_style">สไตล์กรอบ</string>
|
||||
<string name="settings_frame_description">เพิ่มกรอบตกแต่งและลายน้ำให้กับรูปภาพ</string>
|
||||
<string name="settings_section_software_processing">การปรับจูน</string>
|
||||
<string name="settings_baseline_jpg_title">การแก้ไขสีพื้นฐาน</string>
|
||||
<string name="settings_baseline_jpg_description">ใช้ LUT พื้นฐานและสูตรพื้นฐานก่อนเลือก LUT ครีเอทีฟ</string>
|
||||
<string name="settings_baseline_raw_title">การแก้ไขสีพื้นฐาน</string>
|
||||
<string name="raw_dcp_title">DCP</string>
|
||||
<string name="raw_dcp_import">นำเข้า DCP</string>
|
||||
@@ -209,8 +207,6 @@
|
||||
<string name="raw_dcp_import_failed">การนำเข้า DCP ล้มเหลว</string>
|
||||
<string name="raw_dcp_delete_success">ลบ DCP แล้ว</string>
|
||||
<string name="raw_dcp_delete_failed">ลบ DCP ไม่สำเร็จ</string>
|
||||
<string name="settings_baseline_phantom_title">การแก้ไขสีพื้นฐานของโหมด Phantom</string>
|
||||
<string name="settings_baseline_phantom_description">ใช้ LUT พื้นฐานและสูตรพื้นฐานก่อนเลือก LUT ครีเอทีฟโฆษณาโหมด Ghost</string>
|
||||
<string name="settings_baseline_dialog_description">เลือก LUT พื้นฐานสำหรับเป้าหมายปัจจุบัน โดยจะใช้ก่อน LUT ครีเอทีฟโฆษณาปกติ</string>
|
||||
<string name="settings_baseline_edit_recipe">แก้ไขสูตร</string>
|
||||
<string name="settings_baseline_clear">ชัดเจน</string>
|
||||
|
||||
@@ -270,8 +270,6 @@
|
||||
<string name="settings_frame_style">边框样式</string>
|
||||
<string name="settings_frame_description">为拍摄的照片添加装饰性边框和水印</string>
|
||||
<string name="settings_section_software_processing">细节微调</string>
|
||||
<string name="settings_baseline_jpg_title">基准色彩校正</string>
|
||||
<string name="settings_baseline_jpg_description">选择创意 LUT 之前先应用的基准 LUT 与基准配方。</string>
|
||||
<string name="settings_baseline_raw_title">基准色彩校正</string>
|
||||
<string name="raw_dcp_title">DCP</string>
|
||||
<string name="raw_dcp_import">导入 DCP</string>
|
||||
@@ -311,8 +309,6 @@
|
||||
<string name="raw_noise_profile_x9_ultra">X9 Ultra</string>
|
||||
<string name="raw_noise_profile_x9_ultra_3x">X9 Ultra 3X</string>
|
||||
<string name="delete_raw_noise_profile_confirm_message">删除降噪模型“%s”?</string>
|
||||
<string name="settings_baseline_phantom_title">幻影模式基准色彩校正</string>
|
||||
<string name="settings_baseline_phantom_description">选择幻影模式创意 LUT 之前先应用的基准 LUT 与基准配方。</string>
|
||||
<string name="settings_baseline_dialog_description">为当前目标选择一个基准 LUT。它会在普通创意 LUT 之前应用。</string>
|
||||
<string name="settings_baseline_edit_recipe">编辑配方</string>
|
||||
<string name="settings_baseline_clear">清除</string>
|
||||
|
||||
@@ -270,8 +270,6 @@
|
||||
<string name="settings_frame_style">邊框樣式</string>
|
||||
<string name="settings_frame_description">為拍攝的相片添加裝飾性邊框和水印</string>
|
||||
<string name="settings_section_software_processing">細節微調</string>
|
||||
<string name="settings_baseline_jpg_title">基準色彩校正</string>
|
||||
<string name="settings_baseline_jpg_description">選擇創意 LUT 之前先應用的基準 LUT 與基準配方。</string>
|
||||
<string name="settings_baseline_raw_title">基準色彩校正</string>
|
||||
<string name="raw_dcp_title">DCP</string>
|
||||
<string name="raw_dcp_import">匯入 DCP</string>
|
||||
@@ -292,8 +290,6 @@
|
||||
<string name="raw_dcp_lens_override_title">當前鏡頭單獨使用 DCP</string>
|
||||
<string name="raw_dcp_lens_override_description">關閉時所有鏡頭共用統一 DCP。打開后僅覆蓋 %1$s。</string>
|
||||
<string name="raw_dcp_non_adobe_curve_warning">非 Adobe 色彩引擎仍會應用 DCP 色彩渲染和曝光偏移,但不會使用 DCP 內置曲線。</string>
|
||||
<string name="settings_baseline_phantom_title">幻影模式基準色彩校正</string>
|
||||
<string name="settings_baseline_phantom_description">選擇幻影模式創意 LUT 之前先應用的基準 LUT 與基準配方。</string>
|
||||
<string name="settings_baseline_dialog_description">為當前目標選擇一個基準 LUT。它會在普通創意 LUT 之前應用。</string>
|
||||
<string name="settings_baseline_edit_recipe">編輯配方</string>
|
||||
<string name="settings_baseline_clear">清除</string>
|
||||
|
||||
@@ -270,8 +270,6 @@
|
||||
<string name="settings_frame_style">邊框樣式</string>
|
||||
<string name="settings_frame_description">為拍攝的相片添加裝飾性邊框和水印</string>
|
||||
<string name="settings_section_software_processing">細節微調</string>
|
||||
<string name="settings_baseline_jpg_title">基準色彩校正</string>
|
||||
<string name="settings_baseline_jpg_description">選擇創意 LUT 之前先應用的基準 LUT 與基準配方。</string>
|
||||
<string name="settings_baseline_raw_title">基準色彩校正</string>
|
||||
<string name="raw_dcp_title">DCP</string>
|
||||
<string name="raw_dcp_import">匯入 DCP</string>
|
||||
@@ -292,8 +290,6 @@
|
||||
<string name="raw_dcp_lens_override_title">當前鏡頭單獨使用 DCP</string>
|
||||
<string name="raw_dcp_lens_override_description">關閉時所有鏡頭共用統一 DCP。打開后僅覆蓋 %1$s。</string>
|
||||
<string name="raw_dcp_non_adobe_curve_warning">非 Adobe 色彩引擎仍會應用 DCP 色彩渲染和曝光偏移,但不會使用 DCP 內置曲線。</string>
|
||||
<string name="settings_baseline_phantom_title">幻影模式基準色彩校正</string>
|
||||
<string name="settings_baseline_phantom_description">選擇幻影模式創意 LUT 之前先應用的基準 LUT 與基準配方。</string>
|
||||
<string name="settings_baseline_dialog_description">為當前目標選擇一個基準 LUT。它會在普通創意 LUT 之前應用。</string>
|
||||
<string name="settings_baseline_edit_recipe">編輯配方</string>
|
||||
<string name="settings_baseline_clear">清除</string>
|
||||
|
||||
@@ -274,8 +274,6 @@
|
||||
<string name="settings_frame_style">Frame Style</string>
|
||||
<string name="settings_frame_description">Add decorative frame and watermark to photos</string>
|
||||
<string name="settings_section_software_processing">Fine Tuning</string>
|
||||
<string name="settings_baseline_jpg_title">Baseline Color Correction</string>
|
||||
<string name="settings_baseline_jpg_description">Choose the baseline LUT and recipe applied before the creative LUT.</string>
|
||||
<string name="settings_baseline_raw_title">Baseline Color Correction</string>
|
||||
<string name="raw_dcp_title">DCP</string>
|
||||
<string name="raw_dcp_import">Import DCP</string>
|
||||
@@ -315,8 +313,6 @@
|
||||
<string name="raw_noise_profile_x9_ultra">X9 Ultra</string>
|
||||
<string name="raw_noise_profile_x9_ultra_3x">X9 Ultra 3X</string>
|
||||
<string name="delete_raw_noise_profile_confirm_message">Delete noise model "%s"?</string>
|
||||
<string name="settings_baseline_phantom_title">Phantom Baseline Color Correction</string>
|
||||
<string name="settings_baseline_phantom_description">Choose the baseline LUT and recipe used before Phantom mode creative LUT processing.</string>
|
||||
<string name="settings_baseline_dialog_description">Select a baseline LUT for this target. It will be applied before the regular creative LUT.</string>
|
||||
<string name="settings_baseline_edit_recipe">Edit Recipe</string>
|
||||
<string name="settings_baseline_clear">Clear</string>
|
||||
|
||||
Reference in new issue
Block a user