Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions meshroom/ui/qml/Viewer/FloatImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ AliceVision.FloatImageViewer {
height: sourceSize.height
visible: true

// paintedWidth / paintedHeight / status for compatibility with standard Image
// paintedWidth / paintedHeight / imageStatus for compatibility with standard Image
property int paintedWidth: sourceSize.width
property int paintedHeight: sourceSize.height
property var status: {
if (root.loading)
return Image.Loading;
else if ((root.source === "") ||
(root.sourceSize.height <= 0) ||
(root.sourceSize.width <= 0))
property var imageStatus: {
if (root.status === AliceVision.FloatImageViewer.EStatus.LOADING) {
return Image.Loading
} else if (root.status === AliceVision.FloatImageViewer.EStatus.ERROR ||
root.status === AliceVision.FloatImageViewer.EStatus.MISSING_FILE ||
root.status === AliceVision.FloatImageViewer.EStatus.OUTDATED_LOADING) {
return Image.Error
} else if ((root.source === "") || (root.sourceSize.height <= 0) || (root.sourceSize.width <= 0)) {
return Image.Null
}

return Image.Ready
}
Expand Down
45 changes: 39 additions & 6 deletions meshroom/ui/qml/Viewer/Viewer2D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,11 @@ FocusScope {
'gamma': Qt.binding(function() { return hdrImageToolbar.gammaValue }),
'gain': Qt.binding(function() { return hdrImageToolbar.gainValue }),
'channelModeString': Qt.binding(function() { return hdrImageToolbar.channelModeValue }),
'isPrincipalPointsDisplayed' : Qt.binding(function() { return lensDistortionImageToolbar.displayPrincipalPoint }),
'surface.displayGrid' : Qt.binding(function() { return lensDistortionImageToolbar.visible && lensDistortionImageToolbar.displayGrid }),
'surface.gridOpacity' : Qt.binding(function() { return lensDistortionImageToolbar.opacityValue }),
'surface.gridColor' : Qt.binding(function() { return lensDistortionImageToolbar.color }),
'surface.subdivisions' : Qt.binding(function() { return root.useFloatImageViewer ? 1 : lensDistortionImageToolbar.subdivisionsValue }),
'isPrincipalPointsDisplayed': Qt.binding(function() { return lensDistortionImageToolbar.displayPrincipalPoint }),
'surface.displayGrid': Qt.binding(function() { return lensDistortionImageToolbar.visible && lensDistortionImageToolbar.displayGrid }),
'surface.gridOpacity': Qt.binding(function() { return lensDistortionImageToolbar.opacityValue }),
'surface.gridColor': Qt.binding(function() { return lensDistortionImageToolbar.color }),
'surface.subdivisions': Qt.binding(function() { return root.useFloatImageViewer ? 1 : lensDistortionImageToolbar.subdivisionsValue }),
'viewerTypeString': Qt.binding(function() { return displayLensDistortionViewer.checked ? "distortion" : "hdr" }),
'sfmRequired': Qt.binding(function() { return displayLensDistortionViewer.checked ? true : false }),
'surface.msfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item != null && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null }),
Expand All @@ -476,7 +476,7 @@ FocusScope {
'cropFisheye': false,
'sequence': Qt.binding(function() { return ((root.enableSequencePlayer && _reconstruction && _reconstruction.viewpoints.count > 0) ? getSequence() : []) }),
'targetSize': Qt.binding(function() { return floatImageViewerLoader.targetSize }),
'useSequence': Qt.binding(function() { return root.enableSequencePlayer && !useExternal && _reconstruction }),
'useSequence': Qt.binding(function() { return root.enableSequencePlayer && !useExternal && _reconstruction })
})
} else {
// Forcing the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
Expand Down Expand Up @@ -745,6 +745,39 @@ FocusScope {
}
}
}

FloatingPane {
Layout.fillWidth: true
Layout.fillHeight: false
Layout.preferredHeight: childrenRect.height
visible: floatImageViewerLoader.item.imageStatus === Image.Error
Layout.alignment: Qt.AlignHCenter

RowLayout {
anchors.fill: parent

Label {
font.pointSize: 8
text: {
switch (floatImageViewerLoader.item.status) {
case 2: // AliceVision.FloatImageViewer.EStatus.OUTDATED_LOADING
return "Outdated Loading"
case 3: // AliceVision.FloatImageViewer.EStatus.MISSING_FILE
return "Missing File"
case 4: // AliceVision.FloatImageViewer.EStatus.ERROR
return "Error"
default:
return ""
}
}
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
}
}

Item {
id: imgPlaceholder
Layout.fillWidth: true
Expand Down