mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 16:58:24 +02:00
[ui] Add FloatImage
component
This commit is contained in:
parent
0f2d8caf87
commit
7a93ff3d3a
1 changed files with 45 additions and 0 deletions
45
meshroom/ui/qml/Viewer/FloatImage.qml
Normal file
45
meshroom/ui/qml/Viewer/FloatImage.qml
Normal file
|
@ -0,0 +1,45 @@
|
|||
import QtQuick 2.11
|
||||
import Utils 1.0
|
||||
|
||||
import AliceVision 1.0 as AliceVision
|
||||
|
||||
/**
|
||||
* FloatImage displays an Image with gamma / offset / channel controls
|
||||
* Requires QtAliceVision plugin.
|
||||
*/
|
||||
|
||||
AliceVision.FloatImageViewer {
|
||||
id: root
|
||||
|
||||
width: textureSize.width
|
||||
height: textureSize.height
|
||||
visible: (status === Image.Ready)
|
||||
|
||||
// paintedWidth / paintedHeight / status for compatibility with standard Image
|
||||
property int paintedWidth: textureSize.width
|
||||
property int paintedHeight: textureSize.height
|
||||
property var status: {
|
||||
if(root.loading)
|
||||
return Image.Loading;
|
||||
else if((root.source === "") ||
|
||||
(root.sourceSize.height <= 0) ||
|
||||
(root.sourceSize.height <= 0))
|
||||
return Image.Null;
|
||||
return Image.Ready;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
clearBeforeLoad: true
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue