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
|
||||
property bool distortion: false
|
||||
property bool isGridDisplayed : false;
|
||||
|
||||
property int subdivisions: 2
|
||||
|
||||
onDistortionChanged: {
|
||||
console.warn("distortion");
|
||||
|
@ -47,6 +47,9 @@ AliceVision.FloatImageViewer {
|
|||
root.displayGrid()
|
||||
}
|
||||
|
||||
onSubdivisionsChanged: {
|
||||
root.updateSubdivisions(subdivisions)
|
||||
}
|
||||
|
||||
channelMode: {
|
||||
switch(channelModeString)
|
||||
|
|
|
@ -12,9 +12,11 @@ FloatingPane {
|
|||
radius: 0
|
||||
|
||||
property int opacityDefaultValue: 100
|
||||
property int subdivisionsDefaultValue: 100
|
||||
|
||||
property real slidersPowerValue: 4
|
||||
property int opacityValue: Math.pow(opacityCtrl.value, 1)
|
||||
property int subdivisionsValue: Math.pow(subdivisionsCtrl.value, 1)
|
||||
|
||||
property variant colorRGBA: null
|
||||
property bool displayGrid: displayGridButton.checked
|
||||
|
@ -104,6 +106,47 @@ FloatingPane {
|
|||
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
|
||||
Rectangle {
|
||||
color: root.palette.window
|
||||
|
|
|
@ -233,6 +233,7 @@ FocusScope {
|
|||
'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;}),
|
||||
})
|
||||
} else {
|
||||
// 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