mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-29 17:06:35 +02:00
[ui] Viewer2D: metadata can come from sfm or the image itself
This commit is contained in:
parent
8877c86dda
commit
7c5752e71f
1 changed files with 25 additions and 5 deletions
|
@ -19,6 +19,26 @@ FocusScope {
|
||||||
property alias useLensDistortionViewer: displayLensDistortionViewer.checked
|
property alias useLensDistortionViewer: displayLensDistortionViewer.checked
|
||||||
property alias usePanoramaViewer: displayPanoramaViewer.checked
|
property alias usePanoramaViewer: displayPanoramaViewer.checked
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: m
|
||||||
|
property variant imgMetadata: {
|
||||||
|
// I did not find a direct way to check if the map is empty or not...
|
||||||
|
var sfmHasImgMetadata = 0;
|
||||||
|
for(var key in root.metadata) { sfmHasImgMetadata = 1; break; }
|
||||||
|
|
||||||
|
if(sfmHasImgMetadata) // check if root.metadata is not empty
|
||||||
|
{
|
||||||
|
return root.metadata
|
||||||
|
}
|
||||||
|
|
||||||
|
if(floatImageViewerLoader.active)
|
||||||
|
{
|
||||||
|
return floatImageViewerLoader.item.metadata
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: aliceVisionPluginLoader
|
id: aliceVisionPluginLoader
|
||||||
active: true
|
active: true
|
||||||
|
@ -230,7 +250,8 @@ FocusScope {
|
||||||
|
|
||||||
// handle rotation/position based on available metadata
|
// handle rotation/position based on available metadata
|
||||||
rotation: {
|
rotation: {
|
||||||
var orientation = metadata ? metadata["Orientation"] : 0
|
var orientation = m.imgMetadata ? m.imgMetadata["Orientation"] : 0
|
||||||
|
|
||||||
switch(orientation) {
|
switch(orientation) {
|
||||||
case "6": return 90;
|
case "6": return 90;
|
||||||
case "8": return -90;
|
case "8": return -90;
|
||||||
|
@ -352,7 +373,7 @@ FocusScope {
|
||||||
|
|
||||||
// handle rotation/position based on available metadata
|
// handle rotation/position based on available metadata
|
||||||
rotation: {
|
rotation: {
|
||||||
var orientation = metadata ? metadata["Orientation"] : 0
|
var orientation = m.imgMetadata ? m.imgMetadata["Orientation"] : 0
|
||||||
switch(orientation) {
|
switch(orientation) {
|
||||||
case "6": return 90;
|
case "6": return 90;
|
||||||
case "8": return -90;
|
case "8": return -90;
|
||||||
|
@ -386,7 +407,7 @@ FocusScope {
|
||||||
|
|
||||||
// handle rotation/position based on available metadata
|
// handle rotation/position based on available metadata
|
||||||
rotation: {
|
rotation: {
|
||||||
var orientation = metadata ? metadata["Orientation"] : 0
|
var orientation = m.imgMetadata ? m.imgMetadata["Orientation"] : 0
|
||||||
switch(orientation) {
|
switch(orientation) {
|
||||||
case "6": return 90;
|
case "6": return 90;
|
||||||
case "8": return -90;
|
case "8": return -90;
|
||||||
|
@ -503,7 +524,7 @@ FocusScope {
|
||||||
|
|
||||||
visible: metadataCB.checked
|
visible: metadataCB.checked
|
||||||
// only load metadata model if visible
|
// only load metadata model if visible
|
||||||
metadata: visible ? root.metadata : {}
|
metadata: visible ? m.imgMetadata : {}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorCheckerPane {
|
ColorCheckerPane {
|
||||||
|
@ -985,7 +1006,6 @@ FocusScope {
|
||||||
smooth: false
|
smooth: false
|
||||||
flat: true
|
flat: true
|
||||||
checkable: enabled
|
checkable: enabled
|
||||||
enabled: _reconstruction.selectedViewId >= 0
|
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
if(checked == true)
|
if(checked == true)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue