Not sure this will work for me, but it is possible in a way (really messy):
import QtQuick 2.15
import QtQuick.Window 2.15
import QtGraphicalEffects 1.15
Window {
id: root
width: 512
height: 512
visible: true
title: qsTr("Mask Invert")
Image {
id: mapimage
width: parent.width
height: parent.height
source: "testimagesquare.png"
visible: true
}
MouseArea {
anchors.fill: mapimage
hoverEnabled: true
onPositionChanged: {
maskposx = mouseX - masksizew/2
maskposy = mouseY - masksizeh/2
}
}
Image {
id: mapimagesub
width: masksizew
height: masksizeh
source: "testimagesquare.png"
sourceSize.width: root.width
sourceSize.height: root.height
sourceClipRect: Qt.rect(maskposx, maskposy, masksizew, masksizeh)
visible: false
}
property real maskposx: 128
property real maskposy: 128
property real masksizew: 128
property real masksizeh: 128
Image {
id: subsourceimage
width: masksizew
height: masksizeh
}
Image {
id: maskimage
width: subsourceimage.width
height: subsourceimage.height
source: "crosshairround.svg"
visible: false
}
OpacityMask {
id: opmask
x: maskposx
y: maskposy
width: masksizew
height: masksizeh
source: huesat //mapimagesub
maskSource: maskimage
invert: false
}
HueSaturation {
id: huesat
anchors.fill: mapimagesub
source: mapimagesub
hue: 0.5
//lightness: -0.2
//saturation: 0.5
visible: false
}
}