mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-04 01:08:26 +02:00
[ui] factorize exif orientation transform in utility functions
This commit is contained in:
parent
205ff22b74
commit
7e4b1a77ac
4 changed files with 60 additions and 69 deletions
49
meshroom/ui/qml/Utils/ExifOrientation.qml
Normal file
49
meshroom/ui/qml/Utils/ExifOrientation.qml
Normal file
|
@ -0,0 +1,49 @@
|
|||
pragma Singleton
|
||||
import QtQuick 2.11
|
||||
|
||||
/**
|
||||
* Singleton that defines utility functions for supporting exif orientation tags.
|
||||
*
|
||||
* If you are looking for a way to create a Loader that supports exif orientation tags,
|
||||
* you can directly use ExifOrientedViewer instead.
|
||||
*
|
||||
* However if you want to apply an exif orientation tag to another type of QML component,
|
||||
* you will need to redefine its transform property using the utility methods given below.
|
||||
*/
|
||||
QtObject {
|
||||
|
||||
function rotation(orientationTag) {
|
||||
switch(orientationTag) {
|
||||
case "3":
|
||||
return 180;
|
||||
case "4":
|
||||
return 180;
|
||||
case "5":
|
||||
return 90;
|
||||
case "6":
|
||||
return 90;
|
||||
case "7":
|
||||
return -90;
|
||||
case "8":
|
||||
return -90;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function xscale(orientationTag) {
|
||||
switch(orientationTag) {
|
||||
case "2":
|
||||
return -1;
|
||||
case "4":
|
||||
return -1;
|
||||
case "5":
|
||||
return -1;
|
||||
case "7":
|
||||
return -1;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue