[Lens Distortion] Display points only in distortion viewer

This commit is contained in:
Landrodie 2021-01-18 10:11:10 +01:00 committed by Fabien Castan
parent cf4211a5c7
commit 73c6e68d02
2 changed files with 7 additions and 8 deletions

View file

@ -33,8 +33,7 @@ AliceVision.FloatImageViewer {
property string channelModeString : "rgba"
// rename into distortionView
property bool distortion: false;
property bool isDistoViewer: false;
property bool isGridDisplayed : false;
property int gridOpacity : 100;
@ -44,8 +43,7 @@ AliceVision.FloatImageViewer {
property int subdivisions: 5;
property int pointsNumber: (subdivisions + 1) * (subdivisions + 1);
onDistortionChanged: {
console.warn("distortion");
onIsDistoViewerChanged: {
root.hasDistortion(distortion);
}
@ -138,7 +136,7 @@ AliceVision.FloatImageViewer {
x: root.getVertex(model.index).x - (width / 2)
y: root.getVertex(model.index).y - (height / 2)
color: Colors.yellow
visible: true
visible: isDistoViewer
MouseArea {
id: mouseAreaCP
anchors.fill : parent;
@ -157,6 +155,7 @@ AliceVision.FloatImageViewer {
Repeater {
id: repeater
model: pointsNumber
visible: false
delegate: rectGrid
function displayControlPoints() {
for (let i = 0; i < model; i++) {

View file

@ -227,8 +227,8 @@ FocusScope {
'isGridDisplayed' : Qt.binding(function(){ return lensDistortionImageToolbar.displayGrid;}),
'gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}),
'gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
'distortion' : Qt.binding(function(){ return displayLensDistortionViewer.checked;}),
'subdivisions' : Qt.binding(function(){ return lensDistortionImageToolbar.subdivisionsValue;}),
'isDistoViewer' : Qt.binding(function(){ return displayLensDistortionViewer.checked;}),
})
} else {
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
@ -732,7 +732,7 @@ FocusScope {
id: resolutionLabel
Layout.fillWidth: true
text: (imgContainer.image && imgContainer.image.sourceSize.width > 0) ? (imgContainer.image.sourceSize.width + "x" + imgContainer.image.sourceSize.height) : ""
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
}
@ -745,7 +745,7 @@ FocusScope {
Layout.minimumWidth: 0
Layout.preferredWidth: 6.0 * Qt.application.font.pixelSize
flat: true
property var types: ["image", "depth", "sim"]
property string type: enabled ? types[currentIndex] : types[0]