Last active
July 8, 2021 15:26
-
-
Save feresr/3a59281aad254d722a447bd10dd2dc59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EditorViewModel : ViewModel() { | |
private var appliedFilters = MutableStateFlow(sortedMapOf<FILTER, FloatArray>()) | |
val lightContextualViewModel = SliderContextualViewModel( | |
onFilterChanged = ::onValueChanged, | |
filterFlow = appliedFilters.map { | |
it.filterKeys { listOf(FILTER.EXPOSURE, FILTER.GRAIN, FILTER.VIBRANCE).contains(it) } | |
}, | |
onFilterCommitted = history::onCommit | |
) | |
val effectContextualViewModel = SliderContextualViewModel( | |
onFilterChanged = ::onValueChanged, | |
filterFlow = appliedFilters.map { | |
it.filterKeys { | |
listOf(FILTER.SATURATION, FILTER.CONTRAST, FILTER.HUE).contains(it) | |
} | |
}, | |
onFilterCommitted = history::onCommit | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment