mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[Float Image Viewer] Change viewer type with switch case on EViewerType
This commit is contained in:
parent
266aee8d40
commit
b81e68523f
3 changed files with 23 additions and 26 deletions
|
@ -40,11 +40,28 @@ AliceVision.FloatImageViewer {
|
||||||
}
|
}
|
||||||
|
|
||||||
property string channelModeString : "rgba"
|
property string channelModeString : "rgba"
|
||||||
|
channelMode: {
|
||||||
|
switch(channelModeString)
|
||||||
|
{
|
||||||
|
case "rgb": return AliceVision.FloatImageViewer.EChannelMode.RGB
|
||||||
|
case "r": return AliceVision.FloatImageViewer.EChannelMode.R
|
||||||
|
case "g": return AliceVision.FloatImageViewer.EChannelMode.G
|
||||||
|
case "b": return AliceVision.FloatImageViewer.EChannelMode.B
|
||||||
|
case "a": return AliceVision.FloatImageViewer.EChannelMode.A
|
||||||
|
default: return AliceVision.FloatImageViewer.EChannelMode.RGBA
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property string viewerTypeString : "default"
|
property string viewerTypeString : "hdr"
|
||||||
|
surface.viewerType: {
|
||||||
property bool isDistoViewer: false;
|
switch(viewerTypeString)
|
||||||
property bool isPanoViewer: false;
|
{
|
||||||
|
case "hdr": return AliceVision.Surface.EViewerType.HDR;
|
||||||
|
case "distortion": return AliceVision.Surface.EViewerType.DISTORTION;
|
||||||
|
case "panorama": return AliceVision.Surface.EViewerType.PANORAMA;
|
||||||
|
default: return AliceVision.Surface.EViewerType.HDR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property bool isPrincipalPointsDisplayed : false;
|
property bool isPrincipalPointsDisplayed : false;
|
||||||
property int pointsNumber: (surface.subdivisions + 1) * (surface.subdivisions + 1);
|
property int pointsNumber: (surface.subdivisions + 1) * (surface.subdivisions + 1);
|
||||||
|
@ -63,26 +80,6 @@ AliceVision.FloatImageViewer {
|
||||||
ppRect.y = pp.y;
|
ppRect.y = pp.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
onIsDistoViewerChanged: {
|
|
||||||
surface.viewerType = AliceVision.Surface.EViewerType.DISTORTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
onIsPanoViewerChanged: {
|
|
||||||
surface.viewerType = AliceVision.Surface.EViewerType.PANORAMA;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
channelMode: {
|
|
||||||
switch(channelModeString)
|
|
||||||
{
|
|
||||||
case "rgb": return AliceVision.FloatImageViewer.EChannelMode.RGB
|
|
||||||
case "r": return AliceVision.FloatImageViewer.EChannelMode.R
|
|
||||||
case "g": return AliceVision.FloatImageViewer.EChannelMode.G
|
|
||||||
case "b": return AliceVision.FloatImageViewer.EChannelMode.B
|
|
||||||
case "a": return AliceVision.FloatImageViewer.EChannelMode.A
|
|
||||||
default: return AliceVision.FloatImageViewer.EChannelMode.RGBA
|
|
||||||
}
|
|
||||||
}
|
|
||||||
clearBeforeLoad: true
|
clearBeforeLoad: true
|
||||||
|
|
||||||
property alias containsMouse: mouseArea.containsMouse
|
property alias containsMouse: mouseArea.containsMouse
|
||||||
|
|
|
@ -222,7 +222,7 @@ AliceVision.PanoramaViewer {
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
if(active) {
|
if(active) {
|
||||||
setSource("FloatImage.qml", {
|
setSource("FloatImage.qml", {
|
||||||
'isPanoViewer' : true,
|
'viewerTypeString' : 'panorama',
|
||||||
'surface.subdivisions': Qt.binding(function() { return subdivisionsPano; }),
|
'surface.subdivisions': Qt.binding(function() { return subdivisionsPano; }),
|
||||||
'source': Qt.binding(function() { return cSource; }),
|
'source': Qt.binding(function() { return cSource; }),
|
||||||
'index' : index,
|
'index' : index,
|
||||||
|
|
|
@ -278,7 +278,7 @@ FocusScope {
|
||||||
'surface.gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}),
|
'surface.gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}),
|
||||||
'surface.gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
|
'surface.gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
|
||||||
'surface.subdivisions' : Qt.binding(function(){ return lensDistortionImageToolbar.subdivisionsValue;}),
|
'surface.subdivisions' : Qt.binding(function(){ return lensDistortionImageToolbar.subdivisionsValue;}),
|
||||||
'isDistoViewer' : Qt.binding(function(){ return displayLensDistortionViewer.checked;}),
|
'viewerTypeString': Qt.binding(function(){ return displayLensDistortionViewer.checked ? "distortion" : "hdr";}),
|
||||||
})
|
})
|
||||||
} 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