From 396a7454e63809935bd92d1fa35c8af4accaff10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaj=20Gr=C3=B6nholm?= Date: Thu, 26 Jan 2023 09:51:22 +0200 Subject: Adjust the MultiEffect API Based on the API review, adjust the MultiEffect API. - Change mask threshold Low/Up to Min/Max and for spread AtMin/AtMax. - Change colorize to colorization so it is more symmetric with brightness, saturation etc. Task-number: QTBUG-109557 Pick-to: 6.5 Change-Id: I96ff2a13e20405998c5ed0cb38ad3b5911daf94c Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../itemswitcher/qml/SwitchEffect3DFlip.qml | 16 ++++---- .../itemswitcher/qml/SwitchEffectBlinds.qml | 8 ++-- .../itemswitcher/qml/SwitchEffectHeart.qml | 12 +++--- .../itemswitcher/qml/SwitchEffectStars.qml | 12 +++--- .../itemswitcher/qml/SwitchEffectThunder.qml | 20 +++++----- .../quick/multieffect/testbed/qml/Settings.qml | 28 ++++++------- .../quick/multieffect/testbed/qml/SettingsView.qml | 46 +++++++++++----------- examples/quick/multieffect/testbed/qml/main.qml | 12 +++--- 8 files changed, 77 insertions(+), 77 deletions(-) (limited to 'examples/quick/multieffect') diff --git a/examples/quick/multieffect/itemswitcher/qml/SwitchEffect3DFlip.qml b/examples/quick/multieffect/itemswitcher/qml/SwitchEffect3DFlip.qml index a5a18b0b8d..bb33b8c6b6 100644 --- a/examples/quick/multieffect/itemswitcher/qml/SwitchEffect3DFlip.qml +++ b/examples/quick/multieffect/itemswitcher/qml/SwitchEffect3DFlip.qml @@ -29,10 +29,10 @@ Item { source: "images/smoke.png" visible: false } - maskThresholdLow: switcher.inAnimation * 0.6 - maskSpreadLow: 0.1 - maskThresholdUp: 1.0 - (switcher.inAnimation * 0.6) - maskSpreadUp: 0.1 + maskThresholdMin: switcher.inAnimation * 0.6 + maskSpreadAtMin: 0.1 + maskThresholdMax: 1.0 - (switcher.inAnimation * 0.6) + maskSpreadAtMax: 0.1 shadowEnabled: true shadowOpacity: 0.5 @@ -69,10 +69,10 @@ Item { source: "images/smoke.png" visible: false } - maskThresholdLow: switcher.outAnimation * 0.6 - maskSpreadLow: 0.1 - maskThresholdUp: 1.0 - (switcher.outAnimation * 0.6) - maskSpreadUp: 0.1 + maskThresholdMin: switcher.outAnimation * 0.6 + maskSpreadAtMin: 0.1 + maskThresholdMax: 1.0 - (switcher.outAnimation * 0.6) + maskSpreadAtMax: 0.1 shadowEnabled: true shadowOpacity: 0.5 diff --git a/examples/quick/multieffect/itemswitcher/qml/SwitchEffectBlinds.qml b/examples/quick/multieffect/itemswitcher/qml/SwitchEffectBlinds.qml index 3a9f22e3ad..8849631be9 100644 --- a/examples/quick/multieffect/itemswitcher/qml/SwitchEffectBlinds.qml +++ b/examples/quick/multieffect/itemswitcher/qml/SwitchEffectBlinds.qml @@ -34,8 +34,8 @@ Item { anchors.fill: parent maskEnabled: true maskSource: mask - maskThresholdLow: switcher.inAnimation - maskSpreadLow: 0.4 + maskThresholdMin: switcher.inAnimation + maskSpreadAtMin: 0.4 } // Item coming in MultiEffect { @@ -43,7 +43,7 @@ Item { anchors.fill: parent maskEnabled: true maskSource: mask - maskThresholdUp: switcher.inAnimation - maskSpreadUp: 0.4 + maskThresholdMax: switcher.inAnimation + maskSpreadAtMax: 0.4 } } diff --git a/examples/quick/multieffect/itemswitcher/qml/SwitchEffectHeart.qml b/examples/quick/multieffect/itemswitcher/qml/SwitchEffectHeart.qml index e81c648e2c..e80c54460c 100644 --- a/examples/quick/multieffect/itemswitcher/qml/SwitchEffectHeart.qml +++ b/examples/quick/multieffect/itemswitcher/qml/SwitchEffectHeart.qml @@ -31,8 +31,8 @@ Item { maskEnabled: true maskSource: mask maskInverted: true - maskThresholdLow: 0.5 - maskSpreadLow: 0.0 + maskThresholdMin: 0.5 + maskSpreadAtMin: 0.0 } // Item coming in MultiEffect { @@ -40,9 +40,9 @@ Item { anchors.fill: parent maskEnabled: true maskSource: mask - maskThresholdLow: 0.5 - maskSpreadLow: 0.0 - colorizeColor: "red" - colorize: Math.max(0, 1.0 - switcher.inAnimation * 2) + maskThresholdMin: 0.5 + maskSpreadAtMin: 0.0 + colorizationColor: "red" + colorization: Math.max(0, 1.0 - switcher.inAnimation * 2) } } diff --git a/examples/quick/multieffect/itemswitcher/qml/SwitchEffectStars.qml b/examples/quick/multieffect/itemswitcher/qml/SwitchEffectStars.qml index 47bdf3f64d..c533572e66 100644 --- a/examples/quick/multieffect/itemswitcher/qml/SwitchEffectStars.qml +++ b/examples/quick/multieffect/itemswitcher/qml/SwitchEffectStars.qml @@ -32,8 +32,8 @@ Item { maskEnabled: true maskSource: mask maskInverted: true - maskThresholdLow: 0.5 - maskSpreadLow: 0.5 + maskThresholdMin: 0.5 + maskSpreadAtMin: 0.5 } // Item coming in MultiEffect { @@ -41,10 +41,10 @@ Item { anchors.fill: parent maskEnabled: true maskSource: mask - maskThresholdLow: 0.5 - maskSpreadLow: 0.5 - colorizeColor: "#ffd020" - colorize: Math.max(0, 1.0 - switcher.inAnimation * 2) + maskThresholdMin: 0.5 + maskSpreadAtMin: 0.5 + colorizationColor: "#ffd020" + colorization: Math.max(0, 1.0 - switcher.inAnimation * 2) brightness: Math.max(0.0, 0.8 - switcher.inAnimation * 2) } } diff --git a/examples/quick/multieffect/itemswitcher/qml/SwitchEffectThunder.qml b/examples/quick/multieffect/itemswitcher/qml/SwitchEffectThunder.qml index ba26675dd7..80a6e9bf8f 100644 --- a/examples/quick/multieffect/itemswitcher/qml/SwitchEffectThunder.qml +++ b/examples/quick/multieffect/itemswitcher/qml/SwitchEffectThunder.qml @@ -31,17 +31,17 @@ Item { blurMax: 32 blurMultiplier: 0.5 opacity: switcher.outAnimation - colorizeColor: "#f0d060" - colorize: switcher.inAnimation + colorizationColor: "#f0d060" + colorization: switcher.inAnimation contrast: switcher.inAnimation brightness: switcher.inAnimation maskEnabled: true maskSource: maskImage - maskThresholdLow: switcher.inAnimation * 0.9 - maskSpreadLow: 0.2 - maskThresholdUp: 1.0 + maskThresholdMin: switcher.inAnimation * 0.9 + maskSpreadAtMin: 0.2 + maskThresholdMax: 1.0 shadowEnabled: true shadowColor: "#f04000" @@ -64,16 +64,16 @@ Item { blurMultiplier: 0.5 opacity: switcher.inAnimation * 3.0 - 1.0 - colorizeColor: "#f0d060" - colorize: switcher.outAnimation + colorizationColor: "#f0d060" + colorization: switcher.outAnimation contrast: switcher.outAnimation brightness: switcher.outAnimation maskEnabled: true maskSource: maskImage - maskThresholdLow: switcher.outAnimation * 0.6 - maskSpreadLow: 0.2 - maskThresholdUp: 1.0 + maskThresholdMin: switcher.outAnimation * 0.6 + maskSpreadAtMin: 0.2 + maskThresholdMax: 1.0 shadowEnabled: true shadowColor: "#f04000" diff --git a/examples/quick/multieffect/testbed/qml/Settings.qml b/examples/quick/multieffect/testbed/qml/Settings.qml index 82db53202c..6139bdc6f4 100644 --- a/examples/quick/multieffect/testbed/qml/Settings.qml +++ b/examples/quick/multieffect/testbed/qml/Settings.qml @@ -28,9 +28,9 @@ QtObject { property real contrast: 0.0 property bool saturationEnabled: true property real saturation: 0.0 - property bool colorizeEnabled: true - property color colorizeColor: Qt.rgba(1.0, 0.0, 0.0, 1.0) - property real colorize: 0.0 + property bool colorizationEnabled: true + property color colorizationColor: Qt.rgba(1.0, 0.0, 0.0, 1.0) + property real colorization: 0.0 property bool blurEnabled: true property real blur: 0.0 @@ -47,10 +47,10 @@ QtObject { property bool maskEnabled: true property bool maskInverted: false - property real maskThresholdLow: 0.0 - property real maskSpreadLow: 0.0 - property real maskThresholdUp: 1.0 - property real maskSpreadUp: 0.0 + property real maskThresholdMin: 0.0 + property real maskSpreadAtMin: 0.0 + property real maskThresholdMax: 1.0 + property real maskSpreadAtMax: 0.0 function reset() { autoPaddingEnabled = defaultSettings.autoPaddingEnabled; @@ -62,9 +62,9 @@ QtObject { contrast = defaultSettings.contrast; saturationEnabled = defaultSettings.saturationEnabled; saturation = defaultSettings.saturation; - colorizeEnabled = defaultSettings.colorizeEnabled; - colorizeColor = defaultSettings.colorizeColor; - colorize = defaultSettings.colorize; + colorizationEnabled = defaultSettings.colorizationEnabled; + colorizationColor = defaultSettings.colorizationColor; + colorization = defaultSettings.colorization; blurEnabled = defaultSettings.blurEnabled; blur = defaultSettings.blur; @@ -81,10 +81,10 @@ QtObject { maskEnabled = defaultSettings.maskEnabled; maskInverted = defaultSettings.maskInverted; - maskThresholdLow = defaultSettings.maskThresholdLow; - maskSpreadLow = defaultSettings.maskSpreadLow; - maskThresholdUp = defaultSettings.maskThresholdUp; - maskSpreadUp = defaultSettings.maskSpreadUp; + maskThresholdMin = defaultSettings.maskThresholdMin; + maskSpreadAtMin = defaultSettings.maskSpreadAtMin; + maskThresholdMax = defaultSettings.maskThresholdMax; + maskSpreadAtMax = defaultSettings.maskSpreadAtMax; rootItem.reseted(); } diff --git a/examples/quick/multieffect/testbed/qml/SettingsView.qml b/examples/quick/multieffect/testbed/qml/SettingsView.qml index d0d70958bf..9b753298dd 100644 --- a/examples/quick/multieffect/testbed/qml/SettingsView.qml +++ b/examples/quick/multieffect/testbed/qml/SettingsView.qml @@ -11,9 +11,9 @@ Item { property real showAnimation: show ? 1 : 0 function resetSettings() { - colorizeColorSelector.setValues(defaultSettings.colorizeColor.r, - defaultSettings.colorizeColor.g, - defaultSettings.colorizeColor.b); + colorizationColorSelector.setValues(defaultSettings.colorizationColor.r, + defaultSettings.colorizationColor.g, + defaultSettings.colorizationColor.b); shadowColorSelector.setValues(defaultSettings.shadowColor.r, defaultSettings.shadowColor.g, defaultSettings.shadowColor.b); @@ -213,25 +213,25 @@ Item { } } SettingsComponentSlider { - text: qsTr("Colorize") + ": " + value.toFixed(3) + text: qsTr("Colorization") + ": " + value.toFixed(3) showCheckbox: true - checked: settings.colorizeEnabled + checked: settings.colorizationEnabled onToggled: { - settings.colorizeEnabled = checked; + settings.colorizationEnabled = checked; } - value: settings.colorize + value: settings.colorization from: 0 to: 1 onMoved: { - settings.colorize = value; + settings.colorization = value; } } SettingsComponentColorSelector { - id: colorizeColorSelector - text: qsTr("Colorize Color") + id: colorizationColorSelector + text: qsTr("Colorization Color") width: settings.settingsViewWidth - 10 onValueChanged: { - settings.colorizeColor = value; + settings.colorizationColor = value; } } } @@ -359,39 +359,39 @@ Item { height: 20 * dp } SettingsComponentSlider { - text: qsTr("Mask Lower Threshold") + ": " + value.toFixed(3) - value: settings.maskThresholdLow + text: qsTr("Mask Threshold Min") + ": " + value.toFixed(3) + value: settings.maskThresholdMin from: 0.0 to: 1.0 onMoved: { - settings.maskThresholdLow = value; + settings.maskThresholdMin = value; } } SettingsComponentSlider { - text: qsTr("Mask Lower Spread") + ": " + value.toFixed(3) - value: settings.maskSpreadLow + text: qsTr("Mask Spread At Min") + ": " + value.toFixed(3) + value: settings.maskSpreadAtMin from: 0.0 to: 1.0 onMoved: { - settings.maskSpreadLow = value; + settings.maskSpreadAtMin = value; } } SettingsComponentSlider { - text: qsTr("Mask Upper Threshold") + ": " + value.toFixed(3) - value: settings.maskThresholdUp + text: qsTr("Mask Threshold Max") + ": " + value.toFixed(3) + value: settings.maskThresholdMax from: 0.0 to: 1.0 onMoved: { - settings.maskThresholdUp = value; + settings.maskThresholdMax = value; } } SettingsComponentSlider { - text: qsTr("Mask Upper Spread") + ": " + value.toFixed(3) - value: settings.maskSpreadUp + text: qsTr("Mask Spread At Max") + ": " + value.toFixed(3) + value: settings.maskSpreadAtMax from: 0.0 to: 1.0 onMoved: { - settings.maskSpreadUp = value; + settings.maskSpreadAtMax = value; } } } diff --git a/examples/quick/multieffect/testbed/qml/main.qml b/examples/quick/multieffect/testbed/qml/main.qml index 71cec0a486..6d34a47bfa 100644 --- a/examples/quick/multieffect/testbed/qml/main.qml +++ b/examples/quick/multieffect/testbed/qml/main.qml @@ -85,8 +85,8 @@ Rectangle { brightness: settings.brightnessEnabled ? settings.brightness : 0 contrast: settings.contrastEnabled ? settings.contrast : 0 saturation: settings.saturationEnabled ? settings.saturation : 0 - colorizeColor: settings.colorizeColor - colorize: settings.colorizeEnabled ? settings.colorize : 0 + colorizationColor: settings.colorizationColor + colorization: settings.colorizationEnabled ? settings.colorization : 0 blurEnabled: settings.blurEnabled blur: settings.blur blurMax: settings.blurMax @@ -100,10 +100,10 @@ Rectangle { shadowScale: settings.shadowScale maskEnabled: settings.maskEnabled maskInverted: settings.maskInverted - maskThresholdLow: settings.maskThresholdLow - maskSpreadLow: settings.maskSpreadLow - maskThresholdUp: settings.maskThresholdUp - maskSpreadUp: settings.maskSpreadUp + maskThresholdMin: settings.maskThresholdMin + maskSpreadAtMin: settings.maskSpreadAtMin + maskThresholdMax: settings.maskThresholdMax + maskSpreadAtMax: settings.maskSpreadAtMax onItemSizeChanged: { warningsView.showSizeWarning(); -- cgit v1.2.3