mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-02 19:02:29 +02:00
[Lens Distortion] subdivisions slider
This commit is contained in:
parent
ee563e227f
commit
b64b18c1a2
3 changed files with 48 additions and 1 deletions
|
@ -36,7 +36,7 @@ AliceVision.FloatImageViewer {
|
||||||
// rename into distortionView
|
// rename into distortionView
|
||||||
property bool distortion: false
|
property bool distortion: false
|
||||||
property bool isGridDisplayed : false;
|
property bool isGridDisplayed : false;
|
||||||
|
property int subdivisions: 2
|
||||||
|
|
||||||
onDistortionChanged: {
|
onDistortionChanged: {
|
||||||
console.warn("distortion");
|
console.warn("distortion");
|
||||||
|
@ -47,6 +47,9 @@ AliceVision.FloatImageViewer {
|
||||||
root.displayGrid()
|
root.displayGrid()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSubdivisionsChanged: {
|
||||||
|
root.updateSubdivisions(subdivisions)
|
||||||
|
}
|
||||||
|
|
||||||
channelMode: {
|
channelMode: {
|
||||||
switch(channelModeString)
|
switch(channelModeString)
|
||||||
|
|
|
@ -12,9 +12,11 @@ FloatingPane {
|
||||||
radius: 0
|
radius: 0
|
||||||
|
|
||||||
property int opacityDefaultValue: 100
|
property int opacityDefaultValue: 100
|
||||||
|
property int subdivisionsDefaultValue: 100
|
||||||
|
|
||||||
property real slidersPowerValue: 4
|
property real slidersPowerValue: 4
|
||||||
property int opacityValue: Math.pow(opacityCtrl.value, 1)
|
property int opacityValue: Math.pow(opacityCtrl.value, 1)
|
||||||
|
property int subdivisionsValue: Math.pow(subdivisionsCtrl.value, 1)
|
||||||
|
|
||||||
property variant colorRGBA: null
|
property variant colorRGBA: null
|
||||||
property bool displayGrid: displayGridButton.checked
|
property bool displayGrid: displayGridButton.checked
|
||||||
|
@ -104,6 +106,47 @@ FloatingPane {
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Grid subdivisions slider
|
||||||
|
RowLayout {
|
||||||
|
spacing: 5
|
||||||
|
|
||||||
|
ToolButton {
|
||||||
|
text: "Subdivisions"
|
||||||
|
|
||||||
|
ToolTip.visible: ToolTip.text && hovered
|
||||||
|
ToolTip.delay: 100
|
||||||
|
ToolTip.text: "Reset Subdivisions"
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
subdivisionsCtrl.value = subdivisionsDefaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TextField {
|
||||||
|
id: subdivisionsLabel
|
||||||
|
|
||||||
|
ToolTip.visible: ToolTip.text && hovered
|
||||||
|
ToolTip.delay: 100
|
||||||
|
ToolTip.text: "subdivisions"
|
||||||
|
|
||||||
|
text: subdivisionsValue.toFixed(1)
|
||||||
|
Layout.preferredWidth: textMetrics_opacityValue.width
|
||||||
|
selectByMouse: true
|
||||||
|
validator: doubleValidator
|
||||||
|
onAccepted: {
|
||||||
|
subdivisionsCtrl.value = Number(subdivisionsLabel.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Slider {
|
||||||
|
id: subdivisionsCtrl
|
||||||
|
Layout.fillWidth: false
|
||||||
|
from: 2
|
||||||
|
to: 10
|
||||||
|
value: subdivisionsDefaultValue
|
||||||
|
stepSize: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Fill rectangle to have a better UI
|
//Fill rectangle to have a better UI
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: root.palette.window
|
color: root.palette.window
|
||||||
|
|
|
@ -233,6 +233,7 @@ FocusScope {
|
||||||
'gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}),
|
'gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}),
|
||||||
'gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
|
'gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
|
||||||
'distortion' : Qt.binding(function(){ return displayLensDistortionViewer.checked;}),
|
'distortion' : Qt.binding(function(){ return displayLensDistortionViewer.checked;}),
|
||||||
|
'subdivisions' : Qt.binding(function(){ return lensDistortionImageToolbar.subdivisionsValue;}),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
|
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue