From 3120a6439bfe3a210c54eeb3885538e238ad5168 Mon Sep 17 00:00:00 2001 From: Declan Date: Sun, 27 Feb 2022 00:09:44 -0500 Subject: [PATCH] Handle average hue inverted (#431) Co-authored-by: Chris Gerth --- .../src/views/PipelineViews/ThresholdTab.vue | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/photon-client/src/views/PipelineViews/ThresholdTab.vue b/photon-client/src/views/PipelineViews/ThresholdTab.vue index 62976f25a..f4176976b 100644 --- a/photon-client/src/views/PipelineViews/ThresholdTab.vue +++ b/photon-client/src/views/PipelineViews/ThresholdTab.vue @@ -73,7 +73,7 @@ color="accent" class="ma-2 black--text" small - @click="setFunction(3)" + @click="setFunction(hueInverted ? 2 : 3)" > mdi-minus @@ -89,13 +89,13 @@ mdi-plus-minus - Set To Average + {{ hueInverted ? "Exclude" : "Set to" }} Average mdi-plus @@ -149,11 +149,26 @@ export default { }, averageHue: { get() { + var isInverted = this.$store.getters.currentPipelineSettings.hueInverted; const arr = this.$store.getters.currentPipelineSettings.hsvHue; + var retVal = 0; + if (Array.isArray(arr)) { - return (arr[0] + arr[1]) + retVal = (arr[0] + arr[1]); + } else { + retVal = (arr.first + arr.second); } - return (arr.first + arr.second); + + if(isInverted){ + retVal += 180; + } + + if(retVal > 360){ + retVal -= 360; + } + + return retVal; + }, }, hueInverted: {